/* ==========================================================================
   CHECKOUT
   Route-scoped luxury checkout polish. Keeps Magento's checkout behavior intact.
   ========================================================================== */

.checkout-index-index .page-main {
    max-width: var(--max-w, 80rem) !important;
    padding: clamp(1.5rem, 3vw, 2.5rem) var(--sp-4, 1rem) 4rem !important;
}

.checkout-index-index .columns,
.checkout-index-index .column.main {
    min-width: 0;
}

.checkout-index-index .page-title-wrapper {
    display: none;
}

.checkout-index-index .checkout-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(19rem, 22rem);
    column-gap: clamp(1.5rem, 3vw, 2.25rem);
    row-gap: var(--sp-6, 1.5rem);
    align-items: start;
}

.checkout-index-index .authentication-wrapper,
.checkout-index-index .opc-estimated-wrapper,
.checkout-index-index .checkout-container > .messages {
    grid-column: 1 / -1;
}

.checkout-index-index .opc-progress-bar {
    grid-column: 1 / -1;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 18rem));
    gap: var(--sp-4, 1rem);
    max-width: 39rem;
    margin: 0 0 var(--sp-2, 0.5rem) !important;
    padding: 0 !important;
    counter-reset: checkout-step;
}

.checkout-index-index .opc-progress-bar-item {
    counter-increment: checkout-step;
    position: relative;
    width: auto !important;
    margin: 0 !important;
    padding: 0 0 var(--sp-4, 1rem) !important;
    list-style: none;
    text-align: left;
}

.checkout-index-index .opc-progress-bar-item::before {
    content: '' !important;
    position: absolute !important;
    left: 2.25rem !important;
    right: 0 !important;
    top: 0.875rem !important;
    width: auto !important;
    height: 1px !important;
    background: var(--border, rgba(28, 22, 18, 0.1)) !important;
    border: 0 !important;
    transform: none !important;
}

.checkout-index-index .opc-progress-bar-item:last-child::before {
    display: none !important;
}

.checkout-index-index .opc-progress-bar-item._active::before,
.checkout-index-index .opc-progress-bar-item._complete::before {
    background: rgba(184, 137, 58, 0.38) !important;
}

