/* ── CandleLit · cozy · aesthetic beige · candlelit warmth ─────── */
:root {
  /* soft warm beige canvas */
  --ivory: #e8dcc6;
  --cream: #f2e8d6;
  --sand: #ddccae;
  --blush: #e4d4b9;   /* warm beige wash */
  --sage: #e0cfb2;    /* soft taupe wash */
  --linen: #dccbb0;

  /* surfaces */
  --white: #ffffff;
  --card: #f9f2e4;    /* warm off-white card */

  /* soft brass / honey accents */
  --clay: #a67f47;        /* honey brass */
  --clay-deep: #866330;   /* deep brass */
  --sage-deep: #6b5a3a;   /* olive-brown */
  --rose: #b08a63;

  /* warm espresso text */
  --ink: #332a20;
  --ink-soft: #7c6d59;
  --ink-faint: #a6957e;

  --border: #ddccb2;
  --shadow-sm: 0 8px 22px -16px rgba(70, 55, 45, 0.35);
  --shadow: 0 22px 50px -30px rgba(70, 55, 45, 0.40);
  --shadow-lg: 0 34px 70px -34px rgba(70, 55, 45, 0.45);
  --radius: 16px;
  --radius-lg: 24px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Nunito Sans", system-ui, -apple-system, Segoe UI, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; font-family: var(--sans); color: var(--ink); }

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1100px 620px at 88% -10%, var(--blush) 0%, transparent 60%),
    radial-gradient(950px 600px at -8% 8%, var(--sage) 0%, transparent 58%),
    radial-gradient(900px 640px at 50% 116%, var(--sand) 0%, transparent 60%),
    var(--ivory);
  background-attachment: fixed;
  overflow-x: hidden;
}

.container { width: min(1180px, 92%); margin: 0 auto; position: relative; z-index: 1; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--ink); letter-spacing: .2px; }
a { color: var(--clay-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Buttons (muted pastel + tactile) ─────────────────────────── */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.5rem; border: 1px solid rgba(255,255,255,.7); border-radius: 999px;
  font-family: var(--sans); font-weight: 800; font-size: .9rem; line-height: 1; letter-spacing: .2px;
  cursor: pointer; white-space: nowrap;
  transition: transform .14s ease, box-shadow .22s ease, filter .2s ease;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.6);
}
.btn:hover { transform: translateY(-2px); text-decoration: none; box-shadow: var(--shadow); }
/* tactile press: subtle sink with inset shadow */
.btn:active { transform: translateY(1px) scale(.98); box-shadow: inset 0 3px 8px rgba(80,60,50,.22); filter: saturate(1.03); }

