/**
 * textpdr-shop — глобальні стилі
 * Mobile First, BEM, CSS Variables
 */

/* -------------------------------------------------------------------------- */
/* CSS Variables                                                              */
/* -------------------------------------------------------------------------- */
:root {
  /* Палітра */
  --color-bg: #ffffff;
  --color-surface: #f7f8fa;
  --color-text: #1c1c1e;
  --color-text-muted: #5c5c64;
  --color-border: #e5e7eb;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-accent-soft: rgba(37, 99, 235, 0.1);
  --color-success: #16a34a;
  --color-error: #dc2626;
  --color-white: #ffffff;
  --color-overlay: rgba(28, 28, 30, 0.55);

  /* Типографіка */
  --font-heading: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 2rem;
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --lh-tight: 1.25;
  --lh-normal: 1.5;

  /* Відступи та радіуси */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* Обкладинка книги: 320×416 та каталог 400×520 → 10:13 */
  --book-cover-aspect: 10 / 13;
  /* Вужчі кути рамки ніж у загального UI — як у друкованої палітурки */
  --radius-book: 8px;

  /* Тіні */
  --shadow-sm: 0 1px 2px rgba(28, 28, 30, 0.06);
  --shadow-md: 0 4px 12px rgba(28, 28, 30, 0.08);
  --shadow-lg: 0 12px 32px rgba(28, 28, 30, 0.12);

  /* Макет */
  --container-max: 1180px;
  --header-height: 64px;

  /* Переходи */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 0.15s;
  --duration-norm: 0.25s;
}

@media (min-width: 768px) {
  :root {
    --fs-3xl: 2.25rem;
    --header-height: 72px;
  }
}

/* -------------------------------------------------------------------------- */
/* Reset / Base                                                               */
/* -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--color-accent-hover);
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: fixed;
  left: var(--space-4);
  top: var(--space-4);
  z-index: 10000;
  width: auto;
  height: auto;
  padding: var(--space-3) var(--space-4);
  background: var(--color-accent);
  color: var(--color-white);
  border-radius: var(--radius-sm);
}

/* -------------------------------------------------------------------------- */
/* Typography                                                                 */
/* -------------------------------------------------------------------------- */
h1,
h2,
h3,
.h1,
.h2,
.h3 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  margin: 0 0 var(--space-4);
  color: var(--color-text);
}

h1,
.h1 {
  font-size: var(--fs-3xl);
}

h2,
.h2 {
  font-size: var(--fs-2xl);
}

h3,
.h3 {
  font-size: var(--fs-xl);
}

p {
  margin: 0 0 var(--space-4);
}

.text-muted {
  color: var(--color-text-muted);
}

.lead {
  font-size: var(--fs-lg);
  color: var(--color-text-muted);
}

/* -------------------------------------------------------------------------- */
/* Layout                                                                     */
/* -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.section {
  padding-top: var(--space-10);
  padding-bottom: var(--space-10);
}

.section--surface {
  background-color: var(--color-surface);
}

.section__head {
  margin-bottom: var(--space-8);
  text-align: center;
}

.section__title {
  margin-bottom: var(--space-2);
}

.section__intro {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* Сітка карток */
.grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* -------------------------------------------------------------------------- */
/* Header                                                                     */
/* -------------------------------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: var(--space-4);
}

.logo {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  font-size: var(--fs-lg);
  color: var(--color-text);
  text-decoration: none;
}

.logo__accent {
  color: var(--color-accent);
}

.logo:hover {
  color: var(--color-text);
}

.nav {
  display: none;
}

@media (min-width: 768px) {
  .nav {
    display: flex;
    align-items: center;
    gap: var(--space-6);
  }

  .nav__link {
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--color-text);
    text-decoration: none;
  }

  .nav__link:hover {
    color: var(--color-accent);
  }
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  text-decoration: none;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.cart-link:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

.cart-link__icon {
  width: 22px;
  height: 22px;
}

.cart-link__count {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  line-height: 18px;
  text-align: center;
  color: var(--color-white);
  background: var(--color-accent);
  border-radius: var(--radius-full);
}

.cart-link__count:empty,
.cart-link__count[data-count="0"] {
  display: none;
}

/* Мобільне меню */
.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
}

