/* ============================================================
   CHANDAMART — CLIENT SITE STYLES
   Palette: White base, Rose/Magenta accent, Charcoal text
   ============================================================ */

:root {
  --rose: #E91E63;
  --rose-dark: #C2185B;
  --rose-light: #FDECF2;
  --teal: #16A085;
  --purple: #7C4DFF;
  --ink: #1A1A2E;
  --ink-soft: #6B6B7B;
  --line: #EFEFF3;
  --white: #FFFFFF;
  --shadow: 0 6px 24px rgba(26, 26, 46, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Poppins', sans-serif;
  background: var(--white);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  padding-bottom: 72px; /* space for bottom nav */
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a { text-decoration: none; color: inherit; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
}
.topbar-inner {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.3px;
}
.logo span { color: var(--rose); }
.search-wrap {
  margin-top: 12px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
}
.search-wrap input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: #FAFAFB;
  font-family: inherit;
  font-size: 14px;
  outline: none;
}
.search-wrap input:focus { border-color: var(--rose); background: var(--white); }
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-soft);
  font-size: 18px;
}

/* ---------- Layout ---------- */
main {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px;
}

.page { display: none; animation: fadeIn 0.25s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Hero banner (top active offer) ---------- */
.hero-banner {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  margin-bottom: 22px;
  min-height: 150px;
  background: linear-gradient(135deg, var(--rose) 0%, var(--rose-dark) 100%);
  color: var(--white);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.hero-banner img.banner-img { width: 100%; border-radius: var(--radius); }
.hero-eyebrow { font-size: 12px; opacity: 0.85; letter-spacing: 0.5px; text-transform: uppercase; }
.hero-title { font-size: 26px; font-weight: 700; line-height: 1.1; }
.hero-sub { font-size: 13px; opacity: 0.9; margin-top: 4px; }

/* ---------- Section headers ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 22px 0 12px;
}
.section-head h2 { font-size: 17px; font-weight: 600; }
.section-head .count { font-size: 12px; color: var(--ink-soft); }

/* ---------- Product grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols, 2), minmax(0, 1fr));
  gap: 14px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.card-img-wrap {
  position: relative;
  aspect-ratio: 3/4;
  background: #F5F5F7;
  overflow: hidden;
}
.card-img-wrap img { width: 100%; height: 100%; object-fit: cover; }

.badge-discount {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--rose);
  color: var(--white);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 100px;
}

.fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--ink-soft);
  transition: color 0.15s ease, transform 0.15s ease;
}
.fav-btn.active { color: var(--rose); }
.fav-btn:active { transform: scale(1.15); }

.card-body { padding: 10px 12px 12px; }
.card-name {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-price-row { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; }
.price { font-weight: 700; font-size: 15px; color: var(--ink); }
.old-price { font-size: 12px; color: var(--ink-soft); text-decoration: line-through; }

.order-btn {
  width: 100%;
  background: #25D366;
  color: var(--white);
  padding: 9px 0;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.order-btn:active { opacity: 0.85; }

/* ---------- Categories ---------- */
.cat-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-pill {
  flex: 0 0 auto;
  padding: 8px 18px;
  border-radius: 100px;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
}
.cat-pill.active { background: var(--ink); color: var(--white); border-color: var(--ink); }

/* ---------- Empty states ---------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}
.empty-state .icon { font-size: 44px; margin-bottom: 12px; opacity: 0.5; }
.empty-state h3 { font-size: 15px; color: var(--ink); margin-bottom: 4px; font-weight: 600; }
.empty-state p { font-size: 13px; }

/* ---------- Offers page ---------- */
.offer-card {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.offer-card img { width: 100%; }
.offer-card-fallback {
  padding: 30px 20px;
  background: linear-gradient(135deg, var(--purple), var(--rose));
  color: var(--white);
  text-align: center;
}

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 60;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 0 8px;
  font-size: 11px;
  color: var(--ink-soft);
  position: relative;
}
.nav-item .material-symbols-outlined { font-size: 22px; }
.nav-item.active { color: var(--rose); }

/* ---------- Privacy floating button + modal ---------- */
.privacy-fab {
  position: fixed;
  right: 16px;
  bottom: 84px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  z-index: 55;
  text-decoration: none;
  overflow: hidden;
}
.privacy-fab[hidden] { display: none; }
.privacy-fab-emoji { font-size: 24px; line-height: 1; }
.privacy-fab-photo { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,26,46,0.5);
  z-index: 100;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-sheet {
  background: var(--white);
  width: 100%;
  max-width: 520px;
  border-radius: 20px 20px 0 0;
  padding: 24px 22px 28px;
  animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-sheet h3 { font-size: 17px; margin-bottom: 14px; }
.modal-sheet ul { padding-left: 18px; font-size: 13.5px; line-height: 1.9; color: var(--ink-soft); }
.modal-close {
  display: block;
  margin: 20px auto 0;
  background: var(--ink);
  color: var(--white);
  padding: 10px 30px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
}

/* ---------- Product detail sheet ---------- */
.detail-sheet .detail-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: var(--radius); margin-bottom: 14px; }
.detail-sheet h2 { font-size: 19px; margin-bottom: 6px; }
.detail-sheet .desc { font-size: 13px; color: var(--ink-soft); line-height: 1.6; margin: 10px 0 16px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 13px;
  opacity: 0;
  transition: all 0.25s ease;
  z-index: 200;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Loader ---------- */
.loader-wrap { display: flex; justify-content: center; padding: 40px 0; grid-column: 1 / -1; }
.spinner {
  width: 30px; height: 30px;
  border: 3px solid var(--line);
  border-top-color: var(--rose);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, #F0F0F3 25%, #F7F7F9 37%, #F0F0F3 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius);
  aspect-ratio: 3/4;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(var(--grid-cols-lg, 3), minmax(0, 1fr)); }
}

/* ---- INTRO VIDEO SPLASH ---- */
#introSplash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.5s ease;
}
#introSplash.introSplash--hide { opacity: 0; pointer-events: none; }
#introVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#introSkipBtn {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  z-index: 2;
  background: rgba(0,0,0,0.45);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
}
#introSoundBtn {
  position: absolute;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 2;
  display: none;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  animation: introPulse 1.4s ease-in-out infinite;
}
#introSoundBtn.show { display: inline-flex; }
#introSoundBtn .material-symbols-outlined { font-size: 18px; }
@keyframes introPulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.06); }
}

