/* ==========================================================================
   СТАРАЯ КНИГА — СТИЛИ ЦИФРОВОГО МАГАЗИНА РЕДКИХ ИЗДАНИЙ
   ========================================================================== */

:root {
  --paper: #f7f3eb;
  --paper-card: #ffffff;
  --paper-deep: #ede5d4;
  --paper-light: #faf7f2;
  --ink: #231f1a;
  --ink-soft: #4a443b;
  --muted: #6e6557;
  --line: #ded5c5;
  --line-soft: #e8e2d5;
  
  --wine: #78232c;
  --wine-hover: #5e1820;
  --wine-light: #fbf0f2;
  
  --gold: #b38219;
  --gold-light: #fef9ed;
  --green: #2a7a4c;
  --green-light: #edf7f1;

  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Montserrat", Arial, sans-serif;

  --shadow-sm: 0 2px 8px rgba(35, 31, 26, 0.05);
  --shadow-md: 0 8px 24px rgba(35, 31, 26, 0.08);
  --shadow-lg: 0 16px 48px rgba(35, 31, 26, 0.14);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

section[id] {
  scroll-margin-top: 85px;
}

/* ==========================================================================
   ТИПОГРАФИКА И ОБЩИЕ ЭЛЕМЕНТЫ
   ========================================================================== */

.kicker {
  margin: 0 0 8px;
  color: var(--wine);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 7px;
}

.kicker i {
  font-size: 12px;
}

h1, h2, h3, h4 {
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 700;
  margin: 0;
}

/* ==========================================================================
   ШАПКА САЙТА (HEADER)
   ========================================================================== */

.site-header {
  height: 74px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 clamp(16px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 243, 235, 0.96);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  min-width: max-content;
}

.brand i {
  font-size: 26px;
  color: var(--wine);
}

.brand strong {
  font: 700 24px/1.1 var(--serif);
  display: block;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  gap: 24px;
  margin-left: 20px;
}

.main-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  height: 74px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--wine);
  border-color: var(--wine);
}

/* Переключатель валют */
.currency-selector {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 12px;
}

.currency-selector i {
  color: var(--gold);
  font-size: 13px;
}

.currency-selector select {
  border: 0;
  background: transparent;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  outline: none;
}

/* Кнопки поиска и корзины */
.search-btn, .cart-button, .menu-toggle {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}

.search-btn:hover {
  background: var(--paper-deep);
  color: var(--wine);
}

.cart-button {
  background: var(--wine);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  transition: background 0.2s, transform 0.15s;
}

.cart-button:hover {
  background: var(--wine-hover);
  transform: translateY(-1px);
}

.cart-badge {
  background: #fff;
  color: var(--wine);
  font-size: 11px;
  font-weight: 700;
  border-radius: 12px;
  padding: 1px 7px;
  min-width: 18px;
  text-align: center;
}

.menu-toggle {
  display: none;
  font-size: 18px;
  padding: 8px;
}

/* ==========================================================================
   HERO СЕКЦИЯ
   ========================================================================== */

.hero {
  min-height: 480px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  padding: 60px clamp(20px, 5vw, 80px) 55px;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #f7f3eb 0%, #eee5d4 100%);
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(640px, 60%);
}

