/* #region Trigger (floating bag) */
.cart-trigger {
    position: fixed;
    right: calc(2.4rem + env(safe-area-inset-right, 0px));
    bottom: calc(7.6rem + env(safe-area-inset-bottom, 0px));
    z-index: 900;
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 50%;
    color: var(--white);
    cursor: pointer;
    overflow: visible;
}

    .cart-trigger.hidden {
        display: none;
    }

/* The concierge's idiom, told in site.css beside .odo-ring-arc: a white ring exhaling in phase with
   the orb above it, a gold line drawn round it under the hand. */
.cart-trigger-ring {
    position: absolute;
    inset: 8px;
    border: 1px solid var(--hairline-strong);
    border-radius: 50%;
    background: rgba(5, 5, 5, .88);
    opacity: 1;
    transition: border-color var(--motion) var(--ease-house);
}

    .cart-trigger-ring::before {
        position: absolute;
        inset: -1px;
        border: 1px solid rgba(245, 245, 245, .35);
        border-radius: 50%;
        content: '';
        pointer-events: none;
        animation: odo-breath var(--breath-period) var(--ease-house) infinite;
        animation-delay: inherit;
        transition: opacity var(--motion-quick) var(--ease-house);
    }

.cart-trigger-icon {
    position: relative;
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.35;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .78;
    transition: opacity var(--motion-quick) var(--ease-house), color var(--motion) var(--ease-house);
}

.cart-trigger:hover .cart-trigger-icon,
.cart-trigger:focus-visible .cart-trigger-icon {
    opacity: 1;
    color: var(--gold);
}

.cart-trigger:hover .odo-ring-arc circle,
.cart-trigger:focus-visible .odo-ring-arc circle {
    stroke-dashoffset: 0;
}

    .cart-trigger:hover .cart-trigger-ring::before,
    .cart-trigger:focus-visible .cart-trigger-ring::before {
        opacity: 0;
        animation-play-state: paused;
    }

.cart-trigger-tooltip {
    position: absolute;
    right: calc(100% + 14px);
    top: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 190px;
    min-height: 72px;
    background: rgba(5, 5, 5, .92);
    border: 1px solid var(--hairline-mid);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    text-align: left;
    opacity: 0;
    pointer-events: none;
    transform: translate(8px, -50%);
    transition: opacity var(--motion) var(--ease-house), transform var(--motion) var(--ease-house);
}

    .cart-trigger-tooltip strong {
        display: block;
        padding: .6rem 1rem .4rem;
        font-family: var(--font);
        font-size: .52rem;
        font-weight: 400;
        letter-spacing: .32em;
        text-transform: uppercase;
        color: rgba(245, 245, 245, .5);
        line-height: 1;
        transition: color var(--motion) var(--ease-house);
    }

    .cart-trigger-tooltip span {
        display: block;
        padding: 0 1rem .6rem;
        font-family: var(--font-display);
        font-style: italic;
        font-size: .88rem;
        font-weight: 300;
        letter-spacing: .01em;
        color: rgba(245, 245, 245, .92);
        line-height: 1.2;
    }

.cart-trigger:hover .cart-trigger-tooltip,
.cart-trigger:focus-visible .cart-trigger-tooltip {
    opacity: 1;
    transform: translate(0, -50%);
}

    .cart-trigger:hover .cart-trigger-tooltip strong,
    .cart-trigger:focus-visible .cart-trigger-tooltip strong {
        color: var(--gold);
    }

    .cart-trigger:hover .cart-trigger-tooltip span,
    .cart-trigger:focus-visible .cart-trigger-tooltip span {
        color: var(--white);
    }

/* A piece added: one circuit of gold round the ring, while the figure rolls to its new value. */
.cart-trigger.is-updated .odo-ring-arc circle {
    animation: odo-arc-sweep 1.8s var(--ease-house);
}

/* The count is a figure, not a notification: the display italic in gold beside the bag, with no
   badge behind it. cart.js rolls it — the old figure leaves upwards as the new one rises in. */
