/* Prox'Easy cart-base — shared rules loaded on every /cart.php page
   (configure + view + checkout). Page-level framing + stepper only; page-
   specific visuals live in configureproduct.css / viewcart.tpl / products.css.

   Target selectors scoped via `body:has(#order-standard_cart)` or the
   `#order-standard_cart` id so rules cannot leak outside the cart. */

/* --- Page framing --- */

/* Hide the orphan "Shopping Cart" banner strip that the parent theme
   prepends above the cart. Our progress stepper (below) replaces it.
   Nexus_proxeasy emits `nav.master-breadcrumb`; Antler used `.top-header.item17`. */
body:has(#order-standard_cart) .master-breadcrumb,
body:has(#order-standard_cart) .top-header,
body:has(#order-standard_cart) .top-header.item17 {
    display: none !important;
}

/* Navbar clearance — the client-area theme's sticky nav sits on top of
   page content. Give the cart room to breathe. */
body:has(#order-standard_cart) .wrapper.sec-normal {
    padding-top: 140px !important;
}

/* Page background — neutral paper tone to complement white cards. */
body:has(#order-standard_cart) section#main-body {
    min-height: auto !important;
    background: var(--pe-bg-page, #FAFAF9) !important;
}

/* --- Layout primitives --- */

/* Hide standard_cart left sidebar (category nav) across every cart page. */
#order-standard_cart > .row > .cart-sidebar {
    display: none !important;
}

/* Cart body takes full width once the sidebar is hidden. */
#order-standard_cart > .row > .cart-body {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

/* Centered, capped wrapper so content doesn't stretch edge-to-edge. */
#order-standard_cart {
    max-width: 1280px;
    margin: 0 auto;
}

/* Collapsed sidebar panels (standard_cart's responsive nav) — hide too. */
#order-standard_cart .sidebar-collapsed {
    display: none !important;
}

/* --- Progress stepper --- */

.pe-cart-progress {
    max-width: 1280px;
    margin: 8px auto 24px;
    padding-inline: 15px;
}
.pe-cart-progress__track {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    counter-reset: step;
}
.pe-cart-progress__step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--pe-text-secondary, #57534E);
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}
.pe-cart-progress__step + .pe-cart-progress__step::before {
    content: '';
    display: block;
    width: 24px;
    height: 2px;
    background: var(--pe-border, #E7E5E4);
    margin-right: 10px;
    flex-shrink: 0;
}
.pe-cart-progress__step.is-done + .pe-cart-progress__step::before,
.pe-cart-progress__step.is-done::before {
    background: var(--pe-primary, #F38020);
}
.pe-cart-progress__marker {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--pe-bg-card, #FFFFFF);
    border: 2px solid var(--pe-border, #E7E5E4);
    color: var(--pe-text-secondary, #78716C);
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
.pe-cart-progress__step.is-active .pe-cart-progress__marker {
    background: var(--pe-primary, #F38020);
    border-color: var(--pe-primary, #F38020);
    color: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(243, 128, 32, 0.15);
}
.pe-cart-progress__step.is-active .pe-cart-progress__label {
    color: var(--pe-text-primary, #1C1917);
    font-weight: 700;
}
.pe-cart-progress__step.is-done .pe-cart-progress__marker {
    background: var(--pe-primary, #F38020);
    border-color: var(--pe-primary, #F38020);
    color: #FFFFFF;
}

/* --- Mobile overflow containment ---

   Bootstrap's `.row` injects -15px horizontal margins that escape the cart
   wrapper on viewports under 768px, causing a 15px horizontal scroll.
   Pad the wrapper inward so row margins land inside. */
@media (max-width: 767px) {
    #order-standard_cart {
        padding-inline: 15px;
    }
    #order-standard_cart > .row {
        margin-inline: 0;
    }
    body:has(#order-standard_cart) .wrapper.sec-normal {
        padding-top: 100px !important;
    }

    .pe-cart-progress {
        margin-top: 0;
        margin-bottom: 16px;
    }
    .pe-cart-progress__step {
        font-size: 12px;
    }
    .pe-cart-progress__step + .pe-cart-progress__step::before {
        width: 12px;
        margin-right: 4px;
    }
    .pe-cart-progress__label {
        /* On very narrow viewports, hide inactive labels; keep active only. */
        display: none;
    }
    .pe-cart-progress__step.is-active .pe-cart-progress__label {
        display: inline;
    }
}

/* --- Toast notifications ---

   Cart-wide primitive. Currently used by the configureproduct flow for
   Save & Add Another success feedback; kept in cart-base.css so future cart
   pages can reuse with no asset duplication.

   Accessible:
   - role="status" + aria-live="polite" so SR users get announced softly
   - aria-atomic="true" on the inner message so full phrase is spoken
   - pointer-events:none until visible so it doesn't trap cursor during enter transition */

#pe-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 360px;
    padding: 14px 20px 14px 16px;
    background: var(--pe-bg-card, #FFFFFF);
    color: var(--pe-text-primary, #1C1917);
    border-left: 4px solid var(--pe-success, #16A34A);
    border-radius: 12px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.12),
                0 2px 8px rgba(0, 0, 0, 0.06);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    opacity: 0;
    transform: translateX(calc(100% + 32px));
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.2s ease;
    pointer-events: none;
}
#pe-toast.is-visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}
#pe-toast.is-error {
    border-left-color: var(--pe-danger, #DC2626);
}
#pe-toast .pe-toast__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--pe-success, #16A34A);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
#pe-toast.is-error .pe-toast__icon {
    background: var(--pe-danger, #DC2626);
}
#pe-toast .pe-toast__msg {
    flex: 1;
    min-width: 0;
}

@media (max-width: 767px) {
    #pe-toast {
        left: 12px;
        right: 12px;
        bottom: 12px;
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    #pe-toast {
        transition: opacity 0.15s ease;
        transform: none;
    }
    #pe-toast.is-visible {
        transform: none;
    }
}