.hero h1 {
  font-size: clamp(40px, 4.8vw, 66px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 8px 0 16px;
}

.hero-text {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
  max-width: 520px;
  margin: 0 0 24px;
}

.hero-search {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  height: 48px;
  width: min(480px, 100%);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hero-search:focus-within {
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(120, 35, 44, 0.12);
}

.hero-search i {
  margin: 0 14px;
  color: var(--muted);
  font-size: 16px;
}

.hero-search input {
  flex: 1;
  border: 0;
  outline: 0;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  min-width: 0;
}

.hero-search button {
  height: 100%;
  border: 0;
  background: var(--wine);
  color: #fff;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  padding: 0 22px;
  cursor: pointer;
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
  transition: background 0.2s;
}

.hero-search button:hover {
  background: var(--wine-hover);
}

.search-tags {
  margin-top: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.tag-link {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 3px 10px;
  font-size: 11px;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: var(--sans);
  transition: all 0.2s;
}

.tag-link:hover {
  border-color: var(--wine);
  color: var(--wine);
  background: var(--wine-light);
}

.hero-image-wrap {
  position: absolute;
  inset: 0 0 0 auto;
  width: 52%;
  height: 100%;
  pointer-events: none;
}

.hero-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  mix-blend-mode: multiply;
  opacity: 0.95;
}

/* ==========================================================================
   ФЛАГМАНСКИЙ ОФФЕР: ПОЛНЫЙ АРХИВ (BESTSELLER BANNER)
   ========================================================================== */

.all-access-section {
  max-width: 1280px;
  margin: 40px auto;
  padding: 0 clamp(16px, 4vw, 56px);
}

.all-access-card {
  background: linear-gradient(135deg, #2b251f 0%, #1e1914 100%);
  color: #f7f4ed;
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 48px);
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 36px;
  align-items: center;
  box-shadow: 0 20px 50px rgba(28, 22, 17, 0.35);
  border: 1px solid #4a3e33;
  position: relative;
  overflow: hidden;
}

.all-access-card::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(179, 130, 25, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.access-badge {
  background: var(--gold);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.discount-pill {
  background: rgba(255, 255, 255, 0.12);
  color: #fce8a6;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(252, 232, 166, 0.3);
}

.all-access-card h2 {
  color: #fff;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.05;
  margin-bottom: 14px;
}

.access-desc {
  color: #d6ccbc;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 22px;
  max-width: 600px;
}

.access-features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.access-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #e5dece;
  line-height: 1.4;
}

.access-features li i {
  color: #52c47e;
  font-size: 15px;
  margin-top: 2px;
}

.access-cta-row {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.price-box {
  display: flex;
  flex-direction: column;
}

.price-box .old-price {
  color: #9c8e7e;
  text-decoration: line-through;
  font-size: 14px;
  font-family: var(--serif);
}

.price-box .current-price {
  color: #ffd875;
  font: 700 36px/1 var(--serif);
}

.price-box .one-time-note {
  font-size: 10px;
  color: #b5a999;
  margin-top: 4px;
}

.action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-primary-large {
  background: linear-gradient(135deg, #b38219 0%, #8f630a 100%);
  color: #fff;
  border: 0;
  border-radius: var(--radius-md);
  padding: 14px 26px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 18px rgba(179, 130, 25, 0.35);
  transition: all 0.2s;
}

.btn-primary-large:hover {
  background: linear-gradient(135deg, #c7921e 0%, #a4730f 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(179, 130, 25, 0.45);
}

.btn-secondary-large {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-secondary-large:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Визуал стопки книг */
.access-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.visual-stack {
  position: relative;
  width: 260px;
  height: 280px;
}

.stack-img {
  position: absolute;
  width: 160px;
  height: 230px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: -8px 12px 25px rgba(0, 0, 0, 0.45);
  border: 1px solid #5a4e40;
  transition: transform 0.3s;
}

.stack-1 {
  top: 0;
  left: 0;
  transform: rotate(-8deg);
  z-index: 1;
}

.stack-2 {
  top: 20px;
  left: 45px;
  transform: rotate(2deg);
  z-index: 2;
}

.stack-3 {
  top: 35px;
  left: 95px;
  transform: rotate(10deg);
  z-index: 3;
}

.visual-stack:hover .stack-1 { transform: rotate(-14deg) translateX(-10px); }
.visual-stack:hover .stack-3 { transform: rotate(16deg) translateX(10px); }

.instant-delivery-pill {
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  color: #dfd7cb;
  display: flex;
  align-items: center;
  gap: 8px;
}

.instant-delivery-pill i {
  color: #52c47e;
}

/* ==========================================================================
   ТЕМАТИЧЕСКИЕ БАНДЛЫ (BUNDLES)
   ========================================================================== */

.bundles-section {
  max-width: 1280px;
  margin: 50px auto 30px;
  padding: 0 clamp(16px, 4vw, 56px);
}

.section-heading {
  margin-bottom: 28px;
}

.section-heading h2 {
  font-size: clamp(28px, 3.2vw, 38px);
  letter-spacing: -0.02em;
}

.section-sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.bundles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.bundle-card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.bundle-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--wine);
}

.bundle-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.bundle-badge {
  background: var(--wine-light);
  color: var(--wine);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 12px;
}

.bundle-discount {
  background: var(--green-light);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
}

.bundle-card h3 {
  font-size: 22px;
  line-height: 1.15;
  margin-bottom: 6px;
}

.bundle-subtitle {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 14px;
}

.bundle-preview-strip {
  height: 130px;
  background: var(--paper-deep);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--line);
}

.bundle-preview-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.bundle-desc {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

.bundle-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
  margin-top: auto;
}

.bundle-price-box .old {
  font-size: 11px;
  color: var(--muted);
  text-decoration: line-through;
  font-family: var(--serif);
}

.bundle-price-box .val {
  font: 700 22px/1 var(--serif);
  color: var(--ink);
}

.bundle-btn {
  background: var(--wine);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.bundle-btn:hover {
  background: var(--wine-hover);
}

/* ==========================================================================
   КАТАЛОГ 30 КНИГ (CATALOG GRID)
   ========================================================================== */

.catalog-section {
  max-width: 1280px;
  margin: 40px auto 60px;
  padding: 0 clamp(16px, 4vw, 56px);
}

.section-heading-catalog {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-heading-catalog h2 {
  font-size: clamp(28px, 3.2vw, 38px);
}

.view-all-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-all-btn:hover {
  border-color: var(--wine);
  color: var(--wine);
}

/* Фильтр по жанрам */
.genre-filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
}

.genre-pill {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 20px;
  padding: 8px 16px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s;
}

.genre-pill i {
  color: var(--muted);
}

.genre-pill:hover,
.genre-pill.is-active {
  background: var(--wine);
  color: #fff;
  border-color: var(--wine);
}

.genre-pill.is-active i {
  color: #fff;
}

.filter-status-row {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 12px;
}

/* Сетка книг */
.book-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
}

.book-card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #c4b59f;
}

.card-cover-link {
  height: 240px;
  background: var(--paper-deep);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  display: block;
}

.card-cover-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: sepia(0.08) contrast(0.96);
  transition: transform 0.35s ease;
}

.book-card:hover .card-cover-link img {
  transform: scale(1.04);
}

.card-body {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-genre-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--wine);
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.card-title {
  font-size: 18px;
  line-height: 1.15;
  margin: 0 0 6px;
  min-height: 42px;
  cursor: pointer;
}

.card-title a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
}

.card-title a:hover {
  color: var(--wine);
}

.card-author {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 10px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  margin-top: auto;
  margin-bottom: 14px;
}

.card-meta i {
  color: var(--wine);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

.card-price {
  font: 700 18px var(--serif);
  color: var(--ink);
  white-space: nowrap;
}

.card-add-btn {
  border: 0;
  background: var(--wine);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.2s;
}

.card-add-btn:hover {
  background: var(--wine-hover);
}

.card-add-btn.in-cart {
  background: var(--green);
}

/* ==========================================================================
   СЕКЦИЯ: КАЧЕСТВО И СТАНДАРТЫ ОЦИФРОВКИ
   ========================================================================== */

.quality-section {
  background: #ede3cf;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 60px clamp(16px, 4vw, 56px);
}

.quality-section .section-heading {
  max-width: 1280px;
  margin: 0 auto 36px;
}

.quality-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.quality-card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.q-icon {
  width: 46px;
  height: 46px;
  background: var(--wine-light);
  color: var(--wine);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}

.quality-card h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.quality-card p {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
}

/* ==========================================================================
   СЕКЦИЯ: КАК ЭТО УСТРОЕНО
   ========================================================================== */

.how-it-works {
  max-width: 1280px;
  margin: 60px auto;
  padding: 0 clamp(16px, 4vw, 56px);
}

.steps-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 36px;
}

.step-item {
  flex: 1;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
}

.step-num {
  width: 36px;
  height: 36px;
  background: var(--wine);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 14px;
}

.step-item h4 {
  font-size: 20px;
  margin-bottom: 8px;
}

.step-item p {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0;
}

.step-divider {
  color: var(--muted);
  font-size: 18px;
}

/* ==========================================================================
   ФУТЕР (FOOTER)
   ========================================================================== */

.site-footer {
  background: #25211c;
  color: #d8cfc2;
  border-top: 1px solid #3d362e;
  padding: 60px clamp(16px, 4vw, 56px) 24px;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid #3d362e;
}

.footer-col h5 {
  color: #fff;
  font-family: var(--serif);
  font-size: 18px;
  margin: 0 0 16px;
}

.brand-col .brand strong {
  color: #fff;
}

.footer-about {
  color: #a69c8f;
  font-size: 12px;
  line-height: 1.6;
  max-width: 420px;
  margin: 14px 0;
}

.footer-guarantee {
  font-size: 12px;
  color: #52c47e;
}

.footer-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-menu a {
  color: #d8cfc2;
  text-decoration: none;
  font-size: 12px;
  transition: color 0.2s;
}

.footer-menu a:hover {
  color: #ffd875;
}

.payment-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.pay-badge {
  background: #342e27;
  border: 1px solid #453e35;
  color: #dfd7cb;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.cloud-note {
  font-size: 12px;
  color: #a69c8f;
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-bottom {
  max-width: 1280px;
  margin: 24px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #8c8275;
}

/* ==========================================================================
   МОДАЛЬНЫЕ ОКНА (DIALOGS)
   ========================================================================== */

.custom-dialog {
  border: 0;
  border-radius: var(--radius-lg);
  padding: 0;
  background: var(--paper-card);
  color: var(--ink);
  width: min(720px, calc(100% - 32px));
  max-height: 90vh;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.custom-dialog::backdrop {
  background: rgba(28, 23, 18, 0.65);
  backdrop-filter: blur(4px);
}

.dialog-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: var(--paper-deep);
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  z-index: 10;
  transition: background 0.2s;
}

.dialog-close-btn:hover {
  background: #ded5c5;
}

.dialog-header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.dialog-header h2 {
  font-size: 28px;
}

/* ДЕТАЛИ КНИГИ */
.book-dialog-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  padding: 28px;
  max-height: 80vh;
  overflow-y: auto;
}

.dialog-book-cover {
  width: 100%;
  height: 330px;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.dialog-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin: 16px 0;
}

.dialog-facts div {
  font-size: 11px;
  color: var(--muted);
}

.dialog-facts b {
  display: block;
  font: 700 15px var(--serif);
  color: var(--ink);
  margin-top: 2px;
}

.dialog-book-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.dialog-book-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}