.cart-trigger-count {
    position: absolute;
    top: 5px;
    right: 6px;
    min-width: 1rem;
    height: 1.3rem;
    overflow: hidden;
    color: var(--gold);
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-style: italic;
    font-weight: 400;
    line-height: 1.3rem;
    text-align: center;
}

    .cart-trigger-count span {
        display: block;
        transition: transform var(--motion) var(--ease-house), opacity var(--motion) var(--ease-house);
    }

        .cart-trigger-count span.is-leaving {
            position: absolute;
            inset-inline: 0;
            opacity: 0;
            transform: translateY(-100%);
        }

        .cart-trigger-count span.is-arriving {
            opacity: 0;
            transform: translateY(100%);
        }

@media (prefers-reduced-motion: reduce) {
    .cart-trigger.is-updated .odo-ring-arc circle {
        animation: none;
    }

    .cart-trigger-ring::before {
        opacity: 0;
    }

    .cart-trigger-count span {
        transition: none;
    }
}

/* #endregion */

/* #region Drawer shell */
/* The drawer pair sits above .partner-consent (z-index 1200): the consent bar must never
   cover the checkout button of an open cart. */
.cart-overlay {
    position: fixed;
    inset: 0;
    z-index: 1240;
    background: var(--overlay);
    opacity: 1;
    transition: opacity .4s var(--ease-house);
}

    .cart-overlay.hidden {
        opacity: 0;
        pointer-events: none;
    }

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1250;
    display: flex;
    flex-direction: column;
    width: min(96vw, 580px);
    height: 100dvh;
    background: #050505;
    border-left: 1px solid var(--line);
    transform: translateX(100%);
    /* Hidden for real when closed — off-screen alone still leaves its buttons in the tab order.
       The visibility change waits for the slide out, so the drawer never vanishes mid-motion. */
    visibility: hidden;
    transition: transform .5s var(--ease-house), visibility 0s linear .5s;
    /* The drawer scrolls as a whole once header, items and footer outgrow a short screen — a phone
       held sideways — or the checkout button sits below the edge with the page behind it locked. */
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: env(safe-area-inset-right, 0px);
}

    .cart-drawer.open {
        transform: translateX(0);
        visibility: visible;
        transition: transform .5s var(--ease-house), visibility 0s linear 0s;
    }

/* The right padding clears the close button, which a 320px drawer otherwise lays over the title. */
.cart-header {
    position: relative;
    padding: 1.8rem calc(1.6rem + 40px + .75rem) 1.35rem clamp(1.5rem, 5vw, 2.4rem);
    border-bottom: 1px solid var(--line);
}

.cart-title {
    margin: .12rem 0 0;
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    color: var(--white);
}

.cart-header > .h-tag {
    margin-bottom: 0;
}

.cart-close {
    position: absolute;
    top: 1.6rem;
    right: 1.6rem;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--white);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color .3s var(--ease-house), color .3s var(--ease-house);
}

    .cart-close:hover {
        border-color: var(--gold);
        color: var(--gold);
    }
/* #endregion */

/* #region Line items */
.cart-items {
    /* The line items are the drawer's reason to exist — they grow into free space and never
       collapse below a few visible rows, whatever the cross-sell and footer demand. */
    flex: 1 1 auto;
    min-height: 8rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.25rem clamp(1.5rem, 5vw, 2.4rem);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 1rem;
    padding: 0 0 1rem;
    border-bottom: 1px solid var(--line);
}

    /* The rule separates lines from each other, so the last one has nothing to separate itself
       from — under it the border only drew a second edge above the totals. */
    .cart-item:last-child {
        padding-bottom: 0;
        border-bottom: 0;
    }

.cart-item-image {
    width: 88px;
    aspect-ratio: 1;
    object-fit: cover;
    background: #111;
}

.cart-item-body {
    min-width: 0;
}

.cart-item-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .5rem;
}

.cart-item-product {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: .64rem;
    font-weight: 600;
    letter-spacing: .26em;
    text-transform: uppercase;
    color: rgba(245, 245, 245, .5);
}

.cart-item-remove {
    padding: 10px 8px;
    margin: -10px -8px;
    background: transparent;
    border: 0;
    color: var(--text-muted);
    font-size: .66rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color .3s var(--ease-house);
}

    .cart-item-remove:hover {
        color: var(--white);
    }

/* One part of the configuration per line. As a single run joined with middle dots it wrapped where
   the drawer happened to end, so a composition of three forms read as one long unbroken sentence. */
.cart-item-summary {
    margin: 0 0 .75rem;
    font-size: .72rem;
    line-height: 1.5;
    color: var(--text-muted);
}