@media (min-width: 768px) {
  .menu-toggle {
    display: none;
  }
}

.mobile-nav {
  display: none;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}

.mobile-nav.is-open {
  display: block;
}

.mobile-nav__list {
  list-style: none;
  margin: 0;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.mobile-nav__link {
  font-weight: var(--fw-medium);
  color: var(--color-text);
  text-decoration: none;
}

/* -------------------------------------------------------------------------- */
/* Hero                                                                       */
/* -------------------------------------------------------------------------- */
.hero {
  padding-top: var(--space-10);
  padding-bottom: var(--space-10);
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-bg) 100%);
}

.hero__grid {
  display: grid;
  gap: var(--space-8);
  align-items: center;
}

@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr 1fr;
  }
}

.hero__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.hero__visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* -------------------------------------------------------------------------- */
/* Hero Carousel                                                              */
/* -------------------------------------------------------------------------- */
.hero-carousel {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.hero-carousel__track {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  aspect-ratio: var(--book-cover-aspect);
}

.hero-carousel__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.hero-carousel__slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.hero-carousel__slide a {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-carousel__slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(28, 28, 30, 0.18);
}

.hero-carousel__dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.hero-carousel__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--color-border);
  cursor: pointer;
  padding: 0;
  transition: background var(--duration-norm), width var(--duration-norm);
}

.hero-carousel__dot.is-active {
  background: var(--color-accent);
  width: 24px;
}


/* -------------------------------------------------------------------------- */
/* Buttons                                                                    */
/* -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-6);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--duration-fast), color var(--duration-fast),
    border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast);
}

.btn--primary {
  background: var(--color-accent);
  color: var(--color-white);
}

.btn--primary:hover {
  background: var(--color-accent-hover);
}

.btn--secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn--secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn--ghost {
  background: transparent;
  color: var(--color-accent);
}

.btn--sm {
  min-height: 38px;
  padding: 0 var(--space-4);
  font-size: var(--fs-xs);
}

.btn--lg {
  min-height: 48px;
  padding: 0 var(--space-8);
  font-size: var(--fs-base);
}

.btn--block {
  width: 100%;
}

.btn--success {
  background: var(--color-success) !important;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* -------------------------------------------------------------------------- */
/* Cards (каталог)                                                            */
/* -------------------------------------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--radius-book) var(--radius-book) var(--radius-lg) var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration-norm) var(--ease-out), transform var(--duration-norm) var(--ease-out);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card__media {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--color-surface);
  aspect-ratio: var(--book-cover-aspect);
}

.card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

/* Обкладинка в каталозі: стабільна «палітурка», без розтягування сітки */
.card--book .card__media {
  background: var(--color-surface);
}

.card__badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  padding: var(--space-1) var(--space-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--color-white);
  background: var(--color-error);
  border-radius: var(--radius-full);
}

.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--space-5);
}

.card__title {
  font-size: var(--fs-lg);
  margin-bottom: var(--space-2);
}

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

.card__title a:hover {
  color: var(--color-accent);
}

.card__subtitle {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.card__excerpt {
  font-size: var(--fs-sm);
  margin-bottom: var(--space-5);
  flex: 1;
}

.card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.card__price .price {
  font-weight: var(--fw-bold);
  font-size: var(--fs-lg);
  color: var(--color-text);
}

.card__sold {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.price--old {
  text-decoration: line-through;
  font-weight: var(--fw-normal);
  color: var(--color-text-muted);
  margin-right: var(--space-2);
  font-size: var(--fs-sm);
}

/* -------------------------------------------------------------------------- */
/* Сторінка книги                                                             */
/* -------------------------------------------------------------------------- */
.book-layout {
  display: grid;
  gap: var(--space-8);
}

@media (min-width: 900px) {
  .book-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    align-items: start;
  }
}

/* Карусель скрінів на сторінці книги */
.book-gallery-carousel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
}