.dialog-price-tag {
  font: 700 28px var(--serif);
  color: var(--wine);
}

/* КОРЗИНА */
.cart-items-container {
  padding: 18px 28px;
  max-height: 50vh;
  overflow-y: auto;
}

.cart-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.cart-thumb {
  width: 50px;
  height: 65px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.cart-row-info {
  flex: 1;
}

.cart-row-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.cart-row-meta {
  font-size: 11px;
  color: var(--muted);
}

.cart-row-price {
  font: 700 18px var(--serif);
  color: var(--ink);
  white-space: nowrap;
}

.cart-del-btn {
  border: 0;
  background: transparent;
  color: #9c8e7e;
  cursor: pointer;
  padding: 6px;
  font-size: 14px;
  transition: color 0.2s;
}

.cart-del-btn:hover {
  color: var(--wine);
}

.cart-dialog-footer {
  padding: 20px 28px 24px;
  background: var(--paper-light);
  border-top: 1px solid var(--line);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 18px;
}

.cart-total-sum {
  font: 700 28px var(--serif);
  color: var(--wine);
}

.cart-checkout-btn {
  width: 100%;
  background: var(--wine);
  color: #fff;
  border: 0;
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cart-checkout-btn:hover {
  background: var(--wine-hover);
}

.empty-cart-msg {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 14px;
}

/* ЧЕКАУТ (CHECKOUT DIALOG) */
.checkout-body {
  padding: 24px 28px;
  max-height: 80vh;
  overflow-y: auto;
}

.checkout-summary-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
}

.checkout-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.checkout-summary-header strong {
  font: 700 22px var(--serif);
  color: var(--wine);
}

.form-group {
  margin-bottom: 22px;
}

.form-group label span {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}

.form-group label small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 8px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon i {
  position: absolute;
  left: 14px;
  color: var(--muted);
  font-size: 16px;
}

.input-with-icon input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-with-icon input:focus {
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(120, 35, 44, 0.12);
}

/* Способы оплаты (Payment methods) */
.payment-methods-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pay-method-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.pay-method-card:hover {
  border-color: var(--wine);
}

.pay-method-card.is-selected {
  border-color: var(--wine);
  background: var(--wine-light);
  box-shadow: 0 0 0 1px var(--wine);
}

.method-details {
  flex: 1;
}

.method-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.method-title strong {
  font-size: 13px;
  color: var(--ink);
}

.method-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: #efe7d7;
  color: var(--ink-soft);
  padding: 2px 7px;
  border-radius: 10px;
}