/* #endregion */

/* #region Cross-sell */
/* The dialog the cross-sell now lives in. In the drawer it stood between the basket's own lines and
   its totals at .6rem, two to a row — microscopic, and competing with the thing the reader had come
   to look at. Here it has a screen of its own for the one moment it is welcome. */
.cart-cross-modal[hidden] {
    display: none;
}

.cart-cross-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 3vw, 3rem);
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s var(--ease-house);
}

    .cart-cross-modal.is-open {
        opacity: 1;
        pointer-events: auto;
    }

.cart-cross-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 5, .82);
    backdrop-filter: blur(14px);
}

.cart-cross-modal-dialog {
    position: relative;
    width: min(680px, 100%);
    padding: clamp(2.2rem, 4vw, 3.4rem);
    border: 1px solid var(--hairline-mid);
    outline: 0;
    background: #050505;
    box-shadow: 0 40px 120px rgba(5, 5, 5, .8);
    text-align: center;
    transform: translateY(20px) scale(.99);
    transition: transform .4s var(--ease-house);
}

.cart-cross-modal.is-open .cart-cross-modal-dialog {
    transform: none;
}

.cart-cross-modal-close {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(245, 245, 245, .16);
    border-radius: 50%;
    background: transparent;
    color: var(--white);
    cursor: pointer;
    transition: border-color .3s var(--ease-house), color .3s var(--ease-house);
}

    .cart-cross-modal-close::before,
    .cart-cross-modal-close::after {
        position: absolute;
        width: 14px;
        height: 1px;
        background: currentColor;
        content: '';
    }

    .cart-cross-modal-close::before {
        transform: rotate(45deg);
    }

    .cart-cross-modal-close::after {
        transform: rotate(-45deg);
    }

    .cart-cross-modal-close:hover,
    .cart-cross-modal-close:focus-visible {
        border-color: var(--gold);
        color: var(--gold);
    }

.cart-cross-modal-dialog h2 {
    margin: 1rem 0 0;
    color: var(--white);
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 300;
    line-height: 1.15;
}

    .cart-cross-modal-dialog h2 i {
        font-family: var(--font-display);
        font-style: italic;
    }

.cart-cross-modal-lead {
    max-width: 44ch;
    margin: 1rem auto 0;
    color: var(--text-muted);
    font-size: .92rem;
    font-weight: 300;
    line-height: 1.75;
}

.cart-cross-modal-dismiss {
    margin-top: clamp(1.6rem, 3vh, 2.2rem);
    padding: 0 0 .35rem;
    border: 0;
    border-bottom: 1px solid var(--hairline);
    background: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: .62rem;
    font-weight: 300;
    letter-spacing: .18em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color .3s var(--ease-house), border-color .3s var(--ease-house);
}

    .cart-cross-modal-dismiss:hover,
    .cart-cross-modal-dismiss:focus-visible {
        border-bottom-color: var(--gold);
        color: var(--gold);
    }

/* At a screen's width the three offers are cards, not the two-to-a-row slivers the drawer had. */
.cart-recommendations {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(.8rem, 2vw, 1.2rem);
    margin-top: clamp(1.8rem, 3.5vh, 2.6rem);
}

.cart-recommendation {
    display: block;
    padding: 0;
    border: 1px solid var(--line);
    color: var(--white);
    text-align: left;
    text-decoration: none;
    transition: border-color var(--motion-quick) var(--ease-house);
}

    /* The offer does not lift: its line warms to gold and the picture comes up to full light. */
    .cart-recommendation:hover,
    .cart-recommendation:focus-visible {
        border-color: var(--gold);
    }

        .cart-recommendation:hover img,
        .cart-recommendation:focus-visible img {
            filter: var(--photo-lifted);
        }

    .cart-recommendation.hidden {
        display: none;
    }

    .cart-recommendation img {
        width: 100%;
        aspect-ratio: 1;
        display: block;
        object-fit: cover;
        filter: var(--photo-at-rest);
        transition: filter var(--motion-slow) var(--ease-house);
    }

    .cart-recommendation > span {
        display: block;
        padding: .9rem 1rem 1.1rem;
    }

    .cart-recommendation strong {
        display: block;
        font-size: .68rem;
        letter-spacing: .12em;
        text-transform: uppercase;
    }

    .cart-recommendation small {
        display: block;
        margin-top: .45rem;
        color: var(--text-muted);
        font-size: .72rem;
        font-weight: 300;
        line-height: 1.55;
    }

