/* ==========================================================================
   Everest Side Cart — slide-out cart drawer
   Palette sampled from the cart page: page #0a1628, card #162d4a,
   border #234567, inner #0f2137, accent #6bb3fb (hover #9dcbfd),
   text #a3c4d9, muted #6a8fa8, green #10b981, thumb bg #1c3a5c.
   All selectors namespaced .evp-cart-*.
   ========================================================================== */

.evp-cart {
    position: fixed;
    inset: 0;
    z-index: 10500; /* above header (z-50) and promo popup (10000) is fine — drawer opens on demand */
    pointer-events: none;
}

.evp-cart__overlay {
    position: absolute;
    inset: 0;
    background: rgba(1, 26, 46, 0.7);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.evp-cart__drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, calc(100vw - 48px));
    display: flex;
    flex-direction: column;
    background: #0f2137;
    border-left: 1px solid #234567;
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overscroll-behavior: contain;
}

.evp-cart.evp-cart--open {
    pointer-events: auto;
}

.evp-cart.evp-cart--open .evp-cart__overlay {
    opacity: 1;
}

.evp-cart.evp-cart--open .evp-cart__drawer {
    transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
    .evp-cart__overlay,
    .evp-cart__drawer {
        transition: none;
    }
}

/* Body scroll lock (JS adds class to <html>); padding compensation is set
   inline by JS so the page doesn't shift when the scrollbar disappears. */
html.evp-cart-lock,
html.evp-cart-lock body {
    overflow: hidden !important;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.evp-cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid #234567;
    background: #162d4a;
    flex-shrink: 0;
}

.evp-cart-head__title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: "Plus Jakarta Sans", Inter, sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
}

.evp-cart-head__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.4rem;
    font-size: 0.8rem;
    font-weight: 800;
    color: #0a1628;
    background: #6bb3fb;
    border-radius: 9999px;
}

.evp-cart-head__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.evp-cart-head__viewcart {
    font-size: 0.8rem;
    font-weight: 700;
    color: #6bb3fb;
    text-decoration: none;
    white-space: nowrap;
}

.evp-cart-head__viewcart:hover {
    color: #9dcbfd;
    text-decoration: underline;
}

.evp-cart-head__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: -6px -8px -6px 0;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: #a3c4d9;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.evp-cart-head__close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.evp-cart-head__close svg {
    width: 22px;
    height: 22px;
}

/* --------------------------------------------------------------------------
   Free shipping progress bar
   -------------------------------------------------------------------------- */

.evp-cart-shipbar {
    padding: 0.85rem 1.25rem;
    background: #0a1628;
    border-bottom: 1px solid #234567;
    flex-shrink: 0;
}

.evp-cart-shipbar__text {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    color: #a3c4d9;
}

.evp-cart-shipbar__text strong {
    color: #fff;
}

.evp-cart-shipbar--unlocked .evp-cart-shipbar__text strong {
    color: #10b981;
}

/* Two segments (standard / 2-day), widths proportional to the $ ranges */
.evp-cart-shipbar__tracks {
    display: flex;
    gap: 5px;
}

.evp-cart-shipbar__seg {
    flex-basis: 0;
    min-width: 0;
}

.evp-cart-shipbar__track {
    height: 6px;
    border-radius: 9999px;
    background: #234567;
    overflow: hidden;
}

.evp-cart-shipbar__fill {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, #6bb3fb, #9dcbfd);
    transition: width 0.45s ease;
}

.evp-cart-shipbar--unlocked .evp-cart-shipbar__fill {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.evp-cart-shipbar__seglabel {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.66rem;
    font-weight: 600;
    color: #6a8fa8;
    white-space: nowrap;
}

.evp-cart-shipbar__seglabel.is-done {
    color: #10b981;
}

/* --------------------------------------------------------------------------
   Scrollable body
   -------------------------------------------------------------------------- */

.evp-cart-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 1.25rem;
}

/* Line items */

.evp-cart-items {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.evp-cart-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #162d4a;
    border: 1px solid #234567;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.evp-cart-item.evp-cart-item--removing {
    opacity: 0;
    transform: translateX(12px);
}

.evp-cart-item__thumb {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #1c3a5c;
}

