/* ============================================================
   MAKTABATUS SUFFAH — GLOBAL STYLESHEET
   Design System: Dark Luxury + Glassmorphism
   Source of truth: FILE_01_MASTER_CONTEXT.md Section 3
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Noto+Nastaliq+Urdu:wght@400;700&family=Noto+Serif+Bengali:wght@400;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=DM+Sans:wght@400;500;600&display=swap");

/* ---------- Theme tokens ---------- */
:root[data-theme="dark"] {
  --bg-primary: #0D1117;
  --bg-secondary: #0F1923;
  --bg-card: rgba(15, 25, 35, 0.8);
  --gold: #C9A84C;
  --gold-light: #E5C76B;
  --gold-dark: #A6873D;
  --gold-glow: rgba(201, 168, 76, 0.15);
  --gold-border: rgba(201, 168, 76, 0.25);
  --text-primary: #F0EDE6;
  --text-secondary: #9BA8B8;
  --text-muted: #64748B;
  --border: rgba(201, 168, 76, 0.12);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-gold: 0 4px 24px rgba(201, 168, 76, 0.2);
  --blur: blur(12px);
}

:root[data-theme="light"] {
  --bg-primary: #FAF6EE;
  --bg-secondary: #F3EDD8;
  --bg-card: rgba(255, 252, 245, 0.9);
  --gold: #8B6914;
  --gold-light: #A67C1A;
  --gold-dark: #6B5010;
  --gold-glow: rgba(139, 105, 20, 0.12);
  --gold-border: rgba(139, 105, 20, 0.25);
  --text-primary: #1A120A;
  --text-secondary: #6B4E2A;
  --text-muted: #9C7B52;
  --border: rgba(139, 105, 20, 0.15);
  --shadow: 0 4px 20px rgba(100, 70, 20, 0.12);
  --shadow-gold: 0 4px 20px rgba(139, 105, 20, 0.15);
  --blur: blur(12px);
}

:root {
  --error: #EF4444;
  --success: #10B981;
  --warning: #F59E0B;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --loader-bg: #FAFAF8;
  --bottom-nav-h: 64px;
  --lang-green: #1F9D55;   /* Bengali badge */
  --lang-blue: #2F6FD8;    /* Urdu badge */
  --lang-gold: var(--gold);/* Arabic badge */
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: "DM Sans", sans-serif;
  line-height: 1.6;
  transition: background 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
  position: relative;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
/* body's 1.6 line-height suits paragraphs; UI chrome (nav, buttons,
   labels, headings) reads tighter and cleaner at ~1.3 */
h1, h2, h3, h4, h5, h6 { line-height: 1.3; }
button, .btn, input, select, textarea, label { line-height: 1.4; }
nav a, .drawer-nav a, .profile-tab, .auth-tab, .filter-chip, .lang-dd-menu button,
.people-name-lg, .book-card-title, .cart-item-title, .order-number, .section-heading { line-height: 1.3; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; }
ul { list-style: none; }
svg { display: block; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Islamic geometric SVG pattern — subtle body background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.03;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23C9A84C' stroke-width='1'%3E%3Cpath d='M60 0 L120 60 L60 120 L0 60 Z'/%3E%3Ccircle cx='60' cy='60' r='42'/%3E%3Cpath d='M60 18 L102 60 L60 102 L18 60 Z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 220px 220px;
}

/* Font-family helper classes — apply per book/author language */
.font-bn { font-family: "Noto Serif Bengali", serif; }
.font-ur { font-family: "Noto Nastaliq Urdu", serif; direction: rtl; }
.font-ar { font-family: "Amiri", serif; }
.font-head { font-family: "Cormorant Garamond", serif; }

/* ---------- Glass card ---------- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.glass-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
  transform: translateY(-4px);
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

.gold-text { color: var(--gold); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 28px; border-radius: var(--radius-md);
  font-weight: 600; font-size: 0.95rem; letter-spacing: 0.2px;
  transition: var(--transition); white-space: nowrap;
}
.btn-filled {
  background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
  color: #14100A;
}
.btn-filled:hover { box-shadow: var(--shadow-gold); transform: translateY(-2px); }
.btn-outline {
  border: 1.5px solid var(--gold-border); color: var(--gold);
  background: transparent;
}
.btn-outline:hover { background: var(--gold-glow); border-color: var(--gold); }

.section-label {
  color: var(--gold); font-size: 0.78rem; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase;
}
.section-heading {
  font-family: "Cormorant Garamond", serif; font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.2rem); margin-top: 4px; color: var(--text-primary);
}
.see-all {
  color: var(--gold); font-size: 0.85rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ============================================================
   LOADING SCREEN
   ============================================================ */
#loading-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--loader-bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; transition: opacity 0.6s ease;
}
#loading-screen.fade-out { opacity: 0; pointer-events: none; }
.loader-arabic {
  font-family: "Amiri", serif; font-size: 2.4rem; color: #8B6914;
  opacity: 0; transform: translateY(14px); animation: loaderIn 0.7s ease forwards;
}
.loader-brand {
  font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 1.6rem; color: #1A120A;
  opacity: 0; animation: loaderFade 0.7s ease forwards 0.6s;
}
.loader-sub {
  font-family: "DM Sans", sans-serif; font-size: 0.85rem; letter-spacing: 1px; color: #8B6914;
  opacity: 0; animation: loaderFade 0.7s ease forwards 1.1s;
}
.loader-bar {
  width: 180px; height: 3px; background: rgba(139,105,20,0.15); border-radius: 4px; overflow: hidden; margin-top: 6px;
}
.loader-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg,#8B6914,#C9A84C); animation: loaderFill 2s ease forwards 0.3s; }
@keyframes loaderIn { to { opacity: 1; transform: translateY(0); } }
@keyframes loaderFade { to { opacity: 1; } }
@keyframes loaderFill { to { width: 100%; } }

/* ============================================================
   TOP TICKER STRIP
   ============================================================ */
#ticker-strip {
  background: var(--bg-secondary); color: var(--gold);
  font-size: 0.8rem; font-weight: 500; letter-spacing: 0.3px;
  overflow: hidden; white-space: nowrap; position: relative;
  border-bottom: 1px solid var(--border);
}
#ticker-track {
  display: inline-flex; padding: 8px 0; animation: tickerScroll 28s linear infinite;
}
#ticker-track span { padding: 0 28px; display: inline-flex; align-items: center; gap: 10px; }
#ticker-track span::after { content: "•"; color: var(--gold-border); margin-left: 28px; }
@keyframes tickerScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============================================================
   NAVBAR (TOP)
   ============================================================ */
