/* ==========================================================================
   CHECKOUT FLOW STYLES — M&F HERRAMIENTAS
   Aesthetic: Dark Tech Industrial matching M&F site identity
   Primary Color: Celeste vívido (#036fd3)
   Secondary Color: Negro (#000000 / #0a0b0d / #101215)
   Primary Typography: Montserrat Alternates Bold
   Secondary Typography: Inter
   ========================================================================== */

/* ===== Checkout Modal (Fullscreen Overlay) ===== */
.checkout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: 'Inter', sans-serif;
}

.checkout-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* ===== Checkout Container ===== */
.checkout-container {
    width: 100%;
    max-width: 740px;
    max-height: 92vh;
    background: #0b0d12;
    color: #ffffff;
    border-radius: 16px;
    border: 1px solid #1a1e27;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8),
                0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(30px) scale(0.96);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.checkout-overlay.is-open .checkout-container {
    transform: translateY(0) scale(1);
}

/* ===== Checkout Header ===== */
.checkout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: 1px solid #161922;
    background: #07080b;
    flex-shrink: 0;
}

.checkout-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.checkout-header-title i {
    font-size: 1.3rem;
    color: #036fd3;
}

.checkout-header-title h3 {
    margin: 0;
    font-family: 'Montserrat Alternates', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.checkout-close-btn {
    background: #14171e;
    border: 1px solid #222733;
    color: #8a94a6;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkout-close-btn:hover {
    background: #036fd3;
    color: #ffffff;
    border-color: #036fd3;
    transform: rotate(90deg);
}

/* ===== Progress Bar ===== */
.checkout-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 28px 16px;
    background: #0f1118;
    border-bottom: 1px solid #161922;
    gap: 0;
    flex-shrink: 0;
}

.checkout-step-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.checkout-step-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat Alternates', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    background: #161922;
    color: #64748b;
    border: 2px solid #222733;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.checkout-step-dot.is-active {
    background: #036fd3;
    color: #ffffff;
    border-color: #036fd3;
    box-shadow: 0 0 0 4px rgba(3, 111, 211, 0.25);
    transform: scale(1.1);
}

.checkout-step-dot.is-completed {
    background: #036fd3;
    color: #ffffff;
    border-color: #036fd3;
}