.evp-cart-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.evp-cart-item__info {
    flex: 1;
    min-width: 0;
}

.evp-cart-item__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.evp-cart-item__name {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
}

.evp-cart-item__name a {
    color: inherit;
    text-decoration: none;
}

.evp-cart-item__name a:hover {
    color: #6bb3fb;
}

.evp-cart-item__remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: -4px -4px 0 0;
    flex-shrink: 0;
    border: none;
    border-radius: 0.4rem;
    background: transparent;
    color: #6a8fa8;
    cursor: pointer;
    transition: color 0.2s ease;
}

.evp-cart-item__remove:hover {
    color: #ef4444;
}

.evp-cart-item__remove svg {
    width: 14px;
    height: 14px;
}

.evp-cart-item__meta {
    margin-top: 0.15rem;
    font-size: 0.75rem;
    color: #6a8fa8;
}

.evp-cart-item__meta dl,
.evp-cart-item__meta dt,
.evp-cart-item__meta dd,
.evp-cart-item__meta p {
    display: inline;
    margin: 0;
    padding: 0;
    font-size: 0.75rem;
    color: #6a8fa8;
}

.evp-cart-item__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.evp-cart-item__qty {
    display: flex;
    align-items: center;
    background: #0f2137;
    border: 1px solid #234567;
    border-radius: 0.5rem;
    overflow: hidden;
}

.evp-cart-item__qty button {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: #a3c4d9;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.evp-cart-item__qty button:hover:not(:disabled) {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.evp-cart-item__qty button:disabled {
    opacity: 0.35;
    cursor: default;
}

.evp-cart-item__qty-num {
    min-width: 28px;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
}

.evp-cart-item__price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.25;
}

.evp-cart-item__price del {
    font-size: 0.72rem;
    color: #6a8fa8;
}

.evp-cart-item__subtotal {
    font-size: 0.95rem;
    font-weight: 800;
    color: #6bb3fb;
    transition: transform 0.18s ease;
}

.evp-cart-item__subtotal.evp-cart-bump {
    transform: scale(1.12);
}

.evp-cart-item__each {
    font-size: 0.7rem;
    color: #6a8fa8;
}

/* Shipment protection */

.evp-cart-protect {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.75rem;
    background: rgba(16, 185, 129, 0.07);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 0.75rem;
}

.evp-cart-protect__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #10b981;
}

.evp-cart-protect__label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
}

.evp-cart-protect__free {
    font-size: 0.85rem;
    font-weight: 800;
    color: #10b981;
}

/* Tooltip */

.evp-cart-tip {
    position: relative;
    display: inline-flex;
}

.evp-cart-tip__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: 1px solid #6a8fa8;
    border-radius: 9999px;
    background: transparent;
    color: #6a8fa8;
    font-size: 0.6rem;
    font-weight: 800;
    line-height: 1;
    cursor: help;
}

.evp-cart-tip__text {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 230px;
    padding: 0.6rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.45;
    color: #a3c4d9;
    background: #0a1628;
    border: 1px solid #234567;
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 5;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.evp-cart-tip:hover .evp-cart-tip__text,
.evp-cart-tip__btn:focus + .evp-cart-tip__text {
    opacity: 1;
    visibility: visible;
}

/* Cross-sell */

.evp-cart-upsell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #162d4a 0%, #1c3a5c 100%);
    border: 1px solid rgba(40, 183, 217, 0.4);
    border-radius: 0.75rem;
}

.evp-cart-upsell__thumb {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #0f2137;
}

.evp-cart-upsell__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.evp-cart-upsell__info {
    flex: 1;
    min-width: 0;
}

.evp-cart-upsell__eyebrow {
    margin: 0;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6bb3fb;
}

.evp-cart-upsell__name {
    margin: 0.1rem 0 0;
    font-size: 0.83rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.evp-cart-upsell__price {
    margin: 0.1rem 0 0;
    font-size: 0.8rem;
    font-weight: 800;
    color: #6bb3fb;
}

.evp-cart-upsell__add {
    flex-shrink: 0;
    min-height: 44px;
    padding: 0 1rem;
    border: none;
    border-radius: 0.6rem;
    background: #6bb3fb;
    color: #0a1628;
    font-size: 0.85rem;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.evp-cart-upsell__add:hover:not(:disabled) {
    background: #9dcbfd;
}

.evp-cart-upsell__add:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Coupon / shipping notice */

.evp-cart-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.75rem;
    background: #0a1628;
    border: 1px solid #234567;
    border-radius: 0.5rem;
}

.evp-cart-notice svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 0.1rem;
    color: #6bb3fb;
}

