/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0f;
  --bg-alt: #0d0d14;
  --bg-card: #14141f;
  --bg-card-hover: #1a1a2a;
  --border: rgba(120, 40, 180, 0.15);
  --border-hover: rgba(120, 40, 180, 0.4);
  --text: #d4cfc8;
  --text-muted: #6b6b7b;
  --accent: #a855f7;
  --accent-glow: rgba(168, 85, 247, 0.5);
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-full: 9999px;
  --shadow-card: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-hover: 0 20px 60px rgba(120,40,180,0.25);
  --font-display: 'Playfair Display', 'Creepster', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-creepy: 'Creepster', cursive;
  --max-width: 1200px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== TYPOGRAPHY ===== */
.text-accent { color: var(--accent); }
.text-center { text-align: center; }

/* ===== HEADER ===== */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 68px;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--text);
}
.logo-icon { font-size: 28px; }
.logo-text {
  font-family: var(--font-creepy);
  font-size: 24px; letter-spacing: 1px;
}

.nav { display: flex; gap: 32px; }
.nav-link {
  color: var(--text-muted); text-decoration: none;
  font-size: 14px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.5px; transition: color 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  background: none; border: none; color: var(--text-muted);
  font-size: 20px; cursor: pointer; position: relative;
  padding: 8px; border-radius: var(--radius-sm); transition: all 0.2s;
}
.icon-btn:hover { color: var(--accent); background: rgba(168,85,247,0.1); }

.cart-btn { position: relative; }
.cart-count {
  position: absolute; top: 0; right: 0;
  background: var(--accent); color: white; font-size: 10px;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; transition: transform 0.2s;
}
.cart-count.bump { transform: scale(1.3); }

.mobile-menu-btn {
  display: none; background: none; border: none;
  color: var(--text); font-size: 24px; cursor: pointer;
}

/* ===== CART SIDEBAR ===== */
.cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }

.cart-sidebar {
  position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 90vw;
  background: var(--bg-card); z-index: 201;
  transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
  box-shadow: -4px 0 40px rgba(0,0,0,0.5);
}
.cart-sidebar.open { transform: translateX(0); }

.cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.cart-header h2 { font-family: var(--font-display); font-size: 22px; }
.cart-items { flex: 1; overflow-y: auto; padding: 16px 24px; }
.cart-empty { color: var(--text-muted); text-align: center; padding: 40px 0; }

.cart-item {
  display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border);
  align-items: center;
}
.cart-item-emoji { font-size: 28px; }
.cart-item-info { flex: 1; }
.cart-item-title { font-weight: 600; font-size: 14px; }
.cart-item-price { color: var(--accent); font-weight: 700; font-size: 14px; }
.cart-item-remove {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 18px; padding: 4px 8px; transition: color 0.2s;
}
.cart-item-remove:hover { color: var(--danger); }

.cart-footer {
  padding: 20px 24px; border-top: 1px solid var(--border);
}
.cart-total {
  display: flex; justify-content: space-between;
  font-weight: 700; font-size: 18px; margin-bottom: 12px;
}
.cart-total-price { color: var(--accent); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 28px; border-radius: var(--radius-sm); font-size: 15px;
  font-weight: 600; cursor: pointer; border: none; text-decoration: none;
  transition: all 0.2s; font-family: var(--font-body);
}
.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: white; box-shadow: 0 0 20px rgba(124,58,237,0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(124,58,237,0.5);
}
.btn-outline {
  background: transparent; color: var(--accent);
  border: 2px solid rgba(168,85,247,0.3);
}
.btn-outline:hover { border-color: var(--accent); background: rgba(168,85,247,0.1); }
.btn-lg { padding: 16px 36px; font-size: 17px; }
.btn-full { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ===== HERO ===== */
.hero {
  min-height: 100vh; display: flex; align-items: center;
  position: relative; overflow: hidden; padding-top: 68px;
}
.hero-bg {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(60,30,80,0.4) 0%, transparent 60%),
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><path d='M20 80 Q 40 20, 60 80 T 90 80' stroke='%237c3aed' fill='none' stroke-width='0.5' opacity='0.3'/></svg>");
  background-size: 100%, 120px 120px;
  pointer-events: none;
}
.hero-content { position: relative; z-index: 10; text-align: center; max-width: 800px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(168,85,247,0.1); border: 1px solid rgba(168,85,247,0.2);
  padding: 8px 20px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 500; color: var(--accent); margin-bottom: 32px;
}
.pulse-dot {
  width: 8px; height: 8px; background: var(--accent); border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}

.hero-title {
  font-family: var(--font-display); font-size: clamp(48px, 8vw, 96px);
  font-weight: 900; line-height: 1.1; margin-bottom: 24px;
}
.hero-subtitle {
  font-size: clamp(16px, 2.5vw, 20px); color: var(--text-muted);
  max-width: 640px; margin: 0 auto 40px;
}
.hero-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 56px; }
.hero-stats { display: flex; gap: 48px; justify-content: center; flex-wrap: wrap; }
.stat { text-align: center; }
.stat-num {
  display: block; font-family: var(--font-display);
  font-size: 36px; font-weight: 900; color: var(--accent);
}
.stat-label { font-size: 11px; color: var(--text-muted); letter-spacing: 2px; text-transform: uppercase; }

