/* ===================== TOKENS ===================== */
:root {
  --bg: #060a10;
  --bg-soft: #0b1119;
  --bg-card: #0f1620;
  --line: rgba(255, 255, 255, 0.08);
  --ink: #e9e4d8;
  --ink-dim: #9aa3ad;
  --ink-faint: #5f6a75;
  --accent: #7dd3fc;
  --accent-soft: rgba(125, 211, 252, 0.35);
  --gold: #cbb98a;
  --font-display: "Cormorant Garamond", serif;
  --font-logo: "Marcellus", serif;
  --font-body: "Inter", sans-serif;
  --radius: 4px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Нові токени для фентезі/неонового стилю */
  --font-fantasy: "Marcellus", serif;
  --gold-text: #c5b285;
  --gold-bright: #e2d2a4;
  --gold-dim: #8c7b56;
  --neon-cyan: #51cbf5;
  --neon-glow: rgba(81, 203, 245, 0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative; 
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; margin: 0; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

.section-inner { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.section-eyebrow {
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.section-title { font-size: clamp(32px, 5vw, 48px); margin-bottom: 24px; }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all 0.3s var(--ease);
}
.btn-outline {
  border-color: var(--accent-soft);
  color: var(--ink);
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--accent);
  background: rgba(125, 211, 252, 0.08);
  box-shadow: 0 0 24px rgba(125, 211, 252, 0.15);
}
.btn-solid {
  background: var(--accent);
  color: #061018;
  border-color: var(--accent);
  font-weight: 600;
}
.btn-solid:hover { background: #a6e2fe; box-shadow: 0 0 24px rgba(125, 211, 252, 0.35); }
.btn-full { width: 100%; }

/* НЕОНОВА КНОПКА */
/* ===================== ЕФЕКТИ ПУЛЬСАЦІЇ ТА ФЕНТЕЗІ ===================== */

.btn-neon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-fantasy);
  font-size: 14px;
  letter-spacing: 0.25em;
  color: var(--gold-bright);
  background: rgba(4, 15, 25, 0.4);
  border: 1px solid rgba(81, 203, 245, 0.4); /* Завжди видима легка обводка */
  border-radius: 8px;
  padding: 16px 36px;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
  animation: neonPulse 2.5s infinite alternate ease-in-out;
  transition: border-color 0.3s ease, background 0.3s ease, color 0.3s ease;
}

@keyframes neonPulse {
  0% {
    box-shadow: 0 0 8px rgba(81, 203, 245, 0.1), inset 0 0 5px rgba(81, 203, 245, 0.05);
    transform: scale(1);
  }
  100% {
    box-shadow: 0 0 20px rgba(81, 203, 245, 0.5), inset 0 0 12px rgba(81, 203, 245, 0.2);
    transform: scale(1.02);
  }
}

.btn-neon:hover {
  /* Не вимикаємо анімацію, просто робимо обводку і текст яскравішими */
  color: #ffffff;
  border: 1px solid rgba(81, 203, 245, 0.9);
  background: rgba(4, 15, 25, 0.7);
}

.sparkles-container {
  position: absolute; /* Змінено з fixed на absolute — тепер вони прокручуються з сайтом */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%; /* Розтягуємо на всю висоту контенту */
  pointer-events: none;
  z-index: 1; /* Поверх фону, але під текстом */
  overflow: hidden;
}

.sparkle {
  position: absolute;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 6px #fff, 0 0 12px var(--accent);
  opacity: 0;
  animation: twinkle infinite ease-in-out;
}

@keyframes twinkle {
  0% { opacity: 0; transform: scale(0.5); }
  50% { opacity: 0.5; transform: scale(1); } /* Легке мерехтіння */
  100% { opacity: 0; transform: scale(0.5); }
}

/* ===================== REVEAL ANIMATION ===================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ===================== HEADER ===================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 22px 0;
  transition: background 0.4s var(--ease), padding 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(6, 10, 16, 0.85);
  backdrop-filter: blur(14px);
  padding: 14px 0;
  border-color: var(--line);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: var(--font-logo);
  font-size: 22px;
  letter-spacing: 0.3em;
  color: var(--ink);
  opacity: 0;
  animation: logoFadeIn 2.5s ease-in-out forwards;
}
@keyframes logoFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
.main-nav { display: flex; gap: 40px; }
.main-nav a {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  transition: color 0.25s;
  position: relative;
}
.main-nav a:hover { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 20px; }
.lang-switch { display: flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lang-switch button {
  background: transparent; border: none; color: var(--ink-faint);
  font-size: 11px; letter-spacing: 0.1em; padding: 6px 10px;
  transition: color 0.25s, background 0.25s;
}
.lang-switch button.active { color: var(--bg); background: var(--accent); }
.lang-switch button:not(.active):hover { color: var(--ink); }
.icon-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--ink);
  padding: 6px;
  display: flex;
}
.cart-count {
  position: absolute;
  top: -4px; right: -6px;
  background: var(--accent);
  color: #061018;
  font-size: 10px;
  font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ===================== HERO ===================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 140px 32px 60px clamp(32px, 10vw, 100px);
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background: url("/img/hero-bg.jpg") center 30% / cover no-repeat;
  transform: scale(1.08);
  animation: heroZoom 22s ease-in-out infinite alternate;
}
@keyframes heroZoom {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6,10,16,0.55) 0%, rgba(6,10,16,0.35) 40%, var(--bg) 96%);
  animation: waterShimmer 7s infinite alternate ease-in-out;
}
@keyframes waterShimmer {
  0% { opacity: 0.9; filter: brightness(0.95); }
  100% { opacity: 1; filter: brightness(1.1); }
}
.hero-content { position: relative; max-width: 620px; }
.hero-eyebrow {
  font-family: var(--font-fantasy);
  font-size: 13px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 8px;
}
.hero-title {
  font-family: var(--font-fantasy);
  font-size: clamp(64px, 10vw, 110px);
  letter-spacing: 0.15em;
  color: var(--gold-bright);
  text-shadow: 0 0 30px rgba(226, 210, 164, 0.2);
  line-height: 0.95;
}
.hero-tagline {
  font-family: var(--font-fantasy);
  font-size: 13px;
  letter-spacing: 0.25em;
  color: var(--gold-text);
  margin: 14px 0 20px;
  margin-top: 30px;
}
.hero-desc {
  font-size: 14px;
  line-height: 1.8;
  color: #8f9cae;
  max-width: 480px;
  margin-bottom: 34px;
}
.hero-features {
  position: relative;
  display: flex;
  gap: 40px;
  margin-top: 60px;
  flex-wrap: wrap;
}
.feature {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-fantasy);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--gold-text);
  line-height: 1.4;
}
.feature-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(197, 178, 133, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.3);
}
.feature-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* ===================== BOOKS & ABOUT (LAYOUT) ===================== */
.books-section { padding: 100px 0 60px; }
.books-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 56px;
  align-items: start;
}
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 28px;
  margin-top: 20px;
}
.book-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--line);
  
  /* Початковий невидимий стан */
  opacity: 0;
  transform: translateY(30px);
  
  /* Каскадна затримка через змінну --delay */
  transition: 
    opacity 0.8s var(--ease) var(--delay, 0ms), 
    transform 0.8s var(--ease) var(--delay, 0ms), 
    border-color 0.4s var(--ease), 
    box-shadow 0.4s var(--ease);
}