.checkout-step-label {
    font-family: 'Montserrat Alternates', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.checkout-step-indicator.is-active .checkout-step-label {
    color: #036fd3;
}

.checkout-step-indicator.is-completed .checkout-step-label {
    color: #ffffff;
}

.checkout-step-connector {
    width: 40px;
    height: 2px;
    background: #222733;
    margin: 0 6px;
    flex-shrink: 0;
    transition: background 0.3s ease;
    align-self: center;
    margin-bottom: 16px;
}

.checkout-step-connector.is-completed {
    background: #036fd3;
}

/* ===== Checkout Body (scrollable) ===== */
.checkout-body {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
    scroll-behavior: smooth;
    background: #0b0d12;
}

.checkout-body::-webkit-scrollbar {
    width: 5px;
}

.checkout-body::-webkit-scrollbar-track {
    background: transparent;
}

.checkout-body::-webkit-scrollbar-thumb {
    background: #222733;
    border-radius: 10px;
}

/* ===== Step Titles ===== */
.checkout-step-title {
    font-family: 'Montserrat Alternates', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px 0;
    letter-spacing: -0.01em;
}

.checkout-step-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    color: #8a94a6;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

/* ===== Form Styles (Step 1: Customer Data) ===== */
.checkout-form-group {
    margin-bottom: 20px;
}

.checkout-form-group label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.checkout-form-group label .required-mark {
    color: #036fd3;
    margin-left: 2px;
    font-weight: 700;
}

.checkout-form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.92rem;
    color: #ffffff;
    background: #12151c;
    border: 1.5px solid #202530;
    border-radius: 10px;
    transition: all 0.25s ease;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.checkout-form-input::placeholder {
    color: #475569;
}

.checkout-form-input:focus {
    border-color: #036fd3;
    background: #161922;
    box-shadow: 0 0 0 3px rgba(3, 111, 211, 0.25);
}

.checkout-form-input.is-invalid {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

.checkout-form-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.checkout-form-input.is-valid {
    border-color: #036fd3;
}

.checkout-form-error {
    font-size: 0.78rem;
    color: #f87171;
    margin-top: 6px;
    display: none;
    align-items: center;
    gap: 6px;
}

.checkout-form-error.is-visible {
    display: flex;
}

.checkout-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

textarea.checkout-form-input {
    resize: vertical;
    min-height: 80px;
}

/* ===== Summary Table (Step 2) ===== */
.checkout-summary-section {
    margin-bottom: 24px;
}

.checkout-summary-label {
    font-family: 'Montserrat Alternates', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: #8a94a6;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkout-summary-label i {
    color: #036fd3;
    font-size: 0.9rem;
}

.checkout-products-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 16px;
    background: #12151c;
    border: 1px solid #202530;
    border-radius: 12px;
    overflow: hidden;
}

.checkout-products-table thead th {
    font-family: 'Montserrat Alternates', sans-serif;
    font-size: 0.74rem;
    font-weight: 700;
    color: #8a94a6;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 14px;
    background: #0b0d12;
    text-align: left;
    border-bottom: 1px solid #202530;
}

.checkout-products-table thead th:last-child {
    text-align: right;
}

.checkout-products-table tbody td {
    padding: 12px 14px;
    font-size: 0.88rem;
    color: #cbd5e1;
    border-bottom: 1px solid #1a1e27;
    vertical-align: middle;
}

.checkout-products-table tbody tr:last-child td {
    border-bottom: none;
}

.checkout-products-table .product-ref {
    display: inline-block;
    font-family: 'Montserrat Alternates', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    color: #036fd3;
    background: rgba(3, 111, 211, 0.12);
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: 1px solid rgba(3, 111, 211, 0.25);
}

.checkout-products-table .product-name {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: #ffffff;
    display: block;
    margin-top: 4px;
    font-size: 0.88rem;
}

.checkout-products-table .product-qty {
    text-align: center;
    font-family: 'Montserrat Alternates', sans-serif;
    font-weight: 700;
    color: #ffffff;
}

.checkout-products-table .product-price {
    text-align: right;
    font-family: 'Montserrat Alternates', sans-serif;
    font-weight: 700;
    color: #036fd3;
    white-space: nowrap;
}

/* Summary Totals Row */
.checkout-totals {
    background: #12151c;
    border: 1px solid #202530;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.checkout-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 0.9rem;
    color: #8a94a6;
}

.checkout-totals-row.is-total {
    border-top: 1px solid #202530;
    margin-top: 8px;
    padding-top: 12px;
    font-family: 'Montserrat Alternates', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
}

.checkout-totals-row .price-tag {
    font-family: 'Montserrat Alternates', sans-serif;
    font-weight: 700;
    color: #036fd3;
}

/* Customer Data Review Card */
.checkout-customer-review {
    background: #12151c;
    border: 1px solid #202530;
    border-radius: 12px;
    padding: 20px;
}

.checkout-customer-review-row {
    display: flex;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #1a1e27;
}

.checkout-customer-review-row:last-child {
    border-bottom: none;
}

.checkout-customer-review-row .review-label {
    font-family: 'Montserrat Alternates', sans-serif;
    font-size: 0.76rem;
    font-weight: 700;
    color: #8a94a6;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    min-width: 110px;
    flex-shrink: 0;
}

.checkout-customer-review-row .review-value {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #ffffff;
    font-weight: 500;
}

/* ===== Confirmation (Step 3) ===== */
.checkout-confirmation {
    text-align: center;
    padding: 30px 10px;
}

.checkout-success-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #036fd3;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 8px 30px rgba(3, 111, 211, 0.4);
    animation: checkPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes checkPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

.checkout-success-icon i {
    font-size: 2.4rem;
    color: #ffffff;
    animation: checkFade 0.4s 0.3s ease forwards;
    opacity: 0;
}

@keyframes checkFade {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

.checkout-confirmation h2 {
    font-family: 'Montserrat Alternates', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px 0;
}

.checkout-confirmation .order-id-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #0a1b2e;
    border: 1px solid rgba(3, 111, 211, 0.35);
    color: #036fd3;
    padding: 8px 20px;
    border-radius: 8px;
    font-family: 'Montserrat Alternates', monospace;
    font-size: 1rem;
    font-weight: 700;
    margin: 14px 0 18px;
    letter-spacing: 0.04em;
    box-shadow: 0 4px 14px rgba(3, 111, 211, 0.15);
}

.checkout-confirmation p {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #8a94a6;
    line-height: 1.6;
    max-width: 440px;
    margin: 0 auto;
}

/* ===== Transfer Info (Step 4) ===== */
.checkout-transfer-section {
    margin-bottom: 24px;
}

.checkout-transfer-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding: 18px 20px;
    background: #12151c;
    border: 1px solid #202530;
    border-radius: 14px;
    color: #ffffff;
}

.checkout-transfer-header i {
    font-size: 1.6rem;
    color: #036fd3;
}

.checkout-transfer-header-text h4 {
    margin: 0;
    font-family: 'Montserrat Alternates', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
}

.checkout-transfer-header-text p {
    margin: 2px 0 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #8a94a6;
}

.checkout-bank-card {
    background: #12151c;
    border: 1px solid #202530;
    border-radius: 14px;
    overflow: hidden;
}

