
/* ================================================================
   1.  DETAIL PAGE — ADD TO CART BLOCK
   ================================================================ */
.detail-atc-block {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    background: var(--surface-2);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Qty row */
.detail-atc-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.detail-atc-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-2);
    white-space: nowrap;
}

/* Qty control (reuse from v2 additions) */
.detail-atc-block .qty-control {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border-2);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface);
}

.detail-atc-block .qty-btn {
    width: 36px;
    height: 36px;
    background: var(--surface-2);
    border: none;
    font-size: 18px;
    font-weight: 300;
    color: var(--ink-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
    line-height: 1;
    padding: 0;
}

    .detail-atc-block .qty-btn:hover {
        background: var(--brand-light);
        color: var(--brand);
    }

.detail-atc-block .qty-input {
    width: 48px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    font-size: 15px;
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--ink);
    background: var(--surface);
    padding: 6px 0;
    outline: none;
    -moz-appearance: textfield;
}

    .detail-atc-block .qty-input::-webkit-inner-spin-button,
    .detail-atc-block .qty-input::-webkit-outer-spin-button {
        -webkit-appearance: none;
    }

/* Button row */
.detail-atc-btn-row {
    display: flex;
    gap: 10px;
}

/* Add to Cart button */
.btn-detail-add-to-cart {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), transform .1s;
    letter-spacing: .01em;
}

    .btn-detail-add-to-cart:hover {
        background: var(--brand-hover);
    }

    .btn-detail-add-to-cart:active {
        transform: scale(.98);
    }

    .btn-detail-add-to-cart.btn-adding {
        background: var(--ink-3);
        pointer-events: none;
    }

/* View Cart button */
.btn-detail-view-cart {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    background: var(--surface);
    color: var(--brand);
    border: 2px solid var(--brand);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
    letter-spacing: .01em;
}

    .btn-detail-view-cart:hover {
        background: var(--brand);
        color: #fff;
    }

/* Trust row */
.detail-atc-trust {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

    .detail-atc-trust span {
        font-size: 11px;
        color: var(--ink-3);
        white-space: nowrap;
    }

/* ================================================================
   2.  CART PAGE
   ================================================================ */
.cart-page-shell {
    padding-top: 32px;
    min-height: calc(100vh - var(--nav-h) - 120px);
}

/* Header */
.cart-page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.cart-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-3);
    text-decoration: none;
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: color var(--transition), border-color var(--transition);
}

    .cart-back-link:hover {
        color: var(--brand);
        border-color: var(--brand);
    }

.cart-page-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    flex: 1;
}

.cart-page-count {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-3);
    background: var(--surface-3);
    padding: 3px 12px;
    border-radius: var(--radius-pill);
    margin-left: 4px;
}

/* Empty state */
.cart-page-empty {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.cart-page-empty-inner {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

    .cart-page-empty-inner h2 {
        font-family: var(--font-display);
        font-size: 22px;
        color: var(--ink);
        margin: 0;
    }

    .cart-page-empty-inner p {
        font-size: 14px;
        color: var(--ink-3);
        margin: 0;
    }

.btn-back-to-shop {
    display: inline-flex;
    align-items: center;
    padding: 12px 28px;
    background: var(--brand);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    margin-top: 8px;
    transition: background var(--transition);
}

    .btn-back-to-shop:hover {
        background: var(--brand-hover);
    }

/* Two-col grid: items | summary */
.cart-page-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
}

@media (max-width: 991px) {
    .cart-page-grid {
        grid-template-columns: 1fr;
    }

    .cart-page-summary {
        order: -1;
    }
}

/* ── Item list card ── */
.cart-page-items {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.cart-page-items-head {
    display: grid;
    grid-template-columns: 1fr 160px 120px;
    gap: 12px;
    padding: 12px 20px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-3);
}

/* Single row */
.cart-page-row {
    display: grid;
    grid-template-columns: 1fr 160px 120px;
    gap: 12px;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    transition: background .1s;
}

    .cart-page-row:last-child {
        border-bottom: none;
    }

    .cart-page-row:hover {
        background: var(--surface-2);
    }

/* Product cell */
.cpr-product {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.cpr-thumb-link {
    flex-shrink: 0;
}

.cpr-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-3);
    display: block;
    transition: transform .2s;
}

    .cpr-thumb:hover {
        transform: scale(1.04);
    }

