/* ═══════════════════════════════════════════════════════════
   CHAPELLIA — Global CSS
   Typography:
   · LibreBaskerville 700  → ONLY brand name "CHAPELLIA"
   · Montserrat 600–700    → Headings, buttons, nav, badges
   · Inter 400–500         → Body, descriptions, UI text
   ═══════════════════════════════════════════════════════════ */

/* ── @font-face ─────────────────────────────────────────────── */
@font-face {
  font-family: 'ChapelliaBold';
  src: url('/assets/fonts/LibreBaskerville-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'ChapelliaReg';
  src: url('/assets/fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('/assets/fonts/MontserratVariable-Bold.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --black:        #0a0a0a;
  --white:        #fff;
  --gray-light:   #f5f5f5;
  --gray:         #888;
  --border:       #e5e5e5;
  --accent:       #ff3b3b;
  --font-brand:   'ChapelliaBold', serif;
  --font-heading: 'Montserrat', sans-serif;
  --font-body:    'ChapelliaReg', sans-serif;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
a, button {
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

/* ── Base ────────────────────────────────────────────────────── */
body {
  font-family: var(--font-body);
  font-weight: 400;
  background: var(--white);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
}
a   { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ════════════════════════════════════════════════════════════
   TYPOGRAPHY — STRICT HIERARCHY
   ════════════════════════════════════════════════════════════ */

/* TIER 1: LibreBaskerville — ONLY "CHAPELLIA" brand name */
.nav-logo-name,
.footer-brand-logo span {
  font-family: var(--font-brand) !important;
  font-weight: 700 !important;
  letter-spacing: 3px !important;
}

/* TIER 2: Montserrat 700 — Large headings */
.hero-title,
.shop-hero-title,
h1, h2, h3 {
  font-family: var(--font-heading) !important;
  font-weight: 700 !important;
}

/* TIER 2: Montserrat 600 — Nav, buttons, labels, badges */
.nav-links a,
.mnav-item span,
/* FIX BUG 15: .btn sebagai base — font+weight saja, layout di masing-masing modifier */
.btn,
.btn-primary,
.btn-outline-light,
.btn-outline-dark,
.nav-cart-btn,
.shop-action-btn,
.filter-apply-btn,
.filter-reset-btn,
.pd-btn-buy,
.pd-btn-back,
.shop-card-badge,
.shop-card-sub,
.shop-card-name,
.coming-soon-label,
.pd-limited-text,
.pd-sticker-badge,
.pd-sticker-verified,
.pd-product-name,
.pd-warna-label,
.pd-code-attr,
.pd-char-sub,
.pd-price-label,
.pd-others-title,
.pd-other-item,
.pd-desc-eyebrow,
.pd-desc-details-title,
.filter-section-title,
.filter-modal-title,
.sort-modal-title,
.sort-option-label,
.shop-hero-label,
.shop-hero-sub,
.shop-hero-stock-text,
.footer-col-title,
.footer-bottom,
.topbar,
.badge {
  font-family: var(--font-heading) !important;
  font-weight: 600 !important;
}

/* Active nav — 700 */
.nav-links a.active,
.nav-links a:hover {
  font-weight: 700 !important;
}

/* Sold-out badges — 700 */
.shop-card-badge-sold,
.shop-card-badge-stock {
  font-family: var(--font-heading) !important;
  font-weight: 700 !important;
  letter-spacing: 3px !important;
}

/* Price — Montserrat 700 */
.shop-card-price,
.pd-price {
  font-family: var(--font-heading) !important;
  font-weight: 700 !important;
  letter-spacing: 1px !important;
}

/* TIER 3: Inter 400 — Body text */
.pd-desc-intro,
.pd-desc-body,
.footer-col a,
.footer-brand-tagline {
  font-family: var(--font-body) !important;
  font-weight: 400 !important;
}

/* TIER 3: Inter 500 — Important small info */
.pd-detail-item,
.pd-stock-info,
.nav-user,
.shop-filter-result {
  font-family: var(--font-body) !important;
  font-weight: 500 !important;
}

/* ════════════════════════════════════════════════════════════
   NAV
   ════════════════════════════════════════════════════════════ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 999;
  background: rgba(10,10,10,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 40px; height: 64px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  gap: 16px;
}
.nav-logo       { display: flex; align-items: center; gap: 12px; }
.nav-logo img   { width: 30px; }
.nav-logo-name  { font-size: 20px; letter-spacing: 3px; color: var(--white); }
.nav-links      { display: flex; gap: 24px; align-items: center; flex: 1; justify-content: center; }
.nav-links a {
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: rgba(255,255,255,0.5); transition: color .25s; white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active { color: var(--white); }
.nav-right      { display: flex; align-items: center; gap: 12px; }
.nav-user       { font-size: 11px; color: rgba(255,255,255,0.5); letter-spacing: 1px; }
.nav-user a     { color: rgba(255,255,255,0.5); transition: color .2s; }
.nav-user a:hover { color: var(--white); }

/* ── Icon buttons (cart, account, logout) ── */
/* FIX BUG 7: pisahkan .nav-icon-btn dari .nav-cart-btn,
   hilangkan .nav-cart lama yang konflik */
.nav-icon-btn {
  color: rgba(255,255,255,0.6);
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  transition: color .25s;
  position: relative;
  text-decoration: none;
  background: none; border: none; cursor: pointer;
}
.nav-icon-btn:hover { color: var(--white); }

.nav-cart-btn { position: relative; }

.nav-cart-count {
  position: absolute; top: -6px; right: -6px;
  background: var(--accent); color: var(--white);
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 10px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 700;
  pointer-events: none;
}

.nav-logout-btn {
  color: rgba(255,255,255,0.35);
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  transition: color .25s; text-decoration: none;
  background: none; border: none; cursor: pointer;
}
.nav-logout-btn:hover { color: #ef4444; }

/* Nav avatar */
.nav-avatar {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(255,255,255,0.15); transition: border-color .25s;
}
.nav-avatar:hover { border-color: var(--white); }

.nav-avatar-placeholder {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-size: 13px;
  color: var(--white); font-weight: 600; letter-spacing: 1px;
  border: 2px solid rgba(255,255,255,0.15); transition: border-color .25s;
  flex-shrink: 0; cursor: pointer;
}
.nav-avatar-placeholder:hover { border-color: var(--white); }

/* ════════════════════════════════════════════════════════════
   TOPBAR
   ════════════════════════════════════════════════════════════ */
.topbar {
  background: var(--black); color: rgba(255,255,255,0.6);
  text-align: center; padding: 10px;
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  margin-top: 64px;
}

/* ════════════════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════════════════ */
/* FIX BUG 4: hapus footer.legacy dan .footer-bottom-legacy — dead code */

.footer {
  background: #080808;
  border-top: 1px solid rgba(255,255,255,0.06);
  color: var(--white);
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 72px 60px 56px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 48px;
}
.footer-brand           { display: flex; flex-direction: column; }
.footer-brand-logo      { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.footer-brand-logo img  { width: 24px; opacity: .6; }
.footer-brand-logo span { font-size: 16px; color: rgba(255,255,255,0.8); }
.footer-brand-tagline   { font-size: 12px; color: rgba(255,255,255,0.25); line-height: 1.9; margin-bottom: 24px; }
.footer-socials         { display: flex; gap: 8px; }
.footer-social {
  width: 32px; height: 32px;
  border: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.25); transition: all .25s; text-decoration: none;
}
.footer-social:hover    { border-color: rgba(255,255,255,0.3); color: var(--white); }
.footer-col             { display: flex; flex-direction: column; }
.footer-col-title {
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: rgba(255,255,255,0.5); margin-bottom: 16px;
}
.footer-col a {
  font-size: 12px; color: rgba(255,255,255,0.25); transition: color .25s;
  text-decoration: none; padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  line-height: 1.4; word-break: keep-all; hyphens: none;
}
.footer-col a:last-child { border-bottom: none; }
.footer-col a:hover      { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 24px 60px; text-align: center;
  font-size: 10px; color: rgba(255,255,255,0.15);
  letter-spacing: 2px; text-transform: uppercase;
}

/* ════════════════════════════════════════════════════════════
   MOBILE BOTTOM NAV
   ════════════════════════════════════════════════════════════ */
.mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 998; height: 64px;
}
.mnav-bar {
  position: absolute; bottom: 0; left: 0; right: 0; height: 64px;
  display: flex; align-items: center;
  background: rgba(10,10,10,0.98);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.06);
  z-index: 1;
}
.mnav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  color: rgba(255,255,255,0.3); text-decoration: none;
  font-size: 8px; letter-spacing: .5px; text-transform: uppercase;
  transition: color .2s; height: 64px; position: relative;
}
.mnav-item span       { line-height: 1; white-space: nowrap; }
.mnav-item svg        { transition: opacity .2s; stroke-width: 1.5; width: 20px; height: 20px; }
.mnav-item.active     { color: rgba(255,255,255,0.15); }
.mnav-item.active svg { opacity: .2; }

/* ── FIX BUG 6: mnav-ball — translateY juga di-transition agar tidak lompat ── */
.mnav-ball {
  position: absolute;
  bottom: 6px;
  width: 52px; height: 52px;
  border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
  /* Initial: hidden & shifted down */
  opacity: 0;
  transform: translateX(-50%) translateY(80px);
  /* Transition SEMUA property termasuk left dan transform */
  transition: left .35s cubic-bezier(.4,0,.2,1),
              transform .35s cubic-bezier(.4,0,.2,1),
              opacity .35s ease;
  pointer-events: none;
}
.mnav-ball.settled {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  /* Hanya left yang bergerak saat pindah tab — transform tetap di posisi normal */
  transition: left .35s cubic-bezier(.4,0,.2,1),
              transform .2s cubic-bezier(.4,0,.2,1),
              opacity .2s ease;
}

.mobile-nav-cart-badge {
  position: absolute; top: 6px; left: calc(50% + 6px);
  background: var(--accent); color: var(--white);
  width: 14px; height: 14px; border-radius: 50%;
  font-size: 8px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; line-height: 1;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE — GLOBAL
   ════════════════════════════════════════════════════════════ */
@media(max-width:1024px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr 1fr;
    padding: 56px 40px 48px;
    gap: 36px;
  }
  .footer-brand { grid-column: span 3; }
}

@media(max-width:768px) {
  .footer-hide-mobile { display: none; }
  .nav-logo img       { width: 28px; }
  .nav-logo-name      { font-size: 15px; letter-spacing: 2px; }
  .nav                { padding: 0 20px; height: 60px; }
  .nav-links          { display: none; }
  .nav-user           { display: none; }
  body                { padding-bottom: 64px; }
  .mobile-nav         { display: block; }
  .footer-inner       { grid-template-columns: 1fr 1fr; padding: 40px 20px; gap: 28px; }
  .footer-brand       { grid-column: span 2; }
  .footer-bottom      { padding: 18px 20px; letter-spacing: 1px; }
}

@media(max-width:480px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-brand { grid-column: span 1; }
}

@media(max-width:380px) {
  .mnav-item span { font-size: 7px; letter-spacing: 0; }
  .mnav-item svg  { width: 18px; height: 18px; }
  .mnav-ball      { width: 46px; height: 46px; }
}

/* ════════════════════════════════════════════════════════════
   NON-LATIN SCRIPT FIX
   ─────────────────────────────────────────────────────────
   Bahasa Bengali, Hindi, Arabic, Urdu, Japanese, Korean,
   Chinese, Cantonese, Thai, Egyptian Arabic menggunakan
   skrip non-Latin. Montserrat/Inter tidak support karakter
   ini sehingga browser jatuh ke system font.
   
   Masalah: CSS letter-spacing (0.5px–4px) yang dirancang
   untuk Latin MERUSAK rendering skrip non-Latin karena
   memberi jarak antar komponen huruf silabis.
   
   Solusi: reset letter-spacing ke 0 dan override font ke
   system-ui agar browser pakai font terbaik yang tersedia.
   ════════════════════════════════════════════════════════════ */

/* ── Reset letter-spacing & font untuk semua skrip non-Latin ──────────
   Ditulis sebagai selector individual (tanpa :is()) agar kompatibel
   dengan semua browser termasuk yang tidak support :is() forgiving.
   ─────────────────────────────────────────────────────────────────── */

html[lang="bn"] * { letter-spacing: 0 !important; font-family: system-ui, -apple-system, sans-serif !important; }
html[lang="hi"] * { letter-spacing: 0 !important; font-family: system-ui, -apple-system, sans-serif !important; }
html[lang="ar"] * { letter-spacing: 0 !important; font-family: system-ui, -apple-system, sans-serif !important; }
html[lang="ur"] * { letter-spacing: 0 !important; font-family: system-ui, -apple-system, sans-serif !important; }
html[lang="arz"] * { letter-spacing: 0 !important; font-family: system-ui, -apple-system, sans-serif !important; }
html[lang="ja"] * { letter-spacing: 0 !important; font-family: system-ui, -apple-system, sans-serif !important; }
html[lang="ko"] * { letter-spacing: 0 !important; font-family: system-ui, -apple-system, sans-serif !important; }
html[lang="zh"] * { letter-spacing: 0 !important; font-family: system-ui, -apple-system, sans-serif !important; }
html[lang="yue"] * { letter-spacing: 0 !important; font-family: system-ui, -apple-system, sans-serif !important; }
html[lang="th"] * { letter-spacing: 0 !important; font-family: system-ui, -apple-system, sans-serif !important; }
html[lang="ta"] * { letter-spacing: 0 !important; font-family: system-ui, -apple-system, sans-serif !important; }

/* ── Counter angka tetap Montserrat ── */
html[lang="bn"] .counter-number, html[lang="bn"] .counter-total,
html[lang="hi"] .counter-number, html[lang="hi"] .counter-total,
html[lang="ar"] .counter-number, html[lang="ar"] .counter-total,
html[lang="ur"] .counter-number, html[lang="ur"] .counter-total,
html[lang="arz"] .counter-number, html[lang="arz"] .counter-total,
html[lang="ja"] .counter-number, html[lang="ja"] .counter-total,
html[lang="ko"] .counter-number, html[lang="ko"] .counter-total,
html[lang="zh"] .counter-number, html[lang="zh"] .counter-total,
html[lang="yue"] .counter-number, html[lang="yue"] .counter-total,
html[lang="th"] .counter-number, html[lang="th"] .counter-total,
html[lang="bn"] .nav-cart-count, html[lang="bn"] .mobile-nav-cart-badge,
html[lang="hi"] .nav-cart-count, html[lang="hi"] .mobile-nav-cart-badge,
html[lang="ar"] .nav-cart-count, html[lang="ar"] .mobile-nav-cart-badge,
html[lang="ur"] .nav-cart-count, html[lang="ur"] .mobile-nav-cart-badge,
html[lang="arz"] .nav-cart-count, html[lang="arz"] .mobile-nav-cart-badge,
html[lang="ja"] .nav-cart-count, html[lang="ja"] .mobile-nav-cart-badge,
html[lang="ko"] .nav-cart-count, html[lang="ko"] .mobile-nav-cart-badge,
html[lang="zh"] .nav-cart-count, html[lang="zh"] .mobile-nav-cart-badge,
html[lang="yue"] .nav-cart-count, html[lang="yue"] .mobile-nav-cart-badge,
html[lang="th"] .nav-cart-count, html[lang="th"] .mobile-nav-cart-badge,
html[lang="ta"] .counter-number, html[lang="ta"] .counter-total,
html[lang="ta"] .nav-cart-count, html[lang="ta"] .mobile-nav-cart-badge {
  font-family: var(--font-heading) !important;
  letter-spacing: 0 !important;
}

/* ── Brand name "CHAPELLIA" tetap LibreBaskerville di semua bahasa ── */
html[lang="bn"] .nav-logo-name, html[lang="bn"] .footer-brand-logo span,
html[lang="hi"] .nav-logo-name, html[lang="hi"] .footer-brand-logo span,
html[lang="ar"] .nav-logo-name, html[lang="ar"] .footer-brand-logo span,
html[lang="ur"] .nav-logo-name, html[lang="ur"] .footer-brand-logo span,
html[lang="arz"] .nav-logo-name, html[lang="arz"] .footer-brand-logo span,
html[lang="ja"] .nav-logo-name, html[lang="ja"] .footer-brand-logo span,
html[lang="ko"] .nav-logo-name, html[lang="ko"] .footer-brand-logo span,
html[lang="zh"] .nav-logo-name, html[lang="zh"] .footer-brand-logo span,
html[lang="yue"] .nav-logo-name, html[lang="yue"] .footer-brand-logo span,
html[lang="th"] .nav-logo-name, html[lang="th"] .footer-brand-logo span,
html[lang="ta"] .nav-logo-name, html[lang="ta"] .footer-brand-logo span {
  font-family: var(--font-brand) !important;
  letter-spacing: 3px !important;
}

/* ── RTL: Arabic, Urdu, Egyptian Arabic ── */
html[lang="ar"] { direction: rtl; }
html[lang="ur"] { direction: rtl; }
html[lang="arz"] { direction: rtl; }

html[lang="ar"] .nav,
html[lang="ur"] .nav,
html[lang="arz"] .nav { flex-direction: row-reverse; }

html[lang="ar"] .nav-links,
html[lang="ur"] .nav-links,
html[lang="arz"] .nav-links { flex-direction: row-reverse; }

html[lang="ar"] .footer-inner,
html[lang="ur"] .footer-inner,
html[lang="arz"] .footer-inner { direction: rtl; }

/* ── Bengali & Hindi: font-size sedikit lebih besar untuk ligatur ── */
html[lang="bn"] .nav-links a,
html[lang="hi"] .nav-links a { font-size: 12px !important; }

html[lang="bn"] .mnav-item span,
html[lang="hi"] .mnav-item span { font-size: 9px !important; }

html[lang="bn"] .footer-col-title,
html[lang="hi"] .footer-col-title { font-size: 11px !important; }

html[lang="bn"] .footer-col a,
html[lang="hi"] .footer-col a { font-size: 13px !important; }

/* ── Thai: line-height lebih besar untuk tanda baca atas-bawah ── */
html[lang="th"] * { line-height: 1.8 !important; }
html[lang="th"] .hero-title { line-height: 1.1 !important; }

/* ── Korean & Japanese: sedikit lebih kecil di nav ── */
html[lang="ko"] .nav-links a,
html[lang="ja"] .nav-links a { font-size: 12px !important; }

html[lang="ko"] .mnav-item span,
html[lang="ja"] .mnav-item span { font-size: 9px !important; }