.checkout-bank-card-header {
    background: #07080b;
    padding: 14px 20px;
    border-bottom: 1px solid #202530;
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkout-bank-card-header i {
    color: #036fd3;
    font-size: 1.1rem;
}

.checkout-bank-card-header h5 {
    margin: 0;
    font-family: 'Montserrat Alternates', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
}

.checkout-bank-row {
    display: flex;
    align-items: flex-start;
    padding: 14px 20px;
    border-bottom: 1px solid #1a1e27;
    transition: background 0.15s ease;
}

.checkout-bank-row:last-child {
    border-bottom: none;
}

.checkout-bank-row:hover {
    background: #161922;
}

.checkout-bank-row .bank-label {
    font-family: 'Montserrat Alternates', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: #8a94a6;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    min-width: 140px;
    flex-shrink: 0;
}

.checkout-bank-row .bank-value {
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    color: #ffffff;
    font-weight: 500;
    flex: 1;
}

.checkout-bank-row .bank-value.is-pending {
    color: #38bdf8;
    font-style: italic;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.checkout-bank-row .bank-value.is-pending i {
    font-size: 0.75rem;
}

/* Transfer Instructions Notice */
.checkout-transfer-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #091728;
    border: 1px solid rgba(3, 111, 211, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
    margin-top: 20px;
}

.checkout-transfer-notice i {
    color: #036fd3;
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkout-transfer-notice p {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #93c5fd;
    line-height: 1.55;
}

.checkout-transfer-notice strong {
    color: #ffffff;
    font-family: 'Montserrat Alternates', sans-serif;
}

/* Order Reference Mini-Card on Transfer Step */
.checkout-order-ref-mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0a1b2e;
    border: 1px solid rgba(3, 111, 211, 0.3);
    border-radius: 10px;
    padding: 12px 20px;
    margin-bottom: 20px;
}

.checkout-order-ref-mini .ref-label {
    font-family: 'Montserrat Alternates', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: #8a94a6;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.checkout-order-ref-mini .ref-value {
    font-family: 'Montserrat Alternates', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: #036fd3;
}

/* ===== Checkout Footer (Navigation Buttons) ===== */
.checkout-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    border-top: 1px solid #161922;
    background: #07080b;
    flex-shrink: 0;
    gap: 12px;
}

.checkout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: 'Montserrat Alternates', sans-serif;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.checkout-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
}

.checkout-btn-back {
    background: #14171e;
    color: #8a94a6;
    border: 1px solid #222733;
}

.checkout-btn-back:hover:not(:disabled) {
    background: #1c202b;
    color: #ffffff;
    border-color: #036fd3;
}

.checkout-btn-continue,
.checkout-btn-confirm,
.checkout-btn-home {
    background: #036fd3;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(3, 111, 211, 0.35);
}

.checkout-btn-continue:hover:not(:disabled),
.checkout-btn-confirm:hover:not(:disabled),
.checkout-btn-home:hover:not(:disabled) {
    background: #025ab0;
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(3, 111, 211, 0.45);
}

.checkout-btn-print {
    background: #14171e;
    color: #ffffff;
    border: 1px solid #222733;
}

.checkout-btn-print:hover:not(:disabled) {
    background: #1c202b;
    border-color: #036fd3;
}

/* ===== Edit Cart Link (in Summary step) ===== */
.checkout-edit-cart {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #036fd3;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px 0;
    transition: color 0.2s ease;
    font-family: 'Montserrat Alternates', sans-serif;
}

.checkout-edit-cart:hover {
    color: #38bdf8;
    text-decoration: underline;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .checkout-overlay {
        padding: 0;
        align-items: stretch;
    }

    .checkout-container {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .checkout-header {
        padding: 16px 20px;
    }

    .checkout-progress {
        padding: 14px 12px 10px;
        gap: 0;
    }

    .checkout-step-label {
        display: none;
    }

    .checkout-step-connector {
        width: 24px;
        margin-bottom: 0;
    }

    .checkout-body {
        padding: 20px;
    }

    .checkout-form-row {
        grid-template-columns: 1fr;
    }

    .checkout-footer {
        padding: 14px 20px;
    }

    .checkout-btn {
        padding: 11px 16px;
        font-size: 0.85rem;
    }

    .checkout-products-table {
        font-size: 0.82rem;
    }

    .checkout-products-table thead th,
    .checkout-products-table tbody td {
        padding: 8px;
    }

    .checkout-customer-review-row {
        flex-direction: column;
        gap: 2px;
    }

    .checkout-customer-review-row .review-label {
        min-width: unset;
    }

    .checkout-bank-row {
        flex-direction: column;
        gap: 4px;
        padding: 12px 16px;
    }

    .checkout-bank-row .bank-label {
        min-width: unset;
    }

    .checkout-order-ref-mini {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }
}

@media (max-width: 400px) {
    .checkout-step-dot {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }

    .checkout-step-connector {
        width: 16px;
    }

    .checkout-step-title {
        font-size: 1.15rem;
    }
}

/* ===== Print Styles ===== */
@media print {
    .checkout-overlay {
        position: static;
        background: none;
        backdrop-filter: none;
    }

    .checkout-container {
        max-height: none;
        box-shadow: none;
        border: 1px solid #ccc;
        background: #ffffff;
        color: #000000;
    }

    .checkout-header,
    .checkout-footer,
    .checkout-progress {
        display: none;
    }

    .checkout-body {
        overflow: visible;
        padding: 20px;
        background: #ffffff;
        color: #000000;
    }

    .checkout-btn {
        display: none;
    }
}