#navbar {
  position: sticky; top: 0; z-index: 500;
  background: var(--bg-card); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
}
.navbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.navbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hamburger-btn {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); flex-shrink: 0;
}
.hamburger-btn:hover { background: var(--gold-glow); }
.navbar-logo-link { display: flex; align-items: center; gap: 10px; min-width: 0; }
.navbar-logo-img { width: 46px; height: 46px; object-fit: contain; flex-shrink: 0; }

/* Theme-aware logo swap — dark-colored logo on light bg, light-colored logo on dark bg */
.logo-for-dark { display: none; }
.logo-for-light { display: block; }
:root[data-theme="dark"] .logo-for-dark { display: block; }
:root[data-theme="dark"] .logo-for-light { display: none; }
.navbar-brand-text { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.navbar-brand-name { font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 1.15rem; color: var(--text-primary); white-space: nowrap; }
.navbar-tagline { font-family: "Noto Serif Bengali", serif; font-size: 0.68rem; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--gold-border);
}
.theme-toggle:hover { background: var(--gold-glow); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.lang-dropdown { position: relative; }
.lang-dd-toggle {
  display: flex; align-items: center; gap: 6px; padding: 8px 12px;
  background: var(--bg-secondary); border: 1px solid var(--gold-border); border-radius: 999px;
  font-size: 0.8rem; font-weight: 600; color: var(--text-primary); transition: var(--transition);
}
.lang-dd-toggle:hover { border-color: var(--gold); }
.lang-dd-arrow { color: var(--gold); transition: transform 0.25s ease; flex-shrink: 0; }
.lang-dropdown.open .lang-dd-arrow { transform: rotate(180deg); }
.lang-dd-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 150px; z-index: 80;
  background: var(--bg-card); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--gold-border); border-radius: var(--radius-md); box-shadow: var(--shadow);
  padding: 6px; display: flex; flex-direction: column; gap: 2px;
  opacity: 0; transform: translateY(-6px); pointer-events: none; transition: var(--transition);
}
.lang-dropdown.open .lang-dd-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }
.lang-dd-menu button { padding: 9px 12px; border-radius: var(--radius-sm); font-size: 0.85rem; text-align: left; color: var(--text-secondary); }
.lang-dd-menu button:hover { background: var(--gold-glow); color: var(--gold); }
.lang-dd-menu button.active { color: var(--gold); font-weight: 700; background: var(--gold-glow); }

@media (max-width: 400px) { .navbar-tagline { display: none; } }
@media (max-width: 360px) { .navbar-brand-text { display: none; } }

/* ============================================================
   HAMBURGER DRAWER
   ============================================================ */
#drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 900;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
#drawer-overlay.open { opacity: 1; pointer-events: auto; }
#hamburger-drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: min(320px, 86vw); z-index: 901;
  background: var(--bg-secondary); border-right: 1px solid var(--border);
  transform: translateX(-100%); transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column; overflow-y: auto;
}
#hamburger-drawer.open { transform: translateX(0); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 14px; border-bottom: 1px solid var(--border); }
.drawer-header .brand { display: flex; align-items: center; gap: 10px; font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 1.1rem; }
.drawer-close { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.drawer-close:hover { background: var(--gold-glow); }
.drawer-nav { padding: 10px 8px; flex: 1; }
.drawer-nav a, .drawer-nav .drawer-toggle-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.95rem; color: var(--text-primary);
  border-left: 3px solid transparent;
}
.drawer-nav a:hover { background: var(--gold-glow); color: var(--gold); }
.drawer-nav a.active { border-left-color: var(--gold); color: var(--gold); font-weight: 600; }
.drawer-toggle-item { padding: 0 4px 0 14px; }
.drawer-toggle-item .drawer-books-link { flex: 1; padding: 12px 0; color: inherit; }
.drawer-toggle-item.active .drawer-books-link { color: var(--gold); font-weight: 600; }
.drawer-toggle-item.active { border-left-color: var(--gold); }
.drawer-toggle-item .drawer-books-link:hover { color: var(--gold); }
.drawer-submenu-arrow { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); flex-shrink: 0; }
.drawer-submenu-arrow:hover { background: var(--gold-glow); color: var(--gold); }
.drawer-submenu-arrow.open svg { transform: rotate(180deg); }
.drawer-submenu-arrow svg { transition: transform 0.25s ease; }
.drawer-divider { height: 1px; background: var(--border); margin: 10px 14px; }
.drawer-submenu { display: none; padding-left: 14px; }
.drawer-submenu.open { display: block; }
.drawer-submenu a { padding: 10px 14px; font-size: 0.88rem; color: var(--text-secondary); }
.drawer-footer { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.drawer-footer .drawer-whatsapp { display: flex; align-items: center; gap: 8px; color: var(--success); font-weight: 600; font-size: 0.88rem; }

/* ============================================================
   POPUPS (Language preference + Promo)
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 2000; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity 0.35s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-box { max-width: 480px; width: 100%; padding: 30px 26px; text-align: center; position: relative; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--gold-glow); }
.lang-popup-q { font-size: 0.95rem; line-height: 1.9; margin-bottom: 22px; }
.lang-popup-q .q-en { font-family: "DM Sans"; color: var(--text-primary); display: block; margin-bottom: 4px; }
.lang-popup-q .q-ur { font-family: "Noto Nastaliq Urdu"; direction: rtl; color: var(--text-secondary); display: block; margin-bottom: 4px; }
.lang-popup-q .q-bn { font-family: "Noto Serif Bengali"; color: var(--text-secondary); display: block; }
.lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lang-opt {
  padding: 16px 10px; border-radius: var(--radius-md); border: 1.5px solid var(--gold-border);
  display: flex; flex-direction: column; gap: 4px; transition: var(--transition);
}
.lang-opt:hover { border-color: var(--gold); background: var(--gold-glow); transform: translateY(-2px); }
.lang-opt .lo-name { font-weight: 600; font-size: 0.95rem; }
.lang-opt .lo-count { font-size: 0.75rem; color: var(--text-muted); }
.promo-img { border-radius: var(--radius-md); overflow: hidden; margin-bottom: 16px; }
.promo-img img { width: 100%; }

/* ============================================================
   HERO
   ============================================================ */
#hero-slider { position: relative; width: 100%; aspect-ratio: 16/7; min-height: 220px; overflow: hidden; }
.hero-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease;
  background-size: cover; background-position: center;
}
.hero-slide.active { opacity: 1; }
.hero-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.1), rgba(13,17,23,0.85)); }
.hero-slide-text { position: absolute; left: 0; right: 0; bottom: 24px; text-align: center; z-index: 2; padding: 0 20px; }
.hero-slide-text h3 { font-family: "Cormorant Garamond", serif; font-size: clamp(1.3rem, 3vw, 2rem); color: #fff; }
.hero-slide-text p { color: #E7E1D3; font-size: 0.9rem; margin-top: 4px; }
.hero-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; z-index: 3; }
.hero-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.4); transition: var(--transition); }
.hero-dot.active { background: var(--gold); width: 22px; border-radius: 4px; }
.hero-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-muted); background: var(--bg-secondary); }

