/* =============================================================
   Shared Checkout Stylesheet
   Applies to: Cart, BillingInfo, ShippingInfo, Summary, CustomPayment
   ============================================================= */

/* ----------------------------------------------------------
   Page hero / header band
   ---------------------------------------------------------- */
.checkout-hero {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 1.5rem 0 1.25rem;
    text-align: center;
}

.local-delivery-note__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.25rem;
}

.local-delivery-note__subtitle {
    font-size: 0.95rem;
    color: #495057;
}

.checkout-hero h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #212529;
    margin-bottom: 0;
}

.checkout-hero .env-warning {
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* ----------------------------------------------------------
   Step / progress indicator
   ---------------------------------------------------------- */
.checkout-steps {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
    counter-reset: step;
    gap: 0;
}

.checkout-steps li {
    flex: 1;
    text-align: center;
    position: relative;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #adb5bd;
    padding: 0.6rem 0.25rem;
}

/* connecting line between steps */
.checkout-steps li + li::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 1px;
    height: 60%;
    transform: translateY(-50%);
    background: #dee2e6;
}

.checkout-steps li a {
    color: inherit;
    text-decoration: none;
    pointer-events: none;
    cursor: default;
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
}

.checkout-steps li.active {
    color: #212529;
}

.checkout-steps li.active a {
    background: #212529;
    color: #fff;
    pointer-events: none;
}

.checkout-steps li.completed a {
    color: #495057;
    pointer-events: auto;
    cursor: pointer;
}

.checkout-steps li.completed a:hover {
    background: #f8f9fa;
}

.checkout-steps li.skipped {
    color: #adb5bd;
}

.checkout-steps li.skipped a {
    color: #adb5bd;
    pointer-events: none;
    cursor: default;
}

/* ----------------------------------------------------------
   General checkout page section
   ---------------------------------------------------------- */
.checkout-page {
    padding: 2rem 0 3rem;
    font-size: 1rem;
    line-height: 1.45;
    color: #212529;
}

.checkout-page .card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.checkout-page .card .card-body {
    padding: 1.25rem 1.5rem;
}

/* ----------------------------------------------------------
   Block / card panels used on form pages
   ---------------------------------------------------------- */
.checkout-page .block {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    margin-bottom: 1.5rem;
}

.checkout-page .block-header {
    background: #f8f9fa;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #dee2e6;
}

.checkout-page .block-header h6 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #495057;
    margin: 0;
}

.checkout-page .block-body {
    padding: 1.25rem 1.5rem;
}

/* ----------------------------------------------------------
   Form elements
   ---------------------------------------------------------- */
.checkout-page .form-group {
    margin-bottom: 1.1rem;
}

.checkout-page .form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.3rem;
    display: block;
}

.checkout-page .form-control,
.checkout-page select.form-control {
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
    border-color: #ced4da;
    border-radius: 0.375rem;
}

.checkout-page .form-control:focus {
    border-color: #343a40;
    box-shadow: 0 0 0 0.15rem rgba(52,58,64,.15);
}

.checkout-page .form-check-label {
    font-size: 0.9rem;
}

.checkout-page .text-danger.fa-star {
    font-size: 0.55rem;
    vertical-align: super;
}

/* ----------------------------------------------------------
   Navigation button bar (Previous / Next)
   ---------------------------------------------------------- */
.checkout-nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.checkout-nav-buttons .btn {
    min-width: 130px;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.55rem 1.5rem;
}

/* First page only has Next, center it */
.checkout-nav-buttons.single-next {
    justify-content: flex-end;
}

/* ----------------------------------------------------------
   Cart table (OrderItems + CustomPayment right column)
   ---------------------------------------------------------- */
.checkout-page .cart,
.cart {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    margin-bottom: 1.5rem;
}

.checkout-page .cart-header,
.cart-header {
    background: #f8f9fa;
    padding: 0.875rem 1.25rem 0.75rem;
    border-bottom: 1px solid #dee2e6;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
}

.checkout-page .cart-header h4,
.cart-header h4 {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #343a40;
    margin-bottom: 0.4rem;
}

.checkout-page .cart-body,
.cart-body {
    padding: 0 1.25rem;
}

.checkout-page .cart-item,
.cart-item {
    padding: 0.875rem 0;
    border-bottom: 1px solid #f1f3f5;
}

.checkout-page .cart-item:last-child,
.cart-item:last-child {
    border-bottom: none;
}

.checkout-page .cart-item-img,
.cart-item-img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 0.25rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
    border: 1px solid #e9ecef;
}