@media (min-width: 640px) {
  .book-gallery-carousel {
    gap: var(--space-3);
  }
}

.book-gallery-carousel__btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--duration-fast), background var(--duration-fast),
    opacity var(--duration-fast);
}

.book-gallery-carousel__btn:hover:not(:disabled) {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.book-gallery-carousel__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.book-gallery-carousel__viewport {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.book-gallery-carousel__viewport:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.book-gallery-carousel__track {
  list-style: none;
  margin: 0;
  padding: var(--space-2) 0;
  display: flex;
  gap: 0;
  position: relative;
}

.book-gallery-carousel__slide {
  flex: 0 0 auto;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: flex;
  justify-content: center;
  align-items: stretch;
  min-width: 0;
  box-sizing: border-box;
}

.book-gallery-carousel__slide .gallery__thumb {
  width: min(288px, 100%);
}

.gallery__thumb {
  padding: 0;
  border: none;
  border-radius: var(--radius-book);
  background: transparent;
  overflow: hidden;
  cursor: zoom-in;
  display: block;
}

.gallery__thumb:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Скріншоти (всі слайди за замовчуванням): contain, щоб нічого не обрізалось */
.gallery__thumb img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-book);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

/* Перший слайд — обкладинка: показуємо повністю без обрізання */
.book-gallery-carousel__slide:first-child .gallery__thumb img {
  background: transparent;
  box-shadow: var(--shadow-lg);
}

.format-switcher {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: var(--space-6) 0;
}

.format {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}

.format--active {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}

.format--disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.format__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.format__label {
  font-weight: var(--fw-semibold);
}

.format__price {
  text-align: right;
}

.format__na {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

/* -------------------------------------------------------------------------- */
/* Addon option (додаткова опція на сторінці книги)                           */
/* -------------------------------------------------------------------------- */
#book-addon {
  margin-bottom: var(--space-4);
}

.addon-option {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--duration-fast), background var(--duration-fast);
  user-select: none;
}

.addon-option:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}

.addon-option__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.addon-option__check {
  flex-shrink: 0;
  position: relative;
  width: 20px;
  height: 20px;
}

.addon-option__box {
  display: block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  transition: border-color var(--duration-fast), background var(--duration-fast);
}

.addon-option__input:checked ~ .addon-option__box {
  border-color: var(--color-accent);
  background: var(--color-accent);
}

.addon-option__input:checked ~ .addon-option__box::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 6px;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.addon-option__input:checked + .addon-option__box {
  border-color: var(--color-accent);
  background: var(--color-accent);
}

.addon-option__input:checked + .addon-option__box::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 6px;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.addon-option:has(.addon-option__input:checked) {
  border-color: var(--color-accent);
  border-style: solid;
  background: var(--color-accent-soft);
}

.addon-option__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.addon-option__title {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  color: var(--color-text);
}