.evp-cart-notice p {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #a3c4d9;
}

.evp-cart-notice strong {
    color: #fff;
}

/* Urgency line */

.evp-cart-urgency {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.15rem 0.2rem 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #a3c4d9;
}

.evp-cart-urgency__dot {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    border-radius: 9999px;
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.7);
}

.evp-cart-urgency svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: #10b981;
}

.evp-cart-urgency strong {
    color: #10b981;
}

/* Empty state */

.evp-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3.5rem 1.5rem;
}

.evp-cart-empty svg {
    width: 56px;
    height: 56px;
    color: #6a8fa8;
    margin-bottom: 1rem;
}

.evp-cart-empty__title {
    margin: 0 0 0.25rem;
    font-family: "Plus Jakarta Sans", Inter, sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
}

.evp-cart-empty__sub {
    margin: 0 0 1.25rem;
    font-size: 0.85rem;
    color: #a3c4d9;
}

.evp-cart-empty__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 1.5rem;
    border-radius: 0.75rem;
    background: #6bb3fb;
    color: #0a1628;
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
    transition: background 0.2s ease;
}

.evp-cart-empty__btn:hover {
    background: #9dcbfd;
}

/* --------------------------------------------------------------------------
   Sticky footer
   -------------------------------------------------------------------------- */

.evp-cart-foot {
    flex-shrink: 0;
    padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px));
    background: #162d4a;
    border-top: 1px solid #234567;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.25);
}

.evp-cart-foot__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.evp-cart-foot__label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}

.evp-cart-foot__amount {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    transition: transform 0.18s ease;
}

.evp-cart-foot__amount.evp-cart-bump {
    transform: scale(1.08);
}

.evp-cart-foot__micro {
    margin: 0.15rem 0 0.75rem;
    font-size: 0.72rem;
    color: #6a8fa8;
}

.evp-cart-foot__checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    border-radius: 0.75rem;
    background: #6bb3fb; /* matches the main cart page's Proceed to Checkout */
    color: #011a2e;
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
    transition: background 0.2s ease;
}

.evp-cart-foot__checkout:hover {
    background: #9dcbfd;
}

.evp-cart-foot__continue {
    display: block;
    width: 100%;
    margin-top: 0.6rem;
    padding: 0.4rem;
    border: none;
    background: transparent;
    color: #6bb3fb;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.evp-cart-foot__continue:hover {
    color: #9dcbfd;
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Loading spinner overlay
   -------------------------------------------------------------------------- */

.evp-cart__spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 33, 55, 0.55);
    z-index: 4;
}

.evp-cart__spinner span {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(40, 183, 217, 0.25);
    border-top-color: #6bb3fb;
    border-radius: 9999px;
    animation: evpCartSpin 0.7s linear infinite;
}

@keyframes evpCartSpin {
    to { transform: rotate(360deg); }
}

/* Pending state on interactive controls */
.evp-cart--busy .evp-cart-item__qty button,
.evp-cart--busy .evp-cart-item__remove,
.evp-cart--busy .evp-cart-upsell__add {
    pointer-events: none;
    opacity: 0.55;
}

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */

@media (max-width: 639px) {
    /* Leave a gutter showing the dimmed page behind (Amino Club style);
       tapping it closes the drawer via the overlay. */
    .evp-cart__drawer {
        width: calc(100vw - 48px);
    }

    .evp-cart-head {
        padding: 1rem;
    }

    .evp-cart-body {
        padding: 0.85rem 1rem;
    }

    .evp-cart-foot {
        padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
    }

    .evp-cart-tip__text {
        left: auto;
        right: -12px;
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   Main cart page — Shipment Protection row (shared component)
   -------------------------------------------------------------------------- */

.evp-cart-protect--page {
    margin-bottom: 1.5rem;
}