.checkout-page .cart-title,
.cart-title {
    font-size: 0.85rem;
    line-height: 1.35;
}

.cart-delete {
    color: #adb5bd;
}

.cart-delete:hover {
    color: #dc3545;
}

/* quantity input */
.input-items {
    max-width: 72px;
    text-align: center;
    border-radius: 0.375rem;
    border-color: #ced4da;
}

/* ----------------------------------------------------------
   Order summary sidebar (Cart page + Summary page)
   ---------------------------------------------------------- */
.order-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.45rem 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.95rem;
    color: #495057;
}

.order-summary-item span:last-child,
.order-summary-item strong {
    font-weight: 600;
    text-align: right;
    color: #212529;
}

.order-summary-item.border-0 {
    border-bottom: none !important;
    font-size: 1.05rem;
    font-weight: 700;
    padding-top: 0.65rem;
}

.order-summary-total {
    font-size: 1.2rem;
    font-weight: 700;
    color: #212529;
}

#remaining-row {
    background: #e8f5e9;
    border-radius: 0.25rem;
    padding: 0.5rem 0.5rem;
    border-bottom: none !important;
    font-weight: 700;
    color: #1b5e20;
    margin-top: 0.25rem;
}

#remaining-row span:last-child {
    color: #1b5e20;
}

/* block-body used in summary sidebar */
.block-body.bg-light {
    background: #f8f9fa !important;
    padding: 1rem 1.25rem !important;
}

/* ----------------------------------------------------------
   Checkout proceed button (Cart / Summary)
   ---------------------------------------------------------- */
.btn-checkout-proceed {
    width: 100%;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.03em;
    padding: 0.65rem 1rem;
    border-radius: 0.375rem;
}

/* ----------------------------------------------------------
   Local delivery warning card
   ---------------------------------------------------------- */
.local-delivery-note {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    margin-top: 1rem;
    transition: opacity 0.2s, filter 0.2s;
    /* reset fieldset browser defaults */
    min-width: 0;
    legend: none;
}

.local-delivery-note--disabled {
    opacity: 0.6;
    filter: grayscale(100%);
    background: #e9ecef !important;
    border-color: #adb5bd !important;
    color: #6c757d !important;
}

/* ----------------------------------------------------------
   Responsive
   ---------------------------------------------------------- */
@media (max-width: 767.98px) {
    .checkout-hero h1 {
        font-size: 1.4rem;
    }

    .checkout-steps li {
        font-size: 0.7rem;
    }

    .checkout-page .block-body {
        padding: 1rem;
    }

    .checkout-nav-buttons .btn {
        min-width: 100px;
        padding: 0.5rem 1rem;
    }

    .cart-item-img {
        width: 44px;
        height: 44px;
    }
}

/* =============================================================
   Single-Page Progressive Accordion Checkout
   Applies to: /Customers/Checkout  (Accordion.cshtml)
   ============================================================= */

.pm-payment-page {
    max-width: 1140px;
}

.pm-payment-page .checkout-steps {
    margin-bottom: 0;
}

#pmCheckoutForm .row.g-3 {
    row-gap: 0.5rem;
}

#pmCheckoutForm .block .form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.3rem;
}

#pmCheckoutForm .block .form-control,
#pmCheckoutForm .block select.form-control {
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
    border-color: #ced4da;
    border-radius: 0.375rem;
}

#pmCheckoutForm .block .form-control:focus,
#pmCheckoutForm .block select.form-control:focus {
    border-color: #343a40;
    box-shadow: 0 0 0 0.15rem rgba(52,58,64,.15);
}

.pm-payment-page .pm-order-summary-col {
    padding-left: 0.75rem;
}

.pm-payment-page .pm-accordion-steps {
    padding-right: 0.75rem;
}

/* ── Checkout body ─────────────────────────────────────────── */
.pm-checkout-body {
    background: #f8f9fa;
    min-height: 100vh;
    padding-top: 0;
}

/* ── Enclosed header ───────────────────────────────────────── */
.pm-checkout-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 0.8rem 1.25rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.pm-checkout-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pm-checkout-header__logo img {
    height: 52px;
    display: block;
}

.pm-checkout-header__secure {
    font-size: 0.88rem;
    font-weight: 700;
    color: #198754;
    letter-spacing: 0.04em;
    background: #d1e7dd;
    border: 1px solid #a3cfbb;
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    white-space: nowrap;
}

.pm-checkout-header__secure .fa {
    margin-right: 0;
}

/* ── Sandbox banner ────────────────────────────────────────── */
.pm-sandbox-banner {
    background: #fff3cd;
    border-bottom: 1px solid #ffc107;
    text-align: center;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
}

