/* Baka Shop Books — Онлайн-магазин книг */
:root {
  --bg: #fcfbf9;
  --surface: #ffffff;
  --surface-alt: #f5f2eb;
  --border: #e7e2d7;
  --border-focus: #c2410c;
  --text: #1c1917;
  --text-muted: #57534e;
  --text-light: #78716c;
  --primary: #991b1b;
  --primary-hover: #7f1d1d;
  --primary-light: #fef2f2;
  --accent: #d97706;
  --accent-light: #fffbeb;
  --success: #15803d;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 28px rgba(0,0,0,0.12);
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

/* TOP BAR */
.topbar {
  background: #1c1917;
  color: #d6d3d1;
  font-size: 0.82rem;
  padding: 0.4rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar-links {
  display: flex;
  gap: 1.25rem;
}
.topbar-links a:hover {
  color: #fafaf9;
}

/* HEADER */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.logo svg {
  width: 32px;
  height: 32px;
}
.logo-tagline {
  font-family: var(--font-main);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-light);
  display: block;
  letter-spacing: 0.5px;
}

/* SEARCH */
.search-form {
  flex: 1;
  max-width: 520px;
  position: relative;
}
.search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: var(--surface-alt);
  font-size: 0.92rem;
  outline: none;
  transition: all 0.2s ease;
}
.search-input:focus {
  background: var(--surface);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.12);
}
.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

/* ACTIONS */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
.btn-cart {
  position: relative;
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.6rem 1.1rem;
  border-radius: 9999px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s;
}
.btn-cart:hover {
  background: var(--primary-hover);
}
.cart-badge {
  background: var(--accent);
  color: #1c1917;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  line-height: 1;
}

/* NAV */
.nav-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 2rem;
  overflow-x: auto;
}
.nav-item {
  padding: 0.75rem 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.2s;
}
.nav-item:hover, .nav-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* HERO */
.hero {
  background: linear-gradient(135deg, #2b1113 0%, #4a1518 100%);
  color: #fff;
  padding: 3.5rem 1.5rem;
  position: relative;
  overflow: hidden;
}
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 3rem;
}
.hero-content h1 {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: #fef3c7;
}
.hero-content p {
  font-size: 1.15rem;
  color: #fcd34d;
  opacity: 0.9;
  margin-bottom: 2rem;
  max-width: 540px;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #1c1917;
  font-weight: 700;
  padding: 0.85rem 1.8rem;
  border-radius: 9999px;
  transition: transform 0.2s, background 0.2s;
}
.hero-cta:hover {
  background: #f59e0b;
  transform: translateY(-2px);
}
.hero-badges {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}
.hero-badge-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: #fde68a;
}
.hero-visual {
  display: flex;
  justify-content: center;
}
.hero-book-stack {
  width: 260px;
  height: 220px;
  position: relative;
}
.book-cover-art {
  width: 160px;
  height: 220px;
  border-radius: 6px 12px 12px 6px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.5);
  position: absolute;
  top: 0;
  left: 50px;
  padding: 1.5rem 1rem;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-left: 6px solid rgba(0,0,0,0.3);
}

/* MAIN CONTAINER */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  width: 100%;
}

/* SECTION TITLES */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.75rem;
}
.section-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.section-link {
  color: var(--primary);
  font-size: 0.92rem;
  font-weight: 600;
}
.section-link:hover {
  text-decoration: underline;
}