/* ---- SEO Footer (crawlable links + local text, sits above fixed bottom nav) ---- */
.site-footer {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px calc(88px + env(safe-area-inset-bottom));
  text-align: center;
}
.site-footer-tagline {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0 0 14px;
}
.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-bottom: 12px;
}
.site-footer-links a {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--rose);
  text-decoration: none;
}
.site-footer-links a:hover { text-decoration: underline; }
.site-footer-copy {
  font-size: 11px;
  color: var(--ink-soft);
  margin: 0;
}

/* ---- Visually hidden (SEO/accessibility text kept off-screen, not display:none) ---- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Sponsored Advertisement card ----------
   Isolated feature: reuses the exact .card/.card-img-wrap/.card-body/
   .buy-btn classes so it matches a product card's height pixel-for-
   pixel. Only a badge + description differ. No blinking/flashing —
   the only motion is the same subtle hover the product cards already
   have (box-shadow + translateY), inherited from .card:hover. */
.badge-sponsored {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(26, 26, 46, 0.75);
  color: var(--white);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 9px;
  border-radius: 100px;
  z-index: 1;
}
.ad-card .card-img-wrap { background: #F5F5F7; }
.ad-desc {
  font-size: 11.5px;
  color: var(--ink-soft);
  line-height: 1.35;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ad-cta-btn { background: var(--rose); }

/* ---------- Admin customization hooks (set by js/site-custom.js) ---------- */
html[data-hide-trendingScroll] .eng-sec[data-sec="trendingScroll"],
html[data-hide-mostLikedScroll] .eng-sec[data-sec="mostLikedScroll"],
html[data-hide-newArrivalsScroll] .eng-sec[data-sec="newArrivalsScroll"],
html[data-hide-shoprow] .pg-shop-row,
html[data-hide-morefromshop] #moreFromShopSection,
html[data-hide-comments] #commentsSection { display: none !important; }


/* ============================================================
   Home header: row 1 = logo + name · bell + chats
                row 2 = search · filter · profile
   ============================================================ */
.topbar { padding: 10px 14px 12px; }
.topbar-row { max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 8px; }
.topbar-row-search { margin-top: 10px; }
.topbar .logo { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.topbar .logo .topbar-logo-img { height: 38px; width: 38px; flex: none; margin: 0; }
.topbar .logo .logo-text { color: var(--ink); }
.topbar .logo-text { font-size: 20px; font-weight: 700; letter-spacing: -.3px; white-space: nowrap; }
.topbar .logo-text span { color: var(--rose); }
.topbar-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.topbar-row-search .search-wrap { margin: 0; flex: 1; min-width: 0; max-width: none; }
.topbar .topbar-icon-btn { width: 42px; height: 42px; flex: none; position: relative; text-decoration: none; }
.topbar .topbar-icon-btn .material-symbols-outlined { font-size: 22px; }
.topbar .bell-btn { width: 42px; height: 42px; }
#filterActiveDot { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--rose); border: 2px solid #fff; box-sizing: content-box; }

/* ============================================================
   Advertisement banners (placements: site_top, home_search)
   ============================================================ */
.ad-slot { margin: 0 0 16px; }
.ad-slot[hidden] { display: none; }
.ad-slot-top { margin: 0; }
.ad-slot-top .ad-track { max-width: 520px; margin: 0 auto; }
.ad-track { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.ad-track::-webkit-scrollbar { display: none; }
.ad-banner { position: relative; flex: 0 0 100%; scroll-snap-align: start; display: block; aspect-ratio: 16 / 7; border-radius: 16px; overflow: hidden; background: #f3f3f6; border: 1px solid var(--line); cursor: pointer; padding: 0; text-align: left; }
.ad-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-banner .ad-tag { position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 600; letter-spacing: .04em; background: rgba(255,255,255,.92); color: #444; padding: 3px 8px; border-radius: 999px; }
.ad-banner .ad-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.62)); }
.ad-banner .ad-cap b { font-size: 14px; font-weight: 600; line-height: 1.25; display: block; }
.ad-banner .ad-cap small { font-size: 11.5px; opacity: .9; display: block; margin-top: 1px; }
.ad-banner .ad-btn { background: var(--rose); color: #fff; border-radius: 999px; padding: 7px 14px; font-size: 12px; font-weight: 600; white-space: nowrap; flex: none; }
/* thin strip at the very top of the page, above the header */
.ad-slot-top .ad-banner { border-radius: 0; border: 0; aspect-ratio: auto; height: 42px; }
.ad-slot-top .ad-tag { top: 4px; left: 6px; font-size: 9px; padding: 1px 6px; }
.ad-slot-top .ad-cap { top: 0; padding: 0 10px 0 42px; align-items: center; background: linear-gradient(90deg, rgba(0,0,0,.5), rgba(0,0,0,.08)); }
.ad-slot-top .ad-cap b { font-size: 12.5px; }
.ad-slot-top .ad-cap small { display: none; }
.ad-slot-top .ad-btn { padding: 4px 11px; font-size: 11px; }
