/* Checkout flow — order summary + shipping / customer / payment steps */

.storefront-page .checkout-container--flow {
    display: grid;
    grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    margin-top: 12px;
}

.storefront-page .checkout-container--flow .order-summery,
.storefront-page .checkout-container--flow .user-infos {
    width: auto;
    min-width: 0;
}

/* Order summary — invoice card (readonly) */
.storefront-page .order-summery--card {
    position: relative;
    background: #fff;
    border: 1px solid #D8DEE6;
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 8px 24px rgba(15, 23, 42, 0.07);
    height: fit-content;
}

.storefront-page .order-summery--card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #434C83 0%, #5B66A8 55%, #CE1D89 100%);
    z-index: 1;
}

.storefront-page .order-summery__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 18px 14px;
    border-bottom: 1px dashed #E2E8F0;
    background: linear-gradient(180deg, #FAFBFC 0%, #fff 100%);
}

.storefront-page .order-summery__header-main {
    min-width: 0;
    flex: 1;
}

.storefront-page .order-summery__header-aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.storefront-page .order-summery__eyebrow {
    margin: 0 0 4px;
    font-family: yekanR, sans-serif;
    font-size: 11px;
    letter-spacing: 0.02em;
    color: #718096;
    text-transform: uppercase;
}

.storefront-page .order-summery__title {
    margin: 0;
    font-family: yekanB, sans-serif;
    font-size: 17px;
    line-height: 1.45;
    color: #1A202C;
}

.storefront-page .order-summery__ref {
    margin: 4px 0 0;
    font-family: yekanR, sans-serif;
    font-size: 12px;
    color: #718096;
    direction: ltr;
    unicode-bidi: plaintext;
    text-align: right;
}

.storefront-page .order-summery__badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #EEF0F8;
    border: 1px solid rgba(67, 76, 131, 0.14);
    font-family: yekanM, sans-serif;
    font-size: 11px;
    color: #434C83;
    white-space: nowrap;
}

.storefront-page .order-summery__readonly {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 6px;
    background: #F7FAFC;
    border: 1px solid #E2E8F0;
    font-family: yekanR, sans-serif;
    font-size: 10px;
    color: #718096;
    white-space: nowrap;
}

.storefront-page .order-summery__body {
    padding: 14px 18px 18px;
}

