@charset "UTF-8";

/**
 * Checkout New - Apple theme + glass effect
 * Used by: customer/checkout_new.blade.php
 * Do not change form IDs, names, or JS hooks.
 */

/* ============================================================
   PAGE WRAPPER
   ============================================================ */

.nx-checkout-page {
    --checkout-glass-bg: rgba(255, 255, 255, 0.78);
    --checkout-glass-border: rgba(255, 255, 255, 0.28);
    --checkout-glass-blur: 20px;
    font-family: var(--font-system, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
    /* background: var(--modern-surface-secondary, #f2f2f7); */
    min-height: 100vh;
    padding: var(--space-4, 1rem) 0 var(--space-12, 3rem);
}

@media (min-width: 768px) {
    .nx-checkout-page {
        padding: var(--space-6, 1.5rem) 0 var(--space-16, 4rem);
    }
}

/* ============================================================
   CHECKOUT GRID — lg+: main left; summary + terms stacked right.
   < lg: flex column order = summary → billing/payment → terms (unchanged UX)
   ============================================================ */

.nx-checkout-page .nx-checkout-grid--layout {
    display: flex;
    flex-direction: column;
    gap: var(--space-4, 1rem);
}

/* Mobile: flatten sidebar so summary / main / terms keep previous stack order */
.nx-checkout-page .nx-checkout-grid__sidebar {
    display: contents;
}

.nx-checkout-page .nx-checkout-grid__summary {
    order: 1;
}

.nx-checkout-page .nx-checkout-grid__main {
    order: 2;
}

.nx-checkout-page .nx-checkout-grid__terms {
    order: 3;
}

@media (min-width: 992px) {
    .nx-checkout-page .nx-checkout-grid--layout {
        display: grid;
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
        grid-template-rows: auto;
        gap: var(--space-6, 1.5rem);
        align-items: start;
    }

    .nx-checkout-page .nx-checkout-grid__sidebar {
        display: flex;
        flex-direction: column;
        gap: var(--space-4, 1rem);
        grid-column: 2;
        grid-row: 1;
        width: 100%;
        min-width: 0;
    }

    .nx-checkout-page .nx-checkout-grid__main {
        order: unset;
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
    }

    .nx-checkout-page .nx-checkout-grid__summary,
    .nx-checkout-page .nx-checkout-grid__terms {
        order: unset;
        width: 100%;
    }

    .nx-checkout-page .nx-checkout-grid__summary {
        margin-bottom: 0 !important;
    }
}

/* ============================================================
   GLASS CARDS (billing, payment, terms, summary)
   ============================================================ */

.nx-checkout-page .nx-checkout-card {
    background: var(--checkout-glass-bg);
    backdrop-filter: blur(var(--checkout-glass-blur));
    -webkit-backdrop-filter: blur(var(--checkout-glass-blur));
    border: 1px solid var(--checkout-glass-border);
    border-radius: var(--radius-xl, 1rem);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.nx-checkout-page .nx-checkout-card .card-body {
    background: transparent;
    border: none;
}

.nx-checkout-page .nx-checkout-card .card-header {
    background: var(--primary, #0d6efd) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-weight: var(--font-semibold, 600);
}

/* ============================================================
   SECTION TITLES
   ============================================================ */

.nx-checkout-page .nx-checkout-card h4,
.nx-checkout-page .nx-checkout-card .card-header h5 {
    color: var(--modern-text-primary, #1c1c1e);
    font-weight: var(--font-semibold, 600);
    font-size: var(--text-lg, 1.125rem);
}

.nx-checkout-page .nx-checkout-card .card-header h5 {
    color: inherit;
}

/* ============================================================
   FORMS (keep existing .form-control behaviour)
   ============================================================ */

.nx-checkout-page .form-control {
    background: #fff;
    border: 1px solid var(--modern-border-secondary, #e5e5ea);
    border-radius: var(--radius-md, 0.5rem);
    color: var(--modern-text-primary, #1c1c1e);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nx-checkout-page .form-control:focus {
    border-color: var(--primary, #0d6efd);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.nx-checkout-page select.form-control {
    background: #fff;
    color: var(--modern-text-primary, #1c1c1e);
}

/* ============================================================
   RADIO / CHECKBOX – nx-form-check (payment, shipping, terms)
   ============================================================ */

.nx-checkout-page .nx-form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-height: 1.5rem;
    margin-bottom: 0.5rem;
}

.nx-checkout-page .nx-form-check:last-child {
    margin-bottom: 0;
}

.nx-checkout-page .nx-form-check-input {
    flex-shrink: 0;
    margin: 0.1875rem 0 0 0;
    border: 1px solid var(--modern-border-secondary, #e5e5ea);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #fff;
    cursor: pointer;
    box-sizing: border-box;
    padding: 0;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

/* Checkbox: square (agree_terms and any checkbox) */
.nx-checkout-page .nx-form-check input[type="checkbox"].nx-form-check-input,
.nx-checkout-page .nx-form-check-input[type="checkbox"],
.nx-checkout-page #agreeTerms.nx-form-check-input {
    width: 1.125rem !important;
    height: 1.125rem !important;
    min-width: 1.125rem !important;
    min-height: 1.125rem !important;
    border-radius: 0.25rem !important;
    aspect-ratio: 1 / 1;
}

/* Checkbox unchecked – explicit square look */
.nx-checkout-page .nx-form-check input[type="checkbox"].nx-form-check-input,
.nx-checkout-page .nx-form-check-input[type="checkbox"] {
    background-color: #fff !important;
    background-image: none !important;
    border-color: var(--modern-border-secondary, #e5e5ea) !important;
}

/* Radio: circle – force circular shape (override Bootstrap/global) */
.nx-checkout-page .nx-form-check input[type="radio"].nx-form-check-input,
.nx-checkout-page .nx-form-check-input[type="radio"] {
    width: 1.125rem !important;
    height: 1.125rem !important;
    min-width: 1.125rem !important;
    min-height: 1.125rem !important;
    border-radius: 50% !important;
    aspect-ratio: 1 / 1;
}

/* Radio unchecked – explicit default (override global) */
.nx-checkout-page .nx-form-check input[type="radio"].nx-form-check-input,
.nx-checkout-page .nx-form-check-input[type="radio"] {
    background-color: #fff !important;
    background-image: none !important;
    border-color: var(--modern-border-secondary, #e5e5ea) !important;
}

/* Radio checked */
.nx-checkout-page .nx-form-check input[type="radio"].nx-form-check-input:checked,
.nx-checkout-page .nx-form-check-input[type="radio"]:checked {
    background-color: var(--primary, #0d6efd) !important;
    border-color: var(--primary, #0d6efd) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e") !important;
    background-size: 0.375rem 0.375rem !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Checkbox checked – square with checkmark */
.nx-checkout-page .nx-form-check input[type="checkbox"].nx-form-check-input:checked,
.nx-checkout-page .nx-form-check-input[type="checkbox"]:checked,
.nx-checkout-page #agreeTerms.nx-form-check-input:checked {
    background-color: var(--primary, #0d6efd) !important;
    border-color: var(--primary, #0d6efd) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3e%3c/svg%3e") !important;
    background-size: 100% 100% !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    border-radius: 0.25rem !important;
}

.nx-checkout-page .nx-form-check-input:focus {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}

.nx-checkout-page .nx-form-check-label {
    flex: 1;
    cursor: pointer;
    font-weight: 400;
    line-height: 1.5;
    color: var(--modern-text-primary, #1c1c1e);
}

.nx-checkout-page .nx-form-check-label a {
    pointer-events: auto;
}

/* ============================================================
   ONLINE PAYMENT GATEWAYS – selected state
   ============================================================ */

.nx-checkout-page #online-methods .btn-pg {
    background-color: #fff;
    border: 1px solid var(--modern-border-secondary, #e5e5ea);
    color: var(--modern-text-primary, #1c1c1e);
    border-radius: var(--radius-md, 0.5rem);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.nx-checkout-page #online-methods .btn-pg:hover {
    background-color: var(--filter-bg, #f8f9fa);
    border-color: var(--primary, #0d6efd);
}

.nx-checkout-page #online-methods input[name="online_payment"]:checked + .btn-pg {
    background-color: var(--primary, #0d6efd) !important;
    border-color: var(--primary, #0d6efd) !important;
    color: #fff !important;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}

.nx-checkout-page #online-methods input[name="online_payment"]:checked + .btn-pg span {
    color: #fff;
}

/* ============================================================
   SUMMARY SIDEBAR - GLASS
   ============================================================ */

.nx-checkout-page .nx-checkout-summary {
    background: var(--checkout-glass-bg);
    backdrop-filter: blur(var(--checkout-glass-blur));
    -webkit-backdrop-filter: blur(var(--checkout-glass-blur));
    border: 1px solid var(--checkout-glass-border);
    border-radius: var(--radius-xl, 1rem);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.nx-checkout-page .nx-checkout-summary .card-header {
    background: var(--primary, #0d6efd) !important;
    color: #fff;
}

.nx-checkout-page .nx-checkout-summary .list-group-item {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(0, 0, 0, 0.06);
}

.nx-checkout-page .nx-checkout-summary .card-footer.bg-light {
    background: rgba(248, 249, 250, 0.9) !important;
    backdrop-filter: blur(8px);
}

/* ============================================================
   PROMO CODE – input + Apply button
   ============================================================ */

.nx-checkout-page .nx-promo-code {
    background: rgba(255, 255, 255, 0.6) !important;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-md, 0.5rem);
}

.nx-checkout-page .nx-promo-group {
    border-radius: var(--radius-md, 0.5rem);
    overflow: hidden;
    border: 1px solid var(--modern-border-secondary, #e5e5ea);
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nx-checkout-page .nx-promo-group:focus-within {
    border-color: var(--primary, #0d6efd);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.nx-checkout-page .nx-promo-input,
.nx-checkout-page .nx-checkout-summary #promo-code {
    border: none !important;
    background: transparent !important;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    color: var(--modern-text-primary, #1c1c1e);
    min-height: 2.75rem;
}

.nx-checkout-page .nx-promo-input::placeholder {
    color: var(--modern-text-secondary, #8e8e93);
}

.nx-checkout-page .nx-promo-input:focus {
    outline: none !important;
    box-shadow: none !important;
}

.nx-checkout-page .nx-promo-btn,
.nx-checkout-page .nx-checkout-summary #apply-promo {
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    border-radius: 0;
    border-left: 1px solid var(--modern-border-secondary, #e5e5ea);
    background: var(--primary, #0d6efd);
    color: #fff !important;
    min-height: 2.75rem;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.nx-checkout-page .nx-promo-btn:hover,
.nx-checkout-page #apply-promo:hover {
    background: var(--primary-hover, #0b5ed7);
    color: #fff !important;
}

.nx-checkout-page .nx-promo-btn:active,
.nx-checkout-page #apply-promo:active {
    opacity: 0.9;
}

.nx-checkout-page .nx-promo-message {
    font-size: 0.875rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.nx-checkout-page .btn-primary.style-two {
    background: var(--primary, #0d6efd);
    border-color: transparent;
    border-radius: var(--radius-lg, 0.75rem);
    font-weight: var(--font-medium, 500);
    transition: background 0.2s ease, transform 0.1s ease;
}

.nx-checkout-page .btn-primary.style-two:hover {
    background: var(--primary-hover, #0b5ed7);
}

/* Place Order CTA — solid theme colors, no gradient / motion hover */
.nx-checkout-page .nx-checkout-submit {
    width: 100%;
}

.nx-checkout-page #place-order-btn.nx-place-order-btn {
    min-height: 52px;
    padding: 0.875rem 1.5rem;
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: none;
    border-radius: var(--radius-lg, 0.75rem);
    color: #fff;
    background: var(--primary, #0d6efd);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.nx-checkout-page #place-order-btn.nx-place-order-btn:hover {
    color: #fff;
    background: var(--primary-hover, #0b5ed7);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nx-checkout-page #place-order-btn.nx-place-order-btn:active {
    background: var(--primary-hover, #0b5ed7);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.nx-checkout-page #place-order-btn.nx-place-order-btn:focus {
    outline: none;
}

.nx-checkout-page #place-order-btn.nx-place-order-btn:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px #fff,
        0 0 0 6px var(--primary, #0d6efd);
}

/* ============================================================
   ALERTS (form errors, promo messages)
   ============================================================ */

.nx-checkout-page #form-errors {
    border-radius: var(--radius-lg, 0.75rem);
}

/* ============================================================
   VALIDATION MESSAGES – only after submit or invalid on change
   ============================================================ */

/* Hide all invalid-feedback on initial load; show only when form has been validated */
.nx-checkout-page #checkout-form .invalid-feedback {
    display: none !important;
}

.nx-checkout-page #checkout-form.nx-validation-active .form-control.is-invalid ~ .invalid-feedback,
.nx-checkout-page #checkout-form.nx-validation-active .nx-form-check-input.is-invalid ~ .invalid-feedback,
.nx-checkout-page #checkout-form.nx-validation-active select.is-invalid ~ .invalid-feedback,
.nx-checkout-page #checkout-form.nx-validation-active textarea.is-invalid ~ .invalid-feedback,
.nx-checkout-page #checkout-form.nx-validation-active .nx-shipping-method-wrap.is-invalid + .invalid-feedback#shipping_method_feedback {
    display: block !important;
}

/* ============================================================
   MOBILE: STICKY SUBMIT
   ============================================================ */

@media (max-width: 767.98px) {
    .nx-checkout-page .sticky-submit {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1050;
        background: var(--checkout-glass-bg);
        backdrop-filter: blur(var(--checkout-glass-blur));
        -webkit-backdrop-filter: blur(var(--checkout-glass-blur));
        padding: var(--space-3, 0.75rem);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    }

    .nx-checkout-page form.needs-validation {
        padding-bottom: 80px;
    }

    .nx-checkout-page .nx-checkout-card,
    .nx-checkout-page .nx-checkout-summary .card {
        border-radius: 0;
        box-shadow: none;
    }
}