.addon-option__sub {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.addon-option__price {
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  color: var(--color-accent);
  white-space: nowrap;
}

.prose {
  max-width: 72ch;
}

.prose p:last-child {
  margin-bottom: 0;
}

/* Зміст */
.toc {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc__item {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--fs-sm);
}

.toc__page {
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* Відгуки */
.review {
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
}

.review__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.review__name {
  font-weight: var(--fw-semibold);
}

.review__date {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.review__text {
  margin: 0;
  font-size: var(--fs-sm);
}

.stars {
  margin-bottom: var(--space-2);
}

.stars__item {
  color: var(--color-border);
  font-size: var(--fs-sm);
}

.stars__item--full {
  color: #f59e0b;
}

.reviews-grid {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .reviews-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Акордеон FAQ */
.accordion__item {
  border-bottom: 1px solid var(--color-border);
}

.accordion__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  font-family: var(--font-heading);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  text-align: left;
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
}

.accordion__icon {
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--color-accent);
  border-bottom: 2px solid var(--color-accent);
  transform: rotate(45deg);
  transition: transform var(--duration-norm) var(--ease-out);
  flex-shrink: 0;
}

.accordion__trigger[aria-expanded="true"] .accordion__icon {
  transform: rotate(-135deg);
}

.accordion__panel {
  padding-bottom: var(--space-4);
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

.accordion__panel p {
  margin: 0;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-overlay);
  padding: var(--space-4);
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox__dialog {
  position: relative;
  max-width: min(920px, 100%);
  max-height: 90vh;
}

.lightbox__img {
  display: block;
  max-height: 85vh;
  max-width: min(920px, 100%);
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  border-radius: var(--radius-book);
  box-shadow: var(--shadow-lg);
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

.lightbox__close {
  top: var(--space-3);
  right: var(--space-3);
  transform: none;
}

.lightbox__nav--prev {
  left: var(--space-3);
}

.lightbox__nav--next {
  right: var(--space-3);
}

body.lightbox-on {
  overflow: hidden;
}

/* -------------------------------------------------------------------------- */
/* Кошик                                                                      */
/* -------------------------------------------------------------------------- */
.cart-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.cart-table th,
.cart-table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.cart-table th {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.cart-item__title {
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-1);
}

.cart-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.cart-qty__btn {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--color-surface);
  font-size: 18px;
  cursor: pointer;
}

.cart-qty__value {
  width: 40px;
  text-align: center;
  font-weight: var(--fw-semibold);
}

.cart-empty {
  padding: var(--space-10);
  text-align: center;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.checkout-grid {
  display: grid;
  gap: var(--space-8);
}

@media (min-width: 900px) {
  .checkout-grid {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
  }
}

.panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  background: var(--color-bg);
}

.panel__title {
  margin-bottom: var(--space-4);
  font-size: var(--fs-lg);
}

.form-grid {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .form-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.field__label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}

.field__input,
.field__select,
.field__textarea {
  min-height: 44px;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
}

.field__textarea {
  min-height: 100px;
  resize: vertical;
}

.field__hint {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.radio {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.radio__input {
  margin-top: 4px;
}

.radio--active {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) 0;
  font-size: var(--fs-sm);
}

.summary-row--total {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-3);
  padding-top: var(--space-4);
}

/* -------------------------------------------------------------------------- */
/* Модалки: exit-intent, cookie                                               */
/* -------------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: var(--color-overlay);
}

.modal[hidden] {
  display: none !important;
}

.modal__dialog {
  width: 100%;
  max-width: 480px;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  box-shadow: var(--shadow-lg);
  position: relative;
}

.modal__close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 36px;
  height: 36px;
  border: none;
  background: var(--color-surface);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.modal__title {
  margin-bottom: var(--space-3);
  padding-right: var(--space-8);
}

.modal__text {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10030;
  padding: var(--space-4);
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 24px rgba(28, 28, 30, 0.08);
}

.cookie-banner[hidden] {
  display: none !important;
}

.cookie-banner__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .cookie-banner__inner {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

.cookie-banner__text {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  margin: 0;
}

.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* -------------------------------------------------------------------------- */
/* Footer                                                                     */
/* -------------------------------------------------------------------------- */
.footer {
  margin-top: var(--space-12);
  padding-top: var(--space-10);
  padding-bottom: var(--space-8);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.footer__grid {
  display: grid;
  gap: var(--space-8);
}

@media (min-width: 768px) {
  .footer__grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer__brand {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  margin-bottom: var(--space-3);
}

.footer__text {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  margin: 0;
}

.footer__title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-3);
}

.footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer__link {
  font-size: var(--fs-sm);
  color: var(--color-text);
  text-decoration: none;
}

.footer__link:hover {
  color: var(--color-accent);
}

.footer__bottom {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  text-align: center;
}

/* -------------------------------------------------------------------------- */
/* Utility                                                                    */
/* -------------------------------------------------------------------------- */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.stack--lg {
  gap: var(--space-6);
}

.mt-0 {
  margin-top: 0;
}

.text-center {
  text-align: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-4);
}

.error-page__code {
  font-family: var(--font-heading);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: var(--fw-bold);
  color: var(--color-accent);
  line-height: 1;
}