/* CATEGORY CHIPS */
.category-filter {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.chip {
  padding: 0.5rem 1.1rem;
  border-radius: 9999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.chip:hover, .chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* BOOKS GRID */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.75rem;
}
.book-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.book-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.book-badge {
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  z-index: 2;
}
.badge-hit { background: #fee2e2; color: #991b1b; }
.badge-new { background: #dcfce7; color: #166534; }
.badge-sale { background: #fef3c7; color: #92400e; }

.book-visual {
  height: 230px;
  background: linear-gradient(180deg, #f5f2eb 0%, #ebe6db 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
}
.book-mockup {
  width: 125px;
  height: 180px;
  border-radius: 4px 8px 8px 4px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem 0.75rem;
  color: #ffffff;
  border-left: 5px solid rgba(0,0,0,0.25);
  position: relative;
  transition: transform 0.2s;
}
.book-card:hover .book-mockup {
  transform: scale(1.03) rotate(-1deg);
}
.bm-title {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.25;
}
.bm-author {
  font-size: 0.65rem;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.bm-decor {
  width: 25px;
  height: 2px;
  background: rgba(255,255,255,0.6);
  margin: 0.3rem 0;
}

.book-info {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.book-author {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.book-title {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.book-rating {
  color: #f59e0b;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-weight: 600;
}
.book-price-row {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.price-box {
  display: flex;
  flex-direction: column;
}
.price-current {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}
.price-old {
  font-size: 0.82rem;
  color: var(--text-light);
  text-decoration: line-through;
}
.btn-buy {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s;
}
.btn-buy:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* FEATURES SECTION */
.features-band {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 3rem 1.5rem;
  margin-top: 3rem;
}
.features-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}
.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.feature-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}
.feature-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* FOOTER */
.footer {
  background: #1c1917;
  color: #a8a29e;
  padding: 3.5rem 1.5rem 1.5rem;
  margin-top: auto;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #292524;
}
.footer-brand h3 {
  color: #f5f5f4;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}
.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 320px;
}
.footer-col h4 {
  color: #f5f5f4;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.footer-col ul {
  list-style: none;
}
.footer-col li {
  margin-bottom: 0.6rem;
}
.footer-col a {
  font-size: 0.9rem;
  transition: color 0.2s;
}
.footer-col a:hover {
  color: #ffffff;
}
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}

/* CART MODAL & DRAWER */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: flex-end;
}
.modal-overlay.open {
  display: flex;
}
.drawer {
  background: var(--surface);
  width: 100%;
  max-width: 440px;
  height: 100%;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.25s ease-out;
}
@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.drawer-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.drawer-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
}
.drawer-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}
.cart-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.cart-item {
  display: flex;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.cart-item-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}
.cart-item-author {
  font-size: 0.8rem;
  color: var(--text-light);
}
.cart-item-price {
  font-weight: 700;
  color: var(--primary);
  margin-top: 0.4rem;
}
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.qty-btn {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}
.drawer-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
}
.drawer-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.btn-checkout {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.85rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-checkout:hover {
  background: var(--primary-hover);
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #1c1917;
  color: white;
  padding: 0.9rem 1.4rem;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  z-index: 300;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.25s ease;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
  .hero-content h1 { font-size: 2.2rem; }
  .hero-content p { margin: 0 auto 2rem; }
  .hero-badges { justify-content: center; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .header-inner { flex-wrap: wrap; }
  .search-form { order: 3; max-width: 100%; }
  .footer-inner { grid-template-columns: 1fr; }
  .topbar { display: none; }
}


/* === BAKA EASTER EGG STYLES === */
.baka-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.baka-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.baka-box {
  background: #180507;
  border: 2px solid #ef4444;
  box-shadow: 0 0 50px rgba(239, 68, 68, 0.5), inset 0 0 30px rgba(239, 68, 68, 0.2);
  border-radius: 16px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  padding: 2rem;
  color: #fff;
  transform: scale(0.85);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}
.baka-modal-overlay.active .baka-box {
  transform: scale(1);
}
.baka-avatar-wrap {
  width: 200px;
  height: 200px;
  margin: 0 auto 1.5rem;
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid #f87171;
  box-shadow: 0 0 25px rgba(248, 113, 113, 0.6);
  animation: bakaGlow 2s infinite alternate;
}
@keyframes bakaGlow {
  0% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.5); transform: rotate(-1deg); }
  100% { box-shadow: 0 0 45px rgba(239, 68, 68, 0.9); transform: rotate(1deg); }
}
.baka-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.baka-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: #fca5a5;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}
.baka-sub {
  font-size: 0.95rem;
  color: #fecaca;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
.baka-promo {
  background: #2b080b;
  border: 1px dashed #f87171;
  padding: 0.75rem;
  border-radius: 8px;
  font-family: monospace;
  font-size: 1.1rem;
  color: #fef08a;
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
  user-select: all;
}
.baka-btn {
  background: linear-gradient(135deg, #ef4444 0%, #991b1b 100%);
  color: white;
  border: none;
  padding: 0.75rem 1.75rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}
.baka-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
}