/* ============================================================
   QUOTE + BRAND
   ============================================================ */
.quote-brand-wrap { padding: 46px 0 20px; }
.quote-card { max-width: 720px; margin: 0 auto; padding: 32px 30px; text-align: center; position: relative; }
.quote-card::before {
  content: "\201C"; position: absolute; top: -6px; left: 20px; font-family: Georgia, serif;
  font-size: 4.5rem; color: var(--gold-border); line-height: 1;
}
.quote-text { font-family: "Cormorant Garamond", serif; font-style: italic; font-size: 1.25rem; line-height: 1.6; color: var(--text-primary); }
.quote-source { margin-top: 14px; color: var(--gold); font-size: 0.85rem; font-weight: 600; }

.brand-section { text-align: center; max-width: 640px; margin: 46px auto 0; padding: 0 20px; }
.brand-section h1 { font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.brand-section p { color: var(--text-secondary); margin-top: 12px; font-size: 1rem; }
.brand-buttons { display: flex; gap: 14px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }

/* ============================================================
   HIGHLIGHT CARDS
   ============================================================ */
.highlights-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 40px 0; }
.highlight-card { padding: 20px 14px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.highlight-card .hi-icon-box { width: 46px; height: 46px; border-radius: var(--radius-md); background: var(--gold-glow); display: flex; align-items: center; justify-content: center; }
.highlight-card .hi-icon { width: 22px; height: 22px; color: var(--gold); }
.highlight-card span { font-size: 0.85rem; font-weight: 600; }
@media (max-width: 640px) { .highlights-grid { grid-template-columns: 1fr 1fr; } }

/* ============================================================
   BOOK SECTIONS + CARDS
   ============================================================ */
.book-section { padding: 20px 0; }
.book-section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.book-scroll { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.book-scroll::-webkit-scrollbar { height: 6px; }
.book-scroll::-webkit-scrollbar-thumb { background: var(--gold-border); border-radius: 4px; }

.book-card { flex: 0 0 170px; scroll-snap-align: start; padding: 12px; position: relative; cursor: pointer; }
.book-cover-wrap { position: relative; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 2/3; background: var(--bg-secondary); margin-bottom: 10px; }
.book-cover-wrap img { width: 100%; height: 100%; object-fit: cover; }
.lang-badge { position: absolute; top: 8px; left: 8px; font-size: 0.62rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; color: #fff; text-transform: uppercase; letter-spacing: 0.4px; }
.lang-badge.bn { background: var(--lang-green); }
.lang-badge.ur { background: var(--lang-blue); }
.lang-badge.ar { background: var(--lang-gold); color: #14100A; }
.stock-badge { position: absolute; top: 8px; right: 8px; font-size: 0.6rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; }
.stock-badge.NEW { background: var(--success); color: #fff; }
.stock-badge.HOT { background: var(--error); color: #fff; }
.stock-badge.BESTSELLER { background: var(--gold); color: #14100A; }
.stock-badge.PRE-ORDER { background: var(--warning); color: #14100A; }
.book-card-title { font-size: 0.85rem; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-card-author { font-size: 0.75rem; color: var(--text-secondary); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.book-card-price { margin-top: 6px; display: flex; align-items: baseline; gap: 6px; }
.book-card-price .now { font-weight: 700; color: var(--gold); font-size: 0.92rem; }
.book-card-price .was { font-size: 0.75rem; color: var(--text-muted); text-decoration: line-through; }
.book-card-actions { display: flex; gap: 6px; margin-top: 8px; }
.book-card-actions button { flex: 1; height: 30px; border-radius: var(--radius-sm); border: 1px solid var(--gold-border); display: flex; align-items: center; justify-content: center; }
.book-card-actions button:hover { background: var(--gold-glow); }
.book-card-actions svg { width: 15px; height: 15px; }
.book-empty-note { color: var(--text-muted); font-size: 0.88rem; padding: 20px 0; }

/* ============================================================
   BOOKS LIST PAGE (books.html)
   ============================================================ */
.page-header { text-align: center; padding: 14px 0 2px; }
.page-header h1 { font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: clamp(1.3rem, 3vw, 1.7rem); }
.page-header p { color: var(--text-secondary); margin-top: 4px; font-size: 0.82rem; }

.browse-cats-row { padding: 18px 0; }
.browse-cats-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.browse-cats-head h3 { font-size: 1rem; font-weight: 700; }
.browse-cats-scroll { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.browse-cat-item { flex: 0 0 84px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.browse-cat-circle { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.browse-cat-circle svg { width: 24px; height: 24px; color: var(--gold); }
.browse-cat-item span { font-size: 0.72rem; color: var(--text-secondary); line-height: 1.3; }

.chips-row { display: flex; gap: 10px; overflow-x: auto; padding: 6px 0 18px; }
.filter-chip { flex-shrink: 0; padding: 9px 16px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; border: 1.5px solid var(--gold-border); color: var(--text-secondary); }
.filter-chip.active { background: linear-gradient(135deg, var(--gold-light), var(--gold-dark)); color: #14100A; border-color: transparent; }

.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.filter-select-btn {
  display: flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--gold-border); font-size: 0.82rem; color: var(--text-primary); background: var(--bg-card);
}
.filter-select-btn:hover { border-color: var(--gold); }
.filter-select-btn svg { width: 13px; height: 13px; color: var(--gold); }
.clear-filters-btn { font-size: 0.8rem; color: var(--gold); font-weight: 600; margin-left: auto; }
.active-filter-tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 10px; }
.active-filter-tag { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--gold-glow); color: var(--gold); font-size: 0.76rem; font-weight: 600; }
.active-filter-tag button { display: flex; }
.active-filter-tag svg { width: 11px; height: 11px; }

.results-info { padding: 10px 0; font-size: 0.85rem; color: var(--text-secondary); }

.books-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; padding-bottom: 20px; }
@media (min-width: 640px) { .books-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .books-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1180px) { .books-grid { grid-template-columns: repeat(5, 1fr); } }
.books-grid .book-card { width: 100%; flex: none; }

.pagination-row { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 20px 0 40px; }
.page-btn { min-width: 36px; height: 36px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--gold-border); font-size: 0.85rem; color: var(--text-secondary); display: flex; align-items: center; justify-content: center; }
.page-btn.active { background: linear-gradient(135deg, var(--gold-light), var(--gold-dark)); color: #14100A; border-color: transparent; font-weight: 700; }
.page-btn:disabled { opacity: 0.4; pointer-events: none; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.empty-state svg { width: 56px; height: 56px; color: var(--gold-border); margin: 0 auto 16px; }

/* Mobile filter drawer */
#filter-drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 900; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
#filter-drawer-overlay.open { opacity: 1; pointer-events: auto; }
#filter-drawer {
  position: fixed; left: 0; right: 0; bottom: 0; max-height: 82vh; z-index: 901;
  background: var(--bg-secondary); border-top: 1px solid var(--gold-border);
  border-radius: 20px 20px 0 0; transform: translateY(100%); transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto; padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
}
#filter-drawer.open { transform: translateY(0); }
.filter-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.filter-drawer-head h3 { font-size: 1.05rem; font-weight: 700; }
.filter-group { margin-bottom: 18px; }
.filter-group h4 { font-size: 0.82rem; color: var(--gold); margin-bottom: 10px; letter-spacing: 0.4px; }
.filter-option-list { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-option { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--gold-border); font-size: 0.82rem; color: var(--text-secondary); }
.filter-option.active { background: var(--gold-glow); color: var(--gold); border-color: var(--gold); font-weight: 600; }
.filter-drawer-actions { display: flex; gap: 10px; margin-top: 6px; }
.filter-drawer-actions .btn { flex: 1; }
.mobile-filter-toggle { display: none; }
@media (max-width: 900px) {
  .desktop-filter-bar { display: none; }
  .mobile-filter-toggle { display: flex; }
}

/* ============================================================
   BOOK DETAIL PAGE (book/index.html)
   ============================================================ */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 16px 0; font-size: 0.82rem; color: var(--text-secondary); }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb span { color: var(--text-muted); }
.breadcrumb-current { color: var(--text-primary); font-weight: 600; }

.book-detail-grid { display: grid; grid-template-columns: 1fr; gap: 28px; padding-bottom: 30px; }
@media (min-width: 900px) { .book-detail-grid { grid-template-columns: 420px 1fr; } }

.gallery-wrap { align-self: start; }
/* Sticky gallery only makes sense in the desktop 2-column layout —
   on mobile (1 column) it was trapping the title/price/buttons behind
   the image while scrolling. */
@media (min-width: 900px) {
  .gallery-wrap { position: sticky; top: 76px; }
}
.gallery-slider {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius-lg);
  border: 1px solid var(--gold-border); background: var(--bg-secondary);
}
.gallery-slider::-webkit-scrollbar { display: none; }
.gallery-slide { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 2/3; display: flex; }
.gallery-slide img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.gallery-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.gallery-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-border); }
.gallery-dot.active { background: var(--gold); width: 18px; border-radius: 4px; transition: var(--transition); }

.book-info-col { display: flex; flex-direction: column; gap: 14px; }
.book-title-lg { font-size: clamp(1.4rem, 3vw, 1.8rem); font-weight: 700; line-height: 1.35; }
.book-byline { font-size: 0.95rem; color: var(--text-secondary); }
.book-author-lg { color: var(--gold); font-weight: 600; }
.book-publisher-lg { color: var(--gold); font-weight: 600; }

.book-rating-row { display: flex; align-items: center; gap: 8px; }
.book-rating-row .review-stars svg { width: 15px; height: 15px; fill: var(--gold); }
.rating-text { font-size: 0.82rem; color: var(--text-secondary); }

.book-badges-row { display: flex; align-items: center; gap: 10px; }
.book-badges-row .lang-badge { position: static; }
.stock-status { font-size: 0.85rem; font-weight: 700; }

.also-avail-label { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 8px; }
.also-avail-row { display: flex; gap: 8px; flex-wrap: wrap; }
.also-avail-chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--gold-border); font-size: 0.82rem; color: var(--gold); }
.also-avail-chip:hover { background: var(--gold-glow); }

.qty-row { display: flex; align-items: center; justify-content: space-between; max-width: 220px; }
.qty-row span:first-child { font-size: 0.88rem; color: var(--text-secondary); }
.qty-selector { display: flex; align-items: center; border: 1px solid var(--gold-border); border-radius: var(--radius-sm); overflow: hidden; }
.qty-selector button { width: 34px; height: 34px; font-size: 1.1rem; color: var(--gold); }
.qty-selector button:hover { background: var(--gold-glow); }
.qty-selector span { width: 36px; text-align: center; font-weight: 600; }

.price-block { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price-now { font-size: 1.6rem; font-weight: 700; color: var(--gold); }
.price-was { font-size: 1rem; color: var(--text-muted); text-decoration: line-through; }
.price-save { font-size: 0.8rem; font-weight: 700; color: var(--success); background: rgba(16,185,129,0.12); padding: 3px 9px; border-radius: 999px; }

.delivery-est-row { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-secondary); }
.delivery-est-row svg { width: 16px; height: 16px; color: var(--gold); flex-shrink: 0; }

.book-action-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.book-action-buttons .btn { flex: 1; min-width: 140px; }

.secondary-actions-row { display: flex; gap: 12px; }
.secondary-action-btn { display: flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--gold-border); font-size: 0.85rem; color: var(--text-secondary); }
.secondary-action-btn:hover { border-color: var(--gold); color: var(--gold); }
.secondary-action-btn svg { width: 16px; height: 16px; }
.secondary-action-btn.in-wishlist { color: var(--error); border-color: var(--error); }

.policy-icons-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.policy-icon-item { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--text-secondary); }
.policy-icon-item svg { width: 18px; height: 18px; color: var(--gold); flex-shrink: 0; }

.whatsapp-order-link { color: var(--success); font-size: 0.88rem; font-weight: 600; }

.tabs-section { padding: 20px 0; }
.tabs-head { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab-btn { padding: 11px 18px; font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.desc-block p { font-size: 0.92rem; line-height: 1.8; color: var(--text-secondary); }
.desc-divider { height: 1px; background: var(--border); margin: 18px 0; }
.specs-table { width: 100%; border-collapse: collapse; }
.specs-table tr { border-bottom: 1px solid var(--border); }
.specs-table td { padding: 10px 8px; font-size: 0.88rem; }
.spec-key { color: var(--text-secondary); width: 40%; }
.spec-val { font-weight: 600; }

.toc-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 18px; border-radius: var(--radius-md); background: var(--bg-card); border: 1px solid var(--border); font-weight: 600; }
.toc-toggle svg { transition: transform 0.25s ease; color: var(--gold); }
.toc-toggle.open svg { transform: rotate(180deg); }
.toc-body { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
.toc-body.open { max-height: 600px; padding-top: 12px; }
.toc-body ol { padding-left: 22px; }
.toc-body li { font-size: 0.88rem; color: var(--text-secondary); padding: 6px 0; }

.yt-embed-wrap { position: relative; aspect-ratio: 16/9; border-radius: var(--radius-md); overflow: hidden; margin-bottom: 14px; }
.yt-embed-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

.reviews-section { padding: 20px 0; }
.reviews-summary { display: flex; flex-wrap: wrap; gap: 30px; padding: 20px; border-radius: var(--radius-lg); background: var(--bg-card); border: 1px solid var(--border); margin-bottom: 20px; }
.reviews-avg { text-align: center; min-width: 100px; }
.reviews-avg-num { font-size: 2.4rem; font-weight: 700; color: var(--gold); font-family: "Cormorant Garamond", serif; }
.reviews-breakdown { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.breakdown-row { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--text-secondary); }
.breakdown-bar { flex: 1; height: 6px; border-radius: 4px; background: var(--bg-secondary); overflow: hidden; }
.breakdown-fill { height: 100%; background: var(--gold); }
.review-item { padding: 16px; margin-bottom: 12px; }
.review-item-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.suggested-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (min-width: 640px) { .suggested-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .suggested-grid { grid-template-columns: repeat(6, 1fr); } }
.suggested-grid .book-card { width: 100%; }

#lightbox-overlay { z-index: 3000; }

/* ============================================================
   AUTHORS / PUBLISHERS LIST PAGES
   ============================================================ */
.people-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; padding: 16px 0 20px; }
@media (min-width: 640px) { .people-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .people-grid { grid-template-columns: repeat(4, 1fr); } }
.people-card-lg { padding: 24px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.people-avatar-lg { width: 80px; height: 80px; border-radius: 50%; background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; color: var(--gold); overflow: hidden; margin-bottom: 12px; }
.people-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.people-name-lg { font-weight: 700; font-size: 0.98rem; line-height: 1.35; }
.people-count-lg { font-size: 0.78rem; color: var(--gold); margin-top: 6px; font-weight: 600; }

/* ============================================================
   AUTHOR / PUBLISHER DETAIL PAGES
   ============================================================ */
.person-card-detail { max-width: 680px; margin: 20px auto; padding: 32px 26px; text-align: center; }
.person-avatar-xl { width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 12px; background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; color: var(--gold); overflow: hidden; }
.person-avatar-xl img { width: 100%; height: 100%; object-fit: cover; }
.person-role-label { font-size: 0.76rem; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.person-name-xl { font-size: clamp(1.3rem, 3vw, 1.7rem); font-weight: 700; margin-bottom: 18px; }

.person-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; text-align: left; margin-bottom: 20px; padding: 16px; border-radius: var(--radius-md); background: var(--bg-secondary); }
@media (max-width: 480px) { .person-meta-grid { grid-template-columns: 1fr; } }
.meta-item { display: flex; flex-direction: column; gap: 2px; }
.meta-key { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.meta-val { font-size: 0.88rem; font-weight: 600; color: var(--text-primary); }

.person-bio-block { text-align: left; margin-bottom: 20px; }
.person-bio-text { font-size: 0.9rem; line-height: 1.8; color: var(--text-secondary); }
.person-bio-text.clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bio-toggle-btn { color: var(--gold); font-size: 0.82rem; font-weight: 600; margin-top: 8px; }

.mini-section-heading { font-size: 0.95rem; font-weight: 700; margin: 20px 0 12px; text-align: left; }
.mini-books-row { display: flex; gap: 12px; overflow-x: auto; }
.mini-book-card { flex: 0 0 100px; text-align: center; }
.mini-book-card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 6px; }
.mini-book-card span { font-size: 0.76rem; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ============================================================
   CATEGORIES PAGE (categories.html)
   ============================================================ */
.categories-full-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; padding: 10px 0 40px; }
@media (min-width: 640px) { .categories-full-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .categories-full-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1180px) { .categories-full-grid { grid-template-columns: repeat(5, 1fr); } }
.category-card-full {
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  padding: 22px 14px; border-radius: var(--radius-lg); background: var(--bg-card); border: 1px solid var(--gold-border);
  transition: var(--transition);
}
.category-card-full:hover { border-color: var(--gold); box-shadow: var(--shadow-gold); transform: translateY(-4px); }
.category-icon-circle { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.category-icon-circle svg { width: 26px; height: 26px; color: var(--gold); }
.category-name-full { font-weight: 700; font-size: 0.92rem; }
.category-count-full { font-size: 0.76rem; color: var(--text-muted); }

/* ============================================================
   CART PAGE (cart.html)
   ============================================================ */
.cart-title { font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: clamp(1.4rem, 3vw, 1.8rem); padding: 20px 0 4px; }

.multihub-notice { padding: 14px 18px; font-size: 0.85rem; color: var(--gold); margin-bottom: 16px; border-color: var(--gold-border); }

.cart-items-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.cart-item { display: flex; gap: 14px; padding: 14px; }
.cart-item-img { flex-shrink: 0; width: 76px; }
.cart-item-img img { width: 76px; height: 114px; object-fit: cover; border-radius: var(--radius-sm); }
.cart-item-body { flex: 1; min-width: 0; }
.cart-item-title { font-weight: 700; font-size: 0.92rem; display: block; }
.cart-item-author { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }
.cart-item-price { margin-top: 6px; display: flex; align-items: baseline; gap: 8px; }
.cart-item-price .now { font-weight: 700; color: var(--gold); }
.cart-item-price .was { font-size: 0.78rem; color: var(--text-muted); text-decoration: line-through; }
.cart-item-controls { display: flex; align-items: center; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.cart-link-btn { font-size: 0.78rem; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; }
.cart-link-btn:hover { color: var(--gold); }
.cart-remove-btn:hover { color: var(--error); }

.coupon-row { display: flex; gap: 10px; margin-bottom: 6px; }
.coupon-row input { flex: 1; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--gold-border); background: var(--bg-secondary); color: var(--text-primary); font-size: 0.88rem; }
.coupon-row input:focus { outline: none; border-color: var(--gold); }

.order-summary { padding: 20px; margin: 18px 0; }
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.9rem; color: var(--text-secondary); }
.summary-divider { height: 1px; background: var(--border); margin: 8px 0; }
.summary-total { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.summary-total span:last-child { color: var(--gold); }

.cart-actions-col { display: flex; flex-direction: column; gap: 12px; align-items: center; margin-top: 20px; }
.cart-actions-col .btn { width: 100%; max-width: 420px; }
.continue-shopping-link { font-size: 0.85rem; color: var(--text-secondary); }
.continue-shopping-link:hover { color: var(--gold); }

/* ============================================================
   LOGIN / REGISTER PAGE (login.html)
   ============================================================ */
.auth-main { display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px 60px; min-height: 60vh; }
.auth-card { width: 100%; max-width: 460px; padding: 30px 26px; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 24px; background: var(--bg-secondary); border-radius: 999px; padding: 4px; }
.auth-tab { flex: 1; padding: 10px; border-radius: 999px; font-weight: 600; font-size: 0.9rem; color: var(--text-secondary); }
.auth-tab.active { background: linear-gradient(135deg, var(--gold-light), var(--gold-dark)); color: #14100A; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--text-secondary); font-weight: 600; min-width: 0; }
.auth-label input, .auth-label select, .auth-label textarea { width: 100%; min-width: 0; }
.auth-label input, .auth-label select {
  padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--gold-border);
  background: var(--bg-secondary); color: var(--text-primary); font-size: 0.92rem; font-weight: 400;
  appearance: none; -webkit-appearance: none;
}
.auth-label select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C9A84C' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; padding-right: 36px;
}
.auth-label input:focus, .auth-label select:focus { outline: none; border-color: var(--gold); }
.password-field { position: relative; display: flex; }
.password-field input { flex: 1; padding-right: 42px; }
.password-eye { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.password-eye:hover { color: var(--gold); }
.text-link-btn { color: var(--gold); font-size: 0.85rem; font-weight: 600; text-align: center; }
.text-link-btn:hover { text-decoration: underline; }
.minimal-footer { border-top: 1px solid var(--border); }

/* ============================================================
   PROFILE PAGE (profile.html)
   ============================================================ */
.profile-header-card { display: flex; align-items: center; gap: 16px; padding: 22px; margin: 18px 0; flex-wrap: wrap; }
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; color: var(--gold); flex-shrink: 0; }
.profile-header-info h1 { font-size: 1.2rem; font-weight: 700; }
.profile-cust-id { font-size: 0.78rem; color: var(--gold); font-weight: 600; margin-top: 2px; }
.profile-contact, .profile-member-since { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }

.profile-tabs { display: flex; gap: 6px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.profile-tab { flex: 1; text-align: center; padding: 11px 8px; font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.profile-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

.order-filter-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 14px; }
.order-card { padding: 18px; margin-bottom: 14px; }
.order-card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.order-number { font-weight: 700; }
.order-date { font-size: 0.78rem; color: var(--text-muted); }
.order-status-badge { font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid; display: inline-block; }
.order-total { font-weight: 700; color: var(--gold); margin-top: 6px; }
.order-detail-wrap { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.shipment-card { padding: 14px; border-radius: var(--radius-md); background: var(--bg-secondary); }
.shipment-head { display: flex; justify-content: space-between; font-weight: 600; font-size: 0.88rem; margin-bottom: 6px; }
.shipment-status { font-size: 0.78rem; font-weight: 700; }
.shipment-tracking { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 4px; }
.shipment-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.settings-block { padding: 22px; margin-bottom: 18px; }
.settings-heading { font-size: 1rem; font-weight: 700; margin-bottom: 16px; }
.settings-heading-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.settings-heading-row .settings-heading { margin-bottom: 0; }
.address-item { display: flex; justify-content: space-between; gap: 10px; padding: 14px; border-radius: var(--radius-md); background: var(--bg-secondary); margin-bottom: 10px; font-size: 0.85rem; }
.address-item p { color: var(--text-secondary); margin-top: 4px; }
.address-item.is-default { border: 1px solid var(--gold-border); }
.default-badge { font-size: 0.68rem; color: var(--gold); border: 1px solid var(--gold-border); padding: 2px 8px; border-radius: 999px; margin-left: 6px; }
.address-item-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.address-item-actions button { font-size: 0.78rem; color: var(--gold); }
.address-item-actions button:last-child { color: var(--error); }

/* ============================================================
   CHECKOUT PAGE (checkout.html)
   ============================================================ */
.checkout-section { padding: 20px; margin-bottom: 16px; }
.checkout-textarea { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--gold-border); background: var(--bg-secondary); color: var(--text-primary); font-family: inherit; font-size: 0.92rem; resize: vertical; }
.saved-address-option { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: var(--radius-md); background: var(--bg-secondary); margin-bottom: 8px; font-size: 0.85rem; cursor: pointer; }
.saved-address-option input { width: auto; margin-top: 3px; }

.checkout-item-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.checkout-item-row img { width: 40px; height: 60px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.checkout-item-info { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 0.86rem; }
.checkout-item-qty { font-size: 0.76rem; color: var(--text-muted); }
.checkout-item-price { font-weight: 700; color: var(--gold); font-size: 0.88rem; }

.pay-method-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.pay-method-option { display: flex; align-items: flex-start; gap: 10px; padding: 14px; border-radius: var(--radius-md); border: 1px solid var(--gold-border); font-size: 0.88rem; cursor: pointer; }
.pay-method-option input { width: auto; margin-top: 3px; }
.payment-details-panel { padding: 14px; border-radius: var(--radius-md); background: var(--bg-secondary); }
.pay-detail-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 0.85rem; }
.pay-detail-row span:first-child { color: var(--text-muted); min-width: 100px; }
.pay-detail-row code { color: var(--gold); font-weight: 600; }
.copy-btn { margin-left: auto; font-size: 0.76rem; color: var(--gold); border: 1px solid var(--gold-border); padding: 3px 10px; border-radius: 999px; }
.qr-preview-img { width: 140px; height: 140px; object-fit: contain; border-radius: var(--radius-sm); margin: 10px 0; background: #fff; padding: 6px; }
.proof-toggle-row { display: flex; gap: 8px; }
.auth-label-plain-input { width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--gold-border); background: var(--bg-secondary); color: var(--text-primary); font-size: 0.92rem; }
#payment-screenshot-input { font-size: 0.82rem; color: var(--text-secondary); }

/* ============================================================
   ORDER SUCCESS PAGE (order-success.html)
   ============================================================ */
.success-icon { width: 72px; height: 72px; border-radius: 50%; background: rgba(16,185,129,0.15); color: var(--success); display: flex; align-items: center; justify-content: center; margin: 30px auto 16px; }
.success-heading { font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 1.7rem; }
.success-arabic { font-family: "Amiri", serif; color: var(--gold); font-size: 1.2rem; margin-top: 10px; }
.success-sub { color: var(--text-secondary); font-size: 0.9rem; margin-top: 8px; line-height: 1.7; }
.order-id-card { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px; margin: 22px 0; font-size: 0.9rem; }
.order-id-card strong { color: var(--gold); font-size: 1rem; }
.success-footnote { font-size: 0.8rem; color: var(--text-muted); margin-top: 18px; }

/* ============================================================
   404 PAGE (404.html)
   ============================================================ */
.notfound-illustration { color: var(--gold-border); margin: 30px auto 4px; }
.notfound-404 {
  font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: clamp(3.2rem, 12vw, 5rem);
  background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
  -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1;
}
.notfound-heading { font-size: clamp(1.2rem, 3vw, 1.5rem); font-weight: 700; margin-top: 10px; max-width: 480px; margin-left: auto; margin-right: auto; }
.notfound-sub { color: var(--text-secondary); font-size: 0.9rem; margin-top: 12px; max-width: 440px; margin-left: auto; margin-right: auto; }
.notfound-wisdom { font-style: italic; color: var(--gold); font-size: 0.88rem; margin-top: 14px; }
.notfound-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

/* ============================================================
   TRACK ORDER PAGE (track.html)
   ============================================================ */
.track-form { padding: 24px 22px; display: flex; flex-direction: column; gap: 16px; margin-top: 10px; }
.track-order-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px; margin-bottom: 14px; }
.shipment-card-full { padding: 18px; margin-bottom: 14px; }
.track-timeline { display: flex; align-items: center; margin: 16px 0; }
.track-timeline-step { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; text-align: center; }
.track-timeline-step::before {
  content: ""; position: absolute; top: 6px; left: -50%; width: 100%; height: 2px; background: var(--border); z-index: -1;
}
.track-timeline-step:first-child::before { display: none; }
.track-timeline-step.done::before { background: var(--gold); }
.track-timeline-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--bg-secondary); border: 2px solid var(--border); }
.track-timeline-step.done .track-timeline-dot { background: var(--gold); border-color: var(--gold); }
.track-timeline-step.active .track-timeline-dot { box-shadow: 0 0 0 4px var(--gold-glow); animation: pulseDot 1.5s ease-in-out infinite; }
@keyframes pulseDot { 0%,100% { box-shadow: 0 0 0 4px var(--gold-glow); } 50% { box-shadow: 0 0 0 7px var(--gold-glow); } }
.track-timeline-label { font-size: 0.68rem; color: var(--text-muted); margin-top: 6px; }
.track-timeline-step.done .track-timeline-label { color: var(--gold); font-weight: 600; }
.track-order-details { padding: 18px; margin-top: 6px; }

/* Author / Publisher cards */
.people-scroll { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.people-card { flex: 0 0 150px; padding: 18px 12px; text-align: center; }
.people-avatar { width: 68px; height: 68px; border-radius: 50%; margin: 0 auto 10px; background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; color: var(--gold); overflow: hidden; }
.people-avatar img { width: 100%; height: 100%; object-fit: cover; }
.people-name { font-size: 0.88rem; font-weight: 700; line-height: 1.3; }
.people-name-en { font-size: 0.72rem; color: var(--text-secondary); margin-top: 2px; }
.people-meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }
.people-count { font-size: 0.72rem; color: var(--gold); margin-top: 6px; font-weight: 600; }

/* ============================================================
   REVIEWS
   ============================================================ */
.reviews-wrap { padding: 40px 0; }
.review-track { position: relative; max-width: 640px; margin: 0 auto; min-height: 190px; }
.review-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.6s ease; padding: 26px; text-align: center; }
.review-slide.active { opacity: 1; position: relative; }
.review-stars { display: flex; justify-content: center; gap: 4px; margin-bottom: 12px; }
.review-stars svg { width: 16px; height: 16px; fill: var(--gold); }
.review-comment { font-size: 0.95rem; color: var(--text-primary); line-height: 1.7; }
.review-meta { margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 0.82rem; color: var(--text-secondary); }
.verified-badge { display: inline-flex; align-items: center; gap: 3px; color: var(--success); font-weight: 600; }
.verified-badge svg { width: 13px; height: 13px; }

/* ============================================================
   COMING SOON BANNER
   ============================================================ */
.coming-soon-banner { padding: 20px 0 40px; }
.cs-card { max-width: 780px; margin: 0 auto; padding: 30px; text-align: center; }
.cs-preview-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 16px 0 20px; }
.cs-chip { font-size: 0.75rem; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--gold-border); color: var(--text-secondary); }