/* ===== SECTIONS ===== */
.section { padding: 100px 0; }
.section-alt { background: var(--bg-alt); }
.section-header { text-align: center; margin-bottom: 56px; }
.section-tag { color: var(--accent); font-size: 13px; letter-spacing: 3px; text-transform: uppercase; margin-bottom: 12px; }
.section-title {
  font-family: var(--font-display); font-size: clamp(36px, 5vw, 56px);
  font-weight: 700; margin-bottom: 12px;
}
.section-subtitle { color: var(--text-muted); max-width: 540px; margin: 0 auto; font-size: 16px; }
.section-cta { text-align: center; margin-top: 48px; }

/* ===== CATEGORY GRID ===== */
.category-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}
.category-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 16px; text-decoration: none;
  color: var(--text); transition: all 0.3s; cursor: pointer;
}
.category-card:hover {
  border-color: var(--border-hover); background: var(--bg-card-hover);
  transform: translateY(-4px); box-shadow: var(--shadow-hover);
}
.category-icon { font-size: 40px; }
.category-name { font-weight: 700; font-size: 15px; }
.category-desc { font-size: 12px; color: var(--text-muted); }

/* ===== BOOK GRID ===== */
.book-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.book-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; transition: all 0.3s;
  cursor: pointer;
}
.book-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover); border-color: var(--border-hover);
}
.book-cover {
  height: 220px; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.book-cover-emoji {
  font-size: 80px; transition: transform 0.5s;
}
.book-card:hover .book-cover-emoji { transform: scale(1.15); }
.book-badge {
  position: absolute; top: 12px; right: 12px;
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-mystery-thriller { background: #991b1b; color: #fca5a5; }
.badge-dark-romance    { background: #6b21a8; color: #d8b4fe; }
.badge-romance         { background: #9d174d; color: #f9a8d4; }
.badge-fantasy         { background: #065f46; color: #6ee7b7; }
.badge-sci-fi          { background: #155e75; color: #67e8f9; }
.badge-other           { background: #374151; color: #9ca3af; }

.book-info { padding: 20px; }
.book-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.book-author { color: var(--accent); font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.book-desc { color: var(--text-muted); font-size: 13px; line-height: 1.5; margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.book-footer { display: flex; align-items: center; justify-content: space-between; }
.book-price { font-family: var(--font-display); font-size: 22px; font-weight: 900; color: var(--accent); }
.book-add {
  background: rgba(168,85,247,0.15); border: 1px solid rgba(168,85,247,0.3);
  color: var(--accent); padding: 8px 18px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.book-add:hover { background: rgba(168,85,247,0.3); border-color: var(--accent); }

/* ===== SHOP FILTERS ===== */
.shop-controls {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between;
  margin-bottom: 32px;
}
.filter-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn {
  padding: 8px 18px; border-radius: var(--radius-full); font-size: 13px;
  font-weight: 600; cursor: pointer; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-muted);
  transition: all 0.2s;
}
.filter-btn:hover { border-color: var(--border-hover); color: var(--text); }
.filter-btn.active { background: rgba(168,85,247,0.25); border-color: var(--accent); color: var(--accent); }
.sort-select {
  background: var(--bg-card); color: var(--text); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: var(--radius-sm); font-size: 13px;
  cursor: pointer; outline: none;
}
.sort-select:focus { border-color: var(--accent); }

/* ===== STEPS ===== */
.steps-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
}
.step-card {
  text-align: center; padding: 40px 24px;
}
.step-icon { font-size: 56px; display: block; margin-bottom: 16px; }
.step-card h3 { font-family: var(--font-display); font-size: 24px; margin-bottom: 8px; }
.step-card p { color: var(--text-muted); font-size: 15px; }

/* ===== NEWSLETTER ===== */
.newsletter-icon { font-size: 48px; display: block; margin-bottom: 16px; }
.newsletter-form { display: flex; gap: 12px; max-width: 480px; margin: 32px auto 0; }
.input {
  flex: 1; padding: 14px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text); font-size: 15px; outline: none; transition: border-color 0.2s;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: #4a4a5a; }

/* ===== ABOUT PAGE ===== */
.about-hero { padding: 140px 0 80px; text-align: center; }
.about-content {
  max-width: 700px; margin: 0 auto;
  font-size: 17px; line-height: 1.8; color: var(--text-muted);
}
.about-content p { margin-bottom: 24px; }
.about-icon { font-size: 80px; display: block; margin-bottom: 24px; }

/* ===== CONTACT PAGE ===== */
.contact-hero { padding: 140px 0 80px; text-align: center; }
.contact-form {
  max-width: 500px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 16px;
}
.contact-form textarea.input {
  min-height: 120px; resize: vertical; font-family: var(--font-body);
}

/* ===== FOOTER ===== */
.footer {
  background: #06060a; border-top: 1px solid var(--border);
  padding: 48px 0;
}
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.footer-brand { text-align: center; }
.footer-tagline { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 14px; transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }
.footer-quote { color: #3a3a4a; font-size: 13px; font-style: italic; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 300;
  background: var(--accent); color: white; padding: 14px 24px;
  border-radius: var(--radius-sm); font-weight: 600; font-size: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: slideUp 0.3s ease, fadeOut 0.3s ease 2.2s forwards;
  pointer-events: none;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 64px; display: block; margin-bottom: 16px; }

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .nav { display: none; }
  .nav.open {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; top: 68px; left: 0; right: 0;
    background: var(--bg-card); border-bottom: 1px solid var(--border);
    padding: 16px 24px;
  }
  .nav.open .nav-link { padding: 12px 0; }
  .mobile-menu-btn { display: block; }
  .hero-btns { flex-direction: column; align-items: center; }
  .hero-stats { gap: 24px; }
  .newsletter-form { flex-direction: column; }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .shop-controls { flex-direction: column; align-items: stretch; }
  .filter-buttons { justify-content: center; }
}