.book-card.in-view { 
  opacity: 1; 
  transform: translateY(0); 
}

.book-card:hover {
  /* Скасовуємо затримку при ховері, щоб анімація наведення була миттєвою */
  transition-delay: 0ms !important; 
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 50px -15px var(--card-glow, rgba(125,211,252,0.35));
  border-color: var(--card-accent, var(--accent));
}

.book-card:hover .book-card-title {
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.3);
  color: #fff;
}

.book-card-cover {
  aspect-ratio: 3/4.4;
  background: linear-gradient(160deg, var(--card-accent, #333) 0%, #05070b 85%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.book-card-cover.has-cover { aspect-ratio: auto; background: #05070b; display: block; }
.book-card-cover img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.book-card-cover.has-cover img { position: static; width: 100%; height: auto; object-fit: contain; display: block; }
.book-card-cover .placeholder-symbol {
  font-size: 42px;
  color: var(--card-accent, var(--accent));
  opacity: 0.85;
  filter: drop-shadow(0 0 14px var(--card-accent, var(--accent)));
}
.book-card-cover .placeholder-title {
  font-family: var(--font-display);
  letter-spacing: 0.2em;
  font-size: 13px;
  color: var(--ink-dim);
  margin-top: 14px;
  text-transform: uppercase;
}
.book-card-info { padding: 16px 18px 20px; }
.book-card-subtitle {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--card-accent, var(--gold));
  margin-bottom: 4px;
}
.book-card-title {
  font-size: 19px;
  color: var(--ink);
  margin-bottom: 10px;
  transition: all 0.3s ease;
}
.book-card-price { font-size: 13px; color: var(--ink-dim); }

/* ABOUT SIDEBAR (Про серію) */
.about-sidebar {
  display: flex;
  flex-direction: column;
  gap: 44px;
  padding-top: 40px;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  padding-left: 44px;
}
.about-item {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.about-icon-wrap {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}
.about-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.about-text-content h3 {
  font-family: var(--font-fantasy);
  font-size: 16px;
  letter-spacing: 0.18em;
  color: var(--gold-bright);
  margin-bottom: 10px;
}
.about-text-content p {
  font-size: 14px;
  line-height: 1.7;
  color: #7e8b9b;
}

/* ===================== AUTHOR ===================== */
.author-section { 
  padding: 120px 0; 
  text-align: center;
  background: radial-gradient(circle at center, rgba(15, 25, 38, 0.5) 0%, transparent 70%);
}
.author-section .section-title {
  font-family: var(--font-fantasy);
  font-size: 42px;
  letter-spacing: 0.1em;
  color: var(--gold-bright);
  margin-bottom: 28px;
}
.author-text {
  max-width: 720px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 2;
  color: #a3b0c2;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ===================== FOOTER ===================== */
/* ===================== FOOTER ===================== */
.site-footer { 
  padding: 80px 0 40px; 
  border-top: 1px solid var(--line); 
  background: linear-gradient(to top, rgba(6,10,16,0.9) 0%, rgba(6,10,16,0) 100%);
}

.footer-inner { 
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* Ідеальне центрування навігації */
  align-items: center;
  gap: 40px; 
  margin-bottom: 60px; 
}

/* Ліва колонка */
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-tagline { 
  color: var(--ink-dim); 
  font-size: 13px; 
  letter-spacing: 0.05em;
}

/* Центральна колонка: Навігація */
.footer-nav {
  display: flex;
  gap: 24px;
  justify-content: center;
}
.footer-nav a {
  font-family: var(--font-fantasy);
  font-size: 13px;
  color: var(--gold-dim);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}
.footer-nav a:hover { 
  color: var(--gold-bright); 
  text-shadow: 0 0 12px rgba(226, 210, 164, 0.4);
}

/* Права колонка: Контакти та соцмережі */
.footer-social-contacts { 
  display: flex; 
  flex-direction: column; 
  gap: 16px; 
  align-items: flex-end; 
}
.footer-email {
  font-size: 14px;
  color: var(--ink-dim);
  letter-spacing: 0.05em;
  transition: color 0.3s ease;
}
.footer-email:hover {
  color: var(--accent);
}
.footer-social { 
  display: flex; 
  gap: 12px; 
}
.footer-social a { 
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ink-dim); 
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.3s ease; 
}
.footer-social a:hover { 
  color: var(--bg); 
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--neon-glow);
  transform: translateY(-3px);
}

/* Низ футера */
.footer-bottom { 
  border-top: 1px solid var(--line); 
  padding-top: 30px; 
  text-align: center; 
}
.footer-copy { 
  color: var(--ink-faint); 
  font-size: 12px; 
  line-height: 1.8; 
  letter-spacing: 0.03em;
}

/* Адаптив футера для мобільних пристроїв */
@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 36px;
  }
  .footer-brand {
    align-items: center;
  }
  .footer-nav {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 16px;
  }
  .footer-social-contacts {
    align-items: center;
  }

  .footer-copy { 
    margin-top: 10px;
  }
}

