@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Outfit:wght@300;400;500;600;700&display=swap');

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

:root {
  --bg: #FAF7F2;
  --fg: #1A0A2E;
  --primary: #7C3A8E;
  --primary-dark: #6a3079;
  --accent: #C9956C;
  --plum: #2D1242;
  --plum-deep: #1A0A2E;
  --card: #fff;
  --muted: #F0EAF6;
  --muted-fg: #7B6F85;
  --border: #E8DFF0;
  --radius: 1rem;
  --shadow: 0 4px 24px rgba(44,18,66,0.08);
  --shadow-lg: 0 12px 48px rgba(44,18,66,0.14);
}

html { scroll-behavior: smooth; }
body { font-family: 'Outfit', sans-serif; background: var(--bg); color: var(--fg); line-height: 1.7; }
h1,h2,h3,h4 { font-family: 'DM Serif Display', serif; line-height: 1.2; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── NAVBAR ── */
.navbar {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 200;
  transition: box-shadow 0.3s;
}
.navbar.scrolled { box-shadow: 0 4px 24px rgba(44,18,66,0.1); }
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 1.5rem; height: 68px;
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
}
.logo { display: flex; align-items: baseline; gap: 0.4rem; text-decoration: none; }
.logo-name { font-family: 'DM Serif Display', serif; font-size: 1.65rem; color: var(--primary); }
.logo-tag { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 0.25rem; list-style: none; }
.nav-links a {
  font-size: 0.875rem; font-weight: 500; color: var(--muted-fg);
  padding: 0.45rem 0.85rem; border-radius: 999px;
  transition: color 0.2s, background 0.2s; text-decoration: none;
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); background: var(--muted); }
.nav-actions { display: flex; align-items: center; gap: 0.75rem; }
.cart-btn {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--primary); color: #fff;
  border: none; border-radius: 999px;
  padding: 0.5rem 1.1rem 0.5rem 0.85rem;
  font-family: 'Outfit', sans-serif; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: background 0.2s; position: relative;
}
.cart-btn:hover { background: var(--primary-dark); }
.cart-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cart-count {
  background: var(--accent); color: #fff;
  border-radius: 999px; font-size: 0.7rem; font-weight: 700;
  min-width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 0.4rem; }