.cpr-info {
    flex: 1;
    min-width: 0;
}

.cpr-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    transition: color var(--transition);
}

    .cpr-name:hover {
        color: var(--brand);
    }

.cpr-unit-price {
    font-size: 13px;
    color: var(--brand);
    font-weight: 500;
    margin: 3px 0 6px;
}

.cpr-remove {
    font-size: 12px;
    color: var(--ink-3);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: var(--font-body);
    text-decoration: underline;
    transition: color var(--transition);
}

    .cpr-remove:hover {
        color: var(--brand);
    }

/* Qty cell */
.cpr-qty {
    display: flex;
    justify-content: center;
}

    .cpr-qty .qty-control {
        border: 1.5px solid var(--border-2);
        border-radius: var(--radius-sm);
        overflow: hidden;
        display: flex;
        align-items: center;
        background: var(--surface);
    }

    .cpr-qty .qty-btn {
        width: 32px;
        height: 32px;
        background: var(--surface-2);
        border: none;
        font-size: 16px;
        font-weight: 300;
        color: var(--ink-2);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background var(--transition), color var(--transition);
        padding: 0;
    }

        .cpr-qty .qty-btn:hover {
            background: var(--brand-light);
            color: var(--brand);
        }

    .cpr-qty .qty-input {
        width: 40px;
        text-align: center;
        border: none;
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
        font-size: 14px;
        font-weight: 600;
        color: var(--ink);
        background: var(--surface);
        padding: 4px 0;
        outline: none;
        -moz-appearance: textfield;
    }

        .cpr-qty .qty-input::-webkit-inner-spin-button,
        .cpr-qty .qty-input::-webkit-outer-spin-button {
            -webkit-appearance: none;
        }

/* Subtotal cell */
.cpr-subtotal {
    text-align: right;
}

.cpr-line-total {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
}

/* Bottom actions */
.cart-page-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    flex-wrap: wrap;
    gap: 10px;
}

.btn-cart-clear {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-3);
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    cursor: pointer;
    font-family: var(--font-body);
    transition: color var(--transition), border-color var(--transition);
}

    .btn-cart-clear:hover {
        color: var(--brand);
        border-color: var(--brand);
    }

.btn-continue-shopping {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-2);
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: color var(--transition), border-color var(--transition);
}

    .btn-continue-shopping:hover {
        color: var(--brand);
        border-color: var(--brand);
    }

/* ── Order Summary card ── */
.cart-page-summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: calc(var(--nav-h) + 16px);
}

.summary-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

/* Coupon */
.summary-coupon {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-label {
    font-size: 12px;
    color: var(--ink-3);
    margin: 0;
}

.coupon-msg {
    font-size: 12px;
    margin: 0;
}

/* Totals */
.summary-totals {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--ink-2);
}

.summary-discount .discount-value {
    color: #16a34a;
    font-weight: 600;
}

.summary-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.summary-grand {
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
}

/* Checkout */
.cart-page-summary .btn-checkout {
    width: 100%;
    padding: 14px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition);
    letter-spacing: .01em;
}

    .cart-page-summary .btn-checkout:hover {
        background: var(--brand-hover);
    }

/* Trust badges */
.summary-trust {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.trust-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--ink-3);
}

.trust-badge-icon {
    font-size: 14px;
}

/* ── Mobile responsive ── */
@media (max-width: 767px) {
    .cart-page-items-head {
        display: none;
    }

    .cart-page-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .cpr-qty {
        justify-content: flex-start;
    }

    .cpr-subtotal {
        text-align: left;
    }

    .cpr-line-total::before {
        content: "Subtotal: ";
        font-weight: 400;
        font-size: 13px;
        color: var(--ink-3);
    }
}