/* ── Layout ────────────────────────────────────────────────── */
.pm-accordion-layout {
    max-width: 1140px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
}

.pm-accordion-row {
    align-items: flex-start;
}

.pm-accordion-steps {
    /* left column */
}

.pm-order-summary-col {
    /* right column */
}

/* ── Express checkout slot ─────────────────────────────────── */
.pm-express-checkout {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem 0.75rem;
    margin-bottom: 1rem;
}

.pm-express-checkout__label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.pm-express-checkout__buttons {
    display: flex;
    gap: 0.5rem;
}

.pm-express-btn {
    flex: 1;
    background: #000;
    color: #fff;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.6rem 1rem;
    border: none;
    opacity: 0.45;
    cursor: not-allowed;
}

.pm-express-btn--placeholder {
    opacity: 0.35;
}

.pm-express-checkout__divider {
    display: flex;
    align-items: center;
    margin: 0.75rem 0 0;
    color: #adb5bd;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pm-express-checkout__divider::before,
.pm-express-checkout__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #dee2e6;
}

.pm-express-checkout__divider span {
    margin: 0 0.75rem;
}

/* ── Accordion section container ───────────────────────────── */
.pm-accordion-section {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0;
    margin-bottom: 0.75rem;
    box-shadow: none;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.pm-accordion-section--active {
    border-color: #dee2e6;
    box-shadow: none;
}

.pm-accordion-section--completed {
    border-color: #198754;
}

.pm-accordion-section--error {
    border-color: #dc3545;
}

/* ── Section header ────────────────────────────────────────── */
.pm-accordion-section__header {
    display: flex;
    align-items: center;
    padding: 0.9rem 1.25rem;
    background: #f8f9fa;
    cursor: default;
    gap: 0.5rem;
    user-select: none;
}

.pm-accordion-section--completed .pm-accordion-section__header {
    cursor: pointer;
    background: #f0faf4;
}

.pm-accordion-section--completed .pm-accordion-section__header:hover {
    background: #e6f4ec;
}

.pm-accordion-section__number {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: #dee2e6;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.pm-accordion-section--active .pm-accordion-section__number {
    background: #212529;
    color: #fff;
}

.pm-accordion-section--completed .pm-accordion-section__number {
    background: #198754;
    color: #fff;
}

.pm-accordion-section__title {
    flex: 1;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #212529;
}

.pm-accordion-section__check {
    color: #198754;
    font-size: 1.1rem;
    display: none; /* shown via JS when completed */
}

.pm-accordion-section__edit {
    font-size: 0.8rem;
    color: #0d6efd;
    padding: 0.1rem 0.4rem;
    display: none; /* shown via JS when completed */
}

/* ── Collapsed summary pill ────────────────────────────────── */
.pm-accordion-section__summary {
    padding: 0.5rem 1.25rem 0.75rem;
    font-size: 0.85rem;
    color: #495057;
    border-top: 1px solid #e9ecef;
    background: #fff;
}

.pm-accordion-section__summary address {
    margin: 0;
    font-style: normal;
    line-height: 1.5;
}

/* ── Section body ──────────────────────────────────────────── */
.pm-accordion-section__body {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #e9ecef;
    font-size: 1rem;
}

/* ── Form labels (required asterisk via CSS) ───────────────── */
.pm-label-required::before {
    content: '* ';
    color: #dc3545;
    font-size: 0.6em;
    vertical-align: super;
}

/* ── Subsection title ──────────────────────────────────────── */
.pm-subsection-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.4rem;
}

/* ── Section action button row ─────────────────────────────── */
.pm-accordion-section__actions {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
}

.pm-accordion-section__actions .d-flex.align-items-center {
    gap: 0.5rem;
}

.pm-section-next-btn {
    min-width: 200px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.pm-section-next-btn.pm-loading::after {
    content: '';
    display: inline-block;
    width: 0.85em;
    height: 0.85em;
    margin-left: 0.5em;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pm-spin 0.6s linear infinite;
    vertical-align: -0.1em;
}

@keyframes pm-spin {
    to { transform: rotate(360deg); }
}

/* ── Review section items ──────────────────────────────────── */
.pm-review-item {
    border-bottom: 1px solid #f1f3f5;
}

.pm-review-item:last-child {
    border-bottom: none;
}

.pm-review-item__img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 0.25rem;
    border: 1px solid #e9ecef;
    flex-shrink: 0;
}

/* ── Pay button ────────────────────────────────────────────── */
.pm-pay-btn {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.65rem 1.25rem;
}