.hamburger svg { width: 24px; height: 24px; stroke: var(--fg); fill: none; stroke-width: 2; stroke-linecap: round; }

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, var(--plum-deep) 0%, var(--plum) 50%, #5A2070 100%);
  padding: 7rem 1.5rem 5rem; text-align: center; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -120px; right: -120px;
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,149,108,0.18) 0%, transparent 70%);
}
.hero::after {
  content: ''; position: absolute; bottom: -80px; left: -80px;
  width: 350px; height: 350px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,142,0.3) 0%, transparent 70%);
}
.hero-inner { position: relative; max-width: 780px; margin: 0 auto; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(201,149,108,0.2); border: 1px solid rgba(201,149,108,0.5);
  border-radius: 999px; padding: 0.4rem 1rem;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1.5rem;
}
.hero h1, .hero-inner h1 { font-size: clamp(2.4rem, 5vw, 4rem); color: #fff !important; margin-bottom: 1.25rem; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-sub { font-size: clamp(1rem, 2vw, 1.15rem); color: rgba(255,255,255,0.72); line-height: 1.75; max-width: 560px; margin: 0 auto 2.5rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin-bottom: 3rem; }
.hero-wave { margin-top: 2rem; }
.hero-wave svg { display: block; width: 100%; }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.9rem; border-radius: 999px; padding: 0.8rem 1.8rem; transition: all 0.2s; text-decoration: none; cursor: pointer; border: none; font-family: 'Outfit', sans-serif; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(124,58,142,0.35); text-decoration: none; }
.btn-outline { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.4); }
.btn-outline:hover { background: rgba(255,255,255,0.1); text-decoration: none; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #b8844f; transform: translateY(-1px); text-decoration: none; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* ── SECTION WRAPPER ── */
.section { padding: 5rem 1.5rem; }
.section-sm { padding: 3rem 1.5rem; }
.container { max-width: 1200px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-tag { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.75rem; }
.section-title { font-size: clamp(1.75rem, 3.5vw, 2.75rem); color: var(--fg); margin-bottom: 0.75rem; }
.section-sub { font-size: 1rem; color: var(--muted-fg); max-width: 540px; margin: 0 auto; line-height: 1.7; }

/* ── BOOK CARD ── */
.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.5rem; }
.book-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 1.25rem;
  overflow: hidden; transition: transform 0.25s, box-shadow 0.25s; display: flex; flex-direction: column;
}
.book-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.book-cover { aspect-ratio: 4/5; overflow: hidden; position: relative; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.book-card:hover .book-cover img { transform: scale(1.04); }
.book-badge {
  position: absolute; top: 12px; left: 12px;
  background: var(--primary); color: #fff;
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
}
.book-badge.new { background: var(--accent); }
.book-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.book-cat { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.4rem; }
.book-title { font-family: 'DM Serif Display', serif; font-size: 1.1rem; color: var(--fg); margin-bottom: 0.4rem; line-height: 1.3; }
.book-rating { display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.75rem; }
.stars { color: #F59E0B; font-size: 0.75rem; }
.rating-num { font-size: 0.75rem; color: var(--muted-fg); }
.book-price { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 1rem; }
.price-main { font-size: 1.4rem; font-weight: 700; color: var(--fg); }
.price-old { font-size: 0.82rem; color: var(--muted-fg); text-decoration: line-through; }
.book-actions { display: flex; gap: 0.5rem; margin-top: auto; }
.btn-add { flex: 1; background: var(--primary); color: #fff; border: none; border-radius: 999px; padding: 0.65rem 1rem; font-family: 'Outfit', sans-serif; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.btn-add:hover { background: var(--primary-dark); }
.btn-preview { background: var(--muted); color: var(--primary); border: none; border-radius: 999px; padding: 0.65rem 0.9rem; font-family: 'Outfit', sans-serif; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.btn-preview:hover { background: var(--border); }

/* ── CART DRAWER ── */
.cart-backdrop { position: fixed; inset: 0; background: rgba(26,10,46,0.5); backdrop-filter: blur(4px); z-index: 300; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.cart-backdrop.open { opacity: 1; pointer-events: all; }
.cart-drawer {
  position: fixed; top: 0; right: -440px; width: min(440px, 100vw); height: 100vh;
  background: #fff; z-index: 400; transition: right 0.35s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column; box-shadow: -8px 0 40px rgba(0,0,0,0.15);
}
.cart-drawer.open { right: 0; }
.cart-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.cart-header h3 { font-size: 1.1rem; }
.cart-close { background: none; border: none; cursor: pointer; padding: 0.25rem; color: var(--muted-fg); }
.cart-close svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.cart-items-wrap { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; }
.cart-item { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.cart-item img { width: 64px; height: 80px; object-fit: cover; border-radius: 0.5rem; flex-shrink: 0; }
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 0.9rem; font-weight: 600; color: var(--fg); margin-bottom: 0.2rem; }
.cart-item-cat { font-size: 0.75rem; color: var(--muted-fg); margin-bottom: 0.5rem; }
.cart-item-footer { display: flex; justify-content: space-between; align-items: center; }
.cart-item-price { font-weight: 700; font-size: 0.95rem; }
.cart-remove { background: none; border: none; cursor: pointer; color: var(--muted-fg); padding: 0.2rem; }
.cart-remove:hover { color: #dc2626; }
.cart-remove svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.cart-empty { text-align: center; padding: 3rem 1rem; color: var(--muted-fg); }
.cart-empty svg { width: 48px; height: 48px; stroke: var(--border); fill: none; stroke-width: 1.5; margin: 0 auto 1rem; }
.cart-footer { padding: 1.25rem 1.5rem; border-top: 1px solid var(--border); background: var(--bg); }
.cart-row { display: flex; justify-content: space-between; font-size: 0.875rem; color: var(--muted-fg); margin-bottom: 0.5rem; }
.cart-row.free span:last-child { color: #16a34a; font-weight: 600; }
.cart-total-row { display: flex; justify-content: space-between; padding-top: 0.75rem; border-top: 1px solid var(--border); margin-bottom: 1.25rem; }
.cart-total-row span:first-child { font-weight: 600; }
.cart-total-row span:last-child { font-family: 'DM Serif Display', serif; font-size: 1.5rem; }
.btn-checkout { width: 100%; background: var(--primary); color: #fff; border: none; border-radius: 10px; padding: 0.8rem 1.25rem; font-family: 'Outfit', sans-serif; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: background 0.2s; display: flex; align-items: center; justify-content: center; gap: 0.5rem; line-height: 1.4; box-sizing: border-box; }
.btn-checkout svg { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.btn-checkout:hover { background: var(--primary-dark); }
.cart-secure { font-size: 0.75rem; color: var(--muted-fg); text-align: center; margin-top: 0.75rem; display: flex; align-items: center; justify-content: center; gap: 0.4rem; }
.cart-secure svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ── FOOTER ── */
footer { background: var(--plum-deep); color: #fff; padding: 4rem 1.5rem 2rem; }
.footer-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
.footer-brand .logo-name { color: #fff; }
.footer-brand p { font-size: 0.875rem; color: rgba(255,255,255,0.45); line-height: 1.7; margin-top: 0.75rem; max-width: 260px; }
.footer-col h4 { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: rgba(255,255,255,0.4); margin-bottom: 1rem; font-family: 'Outfit', sans-serif; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.footer-col a { font-size: 0.875rem; color: rgba(255,255,255,0.55); text-decoration: none; transition: color 0.2s; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { max-width: 1200px; margin: 0 auto; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.08); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-bottom p { font-size: 0.8rem; color: rgba(255,255,255,0.3); }
.footer-badges { display: flex; gap: 0.5rem; align-items: center; }
.badge-pill { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 999px; padding: 0.3rem 0.75rem; font-size: 0.7rem; color: rgba(255,255,255,0.4); font-weight: 500; }

/* ── PAGE HERO (inner pages) ── */
.page-hero { background: var(--plum); padding: 4.5rem 1.5rem 3rem; text-align: center; position: relative; overflow: hidden; }
.page-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 60% 50%, rgba(124,58,142,0.6) 0%, transparent 65%); }
.page-hero-inner { position: relative; max-width: 700px; margin: 0 auto; }
.page-hero h1 { font-size: clamp(2rem, 4vw, 3.25rem); color: #fff; margin-bottom: 0.75rem; }
.page-hero p { color: rgba(255,255,255,0.65); font-size: 1rem; line-height: 1.7; }
.hero-wave svg { display: block; width: 100%; }

/* ── TRUST STRIP ── */
.trust-strip { background: #fff; border-bottom: 1px solid var(--border); padding: 1rem 1.5rem; }
.trust-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: center; gap: 2.5rem; flex-wrap: wrap; }
.trust-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; font-weight: 500; color: var(--muted-fg); }
.trust-item svg { width: 16px; height: 16px; stroke: var(--primary); fill: none; stroke-width: 2; stroke-linecap: round; }

/* ── MODAL ── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(26,10,46,0.6); backdrop-filter: blur(6px); z-index: 500; opacity: 0; pointer-events: none; transition: opacity 0.3s; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal { background: #fff; border-radius: 1.5rem; max-width: 700px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); transform: scale(0.95); transition: transform 0.3s; }
.modal-backdrop.open .modal { transform: scale(1); }
.modal-grid { display: grid; grid-template-columns: 220px 1fr; }
.modal-img { border-radius: 1.5rem 0 0 1.5rem; overflow: hidden; }
.modal-img img { width: 100%; height: 100%; object-fit: cover; }
.modal-body { padding: 2rem; }
.modal-close { float: right; background: var(--muted); border: none; border-radius: 999px; width: 32px; height: 32px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--muted-fg); }
.modal-close svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; }
.modal-cat { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); margin-bottom: 0.5rem; }
.modal-title { font-family: 'DM Serif Display', serif; font-size: 1.6rem; margin-bottom: 0.5rem; }
.modal-price-row { display: flex; align-items: baseline; gap: 0.75rem; margin: 1rem 0; }
.modal-price-main { font-size: 2rem; font-weight: 700; }
.modal-price-old { font-size: 0.9rem; color: var(--muted-fg); text-decoration: line-through; }
.modal-save { background: #dcfce7; color: #166534; font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.modal-desc { font-size: 0.9rem; color: var(--muted-fg); line-height: 1.7; margin-bottom: 1rem; }
.modal-highlights { list-style: none; margin-bottom: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.modal-highlights li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--fg); }
.modal-highlights li::before { content: '✓'; color: var(--primary); font-weight: 700; }
.modal-meta { display: flex; gap: 1.5rem; margin-bottom: 1.5rem; }
.modal-meta-item { font-size: 0.78rem; color: var(--muted-fg); }
.modal-meta-item strong { color: var(--fg); display: block; font-size: 0.9rem; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .modal-grid { grid-template-columns: 1fr; }
  .modal-img { border-radius: 1.5rem 1.5rem 0 0; height: 220px; }
}
@media (max-width: 700px) {
  .nav-links { display: none; position: fixed; top: 68px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 1rem; border-bottom: 1px solid var(--border); gap: 0; }
  .nav-links.open { display: flex; }
  .hamburger { display: block; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero { padding: 4rem 1.5rem 3rem; }
  .books-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
