/* ========================================================= 
   home.css — Customer Homepage (theme-aware, token-driven)
   Works with /public/css/themes.css tokens.
   ========================================================= */

/* Reset box model */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

/* ---------------------------------------------------------
   Body and background
   --------------------------------------------------------- */
body.home-body{
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Subtle themed background accents (respect reduced motion) */
.bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.fx-orbs .orb {
  position: absolute; filter: blur(40px); opacity: .25; border-radius: 50%;
  animation: float 18s ease-in-out infinite;
}
.orb-a {
  width: 460px; height: 460px; left: -120px; top: -120px;
  background: radial-gradient(
    circle at 30% 30%,
    color-mix(in srgb, var(--accent) 65%, transparent),
    color-mix(in srgb, var(--accent) 25%, transparent) 60%,
    transparent 70%
  );
}
.orb-b {
  width: 420px; height: 420px; right: -110px; top: 12%;
  background: radial-gradient(
    circle at 35% 35%,
    color-mix(in srgb, var(--accent) 55%, transparent),
    color-mix(in srgb, var(--accent) 20%, transparent) 60%,
    transparent 70%
  );
  animation-delay: 2s;
}
.orb-c {
  width: 360px; height: 360px; left: 35%; bottom: -160px;
  background: radial-gradient(
    circle at 40% 40%,
    color-mix(in srgb, var(--accent) 45%, transparent),
    color-mix(in srgb, var(--accent) 18%, transparent) 60%,
    transparent 70%
  );
  animation-delay: 4s;
}
@keyframes float {
  0%,100% { transform: translate3d(0,0,0) scale(1) }
  50%     { transform: translate3d(0,-10px,0) scale(1.02) }
}
@media (prefers-reduced-motion: reduce) {
  .fx-orbs .orb { animation: none; }
}

/* Subtle grid overlay */
.grid-overlay{
  position: absolute; inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--table-border) 60%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--table-border) 60%, transparent) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px;
  mask-image: radial-gradient(1000px 600px at 50% 40%, rgba(255,255,255,.85), transparent 80%);
  opacity: .25;
}

/* ---------------------------------------------------------
   Reusables
   --------------------------------------------------------- */
.glass{
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--surface) 82%, transparent),
    color-mix(in srgb, var(--surface-2) 82%, transparent)
  );
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  border-radius: 18px;
}

.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-weight: 700; letter-spacing: .2px;
  text-decoration: none; cursor: pointer;
  transition: transform .15s, box-shadow .2s, background .2s, border-color .2s, filter .2s;
}
.btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0,0,0,.15);
  background: color-mix(in srgb, var(--surface-2) 85%, var(--accent) 15%);
}
.btn:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
  border-color: var(--accent);
}
.btn.primary{
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.btn.primary:hover { filter: brightness(.98); }
.btn.ghost{ background: transparent; border-style: dashed; }
.hidden{ display: none !important; }

/* ---------------------------------------------------------
   Header
   --------------------------------------------------------- */
.home-header{
  position: sticky; top: 0; z-index: 5;
  margin: 16px; padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
}
.brand{ display: flex; align-items: center; gap: 14px; }
.logo-mark{ width: 46px; height: 46px; position: relative; filter: drop-shadow(0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent)); }
.logo-dot, .logo-stem { position: absolute; background: var(--accent); border-radius: 999px; }
.logo-dot{ width: 12px; height: 12px; left: 17px; top: 5px; }
.logo-stem{
  width: 10px; height: 36px; left: 18px; top: 10px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 65%, var(--surface)));
}
.titles h1{ margin: .1rem 0 0; font-size: 1.4rem; color: var(--text); }
.subtitle{ margin: .1rem 0 0; color: var(--muted); font-size: .95rem; }
.actions{ display: flex; gap: 10px; }

/* ---------------------------------------------------------
   Main layout
   --------------------------------------------------------- */
.home-shell{ position: relative; z-index: 1; padding: 20px; display: grid; gap: 20px; }

/* ---------------------------------------------------------
   Hero
   --------------------------------------------------------- */
.hero{
  display: grid; grid-template-columns: 1.15fr .95fr; gap: 22px; padding: 22px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
}
.hero-left h2{ margin: .2rem 0 .4rem; font-size: 1.6rem; color: var(--text); }
.muted{ color: var(--muted); }
.cta-row{ display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }

.bullets{ margin: 12px 0 0; padding-left: 1.15rem; color: var(--text); }
.bullets li{
  margin: .35rem 0;
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
}

/* Hero media card (replaces old swatches) */
.hero .card{
  margin: 0;
  padding: clamp(10px, 1.2vw, 14px);
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero .card figcaption{
  margin-top: .6rem;
  font-size: .95rem;
  color: var(--muted);
  text-align: center;
}

/* Responsive video */
.media-fit{
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  max-height: clamp(220px, 38vh, 420px);
  border-radius: 12px;
  background: #000;
  object-fit: cover; /* swap to contain if you don’t want any cropping */
}

/* ---------------------------------------------------------
   Quick tiles
   --------------------------------------------------------- */
.tiles{ padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.tiles-grid{
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px;
}
.tile{
  display: block; padding: 16px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text); text-decoration: none;
  transition: transform .15s, box-shadow .2s, background .2s, border-color .2s;
  box-shadow: var(--shadow);
}
.tile:hover{
  transform: translateY(-2px);
  background: color-mix(in srgb, var(--surface) 85%, var(--accent) 15%);
  box-shadow: 0 16px 30px rgba(0,0,0,.15);
}
.tile-title{ color: var(--text); font-weight: 800; letter-spacing: .2px; margin: 0 0 4px; }
.tile-sub{ color: var(--muted); font-size: .95rem; }

/* ---------------------------------------------------------
   Stores
   --------------------------------------------------------- */
.stores{ padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.section-head{ display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.section-head h2{ margin: 0; color: var(--text); }
.store-grid{
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px;
}
.store-card{
  padding: 16px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow);
}
.store-card h3{ margin: 0 0 8px; color: var(--text); }
.store-card p{ margin: .4rem 0; }
.store-card a{ color: var(--link); text-decoration: none; }
.store-card a:hover{ text-decoration: underline; }

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */
.home-footer{ padding: 20px; text-align: center; color: var(--muted); }

/* ---------------------------------------------------------
   WhatsApp Floating Button
   --------------------------------------------------------- */
.whatsapp-btn{
  position: fixed; bottom: 16px; right: 16px; z-index: 20;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,.25));
}
.whatsapp-btn img{
  width: 56px; height: 56px; border-radius: 50%;
  transition: transform .2s ease;
}
.whatsapp-btn img:hover{ transform: scale(1.05) }

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 980px){
  .hero{ grid-template-columns: 1fr; }
  .hero .card{ order: -1; }
}
@media (max-width: 560px){
  .home-header{ margin: 12px; padding: 12px; }
  .btn{ height: 42px; }
  .hero{ padding: 16px; }
}

/* ---------------------------------------------------------
   Safety
   --------------------------------------------------------- */
#animeDock, #animeDock * { pointer-events: none !important; }
#animeDock {
  position: fixed; right: 16px; bottom: 16px; z-index: 1;
  width: var(--anime-size); height: var(--anime-size);
}

/* =========================================================
   🔧 Horizontal Gallery FIXES
   ========================================================= */

/* 1) Allow grid children (e.g., .gallery) to shrink.
   Without this, CSS Grid can prevent horizontal overflow. */
.home-shell > * { min-width: 0; }

/* 2) Ensure the gallery card never clips its scrolling content. */
.gallery.glass { overflow: visible; }

/* 3) Bullet-proof scroller (pair with <div class="gallery-window"> in HTML). */
.gallery-window{
  width: 100%;
  max-width: 100%;
  overflow-x: auto;        /* the element that scrolls */
  overflow-y: hidden;
  white-space: nowrap;     /* keep child cards on one line */
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable both-edges;
  touch-action: pan-x pinch-zoom;
  padding: 6px 2px 8px;
}
.gallery-window::-webkit-scrollbar{ height: 10px; }
.gallery-window::-webkit-scrollbar-thumb{
  background: var(--border, rgba(255,255,255,.3)); border-radius: 999px;
}

/* 4) Cards as inline blocks so nowrap works everywhere. */
.gallery-item{
  display: inline-block;
  vertical-align: top;
  width: min(420px, 80vw);
  margin-right: 12px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.gallery-item img{
  width: 100%; height: 260px; object-fit: cover; display: block;
}