.method-details p {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 6px;
}

.method-icons {
  display: flex;
  gap: 8px;
  color: #7a7063;
  font-size: 15px;
}

.checkout-inline-error {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid #b33b45;
  border-radius: var(--radius-sm);
  background: #fff0f0;
  color: #7b1f2b;
  font-size: 13px;
  line-height: 1.45;
}

.checkout-inline-error[hidden] {
  display: none;
}

.btn-pay-submit {
  width: 100%;
  background: var(--wine);
  color: #fff;
  border: 0;
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-pay-submit:hover {
  background: var(--wine-hover);
  transform: translateY(-1px);
}

.pay-security-note {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ЭКРАН ВЫДАЧИ ЗАКАЗА (DELIVERY SCREEN) */
.delivery-header {
  text-align: center;
  padding: 36px 28px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.success-icon-wrap {
  width: 60px;
  height: 60px;
  background: var(--green-light);
  color: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 16px;
}

.delivery-header h2 {
  font-size: 32px;
  margin-bottom: 8px;
}

.delivery-sub {
  color: var(--ink-soft);
  font-size: 13px;
  max-width: 500px;
  margin: 0 auto;
}

.delivery-links-container {
  padding: 24px 28px;
  max-height: 50vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.delivery-item-row {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.delivery-item-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}

.delivery-btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-drive-download {
  background: #34a853;
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s;
}

.btn-yandex-download {
  background: #fc3f1d;
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s;
}

.btn-drive-download:hover,
.btn-yandex-download:hover {
  opacity: 0.9;
}

.delivery-instructions {
  background: var(--paper-light);
  border-top: 1px solid var(--line);
  padding: 20px 28px;
  font-size: 12px;
}

.delivery-instructions h4 {
  font-size: 16px;
  margin-bottom: 8px;
}

.delivery-instructions ul {
  padding-left: 20px;
  margin: 0;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ==========================================================================
   TOAST УВЕДОМЛЕНИЕ
   ========================================================================== */

.toast {
  position: fixed;
  z-index: 999;
  right: 24px;
  bottom: 24px;
  transform: translateY(100px);
  opacity: 0;
  background: #25211c;
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.25s;
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================================================
   АДАПТИВНОСТЬ (RESPONSIVE)
   ========================================================================== */

@media (max-width: 1100px) {
  .book-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .bundles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .quality-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .all-access-card {
    grid-template-columns: 1fr;
  }
  .visual-stack {
    display: none;
  }
  .book-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .footer-inner {
    grid-template-columns: 1fr;
  }
  .steps-row {
    flex-direction: column;
  }
  .step-divider {
    transform: rotate(90deg);
  }
}

@media (max-width: 768px) {
  html, body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .site-header {
    height: 62px;
    padding: 0 12px;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
  }
  .brand {
    min-width: 0;
    flex: 1 1 auto;
    gap: 8px;
  }
  .brand i { font-size: 22px; }
  .brand strong { font-size: 20px; }
  .brand small { font-size: 8px; letter-spacing: 0.03em; }
  .menu-toggle { flex: 0 0 auto; margin-left: 0; padding: 7px; }
  .currency-selector { flex: 0 0 auto; min-width: 84px; justify-content: center; margin-left: 0; padding: 5px 7px; gap: 4px; }
  .currency-selector select { width: 68px; font-size: 13px; font-weight: 700; color: var(--ink); }
  .search-btn { flex: 0 0 auto; padding: 8px; }
  .search-btn span { display: none; }
  .cart-label { display: none; }
  .cart-button { flex: 0 0 auto; min-width: 40px; justify-content: center; padding: 7px 9px; }
  .hero { min-height: auto; padding: 34px 18px 38px; }
  .hero-copy { width: 100%; min-width: 0; }
  .hero h1 { font-size: clamp(34px, 10vw, 44px); line-height: 0.98; }
  .hero-text { font-size: 14px; }
  .hero-search { width: 100%; max-width: 100%; }
  .hero-search button { padding: 0 14px; white-space: nowrap; }
  .all-access-section, .bundles-section, .catalog-section { width: 100%; max-width: 100%; box-sizing: border-box; overflow: hidden; }
  .all-access-section { margin: 24px auto; padding: 0 14px; }
  .all-access-card { width: 100%; min-width: 0; box-sizing: border-box; padding: 24px 18px; border-radius: 16px; gap: 22px; }
  .access-content { min-width: 0; }
  .badge-row { align-items: stretch; flex-direction: column; gap: 8px; }
  .access-badge, .discount-pill { width: fit-content; max-width: 100%; box-sizing: border-box; }
  .all-access-card h2 { font-size: clamp(28px, 8vw, 36px); }
  .access-desc { font-size: 14px; line-height: 1.55; }
  .access-features { gap: 13px; }
  .access-features li { display: grid; grid-template-columns: auto minmax(0, max-content) minmax(0, 1fr); align-items: start; gap: 7px; min-width: 0; font-size: 13px; }
  .access-features li span, .access-features li strong { min-width: 0; overflow-wrap: anywhere; }
  .access-cta-row { align-items: stretch; flex-direction: column; gap: 16px; }
  .action-buttons { flex-direction: column; gap: 9px; }
  .action-buttons button { width: 100%; justify-content: center; box-sizing: border-box; }
  .access-visual { width: 100%; }
  .visual-stack { display: none; }
  .instant-delivery-pill { width: 100%; box-sizing: border-box; justify-content: center; margin-top: 0; }
}

@media (max-width: 520px) {
  .site-header { padding: 0 10px; }
  .brand strong { font-size: 18px; }
  .brand small { font-size: 7px; }
  .currency-selector i { display: none; }
  .currency-selector select { width: 68px; }
  .hero { padding-left: 16px; padding-right: 16px; }
  .hero h1 { font-size: 36px; }
  .hero-search button { padding: 0 11px; font-size: 11px; }
  .book-grid { grid-template-columns: 1fr; gap: 16px; }
  .card-cover-link { height: min(420px, 104vw); }
}
@media (max-width: 768px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--paper);
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--line);
    margin: 0;
    gap: 0;
  }
  .main-nav.is-open {
    display: flex;
  }
  .main-nav a {
    height: auto;
    padding: 12px 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .menu-toggle {
    display: block;
    margin-left: auto;
  }
  .currency-selector {
    margin-left: 0;
  }
  .cart-label {
    display: none;
  }
  .cart-button {
    padding: 6px 12px;
  }
  .hero {
    padding: 40px 16px;
  }
  .hero-copy {
    width: 100%;
  }
  .hero-image-wrap {
    opacity: 0.2;
    width: 100%;
  }
  .hero h1 {
    font-size: 36px;
  }
  .bundles-grid {
    grid-template-columns: 1fr;
  }
  .quality-grid {
    grid-template-columns: 1fr;
  }
  .book-dialog-body {
    grid-template-columns: 1fr;
  }
  .dialog-book-cover {
    height: 240px;
    width: 160px;
    margin: 0 auto;
  }
}

@media (min-width: 521px) and (max-width: 768px) {
  .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .card-cover-link {
    height: 190px;
  }
}