/* ===================== MODALS (generic) ===================== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(4, 6, 10, 0.75);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 640px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(24px) scale(0.98);
  transition: transform 0.4s var(--ease);
}
.modal-backdrop.open .modal { transform: translateY(0) scale(1); }
.modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: rgba(255,255,255,0.06);
  border: none;
  color: var(--ink);
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  z-index: 2;
}
.modal-close:hover { background: rgba(255,255,255,0.14); }

/* ---- generic full-page sections (book / blog) ---- */
.page-section { padding: 150px 0 100px; min-height: 100vh; }
.back-link {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 40px;
  transition: color 0.25s;
}
.back-link:hover { color: var(--accent); }

/* ---- book full page ---- */
.book-page-layout { display: grid; grid-template-columns: 360px 1fr; gap: 56px; align-items: start; }
.book-page-cover {
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--card-accent, #333) 0%, #05070b 85%);
  aspect-ratio: 3/4.4;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 34px;
  letter-spacing: 0.15em;
  color: var(--ink);
  box-shadow: 0 30px 70px -30px var(--card-glow, rgba(125,211,252,0.35));
}
.book-page-cover.has-cover { aspect-ratio: auto; background: #05070b; display: block; }
.book-page-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-page-cover.has-cover img { width: 100%; height: auto; object-fit: contain; display: block; }
.book-page-subtitle { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.book-page-title { font-size: clamp(34px, 5vw, 52px); margin-bottom: 24px; }
.book-page-desc { color: var(--ink-dim); font-size: 16px; line-height: 1.85; margin-bottom: 22px; max-width: 640px; }
.book-page-excerpt {
  font-family: var(--font-display); font-style: italic; color: var(--ink-dim);
  border-left: 2px solid var(--accent-soft); padding-left: 18px; font-size: 18px; line-height: 1.8;
  margin-bottom: 34px; max-width: 600px;
}
.book-page-footer { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.book-page-price { font-size: 30px; font-family: var(--font-display); color: var(--ink); }

/* ---- blog ---- */
.blog-preview-section { padding: 90px 0; border-top: 1px solid var(--line); }
.blog-preview-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.blog-see-all { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; margin-top: 22px; }
.blog-card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; cursor: pointer;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease);
}
.blog-card:hover { transform: translateY(-6px); border-color: var(--accent-soft); }
.blog-card-image { width: 100%; height: auto; display: block; background: var(--bg-soft); }
.blog-card-image img { width: 100%; height: auto; display: block; object-fit: contain; }
.blog-card-noimage { height: 6px; background: linear-gradient(90deg, var(--accent-soft), transparent); }
.blog-card-body { padding: 20px 22px 24px; }
.blog-card-date { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.06em; margin-bottom: 8px; }
.blog-card-title { font-size: 19px; margin-bottom: 10px; }
.blog-card-excerpt { font-size: 13.5px; color: var(--ink-dim); line-height: 1.7; }

.blog-post-inner { max-width: 760px; }
.blog-post-image-wrap { border-radius: 6px; overflow: hidden; margin-bottom: 30px; }
.blog-post-image-wrap img { width: 100%; height: auto; display: block; }
.blog-post-date { font-size: 12px; color: var(--ink-faint); letter-spacing: 0.06em; margin-bottom: 10px; }
.blog-post-title { font-size: clamp(28px, 4.5vw, 42px); margin-bottom: 26px; }
.blog-post-content { font-size: 16px; line-height: 1.95; color: var(--ink-dim); white-space: pre-line; }

/* ---- checkout modal ---- */
.checkout-modal { padding: 34px 32px; }
.checkout-modal h2 { font-size: 26px; margin-bottom: 10px; }
.checkout-hint { color: var(--ink-dim); font-size: 13px; line-height: 1.6; margin-bottom: 24px; }
.checkout-modal form { display: flex; flex-direction: column; gap: 16px; }
.checkout-modal label { font-size: 12px; color: var(--ink-dim); display: flex; flex-direction: column; gap: 6px; }
.checkout-modal input {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 14px;
}
.checkout-modal input:focus { outline: none; border-color: var(--accent); }
.checkout-summary { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; font-size: 13px; color: var(--ink-dim); display: flex; flex-direction: column; gap: 6px; }
.checkout-summary .row { display: flex; justify-content: space-between; }
.checkout-summary .row.total { color: var(--ink); font-weight: 600; font-size: 15px; margin-top: 6px; }
.checkout-error { color: #f88; font-size: 13px; min-height: 18px; }

/* ---- thanks modal (after leaving a request) ---- */
.thanks-modal { padding: 40px 32px; text-align: center; }
.order-status-icon {
  font-size: 40px; margin-bottom: 14px; color: var(--accent);
  width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--accent-soft);
  display: flex; align-items: center; justify-content: center; margin-left: auto; margin-right: auto;
}
.thanks-modal h2 { font-size: 24px; margin-bottom: 12px; }
.thanks-modal p { color: var(--ink-dim); font-size: 14px; line-height: 1.6; margin-bottom: 24px; }

/* ===================== CART DRAWER ===================== */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(4,6,10,0.65);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s var(--ease);
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(400px, 92vw);
  background: var(--bg-card);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.45s var(--ease);
}
.drawer-backdrop.open .cart-drawer { transform: translateX(0); }
.cart-header { display: flex; justify-content: space-between; align-items: center; padding: 22px 24px; border-bottom: 1px solid var(--line); position: relative; }
.cart-header h3 { font-size: 20px; }
.cart-header .modal-close { position: static; }
.cart-items { flex: 1; overflow-y: auto; padding: 10px 24px; }
.cart-item { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cart-item-swatch { width: 44px; height: 60px; border-radius: 3px; flex-shrink: 0; background: linear-gradient(160deg, var(--card-accent, #444), #05070b); }
.cart-item-info { flex: 1; }
.cart-item-title { font-size: 14px; margin-bottom: 4px; }
.cart-item-price { font-size: 12px; color: var(--ink-dim); }
.cart-item-remove { background: none; border: none; color: var(--ink-faint); font-size: 18px; }
.cart-item-remove:hover { color: #f88; }
.cart-empty { display: none; text-align: center; color: var(--ink-dim); font-size: 14px; padding: 40px 24px; }
.cart-footer { padding: 20px 24px 26px; border-top: 1px solid var(--line); }
.cart-total { display: flex; justify-content: space-between; font-size: 16px; margin-bottom: 16px; }

/* ===================== TOAST ===================== */
.toast {
  position: fixed; bottom: 26px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid var(--accent-soft);
  color: var(--ink);
  padding: 12px 22px;
  border-radius: var(--radius);
  font-size: 13px;
  z-index: 500;
  opacity: 0; pointer-events: none;
  transition: all 0.35s var(--ease);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===================== ADMIN OVERLAY ===================== */
.admin-overlay {
  position: fixed; inset: 0;
  background: rgba(2, 4, 8, 0.92);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s var(--ease);
  padding: 20px;
}
.admin-overlay.open { opacity: 1; pointer-events: auto; }
.admin-box {
  width: 100%; max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--accent-soft);
  border-radius: 8px;
  padding: 40px;
}
.admin-eyebrow { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); margin-bottom: 24px; }
.admin-login { max-width: 320px; margin: 0 auto; text-align: center; }
.admin-login form { display: flex; flex-direction: column; gap: 14px; }
.admin-login input, .admin-book-form input, .admin-book-form textarea, .admin-creds-form input {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  width: 100%;
}
.admin-login input:focus, .admin-book-form input:focus, .admin-book-form textarea:focus, .admin-creds-form input:focus { outline: none; border-color: var(--accent); }
.admin-error { color: #f88; font-size: 13px; min-height: 18px; margin-top: 6px; }
.admin-close { margin-top: 20px; background: none; border: none; color: var(--ink-faint); font-size: 12px; }
.admin-close:hover { color: var(--ink-dim); }

.admin-panel-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.admin-tabs { display: flex; gap: 8px; }
.admin-tab {
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink-dim);
  padding: 8px 16px; border-radius: var(--radius); font-size: 12px; letter-spacing: 0.05em;
}
.admin-tab.active { color: var(--ink); border-color: var(--accent); background: rgba(125,211,252,0.08); }

.admin-books-list { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.admin-book-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px;
}
.admin-book-row .swatch { width: 30px; height: 40px; border-radius: 3px; flex-shrink: 0; }
.admin-book-row .info { flex: 1; }
.admin-book-row .title { font-size: 14px; }
.admin-book-row .meta { font-size: 11px; color: var(--ink-faint); margin-top: 2px; }
.admin-book-row .actions { display: flex; gap: 8px; }
.admin-book-row button { background: none; border: 1px solid var(--line); color: var(--ink-dim); padding: 6px 10px; border-radius: var(--radius); font-size: 11px; }
.admin-book-row button:hover { color: var(--ink); border-color: var(--accent-soft); }
.admin-book-row .status-off { opacity: 0.45; }

.admin-stats-summary { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.admin-stats-summary .stat-card { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; flex: 1; min-width: 140px; }
.admin-stats-summary .stat-card .num { font-family: var(--font-display); font-size: 26px; }
.admin-stats-summary .stat-card .label { font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }
.admin-tab-content h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); margin: 20px 0 10px; }
.admin-stats-table { display: flex; flex-direction: column; gap: 6px; }
.admin-stats-table .row { display: flex; justify-content: space-between; font-size: 13px; padding: 8px 12px; background: var(--bg-soft); border-radius: var(--radius); border: 1px solid var(--line); }

.admin-book-form form { display: flex; flex-direction: column; gap: 14px; }
.admin-book-form label { font-size: 12px; color: var(--ink-dim); display: flex; flex-direction: column; gap: 6px; }
.admin-book-form-row { display: flex; gap: 14px; }
.admin-book-form-row label { flex: 1; }
.admin-checkbox { flex-direction: row !important; align-items: center; gap: 8px !important; }
.admin-book-form-actions { display: flex; gap: 12px; margin-top: 6px; }
.admin-creds-form { display: flex; flex-direction: column; gap: 14px; max-width: 360px; }
.admin-creds-form label { font-size: 12px; color: var(--ink-dim); display: flex; flex-direction: column; gap: 6px; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 992px) {
  .books-layout { grid-template-columns: 1fr; }
  .about-sidebar {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-left: clamp(32px, 8vw, 120px);
    margin-top: 40px;
  }
  .book-page-layout { grid-template-columns: 1fr; }
  .book-page-cover { max-width: 340px; }
}

@media (max-width: 860px) {
  .main-nav { display: none; }
  .footer-inner { flex-direction: column; }
  .admin-tabs { flex-wrap: wrap; }
}

@media (max-width: 600px) {
  .header-inner, .section-inner { padding: 0 20px; }
  .hero { padding: 120px 20px 50px; }
  .hero-title { font-size: 72px; }
  .hero-features { flex-direction: column; gap: 20px; margin-top: 50px; }
  .books-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .book-card-info { padding: 12px 12px 16px; }
  .book-card-title { font-size: 15px; }
  .cart-drawer { width: 100vw; }
  .admin-box { padding: 24px 18px; }
  .admin-book-form-row { flex-direction: column; gap: 14px; }
  .page-section { padding: 120px 0 60px; }
  .lang-switch button { padding: 5px 8px; font-size: 10px; }
  .hero-bg { background-position: 70% 60%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}

/* ===================== EDGE FRAME (декоративна рамка по краях) ===================== */
.edge-frame {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 500;
}
.edge-frame::before,
.edge-frame::after {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(197, 178, 133, 0.35) 12%,
    rgba(197, 178, 133, 0.35) 88%,
    transparent 100%
  );
}
.edge-frame::before { left: 18px; }
.edge-frame::after  { right: 18px; }

.edge-corner {
  position: fixed;
  width: 34px;
  height: 50px;
  color: rgba(197, 178, 133, 0.55);
}
.edge-corner--tl { top: 24px; left: 4px; }
.edge-corner--tr { top: 24px; right: 4px; transform: scaleX(-1); }
.edge-corner--bl { bottom: 24px; left: 4px; transform: scaleY(-1); }
.edge-corner--br { bottom: 24px; right: 4px; transform: scale(-1, -1); }

@media (max-width: 768px) {
  .edge-frame { display: none; }
}

/* ===================== SECTION DIVIDER ===================== */
.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 32px;
}
.section-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(197, 178, 133, 0.4) 50%,
    transparent 100%
  );
}
.section-divider-mark {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(197, 178, 133, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-dim, #c5b285);
  background: rgba(0, 0, 0, 0.2);
}