/* The same breakpoint as the stacking rule below: between the two the offers stood as full-width squares. */
@media (max-width: 640px) {
    .cart-recommendations {
        grid-template-columns: 1fr;
    }

    .cart-recommendation {
        display: grid;
        grid-template-columns: 84px minmax(0, 1fr);
        align-items: center;
    }

        .cart-recommendation > span {
            padding: .7rem .9rem;
        }
}

@media (prefers-reduced-motion: reduce) {
    .cart-cross-modal,
    .cart-cross-modal-dialog,
    .cart-recommendation,
    .cart-recommendation img {
        transition: none;
    }
}
/* #endregion */

/* #region Price, quantity & states */
.cart-item-price {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    font-size: 1rem;
    color: var(--white);
}

/* The same face, size and colour as the one-time amount above it. A monthly fee is money the
   customer is committing to; set smaller and greyer it read as a footnote about the real price. */
.cart-item-recurring {
    color: var(--white);
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 0 0 .55rem;
}

.cart-quantity-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--white);
    font-size: .85rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color .3s var(--ease-house), color .3s var(--ease-house);
}

    .cart-quantity-btn:hover:not(:disabled) {
        border-color: var(--gold);
        color: var(--gold);
    }

    .cart-quantity-btn:disabled {
        opacity: .35;
        cursor: default;
    }

.cart-quantity-value {
    min-width: 3.4rem;
    font-size: .72rem;
    letter-spacing: .08em;
    text-align: center;
    color: var(--text-muted);
}

/* An Odoardo Soul™ composition, read back apart: one row per form, each countable on its own. The
   line stays one line — one order line and one subscription — and these rows are how a customer
   edits what it holds. */
.cart-composition {
    margin: 0 0 .7rem;
}

.cart-composition-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .3rem .8rem;
    padding: .45rem 0;
    border-bottom: 1px solid rgba(245, 245, 245, .06);
}

    .cart-composition-row:last-of-type {
        border-bottom: 0;
    }

/* A form the composition does not hold is still on the list — it is how one is added — but it says
   so by standing back rather than by disappearing. */
.cart-composition-name {
    color: var(--text-muted);
    font-size: .78rem;
    line-height: 1.4;
}

.cart-composition-row.is-chosen .cart-composition-name {
    color: var(--white);
}

/* The stepper takes the right-hand column and the amount sits under it, so three rows keep one
   vertical rhythm however long a form's name is. */
.cart-composition-quantity {
    margin: 0;
    grid-row: span 2;
    justify-content: flex-end;
}

.cart-composition-price {
    color: var(--text-muted);
    font-size: .74rem;
    grid-column: 1;
}

/* A row whose count the line's own stepper settles: the number stands where the stepper would, in
   the same micro-caps the basket counts everything else in. */
.cart-composition-count {
    color: var(--white);
    font-size: .72rem;
    letter-spacing: .08em;
    text-align: right;
}

.cart-composition-note {
    margin: .6rem 0 0;
    color: var(--text-muted);
    font-size: .66rem;
    line-height: 1.5;
}

/* The same stepper the rest of the basket uses — one control, one size, whichever line it stands
   on. The count beside it holds a bare number, so it is narrower than the 3.4rem a unit would need. */
.cart-composition-quantity .cart-quantity-value {
    min-width: 2.4rem;
    color: var(--white);
}

/* A line counted as a whole — an Alibi series, a book — borrows the composition row so that its
   stepper reads exactly like a Soul form's. Two things differ, and only because there is no second
   line under this one: the control does not reserve a row for a price, and there is no rule to draw
   between this row and the next. */
.cart-item-quantity-row {
    border-bottom: 0;
    padding-top: .2rem;
}

    .cart-item-quantity-row .cart-composition-quantity {
        grid-row: auto;
    }

.cart-item-unavailable .cart-item-image,
.cart-item-unavailable .cart-item-summary,
.cart-item-unavailable .cart-composition,
.cart-item-unavailable .cart-item-price {
    opacity: .45;
}

