/* Cart Abandonment Recovery — On-site Reminder Card
 *
 * SOURCE file: production loads the generated tools/cart-abandonment.min.css
 * and SCRIPT_DEBUG loads tools/cart-abandonment.debug.css (see
 * scripts/css-manifest.js). Edit this file, then `npm run build`; never
 * hand-edit the artifacts. */

/* --- Isolation reset (ckit#258) ---
   MUST stay the first rule: later same-specificity rules win by source
   order. The contract (root + declarations) lives in scripts/css-manifest.js;
   the build arms these selectors and verify-css-build checks them exactly.
   Self-contained module: the card brings its own font stack and palette, so
   nothing re-inherits after the revert. box-sizing stays border-box for the
   reason the old scoped rule existed: without it, max-width sizes the CONTENT
   box and the card's padding + border land on top of the cap (620 => 650),
   overhanging the right edge just above the breakpoint. The :where() svg
   exclusion is specificity-neutral and keeps the revert off the dismiss
   icon's internals (fill/stroke would go black). */
.hrck-cart-reminder:not(#\9):not(#\9),
.hrck-cart-reminder:not(#\9):not(#\9)::before,
.hrck-cart-reminder:not(#\9):not(#\9)::after,
.hrck-cart-reminder:not(#\9):not(#\9) *:where(:not(svg, svg *)),
.hrck-cart-reminder:not(#\9):not(#\9) *:where(:not(svg, svg *))::before,
.hrck-cart-reminder:not(#\9):not(#\9) *:where(:not(svg, svg *))::after {
    all: revert;
    box-sizing: border-box;
}

/* Fixed bottom overlay. Transparent and click-through by construction: only the
   card takes pointer events, so the full-width strip never swallows clicks on
   the page behind it. */
.hrck-cart-reminder:not(#\9):not(#\9) {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    padding: 0 16px 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
    /* Extra 24px clears the card's shadow when parked offscreen. */
    transform: translateY(calc(100% + 24px));
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* pointer-events stays none on the overlay in every state; the card re-enables
   it for itself. */
.hrck-cart-reminder--visible:not(#\9):not(#\9) {
    transform: translateY(0);
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .hrck-cart-reminder:not(#\9):not(#\9) {
        transition: none;
    }
}

/* The card. Hugs its content and caps out at 620px, so a long property name
   ellipsizes instead of stretching the cluster apart. */
.hrck-cart-reminder__inner:not(#\9):not(#\9) {
    position: relative; /* containing block for the stretched CTA link */
    display: flex;
    align-items: center;
    gap: 20px;
    width: -moz-fit-content;
    width: fit-content;
    /* 680 rather than 620: the cover photo + a two-line name need the extra
       room, and fit-content means short names still hug. */
    max-width: min(680px, 100%);
    margin: 0 auto;
    padding: 10px 12px 10px 10px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06);
    pointer-events: auto;
}

/* flex: 0 1 auto (never grow) is what keeps the text and the CTA together —
   a grow here is what opened the canyon at full width. */
.hrck-cart-reminder__content:not(#\9):not(#\9) {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 1 auto;
    min-width: 0;
}

/* Property cover photo. Fixed box + object-fit so any aspect ratio crops
   predictably instead of stretching the card. */
.hrck-cart-reminder__media:not(#\9):not(#\9) {
    flex-shrink: 0;
    display: block;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    overflow: hidden;
    background: #f0f2f5;
}

.hrck-cart-reminder__media:not(#\9):not(#\9) img {
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
       object-fit: cover;
    display: block;
}

/* Icon is masked rather than inlined, so it tints from the accent with no
   per-icon markup — same approach as the toolkit's label icons. */
.hrck-cart-reminder__icon:not(#\9):not(#\9) {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--hrck-cart-accent, #ff385c) 12%, #ffffff);
    color: var(--hrck-cart-accent, #ff385c);
}

.hrck-cart-reminder__icon:not(#\9):not(#\9)::before {
    content: '';
    display: block;
    width: 18px;
    height: 18px;
    background-color: currentColor;
    -webkit-mask: var(--hrck-cart-icon) no-repeat center / contain;
    mask: var(--hrck-cart-icon) no-repeat center / contain;
}

/* color-mix is recent; older browsers just get a flat tint rather than nothing. */
@supports not (background: color-mix(in srgb, red 10%, white)) {
    .hrck-cart-reminder__icon:not(#\9):not(#\9) {
        background: #f4f5f7;
    }
}

.hrck-cart-reminder__text:not(#\9):not(#\9) {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

/* The truncation fix: property names are long by nature, and the cover photo
   eats horizontal room, so let the name wrap to two lines and clamp there
   instead of ellipsising mid-word on line one. */
.hrck-cart-reminder__message:not(#\9):not(#\9) {
    font-size: 14px;
    color: #333;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-width: 0;
}

.hrck-cart-reminder__message:not(#\9):not(#\9) strong {
    font-weight: 600;
}

.hrck-cart-reminder__stay:not(#\9):not(#\9) {
    font-size: 12.5px;
    color: #6b7280;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hrck-cart-reminder__actions:not(#\9):not(#\9) {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* CTA button */
.hrck-cart-reminder__cta:not(#\9):not(#\9) {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    /* Accent comes from the admin colour via the same custom-property handoff
       price-alerts/wishlist use. The literal is the fallback, not the source. */
    background: var(--hrck-cart-accent, #ff385c);
    color: #ffffff;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: filter 0.2s, transform 0.15s ease;
    line-height: 1.4;
}

.hrck-cart-reminder__cta:hover:not(#\9):not(#\9) {
    filter: brightness(0.92);
    color: #ffffff;
    text-decoration: none;
}

.hrck-cart-reminder__cta:active:not(#\9):not(#\9) {
    transform: translateY(1px);
}

/* Whole-card link. The CTA is the only anchor; this stretches its hit area over
   the entire card, so clicking anywhere navigates AND still reports as a CTA
   click. Nesting a second <a> around the card would be invalid markup and would
   double-count the click. */
.hrck-cart-reminder--linked:not(#\9):not(#\9) .hrck-cart-reminder__cta::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    z-index: 1;
}

/* :active would fire from anywhere on the stretched area and make the whole card
   look like it nudges. Keep the press effect on the button itself. */
.hrck-cart-reminder--linked:not(#\9):not(#\9) .hrck-cart-reminder__cta:active {
    transform: none;
}

.hrck-cart-reminder--linked:not(#\9):not(#\9) .hrck-cart-reminder__inner {
    cursor: pointer;
}

/* Dismiss button.
   position/z-index live on the BASE rule, not on a --linked variant: a
   two-class variant would outrank the 600px media query below and strip the
   absolute top-right pin on mobile. Declared here, the media query (equal
   specificity, later in the file) still wins where it needs to. The stacking
   keeps dismiss clickable above the stretched card link. */
.hrck-cart-reminder__dismiss:not(#\9):not(#\9) {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    color: #999;
    border-radius: 50%;
    padding: 0;
    transition: background 0.2s, color 0.2s;
}

.hrck-cart-reminder__dismiss:hover:not(#\9):not(#\9) {
    background: #f0f0f0;
    color: #666;
}

/* The dismiss icon's look lives in presentation ATTRIBUTES (fill="none",
   stroke="currentColor", width/height), which lose to any author CSS — a
   theme's `svg { fill: currentColor; width: 1em }` would solid-fill and
   resize it. SVG is excluded from the isolation reset by design, so defend
   the attributes with armored declarations, including `color: inherit` to
   pin currentColor to the button's own color (a theme's `svg { color: x }`
   would otherwise retint it). */
.hrck-cart-reminder__dismiss:not(#\9):not(#\9) svg,
.hrck-cart-reminder__dismiss:not(#\9):not(#\9) svg * {
    color: inherit;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hrck-cart-reminder__dismiss:not(#\9):not(#\9) svg {
    width: 16px;
    height: 16px;
}

/* Responsive: 600px, the width at which the 620px card can no longer hold its
   row layout. (The repo's 960px breakpoint is HomeRunner's desktop/mobile
   boundary — irrelevant to a card this narrow, which sits comfortably in a
   row well below it.) */
@media (max-width: 600px) {
    .hrck-cart-reminder__inner:not(#\9):not(#\9) {
        position: relative;
        width: auto;
        max-width: none;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px;
        border-radius: 14px;
    }

    .hrck-cart-reminder__content:not(#\9):not(#\9) {
        /* Leave room for the absolutely-positioned dismiss. */
        padding-right: 28px;
    }

    .hrck-cart-reminder__message:not(#\9):not(#\9) {
        font-size: 13px;
    }

    /* Narrow screens: the photo shrinks rather than crowding out the name. */
    .hrck-cart-reminder__media:not(#\9):not(#\9) {
        width: 44px;
        height: 44px;
    }

    .hrck-cart-reminder__cta:not(#\9):not(#\9) {
        flex: 1;
        justify-content: center;
        padding: 11px 16px;
        font-size: 14px;
    }

    .hrck-cart-reminder__dismiss:not(#\9):not(#\9) {
        position: absolute;
        top: 8px;
        right: 8px;
        z-index: 2; /* restated: this rule overrides the base position */
    }
}

/* --- Modal collision guard ---
   The card must never sit on top of an open modal. Every ckit modal stamps
   hrck-body-scroll-locked on <html> while open (conversion-kit.js
   bodyScrollLock), so that case is handled declaratively and self-restores
   on close. The toolkit's sticky-booking / price-details modals don't use
   the lock; cart-abandonment.js mirrors their beforeshow/hidden events onto
   the card as --modal-hidden. Hidden, not removed: the reveal transition
   state is preserved and the card returns when the modal closes. */
html.hrck-body-scroll-locked:not(#\9):not(#\9) .hrck-cart-reminder,
.hrck-cart-reminder.hrck-cart-reminder--modal-hidden:not(#\9):not(#\9) {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