/* ============================================================
   APP BANNER (footer strip)
   ============================================================ */
.app-banner { background: var(--bg-secondary); border-top: 1px solid var(--border); padding: 16px 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.app-banner p { font-size: 0.85rem; color: var(--text-secondary); }

/* ============================================================
   FOOTER
   ============================================================ */
footer { background: var(--bg-secondary); border-top: 2px solid var(--gold-border); padding: 50px 0 0; margin-bottom: var(--bottom-nav-h); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1.1fr; gap: 26px; padding-bottom: 34px; }
.footer-col h4 { font-size: 0.85rem; color: var(--gold); margin-bottom: 14px; letter-spacing: 0.6px; text-transform: uppercase; }
.footer-col ul li { margin-bottom: 9px; }
.footer-col ul li a { font-size: 0.87rem; color: var(--text-secondary); }
.footer-col ul li a:hover { color: var(--gold); }
.drawer-logo-img { width: 32px; height: 32px; object-fit: contain; }
.footer-logo-img { width: 52px; height: 52px; object-fit: contain; }
.footer-logo-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.footer-brand-name { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); }
.footer-arabic { font-family: "Amiri", serif; color: var(--gold); font-size: 1.1rem; }
.footer-tagline { font-family: "DM Sans", sans-serif; font-style: italic; font-size: 0.8rem; color: var(--text-secondary); margin-top: 6px; }
.footer-socials { display: flex; gap: 10px; margin-top: 16px; }
.footer-socials a { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--gold-border); display: flex; align-items: center; justify-content: center; }
.footer-socials a:hover { background: var(--gold-glow); }
.footer-socials svg { width: 16px; height: 16px; color: var(--gold); }
.footer-bottom { border-top: 1px solid var(--border); text-align: center; padding: 16px 20px; font-size: 0.78rem; color: var(--text-muted); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
@media (max-width: 767px) {
  .footer-grid { text-align: center; }
  .footer-logo-row { flex-direction: column; justify-content: center; }
  .footer-socials { justify-content: center; }
}

/* ============================================================
   BOTTOM NAV (mobile)
   ============================================================ */
#bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 600;
  background: var(--bg-card); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-top: 1px solid var(--border); display: none;
  height: var(--bottom-nav-h); padding-bottom: env(safe-area-inset-bottom);
  overflow: visible;
}
#bottom-nav .bn-inner { display: flex; height: 100%; overflow: visible; }
#bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-secondary); font-size: 0.62rem; font-weight: 600; position: relative;
}
#bottom-nav a .bn-icon-wrap {
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: var(--transition);
}
#bottom-nav a svg { width: 21px; height: 21px; transition: var(--transition); }
#bottom-nav a.active { color: var(--gold); }
#bottom-nav a.active .bn-icon-wrap {
  position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  width: 46px; height: 46px; background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
  box-shadow: 0 6px 18px var(--gold-glow), 0 0 0 4px var(--bg-primary);
}
#bottom-nav a.active .bn-icon-wrap svg { width: 22px; height: 22px; color: #14100A; }
#bottom-nav a.active span.bn-label { margin-top: 20px; }
@media (max-width: 767px) {
  #bottom-nav { display: block; }
  body { padding-bottom: var(--bottom-nav-h); }
}