.btn-primary { background: linear-gradient(135deg, #3a342c, #2b2622); color: #f3e8d6; border-color: rgba(255,255,255,.12); }
.btn-whatsapp { background: linear-gradient(135deg, #cda866, #b8923f); color: #3f2c08; }
.btn-ig { background: linear-gradient(135deg, #423b32, #2d2823); color: #f3e8d6; border-color: rgba(255,255,255,.12); }
.btn-ghost { background: var(--white); color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { background: var(--sand); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn .ico { font-size: 1.02rem; }

/* ripple injected by ui.js */
.ripple { position: absolute; border-radius: 50%; transform: scale(0); pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.7) 0%, rgba(255,255,255,0) 70%);
  animation: ripple .55s ease-out; }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* ── Header (left brand, glowing name) ───────────────────────── */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1.6rem; margin-top: 1.1rem;
  background: rgba(250,244,233,.72); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow-sm);
}
.brand { display: flex; align-items: center; gap: .55rem; font-family: var(--serif); font-size: 1.55rem; font-weight: 700; color: var(--ink); }
.brand .flame { font-size: 1.3rem; }

/* animated warm candlelight glow on the wordmark */
.brand__name {
  font-family: var(--serif); font-size: 1.7rem; font-weight: 700; letter-spacing: .6px;
  color: #8a5a1e;
  animation: brandGlow 3s ease-in-out infinite;
}
@keyframes brandGlow {
  0%, 100% {
    color: #8a5a1e;
    text-shadow: 0 0 5px rgba(255,176,84,.35), 0 0 12px rgba(255,150,60,.15);
  }
  50% {
    color: #a86a1f;
    text-shadow: 0 0 10px rgba(255,196,110,.85), 0 0 22px rgba(255,164,72,.55),
                 0 0 38px rgba(255,150,60,.28);
  }
}
@media (prefers-reduced-motion: reduce) {
  .brand__name { animation: none; text-shadow: 0 0 8px rgba(255,176,84,.4); }
}

.nav-links { display: flex; align-items: center; gap: 1.4rem; font-weight: 700; font-size: .95rem; }
.nav-links a { color: var(--ink); }
.nav-links a:hover { color: var(--clay-deep); text-decoration: none; }

@media (max-width: 560px) {
  .site-header { flex-direction: column; gap: .5rem; }
}

/* ── Login ───────────────────────────────────────────────────── */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem; position: relative; z-index: 1; }
.auth-card {
  width: min(420px, 100%); background: var(--card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 2.8rem 2.4rem; border: 1px solid var(--border);
}
.auth-card .flame-big { font-size: 2.4rem; display: block; text-align: center; }
.auth-card h1 { text-align: center; margin: .5rem 0 .2rem; font-size: 2.1rem; color: var(--ink); }
.auth-card .sub { text-align: center; color: var(--ink-soft); margin: 0 0 1.6rem; font-size: .95rem; }

.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 800; font-size: .8rem; margin-bottom: .4rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .6px; }
.field input {
  width: 100%; padding: .85rem 1rem; border-radius: 12px;
  border: 1px solid var(--border); background: var(--cream);
  font-family: var(--sans); font-size: 1rem; color: var(--ink); transition: border .2s ease, box-shadow .2s ease;
}
.field input:focus { outline: none; border-color: var(--clay); background: var(--white); box-shadow: 0 0 0 4px rgba(176,121,74,.16); }

.alert { display: none; padding: .7rem 1rem; border-radius: 12px; font-size: .9rem; margin-bottom: 1rem; }
.alert.error { display: block; background: #f7e3dd; color: #9a4a3a; border: 1px solid #ecccc1; }
.hint { text-align: center; font-size: .8rem; color: var(--ink-faint); margin-top: 1.2rem; }

/* OTP login */
.phone-row { display: flex; gap: .5rem; }
.phone-row #cc { width: 78px; text-align: center; flex: 0 0 auto; }
.note { text-align: center; color: var(--ink-soft); font-size: .92rem; margin: 0 0 1.2rem; }
.note strong { color: var(--ink); }
.otp-input { text-align: center; font-size: 1.6rem !important; letter-spacing: .5rem; font-weight: 700; font-family: var(--serif); }
.dev-hint { text-align: center; font-size: .82rem; color: var(--clay-deep); background: var(--sand); border: 1px dashed var(--clay); border-radius: 10px; padding: .5rem .7rem; margin-bottom: 1rem; }
.otp-actions { display: flex; justify-content: space-between; margin-top: 1rem; }
.linkbtn { background: none; border: none; color: var(--clay-deep); font-family: var(--sans); font-weight: 700; font-size: .85rem; cursor: pointer; padding: .2rem; }
.linkbtn:hover { text-decoration: underline; }
.linkbtn:disabled { color: var(--ink-faint); cursor: default; text-decoration: none; }

/* ── Offers ticker (moving banner) ───────────────────────────── */
.ticker {
  position: relative; z-index: 1; margin: 1.1rem auto 0; width: min(1180px, 92%);
  overflow: hidden; border-radius: 999px;
  background: var(--white); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.ticker__track { display: inline-flex; white-space: nowrap; padding: .6rem 0; will-change: transform; animation: ticker 30s linear infinite; }
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__track span { padding: 0 2rem; font-weight: 800; font-size: .85rem; letter-spacing: .5px; color: var(--ink); text-transform: uppercase; }
.ticker__track .spark { color: var(--clay); }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce){ .ticker__track { animation: none; } }

/* ── Hero (hand-animated cozy candle scene) ──────────────────── */
.hero {
  position: relative; overflow: hidden; z-index: 1; margin-top: 1.2rem;
  border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow);
  min-height: 480px; display: grid;
}

/* the cozy room — only shown as a fallback if the video can't load */
.hero__scene {
  position: absolute; inset: 0; z-index: 0; overflow: hidden; display: none;
  background:
    radial-gradient(130% 100% at 28% 26%, #6b4427 0%, #3a2415 48%, #221409 100%);
}
/* rainy window */
.scene-window {
  position: absolute; top: 11%; right: 6%; width: 30%; max-width: 320px; height: 60%;
  border-radius: 10px; overflow: hidden;
  background: linear-gradient(180deg, #34454f 0%, #233038 60%, #1b262d 100%);
  border: 7px solid #271811; box-shadow: 0 0 0 2px rgba(0,0,0,.25), inset 0 0 40px rgba(0,0,0,.4);
}
.scene-window::before, .scene-window::after { content: ""; position: absolute; background: #271811; opacity: .85; }
.scene-window::before { left: 50%; top: 0; width: 6px; height: 100%; transform: translateX(-50%); }
.scene-window::after { top: 50%; left: 0; height: 6px; width: 100%; transform: translateY(-50%); }
.rain {
  position: absolute; top: -12%; width: 2px; height: 16px;
  background: linear-gradient(rgba(205,228,255,.75), transparent); border-radius: 2px;
  animation-name: rainfall; animation-timing-function: linear; animation-iteration-count: infinite;
}
@keyframes rainfall { 0% { transform: translateY(0); opacity: 0; } 12% { opacity: .75; } 100% { transform: translateY(360px); opacity: 0; } }

/* candles on a surface */
.candles { position: absolute; left: 9%; bottom: 12%; display: flex; align-items: flex-end; gap: 30px; z-index: 1; }
.candle {
  position: relative; width: 50px; border-radius: 7px 7px 5px 5px;
  background: linear-gradient(180deg, #f4e6d2 0%, #e7d3b6 55%, #d3bb98 100%);
  box-shadow: 0 18px 30px -16px rgba(0,0,0,.6), inset 0 -8px 14px rgba(150,110,70,.25);
}
.candle::before { content: ""; position: absolute; top: -5px; left: 0; right: 0; height: 10px; border-radius: 50%; background: #cdb593; box-shadow: inset 0 2px 3px rgba(120,85,50,.5); }
.candle--tall { height: 130px; } .candle--mid { height: 96px; } .candle--short { height: 70px; }
.wick { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); width: 3px; height: 9px; background: #3a2a1d; border-radius: 2px; z-index: 2; }
.flame {
  position: absolute; top: -30px; left: 50%; width: 17px; height: 32px;
  transform: translateX(-50%); transform-origin: bottom center;
  border-radius: 50% 50% 46% 46% / 62% 62% 40% 40%;
  background: radial-gradient(circle at 50% 78%, #fff4cf 0%, #ffc05a 48%, #f4711d 82%, #d8530f 100%);
  box-shadow: 0 0 26px 9px rgba(255,150,60,.5), 0 0 60px 22px rgba(255,140,50,.22);
  animation: flicker 1.6s ease-in-out infinite;
}
.candle--mid .flame { animation-duration: 1.9s; }
.candle--short .flame { animation-duration: 1.4s; }
.flame::before { content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 8px; height: 13px; border-radius: 50%; background: radial-gradient(circle, rgba(120,170,255,.8), transparent 70%); }
@keyframes flicker {
  0%, 100% { transform: translateX(-50%) scale(1) rotate(-1.5deg); opacity: .92; }
  35% { transform: translateX(-51%) scale(1.06) rotate(1deg); opacity: 1; }
  70% { transform: translateX(-49%) scale(.97) rotate(-.5deg); opacity: .95; }
}
/* warm pulsing ambience */
.scene-glow {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(40% 50% at 22% 70%, rgba(255,170,80,.32), transparent 70%);
  animation: ambience 4s ease-in-out infinite;
}
@keyframes ambience { 0%, 100% { opacity: .55; } 50% { opacity: .9; } }

/* still poster shows instantly under the video (no black gap while it loads) */
.hero__poster {
  position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: center;
  background-color: #2a1c12;
  background-image: url("../videos/hero-poster.jpg");
}
/* real video fades in over the poster once it can play */
.hero__video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1;
  opacity: 0; transition: opacity .7s ease;
}
.hero--playing .hero__video { opacity: 1; }
.hero--fallback .hero__video { display: none; }
.hero--fallback .hero__poster { display: none; }
.hero--fallback .hero__scene { display: block; }

.hero__overlay {
  position: absolute; inset: 0; z-index: 2;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(60,40,24,.12), transparent 60%),
    linear-gradient(180deg, rgba(28,20,12,.32) 0%, rgba(20,14,8,.66) 100%);
}
.hero__inner { position: relative; z-index: 3; align-self: center; text-align: center; padding: 4.5rem 1.5rem; }

@media (prefers-reduced-motion: reduce) {
  .flame, .rain, .scene-glow { animation: none; }
}
@media (max-width: 600px) { .scene-window { display: none; } .candles { left: 50%; transform: translateX(-50%); } }
.hero h1 { font-size: clamp(2.6rem, 5.5vw, 4.4rem); margin: 0 0 .6rem; color: #fbf3e6; font-weight: 600; letter-spacing: .5px; text-shadow: 0 2px 30px rgba(0,0,0,.45); }
.hero p { font-size: 1.12rem; color: #f1e7d8; max-width: 560px; margin: 0 auto 1.7rem; text-shadow: 0 1px 14px rgba(0,0,0,.5); }
.hero .pill {
  display:inline-block; background: rgba(255,255,255,.92); color: var(--clay-deep);
  border-radius:999px; padding:.42rem 1.1rem; font-weight:800; font-size:.74rem;
  letter-spacing:.9px; text-transform:uppercase; margin-bottom:1.1rem;
}

/* ── Catalog grid ────────────────────────────────────────────── */
.section-head { display:flex; align-items:flex-end; justify-content:space-between; margin: 2.6rem 0 1.3rem; gap:.6rem; flex-wrap:wrap; }
.section-head h2 { font-size: 2.2rem; margin: 0; color: var(--ink); }
.section-head .muted { color: var(--ink-soft); font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.7rem; padding-bottom: 3.5rem; }

.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .28s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.card .thumb { aspect-ratio: 4/5; position: relative; overflow: hidden;
  background: linear-gradient(160deg, #efe1cd, #e2cdae 60%, #d8bf9a); }
/* candle-emoji placeholder shown when there's no product photo */
.card .thumb::after { content: "🕯️"; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 2.6rem; opacity: .5; }
.card:nth-child(3n+2) .thumb { background: linear-gradient(160deg, #ece0cc, #ddccae 60%, #cdb896); }
.card:nth-child(3n+3) .thumb { background: linear-gradient(160deg, #eee2cf, #e0d0b2 60%, #d3bda0); }
.card .thumb__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.card .badge { position:absolute; top:.8rem; left:.8rem; background: rgba(255,255,255,.94); color: var(--clay-deep); font-size:.66rem; font-weight:800; text-transform:uppercase; letter-spacing:.7px; padding:.34rem .7rem; border-radius:999px; box-shadow: var(--shadow-sm); }
.card .sold-out { position:absolute; inset:0; background: rgba(50,40,32,.45); color:#fff; display:grid; place-items:center; font-family:var(--serif); font-size:1.4rem; }

.card .body { padding: 1.1rem 1.2rem 1.3rem; display:flex; flex-direction:column; flex:1; }
.card .body h3 { margin: 0 0 .3rem; font-size: 1.45rem; }
.card .scent { color: var(--ink-soft); font-size: .9rem; margin: 0 0 .9rem; flex: 1; line-height: 1.5; }
.card .meta { display:flex; gap: .5rem; font-size: .72rem; color: var(--ink-soft); margin-bottom: 1rem; flex-wrap: wrap; }
.card .meta span { background: var(--sand); padding: .28rem .6rem; border-radius: 8px; border: 1px solid var(--border); }
.card .price { font-family: var(--serif); font-size: 1.55rem; font-weight: 700; color: var(--clay-deep); margin-bottom: .9rem; }
.card .actions { display:flex; flex-direction:column; gap:.5rem; margin-top:auto; }
.card .actions .btn { width:100%; }

.state { text-align:center; padding: 4rem 1rem; color: var(--ink-soft); }
.spinner { width: 36px; height: 36px; border: 3px solid var(--linen); border-top-color: var(--clay); border-radius: 50%; margin: 0 auto 1rem; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── How to order ────────────────────────────────────────────── */
.steps { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap:1.5rem; padding: 1rem 0 3.5rem; }
.step { background: var(--card); border:1px solid var(--border); border-radius: var(--radius); padding: 1.7rem; box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .28s ease; }
.step:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.step .num { display:grid; place-items:center; width:44px; height:44px; border-radius:50%; background: var(--sand); color: var(--clay-deep); font-family:var(--serif); font-size:1.3rem; font-weight:700; margin-bottom:.9rem; border: 1px solid var(--border); }
.step h3 { margin:.2rem 0 .4rem; font-size:1.3rem; }
.step p { margin:0; color: var(--ink-soft); font-size:.92rem; line-height: 1.55; }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer { background: #3a352f; color: #efe7db; padding: 2.6rem 0; margin-top: 2rem; position: relative; z-index: 1; }
.site-footer .container { display:flex; flex-wrap:wrap; gap:1rem; align-items:center; justify-content:space-between; }
.site-footer .brand { color: #efe7db; }
.site-footer a { color: #e7c3b4; }
.site-footer .muted { color: #c8bfb1; font-size:.85rem; }

/* ── Admin dashboard ─────────────────────────────────────────── */
.admin-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: var(--shadow-sm); margin-bottom: 1rem; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .8rem 1rem; margin-bottom: 1rem; }
.admin-card textarea { width: 100%; padding: .7rem 1rem; border-radius: 12px; border: 1px solid var(--border);
  background: var(--cream); font-family: var(--sans); font-size: .95rem; color: var(--ink); resize: vertical; }
.admin-card .field input { margin: 0; }
.switch { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--ink-soft); }
.switch input { width: 18px; height: 18px; accent-color: var(--clay); }
.product-row { display: flex; gap: 1.2rem; align-items: flex-start; }
.prow-thumb { width: 90px; height: 112px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); flex: 0 0 auto; }
.prow-thumb--empty { display: grid; place-items: center; font-size: 2rem;
  background: linear-gradient(160deg, #efe1cd, #ddccae); }
.prow-actions { display: flex; flex-direction: column; gap: .5rem; flex: 0 0 auto; }
.order-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.order-main { min-width: 0; }
.order-status { padding: .5rem .8rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--cream); font-family: var(--sans); font-weight: 700; color: var(--ink); text-transform: capitalize; }
@media (max-width: 700px) {
  .product-row { flex-direction: column; }
  .prow-actions { flex-direction: row; }
  .admin-grid { grid-template-columns: 1fr; }
}

/* ── Full-page loader ────────────────────────────────────────── */
.page-loader {
  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center;
  background:
    radial-gradient(700px 420px at 50% 30%, var(--blush) 0%, transparent 60%),
    var(--ivory);
  transition: opacity .5s ease;
}
.page-loader.hidden { opacity: 0; pointer-events: none; }
.page-loader__inner { text-align: center; display: grid; justify-items: center; gap: .5rem; }
.page-loader__inner p { color: var(--ink-soft); font-weight: 700; margin: 0; }

/* ── Toast ───────────────────────────────────────────────────── */
.toast { position: fixed; bottom: 1.4rem; left: 50%; transform: translateX(-50%) translateY(140%); background: #3a352f; color: #f5efe6; padding: .9rem 1.4rem; border-radius: 999px; box-shadow: var(--shadow-lg); transition: transform .3s ease; z-index: 50; font-weight:700; }
.toast.show { transform: translateX(-50%) translateY(0); }

@media (max-width: 600px) {
  .nav-links { gap: 1rem; font-size: .9rem; }
  .section-head { align-items: flex-start; }
}