/* ── Global error ──────────────────────────────────────────── */
.pm-accordion-global-error {
    margin-bottom: 1rem;
}

/* ── Account creation hint ─────────────────────────────────── */
.pm-account-creation-hint {
    font-size: 0.9rem;
}

/* ── Right-column sticky summary ───────────────────────────── */
.pm-order-summary-sticky {
    position: sticky;
    top: 80px; /* below the fixed checkout header */
}

.pm-order-summary {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

.pm-order-summary__header {
    background: #f8f9fa;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #dee2e6;
}

.pm-order-summary__title {
    color: #212529;
}

.pm-order-summary__items {
    padding: 0.65rem 1.25rem;
    max-height: 340px;
    overflow-y: auto;
}

.pm-order-summary__items .border-bottom:last-child {
    border-bottom: none !important;
}

.pm-order-summary__thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 0.25rem;
    border: 1px solid #e9ecef;
    flex-shrink: 0;
}

.pm-order-summary__totals {
    padding: 0.5rem 1.25rem 1rem;
}

.pm-order-summary__grand-total {
    font-size: 1.35rem;
    color: #212529;
}

.pm-order-summary__footer {
    padding: 0 1.25rem 1rem;
}

/* ── Mobile summary drawer ─────────────────────────────────── */
.pm-summary-drawer {
    display: none; /* hidden on desktop, shown on mobile via media query */
    position: sticky;
    top: 0;
    z-index: 90;
    background: #212529;
    color: #fff;
}

.pm-summary-drawer__toggle {
    display: flex;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    color: #fff;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    gap: 0.5rem;
}

.pm-summary-drawer__label {
    flex: 1;
    text-align: left;
}

.pm-summary-drawer__total {
    font-size: 1rem;
    font-weight: 700;
}

.pm-summary-drawer__chevron {
    transition: transform 0.3s;
}

.pm-summary-drawer__toggle[aria-expanded="true"] .pm-summary-drawer__chevron {
    transform: rotate(180deg);
}

.pm-summary-drawer__panel {
    background: #fff;
    color: #212529;
    border-bottom: 1px solid #dee2e6;
    padding: 0.5rem 0;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .pm-summary-drawer {
        display: block;
    }

    .pm-accordion-layout {
        padding: 0.75rem 0.5rem 3rem;
    }

    .pm-accordion-section__body {
        padding: 1rem;
    }

    .pm-section-next-btn {
        width: 100%;
    }

    .pm-pay-btn {
        font-size: 0.97rem;
    }

    .pm-order-summary-sticky {
        position: static;
        top: auto;
    }

    .pm-payment-page .pm-order-summary-col,
    .pm-payment-page .pm-accordion-steps {
        padding-left: 15px;
        padding-right: 15px;
    }
}

@media (max-width: 575.98px) {
    .pm-accordion-section__header {
        padding: 0.75rem 1rem;
    }

    .pm-accordion-section__body {
        padding: 0.75rem;
    }
}

/* =============================================================
   Payment page — pm-payment-* components
   (CustomPayment.cshtml)
   ============================================================= */

/* ── Payment block (card / gift card) ──────────────────────── */
.pm-payment-block {
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
}

.pm-payment-block:last-of-type {
    border-bottom: none;
}

.pm-payment-block--secondary {
    padding-top: 0.75rem;
    padding-bottom: 0.5rem;
}

/* ── Section label ──────────────────────────────────────────── */
.pm-payment-block__label {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #495057;
    margin-bottom: 0.4rem;
}

.pm-payment-block__label--secondary {
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: #6c757d;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
}

/* ── Inline link inside label ───────────────────────────────── */
.pm-payment-link {
    font-size: 0.95rem;
    color: #0d6efd;
    text-decoration: none;
}

.pm-payment-link:hover {
    text-decoration: underline;
}

.pm-payment-link--sm {
    font-size: 0.82rem;
}

/* ── Fully-covered notice ────────────────────────────────────── */
.pm-payment-covered {
    font-size: 1rem;
    color: #198754;
    font-weight: 600;
}

/* ── Remaining balance row on payment page ───────────────────── */
#remaining-row {
    background: #e8f5e9 !important;
    border-radius: 0.25rem;
    padding: 0.5rem 0.5rem !important;
    color: #1b5e20 !important;
    margin-top: 0.5rem;
}


/* Trust signal below card input */
.pm-secure-note {
    font-size: .8rem;
    color: #6c757d;
}
.pm-secure-note .fa-lock {
    color: #28a745;
}