/* ============================================================
   WHATSAPP FLOAT
   ============================================================ */
#wa-float {
  position: fixed; right: 18px; bottom: calc(var(--bottom-nav-h) + 18px); z-index: 550;
  width: 54px; height: 54px; border-radius: 50%; background: #25D366;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  opacity: 0; transform: scale(0.7); transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}
#wa-float.show { opacity: 1; transform: scale(1); pointer-events: auto; }
#wa-float svg { width: 28px; height: 28px; color: #fff; }
@media (min-width: 768px) { #wa-float { bottom: 22px; } }

/* ============================================================
   SEARCH BAR (home)
   ============================================================ */
.search-wrap { padding: 18px 0 6px; }
.search-box { position: relative; max-width: 700px; margin: 0 auto; }
.search-box input {
  width: 100%; padding: 14px 46px 14px 18px; border-radius: 999px;
  background: var(--bg-card); border: 1.5px solid var(--gold-border); color: var(--text-primary);
  font-size: 0.92rem; backdrop-filter: var(--blur);
}
.search-box input:focus { outline: none; border-color: var(--gold); }
.search-box .search-icon { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--gold); }
.search-results-drop {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; max-height: 340px; overflow-y: auto;
  z-index: 60; display: none; padding: 8px;
}
.search-results-drop.open { display: block; }
.sr-item { display: flex; gap: 10px; padding: 8px; border-radius: var(--radius-sm); align-items: center; }
.sr-item:hover { background: var(--gold-glow); }
.sr-item img { width: 34px; height: 48px; object-fit: cover; border-radius: 4px; flex-shrink: 0; background: var(--bg-secondary); }
.sr-item .sr-title { font-size: 0.85rem; font-weight: 600; }
.sr-item .sr-sub { font-size: 0.72rem; color: var(--text-secondary); }

/* Skeleton loading */
.skel { background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--gold-glow) 50%, var(--bg-secondary) 75%); background-size: 200% 100%; animation: skelShine 1.5s infinite; border-radius: var(--radius-sm); }
@keyframes skelShine { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Visible focus for accessibility */
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Notify Me mini form (Android banner, out-of-stock etc.) */
.notify-form { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; text-align: left; }
.notify-form input { padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--gold-border); background: var(--bg-secondary); color: var(--text-primary); font-size: 0.88rem; }
.notify-form input:focus { outline: none; border-color: var(--gold); }
.form-msg { font-size: 0.82rem; margin-top: 6px; }
.form-msg.success { color: var(--success); }
.form-msg.error { color: var(--error); }

@media (max-width: 767px) {
  .navbar-right .lang-dd-toggle { padding: 7px 9px; font-size: 0.72rem; }
}