/* ================================================================
   3.  CHECKOUT MODAL + VARIANT MODAL
   Shared styles used by both the checkout form (cart-ui.js)
   and the variant selection modal (Index.cshtml, ProductDetail.cshtml)
   ================================================================ */

.checkout-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}

.checkout-modal {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.checkout-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.checkout-modal-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
}

.checkout-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--ink-3);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition), color var(--transition);
    line-height: 1;
    padding: 0;
}

    .checkout-modal-close:hover {
        background: var(--brand-light);
        color: var(--brand);
    }

/* Form fields */
.checkout-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .checkout-field label {
        font-size: 13px;
        font-weight: 600;
        color: var(--ink-2);
    }

    .checkout-field input,
    .checkout-field select,
    .checkout-field textarea {
        width: 100%;
        padding: 10px 12px;
        border: 1.5px solid var(--border);
        border-radius: var(--radius-sm);
        font-family: var(--font-body);
        font-size: 14px;
        color: var(--ink);
        background: var(--surface);
        outline: none;
        transition: border-color var(--transition);
        box-sizing: border-box;
    }

        .checkout-field input:focus,
        .checkout-field select:focus,
        .checkout-field textarea:focus {
            border-color: var(--brand);
        }

    .checkout-field textarea {
        resize: vertical;
        min-height: 64px;
    }

.req {
    color: var(--brand);
}

.opt {
    color: var(--ink-3);
    font-weight: 400;
}

/* Radio row */
.checkout-radio-row {
    display: flex;
    gap: 20px;
}

.checkout-radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--ink-2);
    cursor: pointer;
}

/* Summary line (grand total row) */
.checkout-summary-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

/* Submit button */
.btn-checkout-submit {
    width: 100%;
    padding: 14px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition);
    letter-spacing: 0.01em;
}

    .btn-checkout-submit:hover:not(:disabled) {
        background: var(--brand-hover);
    }

    .btn-checkout-submit:disabled {
        background: var(--ink-3);
        cursor: not-allowed;
    }

/* Error banner inside modal */
.checkout-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
}


/* ================================================================
   4.  VARIANT CHIPS  (ProductDetail + variant modal on Index)
   ================================================================ */

.variant-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.variant-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.variant-group-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-2);
    display: flex;
    align-items: center;
    gap: 4px;
}

.variant-required-mark {
    color: var(--brand);
    font-size: 14px;
    line-height: 1;
}

.variant-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.variant-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 14px;
    border: 1.5px solid var(--border-2);
    border-radius: var(--radius-pill);
    background: var(--surface);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-2);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), color var(--transition);
    white-space: nowrap;
    line-height: 1.3;
}

    .variant-chip:hover {
        border-color: var(--brand);
        color: var(--brand);
        background: var(--brand-light);
    }

    .variant-chip.selected {
        border-color: var(--brand);
        background: var(--brand);
        color: #fff;
    }

        .variant-chip.selected .variant-chip-extra {
            color: rgba(255, 255, 255, 0.85);
        }

.variant-chip-extra {
    font-size: 11px;
    color: var(--ink-3);
    font-weight: 400;
}

.variant-group-error {
    font-size: 12px;
    color: var(--brand);
    margin: 0;
}

/* Extra price display on ProductDetail page */
.variant-extra-price-display {
    font-size: 13px;
    color: var(--ink-3);
    margin: 4px 0 0;
}

    .variant-extra-price-display strong {
        color: var(--brand);
        font-weight: 700;
    }

/* ── Mobile ── */
@media (max-width: 576px) {
    .checkout-modal {
        padding: 18px;
        max-height: 95vh;
    }

    .checkout-modal-title {
        font-size: 16px;
    }
}

/* Disabled state for checkout anchor on Index (store closed) */
a.btn-checkout.disabled {
    pointer-events: none;
    opacity: 0.55;
    cursor: not-allowed;
}