/* Invoice table */
.storefront-page .checkout-invoice-table {
    --invoice-col-qty: 44px;
    --invoice-col-unit: 84px;
    --invoice-col-total: 84px;
    margin-bottom: 14px;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.storefront-page .checkout-invoice-table__head,
.storefront-page .checkout-order-line {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        var(--invoice-col-qty)
        var(--invoice-col-unit)
        var(--invoice-col-total);
    align-items: start;
    gap: 8px;
}

.storefront-page .checkout-invoice-table__head {
    padding: 9px 12px;
    background: #F1F5F9;
    border-bottom: 1px solid #E2E8F0;
    font-family: yekanM, sans-serif;
    font-size: 11px;
    line-height: 1.4;
    color: #64748B;
}

.storefront-page .checkout-invoice-table__col--name {
    text-align: right;
    min-width: 0;
}

.storefront-page .checkout-invoice-table__col--qty {
    text-align: center;
}

.storefront-page .checkout-invoice-table__col--unit,
.storefront-page .checkout-invoice-table__col--total {
    text-align: left;
    direction: rtl;
    unicode-bidi: plaintext;
}

.storefront-page .checkout-invoice-table__body .checkout-order-line {
    padding: 11px 12px;
    margin: 0;
    border-bottom: 1px solid #EDF2F7;
    background: #fff;
}

.storefront-page .checkout-invoice-table__body .checkout-order-line:last-child {
    border-bottom: none;
}

.storefront-page .checkout-invoice-table__body .checkout-order-line:nth-child(even) {
    background: #FCFDFE;
}

.storefront-page .checkout-order-line__title {
    margin: 0 0 3px;
    font-family: yekanM, sans-serif;
    font-size: 13px;
    line-height: 1.55;
    color: #1A202C;
    word-break: break-word;
}

.storefront-page .checkout-order-line__cell-value {
    display: block;
    font-family: yekanM, sans-serif;
    font-size: 12px;
    line-height: 1.45;
    color: #2D3748;
    margin: 0;
}

.storefront-page .checkout-order-line__unit-price {
    font-family: yekanR, sans-serif !important;
    font-size: 11px !important;
    color: #718096 !important;
}

.storefront-page .checkout-order-line__line-total {
    font-family: yekanB, sans-serif;
    font-size: 12px;
    color: #434C83;
}

.storefront-page .checkout-order-line .order-item-attributes {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.5;
    color: #718096;
}

/* Invoice totals */
.storefront-page .checkout-invoice-totals {
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.storefront-page .checkout-invoice-totals__section {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: linear-gradient(180deg, #FAFBFC 0%, #F8FAFC 100%);
}

.storefront-page .checkout-invoice-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.storefront-page .checkout-invoice-row__label {
    flex: 1;
    min-width: 0;
    font-family: yekanR, sans-serif;
    font-size: 13px;
    line-height: 1.55;
    color: #4A5568;
    text-align: right;
}

.storefront-page .checkout-invoice-row__meta {
    display: block;
    margin-top: 2px;
    font-family: yekanR, sans-serif;
    font-size: 11px;
    color: #718096;
}

.storefront-page .checkout-invoice-row__value {
    flex-shrink: 0;
    font-family: yekanM, sans-serif;
    font-size: 13px;
    line-height: 1.45;
    color: #1A202C;
    text-align: left;
    direction: rtl;
    unicode-bidi: plaintext;
    white-space: nowrap;
}

.storefront-page .checkout-invoice-row__pending {
    font-family: yekanR, sans-serif;
    font-size: 12px;
    color: #718096;
    white-space: normal;
    max-width: 120px;
    text-align: left;
}

.storefront-page .checkout-invoice-row--discount .checkout-invoice-row__label,
.storefront-page .checkout-invoice-row--discount .checkout-invoice-row__value {
    color: #C53030;
}

.storefront-page .checkout-invoice-row__coupon-code {
    font-family: yekanM, sans-serif;
    font-size: 12px;
    color: #434C83;
    background: #EEF0F8;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(67, 76, 131, 0.12);
}

.storefront-page .checkout-invoice-row--shipping-method .checkout-invoice-row__shipping-name {
    font-family: yekanM, sans-serif;
    font-size: 13px;
    color: #434C83;
    background: #EEF0F8;
    padding: 3px 10px;
    border-radius: 8px;
    border: 1px solid rgba(67, 76, 131, 0.14);
    white-space: normal;
    text-align: center;
    max-width: 160px;
}

.storefront-page .checkout-invoice-totals__grand {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    min-height: 0;
    padding: 10px 14px;
    border-radius: 0;
    background: linear-gradient(135deg, #434C83 0%, #5B66A8 100%);
    box-shadow: none;
}

.storefront-page .checkout-invoice-totals__grand-label {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    font-family: yekanM, sans-serif;
    font-size: 13px;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.92);
    text-align: right;
}

.storefront-page .checkout-invoice-totals__grand-value {
    flex: 0 0 auto;
    width: auto;
    font-family: yekanB, sans-serif;
    font-size: 15px;
    line-height: 1.35;
    color: #fff;
    text-align: left;
    direction: rtl;
    unicode-bidi: plaintext;
    white-space: nowrap;
}

/* Legacy aliases (payment / older markup) */
.storefront-page .checkout-summary-rows {
    margin-top: 0;
    padding: 14px 16px;
    border-radius: 10px;
    background: linear-gradient(180deg, #FAFBFC 0%, #F4F6FA 100%);
    border: 1px solid #E8EDF3;
    gap: 10px;
}

.storefront-page .checkout-summary-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #434C83 0%, #5B66A8 100%);
    box-shadow: 0 4px 14px rgba(67, 76, 131, 0.22);
}

/* Shipping form panel */
.storefront-page .checkout-form-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.storefront-page .checkout-shipping-card,
.storefront-page .checkout-form-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 22px 22px 24px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

.storefront-page .checkout-form-card .form {
    max-width: none;
    margin: 0;
}

.storefront-page .checkout-form-card .order-submit {
    margin-top: 4px;
    min-height: 48px;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(67, 76, 131, 0.22);
}

.storefront-page .checkout-abandon-order-form {
    margin: 14px 0 0;
    padding-top: 14px;
    border-top: 1px dashed #E2E8F0;
}

.storefront-page .checkout-abandon-order-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 11px 16px;
    font-family: yekanM, sans-serif;
    font-size: 14px;
    color: #b91c1c;
    background: #fff;
    border: 1px solid #fecaca;
    border-radius: 10px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    box-sizing: border-box;
}

.storefront-page .checkout-abandon-order-btn:hover {
    color: #991b1b;
    border-color: #f87171;
    background: #fef2f2;
}

.storefront-page .checkout-form-card .checkout-customer-card {
    margin-bottom: 16px;
    border: none;
    border-radius: 10px;
    background: #F8FAFC;
    padding: 14px 16px;
}

/* Payment summary — customer review card */
.storefront-page .checkout-form-card--review {
    padding: 0;
    overflow: hidden;
}

.storefront-page .checkout-review-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 14px;
    border-bottom: 1px dashed #E2E8F0;
    background: linear-gradient(180deg, #FAFBFC 0%, #fff 100%);
}

.storefront-page .checkout-review-card__header-main {
    min-width: 0;
    flex: 1;
}

.storefront-page .checkout-review-card__eyebrow {
    margin: 0 0 4px;
    font-family: yekanR, sans-serif;
    font-size: 11px;
    color: #718096;
}

.storefront-page .checkout-review-card__title {
    margin: 0;
    font-family: yekanB, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    color: #1A202C;
}

.storefront-page .checkout-review-card__edit {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    background: #fff;
    font-family: yekanM, sans-serif;
    font-size: 12px;
    line-height: 1.4;
    color: #434C83;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.storefront-page .checkout-review-card__edit:hover {
    background: #EEF0F8;
    border-color: rgba(67, 76, 131, 0.22);
    color: #434C83;
}

.storefront-page .checkout-review-list {
    margin: 0;
    padding: 14px 20px 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.storefront-page .checkout-review-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
}

.storefront-page .checkout-review-row--wide {
    grid-template-columns: minmax(0, 1fr);
}

.storefront-page .checkout-review-item {
    margin: 0;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #EDF2F7;
    border-radius: 10px;
    background: #F8FAFC;
}

.storefront-page .checkout-review-item--wide {
    grid-column: auto;
}

.storefront-page .checkout-review-item--empty {
    visibility: hidden;
    border-color: transparent;
    background: transparent;
    padding: 10px 12px;
    pointer-events: none;
}

.storefront-page .checkout-review-item__label {
    margin: 0 0 4px;
    font-family: yekanR, sans-serif;
    font-size: 11px;
    line-height: 1.45;
    color: #718096;
}

.storefront-page .checkout-review-item__value {
    margin: 0;
    font-family: yekanM, sans-serif;
    font-size: 13px;
    line-height: 1.55;
    color: #1A202C;
    word-break: break-word;
}

.storefront-page .checkout-review-item__value--ltr {
    direction: ltr;
    unicode-bidi: plaintext;
    text-align: right;
}

.storefront-page .checkout-review-pay-form {
    margin: 0;
    padding: 14px 20px 20px;
    border-top: 1px solid #EDF2F7;
}

.storefront-page .checkout-review-pay-btn {
    width: 100%;
    margin: 0;
}

.storefront-page .checkout-form-card .checkout-edit-link {
    margin-top: 12px;
}

.storefront-page .checkout-shipping-card__header {
    margin-bottom: 18px;
    text-align: right;
}

.storefront-page .checkout-shipping-card__title {
    margin: 0 0 6px;
    font-family: yekanB, sans-serif;
    font-size: 17px;
    color: #1A202C;
}

.storefront-page .checkout-shipping-card__hint {
    margin: 0;
    font-family: yekanR, sans-serif;
    font-size: 13px;
    line-height: 1.65;
    color: #718096;
}

.storefront-page .checkout-shipping-methods {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.storefront-page .shipping-method-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 0;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.storefront-page .shipping-method-option:hover {
    border-color: #CBD5E0;
    background: #FAFBFC;
}

.storefront-page .shipping-method-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.storefront-page .shipping-method-option__indicator {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #CBD5E0;
    background: #fff;
    position: relative;
    transition: border-color 0.15s ease;
}

.storefront-page .shipping-method-option__indicator::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: #434C83;
    transform: scale(0);
    transition: transform 0.15s ease;
}

.storefront-page .shipping-method-option__content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.storefront-page .shipping-method-option__name {
    font-family: yekanM, sans-serif;
    font-size: 14px;
    color: #1A202C;
    transition: color 0.15s ease;
}

.storefront-page .shipping-method-option__cost {
    flex-shrink: 0;
    font-family: yekanB, sans-serif;
    font-size: 14px;
    color: #434C83;
    margin-right: 0;
}

.storefront-page .shipping-method-option__cost--free {
    color: #276749;
    background: #F0FFF4;
    border: 1px solid #C6F6D5;
    padding: 2px 10px;
    border-radius: 6px;
    font-family: yekanM, sans-serif;
    font-size: 12px;
}

.storefront-page .shipping-method-option:has(input:checked) {
    border-color: #434C83;
    background: linear-gradient(135deg, #EEF0F8 0%, #F8FAFC 100%);
    box-shadow: 0 0 0 3px rgba(67, 76, 131, 0.1);
}

.storefront-page .shipping-method-option:has(input:checked) .shipping-method-option__indicator {
    border-color: #434C83;
}

.storefront-page .shipping-method-option:has(input:checked) .shipping-method-option__indicator::after {
    transform: scale(1);
}

.storefront-page .shipping-method-option:has(input:checked) .shipping-method-option__name {
    color: #434C83;
}

.storefront-page .shipping-method-option:has(input:focus-visible) {
    outline: 2px solid #434C83;
    outline-offset: 2px;
}

.storefront-page .checkout-shipping-card .shipping-form-error {
    margin: -8px 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #FFF5F5;
    border: 1px solid #FEB2B2;
    font-family: yekanR, sans-serif;
}

.storefront-page .checkout-shipping-card .order-submit {
    margin-top: 0;
    min-height: 48px;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(67, 76, 131, 0.22);
}

@media screen and (min-width: 1021px) {
    .storefront-page .checkout-container--flow .order-summery--card {
        position: sticky;
        top: 8px;
    }
}

@media screen and (max-width: 1020px) {
    .storefront-page .checkout-container--flow {
        grid-template-columns: 1fr;
    }

    .storefront-page .checkout-container--flow .order-summery--card {
        order: 1;
    }

    .storefront-page .checkout-container--flow .checkout-form-panel {
        order: 2;
    }
}

@media screen and (max-width: 768px) {
    .storefront-page .checkout-invoice-table {
        --invoice-col-qty: 36px;
        --invoice-col-unit: 72px;
        --invoice-col-total: 72px;
    }

    .storefront-page .checkout-invoice-table__head {
        font-size: 10px;
        padding: 8px 10px;
    }

    .storefront-page .checkout-invoice-table__body .checkout-order-line {
        padding: 10px;
        gap: 6px;
    }

    .storefront-page .checkout-order-line__title {
        font-size: 12px;
    }

    .storefront-page .checkout-order-line__cell-value {
        font-size: 11px;
    }

    .storefront-page .checkout-invoice-row__label {
        font-size: 12px;
    }

    .storefront-page .checkout-invoice-row__value {
        font-size: 12px;
    }

    .storefront-page .checkout-invoice-totals__grand-label {
        font-size: 12px;
    }

    .storefront-page .checkout-invoice-totals__grand-value {
        font-size: 14px;
    }

    .storefront-page .checkout-review-list {
        padding: 12px 14px 4px;
        gap: 8px;
    }

    .storefront-page .checkout-review-row {
        gap: 8px;
    }

    .storefront-page .checkout-review-card__header {
        padding: 14px 14px 12px;
    }

    .storefront-page .checkout-review-pay-form {
        padding: 12px 14px 16px;
    }
}

@media screen and (max-width: 640px) {
    .storefront-page .checkout-invoice-table__head {
        display: none;
    }

    .storefront-page .checkout-invoice-table__body .checkout-order-line {
        display: block;
        padding: 12px;
        border-bottom: 1px solid #E2E8F0;
    }

    .storefront-page .checkout-invoice-table__body .checkout-order-line:last-child {
        border-bottom: none;
    }

    .storefront-page .checkout-order-line__name {
        margin-bottom: 8px;
        padding-bottom: 8px;
        border-bottom: 1px dashed #EDF2F7;
    }

    .storefront-page .checkout-order-line__qty,
    .storefront-page .checkout-order-line__unit,
    .storefront-page .checkout-order-line__total {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 4px 0;
        text-align: inherit;
    }

    .storefront-page .checkout-order-line__qty::before,
    .storefront-page .checkout-order-line__unit::before,
    .storefront-page .checkout-order-line__total::before {
        content: attr(data-label);
        font-family: yekanR, sans-serif;
        font-size: 11px;
        color: #718096;
        flex-shrink: 0;
    }

    .storefront-page .checkout-order-line__line-total {
        font-size: 13px;
    }

    .storefront-page .order-summery__header {
        flex-direction: column;
        align-items: stretch;
        padding: 14px 14px 12px;
    }

    .storefront-page .order-summery__header-aside {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
    }

    .storefront-page .order-summery__body {
        padding: 12px 14px 14px;
    }

    .storefront-page .checkout-invoice-row {
        flex-wrap: wrap;
    }

    .storefront-page .checkout-invoice-row__value {
        white-space: normal;
    }

    .storefront-page .checkout-invoice-row__pending {
        max-width: none;
    }

    .storefront-page .checkout-shipping-card,
    .storefront-page .checkout-form-card {
        padding: 18px 16px 20px;
    }

    .storefront-page .shipping-method-option__content {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

@media screen and (max-width: 400px) {
    .storefront-page .checkout-invoice-totals__grand {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        padding: 9px 12px;
    }

    .storefront-page .checkout-invoice-totals__grand-value {
        text-align: left;
        font-size: 13px;
    }

    .storefront-page .checkout-invoice-totals__grand-label {
        font-size: 12px;
    }
}
