/* =====================================================================
   Respar Cartoons — v4.1 (Phase 1) additions
   Loaded after v4.css. Adds: message receipts, overlay layers, gallery &
   column blocks, the free-form canvas section and image-frame defaults.
   Nothing here restyles existing V4 components.
   ===================================================================== */

/* ---------- message receipts (Sent / Delivered / Read) ---------- */
.rcpt { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: .68rem; font-weight: 700; letter-spacing: .02em; opacity: .78; border-radius: 6px; cursor: help; }
.rcpt svg { width: 16px; height: 11px; flex: none; }
.rcpt:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }
.msg.mine .rcpt { float: right; color: rgba(255, 255, 255, .78); }
.msg.mine .rcpt-read { color: var(--mint); opacity: 1; }
.msg:not(.mine) .rcpt-read { color: #0d9488; }
.msg::after { content: ""; display: block; clear: both; }

/* ---------- hero highlight text (wrapped for inline editing; keeps V4 size) ---------- */
.hero-highlights li .hl-t { font-size: inherit; }

/* ---------- image frames ---------- */
.ve-frame { position: relative; }
.ve-frame > .ve-img { display: block; }
.cs-it-media.ve-frame { border-radius: var(--r-xl); }
.stk-frame { border-radius: var(--r-lg); overflow: hidden; }
.stk-frame > img { width: 100%; display: block; }

/* ---------- overlay layers ---------- */
.has-layers { position: relative; }
.ve-layers { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.ve-layer { position: absolute; left: 10%; top: 10%; width: 30%; z-index: 6; pointer-events: auto; box-sizing: border-box; animation: lyIn .8s var(--ease-out) backwards; animation-delay: var(--rd, .2s); }
@keyframes lyIn { from { opacity: 0; translate: 0 18px; } }
@media (prefers-reduced-motion: reduce) { .ve-layer { animation: none; } }
.ly-text .ly-p { margin: 0; font-size: clamp(.95rem, 1.6vw, 1.15rem); line-height: 1.55; }
.ly-heading .ly-h { margin: 0; font-size: clamp(1.6rem, 4.4vw, 3.4rem); line-height: 1.05; }
.ly-button .btn { white-space: nowrap; }
.ly-button { width: auto !important; min-width: 0; }
.ly-image > .ve-img { width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; -webkit-user-drag: none; }
.ly-image { height: auto; }
.ly-shape { background: var(--grad-brand); opacity: .9; aspect-ratio: auto; min-height: 24px; }
.ly-shape.sh-rect { border-radius: 24px; }
.ly-shape.sh-circle { border-radius: 50%; }
.ly-shape.sh-pill { border-radius: 999px; }
.ly-shape.sh-blob { border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; }
.ly-shape.sh-star { clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.ly-shape.sh-burst { clip-path: polygon(50% 0, 59% 20%, 79% 9%, 76% 31%, 98% 32%, 83% 50%, 98% 68%, 76% 69%, 79% 91%, 59% 80%, 50% 100%, 41% 80%, 21% 91%, 24% 69%, 2% 68%, 17% 50%, 2% 32%, 24% 31%, 21% 9%, 41% 20%); }
.ly-badge { display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; background: var(--sun); color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: clamp(.8rem, 1.4vw, 1.05rem); text-align: center; padding: 8px; box-shadow: 0 12px 24px -10px rgba(13, 8, 32, .5); line-height: 1.1; }
.on-light .ly-text, .theme-light .ly-text, .theme-lilac .ly-text { color: var(--ink); }

/* ---------- canvas section (free-form layers) ---------- */
.cs-canvas-area { min-height: var(--cv-h, 560px); }
@media (max-width: 1079.98px) { .cs-canvas-area { min-height: var(--cv-ht, 520px); } }
@media (max-width: 719.98px) { .cs-canvas-area { min-height: var(--cv-hm, 640px); } }
.cs-section.cs-canvas { padding: 0; }

/* ---------- stack: image gallery (multiple independent images) ---------- */
.stk-gallery { display: grid; gap: var(--gl-gap, 16px); width: 100%; }
.stk-gallery.gap-none { --gl-gap: 0px; } .stk-gallery.gap-sm { --gl-gap: 8px; } .stk-gallery.gap-lg { --gl-gap: 26px; }
.stk-gallery .gl-item { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.stk-gallery .gl-frame { border-radius: var(--r-lg); overflow: hidden; aspect-ratio: var(--gl-ratio, 4 / 3); background: rgba(139, 92, 246, .12); }
.stk-gallery.r-auto .gl-frame { aspect-ratio: auto; }
.stk-gallery .gl-frame > .ve-img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-out); }
.stk-gallery.r-auto .gl-frame > .ve-img { height: auto; }
.stk-gallery figcaption { font-size: .84rem; opacity: .75; }
.gl-grid-2, .gl-quad { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gl-grid-3, .gl-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .gl-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .gl-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.gl-quad { max-width: 920px; margin-inline: auto; }
.gl-feature { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gl-feature .gl-item:first-child { grid-column: 1 / -1; }
@media (min-width: 720px) {
  .gl-feature { grid-template-columns: 2fr 1fr; grid-auto-rows: 1fr; }
  .gl-feature .gl-item:first-child { grid-column: 1; grid-row: span 3; }
  .gl-feature .gl-item:first-child .gl-frame { aspect-ratio: auto; height: 100%; }
  .gl-feature .gl-item:not(:first-child) .gl-frame { aspect-ratio: auto; height: 100%; }
}
.gl-masonry { display: block; columns: 2 160px; column-gap: var(--gl-gap, 16px); }
.gl-masonry .gl-item { break-inside: avoid; margin-bottom: var(--gl-gap, 16px); }
.gl-masonry .gl-frame { aspect-ratio: auto; }
.gl-masonry .gl-frame > .ve-img { height: auto; }
@media (min-width: 900px) { .gl-masonry { columns: 3 200px; } }
.gl-strip { grid-auto-flow: column; grid-auto-columns: minmax(220px, 34%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.gl-strip .gl-item { scroll-snap-align: start; }
@media (max-width: 719.98px) { .gl-strip { grid-auto-columns: 78%; } }

/* ---------- stack: columns (mixed content) ---------- */
.stk-columns { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); width: 100%; }
@media (min-width: 720px) { .stk-columns.cols-2, .stk-columns.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stk-columns.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .stk-columns.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stk-col { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--r-lg); background: rgba(255, 255, 255, .7); border: 1px solid rgba(27, 16, 53, .08); min-width: 0; }
.theme-dark .stk-col, .theme-brand .stk-col { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); }
.stk-col h3 { margin: 0; font-family: var(--font-display); font-size: 1.05rem; }
.stk-col .cs-md p { margin: 0; }
.stk-col .btn { align-self: flex-start; margin-top: auto; }
.stk-col-img { border-radius: calc(var(--r-lg) - 6px); overflow: hidden; aspect-ratio: 4 / 3; }
.stk-col-img > .ve-img { width: 100%; height: 100%; object-fit: cover; }
.al-center .stk-col { text-align: center; align-items: center; }
.al-center .stk-col .btn { align-self: center; }

/* ---------- safe mode indicator ---------- */
html.rc-safe body::before { content: "Safe mode — design overrides and layers are off"; position: fixed; z-index: 500; left: 50%; bottom: 14px; translate: -50% 0; padding: 8px 14px; border-radius: 999px; background: var(--ink); color: #fff; font: 600 12px/1 var(--font-body); box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .5); }

/* Layout-break protection (Phase 1): absolutely positioned art such as the hero background
   always keeps its own box — crop/aspect settings can't collapse or move it.
   (The editor offers Zoom + Focus point for these instead of Crop.) */
html body [data-ve][data-ve-abs] { position: absolute !important; aspect-ratio: auto !important; }

/* Bug 1: the progress line also hides while the mobile menu is open (beats the .scrolled rule) */
body.menu-open .site-header .scroll-progress, body.menu-open .site-header.scrolled .scroll-progress { opacity: 0; }

/* ---------- v4.1.1 fix 1: hero SCROLL cue never overlaps hero content ----------
   The cue keeps its original spot just above the slanted marquee ribbon (bottom: 60px + 3vw) and
   its look and wheel animation. Before, the hero only kept 120px of empty space under its content,
   less than ribbon allowance + the 64px cue, so the cue rode up into the highlight badges.
   The hero now reserves exactly enough: ribbon allowance + cue + a 32px clear gap.
   It also fades away once the visitor scrolls, and app.js hides it if edited content ever reaches it. */
@media (min-width: 720px) {
  .hero { padding-bottom: calc(60px + 3vw + 64px + 32px); }
  .scroll-cue { transition: opacity .4s ease, visibility .4s ease; }
  .scroll-cue.is-away, .scroll-cue.is-clash { opacity: 0; visibility: hidden; pointer-events: none; }
}

/* ---------- v4.1.1 fix 3: Shop "Popular" searches show which one is selected ----------
   Same selected look as the category filters (.filter-btn[aria-pressed=true]). */
.pop-searches .chip-btn[aria-pressed="true"] { background: var(--sun); color: var(--ink); border-color: var(--sun); box-shadow: 0 10px 24px -12px rgba(255, 214, 102, .8); }
.pop-searches .chip-btn[aria-pressed="true"]:hover { background: var(--sun); border-color: var(--sun); }
.pop-searches .chip-btn:focus-visible { outline: 3px solid var(--lilac); outline-offset: 2px; }

/* ---------- v4.2 (Phase 2): cart recommendations ----------
   Same cards and headings as before; adds a short “why” line on suggestions and an honest label
   when “Popular right now” is an editorial ranking rather than real popularity data. */
.mini-why { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .72rem; line-height: 1.3; font-weight: 600; color: rgba(255, 255, 255, .62); margin: 1px 0 3px; }
.drawer .mini-why { color: #76698f; }
.cart-recs h3 .recs-tag { display: inline-block; vertical-align: 1px; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: #f1e9ff; color: #6d4bb8; font-size: .62rem; letter-spacing: .06em; text-transform: none; font-weight: 800; }
.cart-recs .recs-note { margin: -4px 0 10px; font-size: .74rem; line-height: 1.4; color: #76698f; }

/* ===================== v4.3 · Phase 3 performance ===================== */
/* Off-screen sections (js/core.js) pause their decorative loops; they resume where they were. */
.rc-offscreen, .rc-offscreen *, .rc-offscreen *::before, .rc-offscreen *::after { animation-play-state: paused !important; }
/* Hero "live" dot: the same expanding mint ring, drawn by the GPU (transform/opacity) instead of
   repainting a growing box-shadow every frame. Same size (8px dot + 10px ring), colour, timing. */
.eyebrow .dot { position: relative; box-shadow: none; animation: none; }
.eyebrow .dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: rgba(94, 234, 180, .7); animation: pingRing 2s infinite; pointer-events: none; }
@keyframes pingRing { 0% { transform: scale(1); opacity: 1; } 70%, 100% { transform: scale(3.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .eyebrow .dot::after { animation: none; opacity: 0; } }
/* The closed mobile menu is invisible (clip-path + visibility) but its peeking character kept bobbing. */
.mobile-menu:not(.open), .mobile-menu:not(.open) * { animation-play-state: paused !important; }
/* Opened directly on a page (#/shop…): home sections stay hidden from the first paint (index.html rc:early). */
.rc-page-first #main, .rc-page-first .site-footer { display: none; }   /* footer too, so it does not jump down when the page renders */
