/* Recap Modal */
dialog.recap_modal {
    border: none;
    border-radius: 24px;
    width: 612px;
    height: 480px;
    max-width: calc(100vw - 32px);
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
    background-color: rgba(255, 255, 255, 1);
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s ease-in-out;
    position: relative;
}

dialog.recap_modal[open] {
    visibility: visible;
    opacity: 1;
}

dialog.recap_modal::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

.recap_modal__overlay {
    display: none;
}

.recap_modal__panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: static;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    overflow: visible;
}

.recap_modal__form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 0 0 auto;
}

.recap_modal__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    z-index: 3;
}

.recap_modal__close:hover,
.recap_modal__close:focus {
    color: #333;
    outline: none;
}

.recap_modal__panel h2 {
    width: 532px;
    height: 42px;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 0;
    margin-top: 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.recap_modal__field {
    margin-bottom: 0;
}

.recap_modal__field:first-of-type {
    width: 532px;
    height: 92px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recap_modal__field:last-of-type {
    width: 532px;
    height: 88px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.recap_modal__field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.recap_modal__field label span {
    color: #C0543A;
}

.recap_modal__amount_row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.recap_modal__input_wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}

.recap_modal__circle_btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #C0543A;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.recap_modal__circle_btn:hover,
.recap_modal__circle_btn:focus {
    background-color: var(--totem-color-primary-700);
    outline: none;
}

.recap_modal__circle_btn[data-recap-action="decrease"]:disabled,
.recap_modal__circle_btn[data-recap-action="decrease"]:disabled:hover,
.recap_modal__circle_btn[data-recap-action="decrease"]:disabled:focus {
    background-color: #d3d3d3;
    cursor: not-allowed;
}

.recap_modal__amount_row input {
    width: 100%;
    height: 56px;
    padding: 12px 40px 12px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: poppins, sans-serif;
    box-sizing: border-box;
}

.recap_modal__amount_row input:focus {
    outline: 2px solid #C0543A;
    outline-offset: 0;
}

.recap_modal__currency {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    font-weight: 600;
    font-size: 16px;
    color: #333;
    pointer-events: none;
}

.recap_modal__field select {
    width: 100%;
    height: 56px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: poppins, sans-serif;
    background-color: white;
    cursor: pointer;
    box-sizing: border-box;
}

.recap_modal__field select:focus {
    outline: 2px solid #C0543A;
    outline-offset: 0;
}

.recap_modal__required {
    font-size: 14px;
    font-weight: 400;
    font-family: 'DM Sans', sans-serif;
    color: #666;
    margin-bottom: 0;
    height: 26px;
    display: flex;
    align-items: center;
}

.recap_modal__required span {
    color: #C0543A;
}

.recap_modal__actions {
    width: 532px;
    height: 72px;
    display: flex;
    gap: 24px;
    justify-content: center;
    align-items: center;
    padding: 12px 0;
    box-sizing: border-box;
    margin-top: 0;
}

.recap_modal__btn {
    width: 254px;
    height: 48px;
    padding: 0 20px;
    gap: 8px;
    border: none;
    border-radius: 1000px;
    font-family: 'DM Sans', sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 160%;
    letter-spacing: 0;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.recap_modal__btn--primary {
    background-color: #C0543A;
    color: white;
}

.recap_modal__btn--primary:hover,
.recap_modal__btn--primary:focus {
    background-color: var(--totem-color-primary-700);
    outline: none;
}

.recap_modal__btn--ghost {
    background-color: transparent;
    color: #C0543A;
    border: 1px solid #C0543A;
}

.recap_modal__btn--ghost:hover,
.recap_modal__btn--ghost:focus {
    background-color: #f5f5f5;
    border-color: var(--totem-color-primary-500, #C84B11);
    color: var(--totem-color-primary-500, #C84B11);
    outline: none;
}

@media (min-width: 769px) {
    .recap_modal__form {
        margin-top: auto;
        margin-bottom: auto;
    }
}

body.recap_modal_open {
    overflow: hidden;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    dialog.recap_modal {
        width: 376px;
        height: 512px;
        max-width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
        padding: 40px 20px;
        border-radius: 24px;
        box-shadow: 0 13px 30px 2px rgba(0, 0, 0, 0.12);
        overflow-y: auto;
    }

    .recap_modal__panel {
        gap: 20px;
        height: auto;
        overflow: visible;
    }

    .recap_modal__panel h2 {
        width: 100%;
        font-size: 20px;
        line-height: 1.2;
        height: auto;
        margin-top: 12px;
    }

    .recap_modal__close {
        display: none;
    }

    .recap_modal__form {
        gap: 20px;
    }

    .recap_modal__field:first-of-type,
    .recap_modal__field:last-of-type {
        width: 100%;
        height: auto;
    }

    .recap_modal__field label {
        margin-bottom: 10px;
    }

    .recap_modal__actions {
        flex-direction: column-reverse;
        width: 100%;
        height: auto;
        gap: 14px;
        padding: 0;
        margin-top: 6px;
    }

    .recap_modal__btn {
        width: 100%;
        height: 48px;
    }

    .recap_modal__amount_row {
        gap: 10px;
    }

    .recap_modal__circle_btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
        flex: 0 0 40px;
    }

    .recap_modal__amount_row input,
    .recap_modal__field select {
        height: 56px;
        border-radius: 12px;
    }

    .recap_modal__required {
        height: auto;
        min-height: 24px;
    }
}