.cart-item-notice {
    margin: 0 0 .55rem;
    font-size: .68rem;
    line-height: 1.45;
    color: var(--gold);
}

.cart-error {
    margin: 0 clamp(1.5rem, 5vw, 2.4rem) .8rem;
    padding: .7rem .9rem;
    border: 1px solid var(--gold);
    font-size: .72rem;
    line-height: 1.5;
    color: var(--gold);
}

    .cart-error.hidden {
        display: none;
    }

.cart-drawer.is-busy .cart-items {
    opacity: .6;
    pointer-events: none;
}

    .cart-footer.hidden {
        display: none;
    }

.cart-footer {
    margin-top: auto;
    padding: 1.15rem clamp(1.5rem, 5vw, 2.4rem) max(1.4rem, calc(1rem + env(safe-area-inset-bottom, 0px)));
    background: #050505;
    border-top: 1px solid var(--line);
}

/* On a screen this short the items give up their own scroller and the drawer scrolls instead: two
   nested scrollers in a few hundred pixels leave nothing to grab. */
@media (max-height: 520px) {
    .cart-items {
        flex: 0 0 auto;
        min-height: 0;
        overflow: visible;
    }
}

.cart-checkout span {
    margin-left: .5rem;
}

/* #endregion */

/* #region Totals & checkout */
.cart-totals {
    margin-bottom: .85rem;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    padding-block: .2rem;
    font-size: .88rem;
    color: var(--white);
}

.cart-total-recurring {
    font-size: .82rem;
    color: var(--text-muted);
}

    .cart-total-recurring.hidden {
        display: none;
    }

.cart-total-today {
    margin-top: .45rem;
    padding-top: .55rem;
    border-top: 1px solid var(--line);
    font-size: 1rem;
    font-weight: 500;
}

    .cart-total-today.hidden {
        display: none;
    }

.cart-total-note {
    margin: .15rem 0 0;
    font-size: .72rem;
    line-height: 1.5;
    color: var(--text-muted);
}

    .cart-total-note.hidden {
        display: none;
    }

.cart-checkout {
    display: block;
    width: 100%;
    padding: .95rem 1.25rem;
    background: var(--button-layers);
    border: 1px solid var(--button-border);
    color: var(--white);
    font-size: .72rem;
    font-weight: 400;
    letter-spacing: .28em;
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-size var(--motion) var(--ease-house), border-color var(--motion) var(--ease-house), transform .2s var(--ease-house);
}

    /* The house button (see --button-layers): drawn, never filled. */
    .cart-checkout:hover,
    .cart-checkout:focus-visible {
        background-size: 100% 1px, 100% 100%;
        border-color: var(--button-border-hover);
    }

    .cart-checkout:active {
        transform: translateY(1px);
    }

.cart-root .cfg-summary-craft {
    margin-top: 1.2rem;
    font-size: .66rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    text-align: center;
    color: var(--text-muted);
}

/* #endregion */

/* #region Responsive & reduced motion */
@media (prefers-reduced-motion: reduce) {
    .cart-drawer,
    .cart-overlay,
    .cart-trigger,
    .cart-trigger-icon,
    .cart-trigger-ring,
    .cart-trigger-ring::before {
        transition: none;
        animation: none;
    }

    /* With no slide there is nothing to wait for: the drawer hides the instant it closes. */
    .cart-drawer {
        transition: visibility 0s linear 0s;
    }
}

@media (max-width: 640px) {
    .cart-trigger {
        right: calc(1rem + env(safe-area-inset-right, 0px));
        bottom: calc(6.6rem + env(safe-area-inset-bottom, 0px));
        width: 62px;
        height: 62px;
    }

    .cart-trigger-ring {
        inset: 6px;
    }

    .cart-trigger .odo-ring-arc {
        width: 50px;
        height: 50px;
    }

    .cart-item {
        grid-template-columns: 74px minmax(0, 1fr);
    }

    .cart-item-image {
        width: 74px;
    }

    /* The offers stack here; the dialog they now live in has the whole screen, so nothing has to be
       capped in height to keep the basket's own lines visible any more. */
    .cart-recommendations {
        grid-template-columns: 1fr;
    }
}

/* A hover-only tooltip is unreachable on every touch screen, tablets included. */
@media (hover: none) {
    .cart-trigger-tooltip {
        display: none;
    }
}
/* #endregion */