.checkout-index-index .opc-progress-bar-item > span {
    display: grid !important;
    grid-template-columns: 1.75rem minmax(0, 1fr);
    gap: var(--sp-3, 0.75rem);
    align-items: center;
    min-height: 1.75rem;
    padding: 0 !important;
    color: var(--muted-foreground, #7A6A52) !important;
    font-family: var(--font-sans, 'Outfit', system-ui, sans-serif) !important;
    font-size: var(--text-sm, 0.8125rem) !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    line-height: 1.25 !important;
    text-decoration: none !important;
}

.checkout-index-index .opc-progress-bar-item > span::before {
    content: counter(checkout-step) !important;
    position: static !important;
    display: inline-grid !important;
    place-items: center;
    width: 1.75rem !important;
    height: 1.75rem !important;
    margin: 0 !important;
    border: 1px solid var(--border, rgba(28, 22, 18, 0.1)) !important;
    border-radius: 999px !important;
    background: var(--card, #FDFAF4) !important;
    color: var(--muted-foreground, #7A6A52) !important;
    font-family: var(--font-sans, 'Outfit', system-ui, sans-serif) !important;
    font-size: var(--text-xs, 0.75rem) !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    box-shadow: none !important;
    transform: none !important;
}

.checkout-index-index .opc-progress-bar-item > span::after {
    display: none !important;
}

.checkout-index-index .opc-progress-bar-item._active > span,
.checkout-index-index .opc-progress-bar-item._complete > span {
    color: var(--foreground, #1C1612) !important;
}

.checkout-index-index .opc-progress-bar-item._active > span::before,
.checkout-index-index .opc-progress-bar-item._complete > span::before {
    border-color: var(--gold, #B8893A) !important;
    background: var(--gold, #B8893A) !important;
    color: var(--obsidian, #1C1612) !important;
}

.checkout-index-index .opc-wrapper {
    grid-column: 1;
    width: auto !important;
    float: none !important;
    margin: 0 !important;
    padding: clamp(1.25rem, 2.5vw, 1.75rem) !important;
    border: 1px solid var(--border, rgba(28, 22, 18, 0.1)) !important;
    border-radius: var(--radius, 0.75rem) !important;
    background: var(--card, #FDFAF4) !important;
    box-shadow: var(--shadow-xs, 0 1px 1px rgba(28, 22, 18, 0.04)) !important;
}

.checkout-index-index .opc {
    margin: 0;
    padding: 0;
}

.checkout-index-index .opc > li {
    list-style: none;
}

.checkout-index-index .opc-wrapper .step-title,
.checkout-index-index .checkout-payment-method .step-title {
    margin: 0 0 var(--sp-5, 1.25rem) !important;
    padding: 0 0 var(--sp-4, 1rem) !important;
    border-bottom: 1px solid var(--border, rgba(28, 22, 18, 0.1)) !important;
    color: var(--foreground, #1C1612) !important;
    font-family: var(--font-serif, 'Playfair Display', Georgia, serif) !important;
    font-size: clamp(1.75rem, 3vw, 2.35rem) !important;
    font-weight: 400 !important;
    line-height: 1.08 !important;
}

.checkout-index-index #shipping,
.checkout-index-index #opc-shipping_method {
    margin: 0 !important;
}

.checkout-index-index #opc-shipping_method {
    padding-top: clamp(1.75rem, 3vw, 2.5rem);
}

.checkout-index-index .field.addresses,
.checkout-index-index .shipping-address-items {
    margin: 0 !important;
}

.checkout-index-index .shipping-address-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: var(--sp-4, 1rem);
}

.checkout-index-index .shipping-address-item {
    position: relative;
    width: auto !important;
    min-height: 11rem;
    margin: 0 !important;
    padding: var(--sp-5, 1.25rem) !important;
    border: 1px solid rgba(28, 22, 18, 0.14) !important;
    border-radius: var(--radius-sm, 0.625rem) !important;
    background: rgba(255, 255, 255, 0.28) !important;
    color: var(--foreground, #1C1612) !important;
    font-family: var(--font-sans, 'Outfit', system-ui, sans-serif) !important;
    font-size: var(--text-sm, 0.8125rem) !important;
    line-height: 1.6 !important;
    box-shadow: none !important;
}

.checkout-index-index .shipping-address-item.selected-item {
    border-color: rgba(184, 137, 58, 0.72) !important;
    background: rgba(184, 137, 58, 0.07) !important;
    box-shadow: inset 0 0 0 1px rgba(184, 137, 58, 0.22) !important;
}

.checkout-index-index .shipping-address-item.selected-item::before {
    display: none !important;
}

.checkout-index-index .shipping-address-item.selected-item::after {
    content: '' !important;
    position: absolute !important;
    top: var(--sp-4, 1rem) !important;
    right: var(--sp-4, 1rem) !important;
    width: 0.6rem !important;
    height: 0.95rem !important;
    border: solid var(--gold-dark, #8B6220) !important;
    border-width: 0 2px 2px 0 !important;
    background: transparent !important;
    transform: rotate(45deg) !important;
    box-shadow: none !important;
}

.checkout-index-index .shipping-address-item .action,
.checkout-index-index .shipping-address-item button.action {
    min-height: 2.25rem;
    margin-top: var(--sp-3, 0.75rem);
    border-radius: var(--radius-sm, 0.625rem);
    font-family: var(--font-sans, 'Outfit', system-ui, sans-serif);
    font-size: var(--text-xs, 0.75rem);
    font-weight: 600;
}

.checkout-index-index .shipping-address-item .action.edit-address-link {
    color: var(--gold-dark, #8B6220) !important;
}

.checkout-index-index .new-address-popup {
    margin: var(--sp-5, 1.25rem) 0 0 !important;
}

.checkout-index-index .new-address-popup .action-show-popup {
    min-height: 2.75rem;
    padding: 0 var(--sp-5, 1.25rem) !important;
    border: 1px solid rgba(28, 22, 18, 0.16) !important;
    border-radius: var(--radius-sm, 0.625rem) !important;
    background: transparent !important;
    color: var(--foreground, #1C1612) !important;
    font-family: var(--font-sans, 'Outfit', system-ui, sans-serif) !important;
    font-size: var(--text-sm, 0.8125rem) !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

.checkout-index-index .new-address-popup .action-show-popup:hover {
    border-color: rgba(184, 137, 58, 0.42) !important;
    background: rgba(184, 137, 58, 0.08) !important;
}

.checkout-index-index .form-shipping-address,
.checkout-index-index .form.methods-shipping {
    max-width: none !important;
}

.checkout-index-index .field .label,
.checkout-index-index .field label,
.checkout-index-index .table-checkout-shipping-method th,
.checkout-index-index .table-checkout-shipping-method td {
    color: var(--foreground, #1C1612);
    font-family: var(--font-sans, 'Outfit', system-ui, sans-serif);
    font-size: var(--text-sm, 0.8125rem);
}

.checkout-index-index .field .label,
.checkout-index-index .field label {
    margin-bottom: var(--sp-2, 0.5rem);
    font-weight: 600;
}

.checkout-index-index input.input-text,
.checkout-index-index select,
.checkout-index-index textarea,
.checkout-index-index .select {
    min-height: 2.75rem;
    border: 1px solid rgba(28, 22, 18, 0.16) !important;
    border-radius: var(--radius-sm, 0.625rem) !important;
    background: var(--input-background, #FDFAF4) !important;
    color: var(--foreground, #1C1612) !important;
    font-family: var(--font-sans, 'Outfit', system-ui, sans-serif) !important;
    box-shadow: none !important;
}

.checkout-index-index input.input-text:focus,
.checkout-index-index select:focus,
.checkout-index-index textarea:focus,
.checkout-index-index button:focus,
.checkout-index-index .action:focus {
    outline: none !important;
    border-color: rgba(184, 137, 58, 0.62) !important;
    box-shadow: 0 0 0 3px rgba(184, 137, 58, 0.14) !important;
}

.checkout-index-index input[type='radio'],
.checkout-index-index input[type='checkbox'] {
    accent-color: var(--gold, #B8893A);
}

.checkout-index-index .table-checkout-shipping-method {
    width: 100% !important;
    margin: 0 !important;
    border-collapse: collapse !important;
}

.checkout-index-index .table-checkout-shipping-method thead {
    display: none;
}

.checkout-index-index .table-checkout-shipping-method tbody tr {
    border-bottom: 1px solid var(--border, rgba(28, 22, 18, 0.1));
}

.checkout-index-index .table-checkout-shipping-method tbody tr:first-child {
    border-top: 1px solid var(--border, rgba(28, 22, 18, 0.1));
}

.checkout-index-index .table-checkout-shipping-method td {
    padding: var(--sp-4, 1rem) var(--sp-3, 0.75rem) !important;
    vertical-align: middle !important;
}

.checkout-index-index .table-checkout-shipping-method td:first-child {
    width: 2rem;
    padding-left: 0 !important;
}

.checkout-index-index .table-checkout-shipping-method .price {
    color: var(--foreground, #1C1612);
    font-weight: 700;
}

.checkout-index-index #shipping-method-buttons-container,
.checkout-index-index .checkout-payment-method .actions-toolbar {
    display: flex !important;
    justify-content: flex-end;
    margin-top: var(--sp-6, 1.5rem) !important;
    padding-top: var(--sp-5, 1.25rem);
    border-top: 1px solid var(--border, rgba(28, 22, 18, 0.1));
}

.checkout-index-index .button.action.continue.primary,
.checkout-index-index .action.primary.checkout,
.checkout-index-index .payment-method-content .action.primary {
    min-width: 9.5rem;
    min-height: 3rem;
    padding: 0 var(--sp-7, 1.75rem) !important;
    border: 1px solid var(--obsidian, #1C1612) !important;
    border-radius: var(--radius-sm, 0.625rem) !important;
    background: var(--obsidian, #1C1612) !important;
    color: var(--primary-foreground, #F5F0E8) !important;
    font-family: var(--font-sans, 'Outfit', system-ui, sans-serif) !important;
    font-size: var(--text-sm, 0.8125rem) !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    box-shadow: none !important;
}

.checkout-index-index .button.action.continue.primary:hover,
.checkout-index-index .action.primary.checkout:hover,
.checkout-index-index .payment-method-content .action.primary:hover {
    background: var(--walnut, #3D3020) !important;
    border-color: var(--walnut, #3D3020) !important;
}

.checkout-index-index .opc-sidebar {
    grid-column: 2;
    width: auto !important;
    float: none !important;
    margin: 0 !important;
    color: var(--foreground, #1C1612);
}

.checkout-index-index .opc-block-summary {
    margin: 0 !important;
    padding: var(--sp-5, 1.25rem) !important;
    border: 1px solid var(--border, rgba(28, 22, 18, 0.1)) !important;
    border-radius: var(--radius, 0.75rem) !important;
    background: var(--card, #FDFAF4) !important;
    box-shadow: var(--shadow-xs, 0 1px 1px rgba(28, 22, 18, 0.04)) !important;
}

.checkout-index-index .opc-block-summary > .title {
    display: block !important;
    margin: 0 0 var(--sp-4, 1rem) !important;
    padding: 0 0 var(--sp-4, 1rem) !important;
    border-bottom: 1px solid var(--border, rgba(28, 22, 18, 0.1)) !important;
    color: var(--foreground, #1C1612) !important;
    font-family: var(--font-serif, 'Playfair Display', Georgia, serif) !important;
    font-size: clamp(1.65rem, 2.5vw, 2rem) !important;
    font-weight: 400 !important;
    line-height: 1.1 !important;
}

.checkout-index-index .block.items-in-cart {
    margin: 0 0 var(--sp-4, 1rem) !important;
}

.checkout-index-index .block.items-in-cart > .title {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3, 0.75rem);
    margin: 0 !important;
    padding: 0 0 var(--sp-4, 1rem) !important;
    border-bottom: 1px solid var(--border, rgba(28, 22, 18, 0.1)) !important;
    color: var(--foreground, #1C1612) !important;
    font-family: var(--font-sans, 'Outfit', system-ui, sans-serif) !important;
    font-size: var(--text-lg, 1.125rem) !important;
    font-weight: 600 !important;
}

.checkout-index-index .block.items-in-cart > .title::after {
    color: var(--muted-foreground, #7A6A52) !important;
}

.checkout-index-index .opc-block-summary .content.minicart-items {
    margin-top: var(--sp-4, 1rem);
}

.checkout-index-index .opc-block-summary .minicart-items-wrapper {
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

.checkout-index-index .opc-block-summary .minicart-items {
    margin: 0;
    padding: 0;
}

.checkout-index-index .opc-block-summary .product-item {
    margin: 0 !important;
    padding: var(--sp-4, 1rem) 0 !important;
    border-bottom: 1px solid var(--border, rgba(28, 22, 18, 0.1)) !important;
}

.checkout-index-index .opc-block-summary .product-item:first-child {
    padding-top: 0 !important;
}

.checkout-index-index .opc-block-summary .product-item-name,
.checkout-index-index .opc-block-summary .product-item-name-block {
    color: var(--foreground, #1C1612) !important;
    font-family: var(--font-serif, 'Playfair Display', Georgia, serif) !important;
    font-size: var(--text-md, 1rem) !important;
    font-weight: 400 !important;
    line-height: 1.22 !important;
}

.checkout-index-index .opc-block-summary .details-qty,
.checkout-index-index .opc-block-summary .subtotal {
    color: var(--muted-foreground, #7A6A52) !important;
    font-family: var(--font-sans, 'Outfit', system-ui, sans-serif) !important;
    font-size: var(--text-sm, 0.8125rem) !important;
}

.checkout-index-index .opc-block-summary .table-totals,
.checkout-index-index .opc-block-summary .table.totals {
    width: 100%;
    margin: var(--sp-4, 1rem) 0 0 !important;
    border-collapse: collapse;
    background: transparent !important;
}

.checkout-index-index .opc-block-summary .table-totals tr,
.checkout-index-index .opc-block-summary .table.totals tr {
    border-bottom: 1px solid var(--border, rgba(28, 22, 18, 0.1));
}

.checkout-index-index .opc-block-summary .table-totals tr:last-child,
.checkout-index-index .opc-block-summary .table.totals tr:last-child {
    border-bottom: 0;
}

.checkout-index-index .opc-block-summary .table-totals th,
.checkout-index-index .opc-block-summary .table-totals td,
.checkout-index-index .opc-block-summary .table.totals th,
.checkout-index-index .opc-block-summary .table.totals td {
    padding: var(--sp-3, 0.75rem) 0 !important;
    color: var(--foreground, #1C1612) !important;
    font-family: var(--font-sans, 'Outfit', system-ui, sans-serif) !important;
    font-size: var(--text-sm, 0.8125rem) !important;
}

.checkout-index-index .opc-block-summary .grand th,
.checkout-index-index .opc-block-summary .grand td,
.checkout-index-index .opc-block-summary .grand .price {
    color: var(--foreground, #1C1612) !important;
    font-size: var(--text-md, 1rem) !important;
    font-weight: 800 !important;
}

.checkout-index-index .opc-block-summary .amount,
.checkout-index-index .opc-block-summary .price {
    text-align: right;
    white-space: nowrap;
}

.checkout-index-index .opc-block-shipping-information {
    margin-top: var(--sp-4, 1rem) !important;
    padding: var(--sp-5, 1.25rem) !important;
    border: 1px solid var(--border, rgba(28, 22, 18, 0.1)) !important;
    border-radius: var(--radius, 0.75rem) !important;
    background: var(--card, #FDFAF4) !important;
}

.checkout-index-index .opc-block-shipping-information .shipping-information-title,
.checkout-index-index .opc-block-shipping-information .shipping-information-content {
    color: var(--foreground, #1C1612);
    font-family: var(--font-sans, 'Outfit', system-ui, sans-serif);
}

.checkout-index-index .checkout-payment-method .payment-method-title {
    padding: var(--sp-4, 1rem) 0 !important;
    border-bottom: 1px solid var(--border, rgba(28, 22, 18, 0.1)) !important;
}

.checkout-index-index .checkout-payment-method .payment-method-content {
    padding: var(--sp-5, 1.25rem) 0 !important;
}

.checkout-index-index .payment-option-title,
.checkout-index-index .payment-option-content {
    color: var(--foreground, #1C1612);
    font-family: var(--font-sans, 'Outfit', system-ui, sans-serif);
}

@media (max-width: 1024px) {
    .checkout-index-index .checkout-container {
        grid-template-columns: minmax(0, 1fr);
    }

    .checkout-index-index .opc-wrapper,
    .checkout-index-index .opc-sidebar {
        grid-column: 1;
    }

    .checkout-index-index .opc-sidebar {
        position: static !important;
    }
}

@media (max-width: 767px) {
    .checkout-index-index .page-main {
        padding: var(--sp-4, 1rem) var(--sp-3, 0.75rem) var(--sp-8, 2rem) !important;
    }

    .checkout-index-index .checkout-container {
        row-gap: var(--sp-4, 1rem);
    }

    .checkout-index-index .opc-progress-bar {
        grid-template-columns: 1fr 1fr;
        gap: var(--sp-3, 0.75rem);
        max-width: none;
    }

    .checkout-index-index .opc-progress-bar-item > span {
        grid-template-columns: 1.5rem minmax(0, 1fr);
        font-size: var(--text-xs, 0.75rem) !important;
    }

    .checkout-index-index .opc-progress-bar-item > span::before {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }

    .checkout-index-index .opc-progress-bar-item::before {
        left: 2rem !important;
        top: 0.75rem !important;
    }

    .checkout-index-index .opc-wrapper,
    .checkout-index-index .opc-block-summary,
    .checkout-index-index .opc-block-shipping-information {
        padding: var(--sp-4, 1rem) !important;
        border-radius: var(--radius-sm, 0.625rem) !important;
    }

    .checkout-index-index .shipping-address-items {
        grid-template-columns: 1fr;
    }

    .checkout-index-index .table-checkout-shipping-method tbody tr {
        display: grid;
        grid-template-columns: 2rem 1fr;
        gap: 0 var(--sp-3, 0.75rem);
        padding: var(--sp-3, 0.75rem) 0;
    }

    .checkout-index-index .table-checkout-shipping-method td {
        padding: var(--sp-1, 0.25rem) 0 !important;
    }

    .checkout-index-index .table-checkout-shipping-method td:first-child {
        grid-row: 1 / 4;
        align-self: start;
        padding-top: var(--sp-2, 0.5rem) !important;
    }

    .checkout-index-index #shipping-method-buttons-container,
    .checkout-index-index .checkout-payment-method .actions-toolbar {
        justify-content: stretch;
    }

    .checkout-index-index .button.action.continue.primary,
    .checkout-index-index .action.primary.checkout,
    .checkout-index-index .payment-method-content .action.primary {
        width: 100%;
    }
}
