/* The Gift Boxx — "See what's inside the Boxx" popup + heart on the product photo.
   Uses the colours the site already sets for the chosen box type (--wood-bg, --wood-text, --wood-accent).
   Final version from the prototype; keep values as they are. */

/* Keeps the page from shifting sideways when the popup locks scrolling. */
html { scrollbar-gutter: stable; }
html.wib-locked, html.wib-locked body { overflow: hidden; }

.wib-root, .wib-peek {
  --wib-bg: var(--wood-bg);
  --wib-text: var(--wood-text, var(--ink, #1D1714));
  --wib-accent: var(--wood-accent, var(--accent, #BAA183));
  --wib-muted: color-mix(in srgb, var(--wib-text) 64%, transparent);
  --wib-line: color-mix(in srgb, var(--wib-text) 16%, transparent);
  --wib-tile: color-mix(in srgb, var(--wib-text) 9%, var(--wib-bg));
  --wib-glass: color-mix(in srgb, color-mix(in srgb, var(--wib-bg) 82%, #fff) 52%, transparent);
  --wib-edge: color-mix(in srgb, #fff 38%, transparent);
}
/* Pages without a box type colour fall back to the normal page background. */
body:not(.has-wood) .wib-peek, .wib-root.wib-plain { --wib-bg: var(--bg, #FBF8F4); }

/* ---------- trigger: gift icon + text, sits just above the quantity / Add to cart row ---------- */
.wib-peek { display: inline-flex; align-items: center; gap: 12px; padding: 4px; margin: -.3rem 0 1.1rem; border: 0; background: none; color: var(--wib-text); font: inherit; cursor: pointer; }
.wib-peek[hidden] { display: none; }
.wib-peek:focus-visible { outline: 2px solid var(--wib-accent); outline-offset: 3px; border-radius: 12px; }
.wib-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--wib-tile); border: 1px solid var(--wib-line); }
.wib-ico svg { width: 24px; height: 24px; }
.wib-txt { font-weight: 500; text-decoration: underline; text-decoration-color: var(--wib-accent); text-underline-offset: 5px; text-decoration-thickness: 1.5px; }

.wib-gift { fill: none; stroke: var(--wib-text); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.wib-gift .wib-lid { transform-box: fill-box; transform-origin: 0% 100%; }

/* ---------- popup ---------- */
.wib-overlay { position: fixed; inset: 0; z-index: 90; background: color-mix(in srgb, var(--wib-bg) 40%, transparent); -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%); opacity: 0; visibility: hidden; }
.wib-funnel { position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 91; pointer-events: none; visibility: hidden; overflow: visible; }
.wib-funnel path { fill: var(--wib-glass); stroke: var(--wib-edge); stroke-width: 1; }
.wib-genie { position: fixed; inset: 0; z-index: 92; pointer-events: none; visibility: hidden; }
.wib-fly { position: fixed; z-index: 93; transform: translate(-50%, -50%); visibility: hidden; pointer-events: none; }
.wib-fly .wib-base { fill: var(--wib-tile); }
.wib-overlay.on, .wib-fly.on, .wib-funnel.on, .wib-genie.on { visibility: visible; }

.wib-glass { position: absolute; left: 0; top: 0; width: min(640px, calc(100vw - 32px)); border-radius: 28px; overflow: hidden; color: var(--wib-text);
  background: transparent; border: 1px solid transparent; transform-origin: 0 0; pointer-events: auto; text-align: left; }
.wib-scroller { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding: 30px 30px 44px; }
.wib-scroller::-webkit-scrollbar { display: none; }
.wib-tier { font-size: 14px; color: var(--wib-muted); margin: 0 0 2px; }
.wib-title { font-family: var(--font-head, 'Cormorant Garamond', Georgia, serif); font-weight: 500; font-size: clamp(1.9rem, 4vw, 2.4rem); line-height: 1.1; margin: 0 0 4px; color: var(--wib-text); letter-spacing: -.01em; }
.wib-boxline { font-size: 14px; color: var(--wib-muted); margin: 0 0 20px; }
.wib-boxline[hidden] { display: block; visibility: hidden; height: 0; margin: 0 0 16px; }
.wib-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; }
.wib-list li { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px; margin: 0; }
.wib-list li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--wib-accent); margin-top: 9px; }
.wib-list strong { display: block; font-weight: 500; }
.wib-list span { display: block; font-size: 14px; color: var(--wib-muted); line-height: 1.45; }
@media (max-width: 560px) { .wib-scroller { padding: 24px 20px 44px; } .wib-list { grid-template-columns: minmax(0, 1fr); } }

/* No transform animations inside the panel — they make the text twitch by a pixel on some screens. */
.wib-close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; padding: 0; cursor: pointer;
  background: color-mix(in srgb, var(--wib-bg) 55%, transparent); border: 1px solid var(--wib-edge); transition: background-color .2s ease, border-color .2s ease; }
.wib-close:hover { background: color-mix(in srgb, var(--wib-text) 14%, transparent); border-color: color-mix(in srgb, var(--wib-text) 30%, transparent); }
.wib-close svg { width: 18px; height: 18px; stroke: var(--wib-text); }
.wib-hint { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: grid; justify-items: center; opacity: .5; transition: opacity .3s; padding: 4px 12px; border: 0; background: none; cursor: pointer; }
.wib-hint svg { width: 18px; height: 8px; stroke: var(--wib-text); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-top: -1px; animation: wib-fade 1.6s ease-in-out infinite; }
.wib-hint svg:nth-child(2) { animation-delay: .2s; }
.wib-hint svg:nth-child(3) { animation-delay: .4s; }
.wib-hint.gone { opacity: 0; pointer-events: none; }
@keyframes wib-fade { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wib-hint svg { animation: none; } }

/* ---------- heart (save to wishlist) on the main product photo ---------- */
.gallery-heart { position: absolute; top: 16px; right: 16px; z-index: 3; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; padding: 0; cursor: pointer;
  background: rgba(255, 255, 255, .62); -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .7); box-shadow: 0 6px 18px -8px rgba(29, 23, 20, .35); transition: transform .2s ease; }
.gallery-heart:hover { transform: scale(1.06); }
.gallery-heart svg { width: 22px; height: 22px; fill: transparent; stroke: #1D1714; stroke-width: 1.8; stroke-linejoin: round; transition: fill .2s, stroke .2s; }
.gallery-heart.on svg, .gallery-heart[aria-pressed="true"] svg { fill: #B8463B; stroke: #B8463B; }
.gallery-heart.pop svg { animation: wib-heart-pop .45s ease; }
@keyframes wib-heart-pop { 40% { transform: scale(1.35); } }
