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

:root {
  --burgundy: #4a0e1e;
  --burgundy-dark: #3a0a17;
  --brown: #8b5e3c;
  --brown-light: #a67c52;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --bg: #faf7f2;
  --white: #fff;
  --star: #e8a800;
  --red: #d62828;
}

body {
  font-family: "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  gap: 64px;
}

/* ─── Шапка ─────────────────────────────────────────────────── */

.header {
  padding: 24px 0;
  border-bottom: 1px solid #f0f0f0;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.logo__img {
  width: 189px;
  height: 189px;
  object-fit: contain;
  display: block;
}

.logo__text-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo__text {
  font-family: 'Georgia', serif;
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #1a1a1a;
  margin: 0;
}

.logo__subtitle {
  font-size: 12px;
  line-height: 1.4;
  color: #666;
  text-transform: lowercase;
  margin: 0;
}

/* Меню */
.nav__list {
  display: flex;
  gap: 32px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav__link {
  text-decoration: none;
  color: #333;
  font-size: 16px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav__link:hover {
  color: #8b4513;
}

.nav__link--login {
  color: #8b4513;
  font-weight: 700;
}

/* Поиск */
.search {
  display: flex;
  width: 100%;
  max-width: 400px;
}

.search__input {
  width: 100%;
  padding: 12px 20px;
  border: 1px solid #dcdcdc;
  border-radius: 50px;
  border-right: none;
  outline: none;
  font-size: 14px;
  color: #333;
  background: #fff;
}

.search__btn {
  background-color: #a67b5b;
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.search__btn:hover {
  background-color: #8b4513;
}

.search__btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: white;
}


.hero {
  background: var(--bg);
  padding: 120px 0;
  position: relative;
  overflow: hidden;
}

.hero__inner {
  display: flex;
  align-items: center;
  gap: 80px;
}

.hero__text {
  max-width: 500px;
}

.hero__title {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.hero__subtitle {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--text);
}

.hero__desc {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.hero__cover img {
  width: 100%;
  max-width: 400px;
  height: auto;
}

.btn--hero {
  display: inline-block;
  background: var(--brown-light);
  color: var(--white);
  padding: 14px 36px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 16px;
  transition: background .2s;
}

.btn--hero:hover { background: var(--brown); }

.hero__dots {
  display: flex;
  gap: 8px;
  margin-top: 28px;
}

.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
}

.dot--active { background: rgba(255,255,255,.9); }

/* ─── Секции книг ───────────────────────────────────────────── */

.books-section { padding: 48px 0; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.section-title {
  font-size: 26px;
  font-weight: 700;
}

.section-all {
  font-size: 15px;
  color: var(--brown);
  font-weight: 500;
  transition: color .2s;
}

.section-all:hover { color: var(--burgundy); }

/* ─── Сетка и карточка ──────────────────────────────────────── */

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
}

.book-card {
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: box-shadow .25s, transform .25s;
  position: relative;
}

.book-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  transform: translateY(-4px);
}

.book-card__cover {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.book-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-card__discount {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--red);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
}

.book-card__fav {
  position: absolute;
  bottom: 10px; right: 10px;
  width: 36px; height: 36px;
  border: none;
  background: rgba(255,255,255,.85);
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .2s;
}

.book-card__fav:hover { transform: scale(1.15); }
.book-card__fav.active { background: var(--red); color: var(--white); }

.book-card__info { padding: 14px 16px 18px; }

.book-card__type {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.book-card__prices {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.book-card__old-price {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.book-card__new-price {
  font-size: 18px;
  font-weight: 700;
}

.book-card__title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.book-card__author {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.book-card__rating {
  display: flex;
  gap: 2px;
  margin-bottom: 14px;
}

.star { font-size: 16px; color: #ccc; }
.star.filled { color: var(--star); }

.book-card__btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: var(--brown);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}

.book-card__btn:hover { background: var(--burgundy); }


.skeleton-card {
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
}

.skeleton-cover {
  aspect-ratio: 3 / 4;
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-line {
  height: 14px;
  margin: 10px 16px;
  border-radius: 4px;
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-line:last-child { width: 60%; }

@keyframes shimmer {
  to { background-position: -200% 0; }
}


.footer {
  background: var(--burgundy-dark);
  color: rgba(255,255,255,.8);
  padding: 48px 0 28px;
}

.footer__inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 36px;
}

.footer__heading {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--white);
}

.footer__list li { margin-bottom: 10px; }

.footer__list a {
  font-size: 14px;
  transition: color .2s;
}

.footer__list a:hover { color: var(--white); }

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,.15);
  padding-top: 24px;
}

.footer__socials { display: flex; gap: 12px; }

.social {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  transition: background .2s;
}

.social:hover { background: rgba(255,255,255,.25); }

.footer__copyright {
  font-size: 13px;
  text-align: right;
  opacity: .6;
}


.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.modal--open {
  display: flex;
}

.modal__content {
  position: relative;
  background: var(--white);
  padding: 40px 36px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 420px;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal__close {
  position: absolute;
  right: 16px;
  top: 12px;
  cursor: pointer;
  font-size: 28px;
  color: var(--text-muted);
  line-height: 1;
  transition: color 0.2s;
}

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

.modal__title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 28px;
  color: var(--text);
}

.modal__field {
  margin-bottom: 20px;
}

.modal__label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.modal__input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d4c9b8;
  border-radius: 8px;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s;
}

.modal__input:focus {
  border-color: var(--brown-light);
}

.modal__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 14px;
}

.modal__remember {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  cursor: pointer;
}

.modal__forgot {
  color: var(--brown);
  transition: color 0.2s;
}

.modal__forgot:hover {
  color: var(--burgundy);
}

.modal__btn {
  width: 100%;
  padding: 14px;
  background: var(--burgundy);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.modal__btn:hover {
  background: var(--burgundy-dark);
}

.modal__register {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
}

.modal__register-link {
  color: var(--brown);
  font-weight: 500;
  transition: color 0.2s;
}

.modal__login-link {
  color: var(--brown);
  font-weight: 500;
  transition: color 0.2s;
}

.modal__login-link:hover {
  color: var(--burgundy);
}

.modal__optional {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}


/* ─── Корзина ───────────────────────────────────────────────── */

.cart {
  padding: 48px 0;
}

.cart__title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text);
}

/* Выбрать все */
.cart__select-all {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  margin-bottom: 8px;
}

.cart__select-all label {
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
}

/* Чекбокс */
.checkbox {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #c4b8a8;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  outline: none;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.checkbox:checked {
  background: var(--burgundy);
  border-color: var(--burgundy);
}

.checkbox:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Список товаров */
.cart__items {
  border: 1px solid #e8e0d4;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
}

/* Карточка товара */
.cart__item {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px;
  border-bottom: 1px solid #f0f0f0;
}

.cart__item:last-child {
  border-bottom: none;
}

.cart__product {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}

.cart__image img {
  width: 80px;
  height: 110px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cart__info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cart__item-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.cart__author {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

.cart__weight {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* Цена */
.cart__price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 100px;
}

.cart__old-price {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin: 0;
}

.cart__new-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

/* Количество */
.cart__quantity {
  display: flex;
  align-items: center;
  border: 1px solid #d4c9b8;
  border-radius: 8px;
  overflow: hidden;
}

.btn--quantity {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.btn--quantity:hover {
  background: #f5f0e8;
}

.cart__input {
  width: 48px;
  height: 36px;
  border: none;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  outline: none;
}

.cart__input::-webkit-outer-spin-button,
.cart__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Удалить */
.btn--remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}

.btn--remove:hover {
  color: var(--burgundy);
  background: rgba(139, 0, 0, 0.05);
}

/* Подвал корзины */
.cart__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid #e8e0d4;
}

.btn--secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: transparent;
  border: 1px solid #d4c9b8;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn--secondary:hover {
  background: #f5f0e8;
  border-color: var(--brown);
}

.cart__summary {
  flex: 1;
  text-align: center;
}

.cart__total-label {
  font-size: 16px;
  color: var(--text-muted);
  margin: 0;
}

.cart__total-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.btn--primary {
  padding: 14px 32px;
  background: var(--burgundy);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn--primary:hover {
  background: var(--burgundy-dark);
}

/* ─── Страница рекомендательных технологий ──────────────────── */

.recommend-page {
  padding: 48px 0;
  background: #faf8f5;
  min-height: calc(100vh - 300px);
}

.recommend-page__title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
}

.recommend-page__intro {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 32px;
  padding: 20px;
  background: #fff;
  border-left: 4px solid var(--burgundy);
  border-radius: 8px;
}

.recommend-page__content {
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.recommend-page__heading {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e8e0d4;
}

.recommend-page__subheading {
  font-size: 18px;
  font-weight: 600;
  color: var(--burgundy);
  margin-top: 28px;
  margin-bottom: 16px;
}

.recommend-page__content p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 12px;
}

.recommend-page__content p strong {
  font-weight: 600;
  color: var(--text);
}

.recommend-page__email {
  color: var(--burgundy);
  text-decoration: underline;
  font-weight: 500;
}

.recommend-page__email:hover {
  color: var(--burgundy-dark);
}

.recommend-page__company {
  font-weight: 600;
  font-size: 16px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e8e0d4;
}

.footer__recommend-link {
  color: var(--text-muted);
  text-decoration: underline;
  transition: color 0.2s;
}

.footer__recommend-link:hover {
  color: var(--burgundy);
}

/* ─── Сайдбар кабинета ──────────────────────────────────────── */

.cabinet {
  padding: 48px 0;
}

.cabinet__wrapper {
  display: flex;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

.sidebar {
  flex-shrink: 0;
  width: 240px;
  background: var(--burgundy-dark);
  border-radius: 12px;
  padding: 24px 0;
  position: sticky;
  top: 24px;
  height: fit-content;
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 16px;
}

.sidebar__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brown-light);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar__name {
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
}

.sidebar__nav {
  padding: 0 12px;
}

.sidebar__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
  margin-bottom: 4px;
}

.sidebar__item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.sidebar__item--active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
}

.sidebar__item svg {
  flex-shrink: 0;
}

.sidebar__label {
  flex: 1;
}

.sidebar__badge {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 50px;
}

.sidebar__bottom {
  padding: 16px 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar__bottom-link {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  transition: color 0.2s;
}

.sidebar__bottom-link:hover {
  color: var(--white);
}

/* ─── Контент кабинета ──────────────────────────────────────── */

.cabinet__content {
  flex: 1;
  min-width: 0;
}

.cabinet__title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text);
}

.cabinet__section {
  margin-bottom: 48px;
}

.cabinet__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.cabinet__card {
  display: flex;
  flex-direction: column;
}

.cabinet__card .book-card {
  height: 100%;
}

/* ─── Блок оценки (review-prompt) ───────────────────────────── */

.review-prompt {
  background: #faf8f5;
  border: 1px solid #e8e0d4;
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 16px 16px 18px;
  margin-top: -10px;
  position: relative;
  z-index: 1;
}

.review-prompt__text {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.review-prompt__question {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.review-prompt__stars {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
}

.review-star {
  font-size: 24px;
  color: #d4c9b8;
  cursor: pointer;
  transition: color 0.15s, transform 0.15s;
  user-select: none;
}

.review-star:hover {
  transform: scale(1.1);
}

.review-star.filled {
  color: var(--star);
}

.review-prompt__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.review-prompt__btn {
  padding: 8px 18px;
  background: var(--burgundy);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.review-prompt__btn:hover {
  background: var(--burgundy-dark);
}

.review-prompt__bonus {
  font-size: 13px;
  color: var(--brown);
  font-weight: 600;
  background: #f5f0e8;
  padding: 4px 12px;
  border-radius: 50px;
}

/* ─── Блок отзыва (review-block) ────────────────────────────── */

.review-block {
  background: #faf8f5;
  border: 1px solid #e8e0d4;
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 16px 16px 18px;
  margin-top: -10px;
  position: relative;
  z-index: 1;
}

.review-block__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.review-block__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brown-light);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.review-block__author {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.review-block__rating {
  display: flex;
  gap: 2px;
  margin-bottom: 10px;
}

.review-block__rating .star {
  font-size: 15px;
}

.review-block__text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 10px;
}

.review-block__text--clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.review-block__toggle {
  background: none;
  border: none;
  color: var(--brown);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}

.review-block__toggle:hover {
  color: var(--burgundy);
}

/* ─── Количество отзывов в карточке ──────────────────────────── */

.book-card__reviews {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 6px;
}

/* ─── Страница оформления заказа ────────────────────────────── */

.checkout {
  padding: 48px 0;
}

.checkout__wrapper {
  display: flex;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  align-items: flex-start;
}

.checkout__form-side {
  flex: 1;
  min-width: 0;
}

.checkout__section {
  margin-bottom: 32px;
}

.checkout__heading {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e8e0d4;
}

.checkout__row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.checkout__field {
  flex: 1;
  margin-bottom: 16px;
}

.checkout__label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.checkout__input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d4c9b8;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.checkout__input:focus {
  border-color: var(--brown-light);
}

/* Варианты доставки/оплаты */
.checkout__options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout__option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid #e8e0d4;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.checkout__option:hover {
  border-color: var(--brown-light);
}

.checkout__option input[type="radio"]:checked + .checkout__option-content {
  color: var(--burgundy);
}

.checkout__option:has(input:checked) {
  border-color: var(--burgundy);
  background: #faf8f5;
}

.checkout__option input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--burgundy);
  width: 18px;
  height: 18px;
}

.checkout__option-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.checkout__option-desc {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Правая часть — итог */
.checkout__summary {
  flex-shrink: 0;
  width: 360px;
  background: var(--white);
  border: 1px solid #e8e0d4;
  border-radius: 12px;
  padding: 24px;
  position: sticky;
  top: 24px;
}

.checkout__items {
  margin-bottom: 20px;
}

.checkout__item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.checkout__item-cover {
  width: 50px;
  height: 70px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.checkout__item-info {
  flex: 1;
  min-width: 0;
}

.checkout__item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.checkout__item-author {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.checkout__item-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--burgundy);
}

.checkout__total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 15px;
  color: var(--text);
}

.checkout__total-line--final {
  border-top: 2px solid #e8e0d4;
  margin-top: 8px;
  padding-top: 16px;
  font-size: 20px;
  font-weight: 700;
}

.checkout__btn {
  width: 100%;
  padding: 14px;
  margin-top: 20px;
  background: var(--burgundy);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.checkout__btn:hover {
  background: var(--burgundy-dark);
}

.checkout__empty {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px 0;
}

/* Успех */
.checkout__success {
  display: none;
  text-align: center;
  padding: 40px 0;
}

.checkout__success-icon {
  font-size: 48px;
  color: #4caf50;
  margin-bottom: 16px;
}

.checkout__success-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.checkout__success-desc {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.checkout__success-link {
  display: inline-block;
  padding: 10px 24px;
  background: var(--burgundy);
  color: var(--white);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}

.checkout__success-link:hover {
  background: var(--burgundy-dark);
}

/* Адаптивность */
@media (max-width: 768px) {
  .checkout__wrapper {
    flex-direction: column;
    padding: 0 16px;
  }

  .checkout__summary {
    width: 100%;
    position: static;
  }

  .checkout__row {
    flex-direction: column;
    gap: 0;
  }
}

/* ─── Кнопка «Смотреть все» ──────────────────────────────────── */

.view-all-btn {
  display: block;
  margin: 24px auto 0;
  padding: 12px 32px;
  background: transparent;
  color: var(--burgundy);
  border: 2px solid var(--burgundy);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.view-all-btn:hover {
  background: var(--burgundy);
  color: var(--white);
}

/* ─── Страница книги ─────────────────────────────────────────── */

.book-page {
  padding: 56px 0 80px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

.book-page__wrapper {
  display: flex;
  gap: 56px;
  max-width: 1100px;
  margin: 0 auto;
  align-items: flex-start;
}

/* Обложка */
.book-page__cover-side {
  flex-shrink: 0;
  position: relative;
}

.book-page__cover {
  width: 280px;
  height: 410px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(109, 41, 49, 0.08), 0 20px 48px rgba(0, 0, 0, 0.12);
  transition: transform 0.3s ease;
}

.book-page__cover:hover {
  transform: translateY(-4px);
}

.book-page__fav {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  font-size: 22px;
  color: #ccc;
  cursor: pointer;
  transition: color 0.25s, transform 0.25s, background 0.25s;
  backdrop-filter: blur(4px);
  z-index: 10;
}

.book-page__fav:hover {
  transform: scale(1.12);
  color: #999;
}

.book-page__fav.active {
  color: #8b2a24; /* Бордовый */
  background: rgba(255, 255, 255, 1);
}

/* Основная информация */
.book-page__info {
  flex: 1;
  min-width: 0;
}

.book-page__type {
  font-size: 13px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 10px;
}

.book-page__title {
  font-size: 30px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 10px;
  line-height: 1.25;
  letter-spacing: -0.3px;
}

.book-page__author {
  font-size: 17px;
  color: #666;
  margin-bottom: 22px;
  font-style: italic;
}

/* Рейтинг */
.book-page__rating {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.book-page__stars {
  display: flex;
  gap: 3px;
}

.book-page__stars .star {
  font-size: 19px;
  color: #e0d6c8;
}

.book-page__stars .star.filled {
  color: #d49a3a;
}

.book-page__rating-num {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
}

/* Цены */
.book-page__prices {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 28px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #faf6f0 0%, #f3ece2 100%);
  border-radius: 12px;
  border: 1px solid #ece3d5;
}

.book-page__old-price {
  font-size: 18px;
  color: #999;
  text-decoration: line-through;
  text-decoration-color: #c9a8a8;
}

.book-page__new-price {
  font-size: 32px;
  font-weight: 800;
  color: #8b2a24; /* Бордовый */
  letter-spacing: -0.5px;
}

.book-page__discount {
  padding: 5px 12px;
  background: #8b2a24;
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* Кнопки */
.book-page__actions {
  display: flex;
  gap: 14px;
  margin-bottom: 36px;
}

.btn--primary {
  padding: 15px 36px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #8b2a24 0%, #5a1e26 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(109, 41, 49, 0.25);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(109, 41, 49, 0.35);
}

.book-page__cart-btn {
  padding: 15px 32px;
  border: 2px solid #8b2a24;
  background: transparent;
  color: #8b2a24;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.book-page__cart-btn:hover {
  background: #8b2a24;
  color: #fff;
  transform: translateY(-2px);
}

/* Мета-данные */
.book-page__meta {
  display: flex;
  flex-direction: column;
  padding: 4px 0;
  border-top: 1px solid #eee5d8;
}

.book-page__meta-row {
  display: flex;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid #f2ebe0;
  transition: background 0.2s;
  border-radius: 4px;
  padding-left: 8px;
  padding-right: 8px;
}

.book-page__meta-row:hover {
  background: #faf7f2;
}

.book-page__meta-label {
  font-size: 14px;
  color: #888;
}

.book-page__meta-value {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  text-align: right;
}

/* Описание */
.book-page__description {
  max-width: 1100px;
  margin: 56px auto 0;
}

.book-page__heading {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid #ece3d5;
  position: relative;
}

.book-page__heading::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: #8b2a24;
}

.book-page__desc-text {
  font-size: 16px;
  line-height: 1.85;
  color: #3a322c;
  max-width: 760px;
}

.book-page__desc-text.clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.review-block__toggle {
  margin-top: 10px;
  background: none;
  border: none;
  color: #8b2a24;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  transition: opacity 0.2s;
}

.review-block__toggle:hover {
  opacity: 0.7;
  text-decoration: underline;
}

/* Отзывы */
.book-page__reviews-section {
  max-width: 1100px;
  margin: 56px auto 0;
}

.review-block {
  padding: 24px 0;
  border-bottom: 1px solid #f0ebe2;
  transition: background 0.2s;
}

.review-block:hover {
  background: #faf8f4;
  border-radius: 10px;
  padding-left: 16px;
  padding-right: 16px;
  margin-left: -16px;
  margin-right: -16px;
}

.review-block__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.review-block__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b2a24 0%, #5a1e26 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  flex-shrink: 0;
}

.review-block__author {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}

.review-block__rating {
  display: flex;
  gap: 2px;
}

.review-block__rating .star {
  font-size: 15px;
  color: #e0d6c8;
}

.review-block__rating .star.filled {
  color: #d49a3a;
}

.review-block__text {
  font-size: 15px;
  line-height: 1.75;
  color: #4a4038;
}

.review-block__text--clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================
   FIREBOOKS — СТРАНИЦА КНИГИ
   МОБИЛЬНАЯ ВЕРСИЯ
   ========================================== */

@media (max-width: 768px) {

  .book-page {
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
  }

  /* Обложка сверху, информация снизу */
  .book-page__wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 32px;
    width: 100%;
  }

  /* Центрируем обложку вместе с сердечком */
  .book-page__cover-side {
    width: 220px;
    max-width: 100%;
    align-self: center;
  }

  .book-page__cover {
    display: block;
    width: 100%;
    height: 320px;
    margin: 0 auto;
  }

  /* Информация занимает всю доступную ширину */
  .book-page__info {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .book-page__title {
    font-size: 24px;
  }

  .book-page__new-price {
    font-size: 26px;
  }

  /* Цена не выходит за границы экрана */
  .book-page__prices {
    flex-wrap: wrap;
    padding: 16px 18px;
    box-sizing: border-box;
  }

  /* Кнопки друг под другом */
  .book-page__actions {
    flex-direction: column;
    width: 100%;
  }

  .book-page__desc-text {
    font-size: 15px;
  }

  .book-page__heading {
    font-size: 20px;
  }

}

/* ─── Автоподсказки поиска ──────────────────────────────────── */

.search-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 400px;
  overflow-y: auto;
  z-index: 200;
  margin-top: 4px;
}

.search-suggest__item {
  display: flex;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #f5f0ea;
}

.search-suggest__item:last-child {
  border-bottom: none;
}

.search-suggest__item:hover {
  background: #faf8f5;
}

.search-suggest__cover {
  width: 40px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.search-suggest__info {
  flex: 1;
  min-width: 0;
}

.search-suggest__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-suggest__author {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.search-suggest__price {
  font-size: 14px;
  font-weight: 700;
  color: var(--burgundy);
}

.search-suggest__empty {
  padding: 16px 14px;
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}

/* ─── Страница профиля (новая) ──────────────────────────────── */

#profile-page {
  padding: 48px 0 80px;
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 36px;
}

.profile-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.btn--logout {
  background: transparent;
  border: 1px solid var(--burgundy);
  color: var(--burgundy);
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn--logout:hover {
  background: var(--burgundy);
  color: var(--white);
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.profile-card {
  background: var(--white);
  padding: 28px;
  border-radius: 14px;
  border: 1px solid #e8e0d4;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.profile-card h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.avatar-box {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #8b2a24;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(74, 14, 30, 0.25);
}

.profile-list {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
}

/* ─── Имя пользователя в шапке ──────────────────────────────── */

.nav__link--user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.nav__link--user svg {
  flex-shrink: 0;
  opacity: 0.6;
}

/* ─── Выпадающее меню профиля ───────────────────────────────── */

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--white);
  border: 1px solid #e8e0d4;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  min-width: 200px;
  padding: 8px 0;
  z-index: 300;
}

.dropdown-menu--open {
  display: block;
}

.dropdown-menu__link {
  display: block;
  padding: 10px 18px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s;
}

.dropdown-menu__link:hover {
  background: #faf6f0;
}

.dropdown-menu__link--danger {
  color: var(--burgundy);
  font-weight: 600;
}

/* ─── Автономный класс .clamped ────────────────────────────── */

.clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Адаптивность ───────────────────────────────────────────── */

@media (max-width: 992px) {
  .cabinet__wrapper {
    flex-direction: column;
    gap: 24px;
  }

  .sidebar {
    width: 100%;
    position: static;
  }

  .sidebar__nav {
    display: flex;
    gap: 8px;
    padding: 0 16px;
  }

  .sidebar__item {
    flex: 1;
    justify-content: center;
  }

  .sidebar__bottom {
    flex-direction: row;
    justify-content: center;
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .cabinet__grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .sidebar__nav {
    flex-direction: column;
  }

  .sidebar__item {
    justify-content: flex-start;
  }

  .sidebar__bottom {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 576px) {
  .cabinet__wrapper {
    padding: 0 16px;
  }

  .cabinet__grid {
    grid-template-columns: 1fr;
  }

  .review-prompt__bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

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

/* ─── Профиль ───────────────────────────────────────────────── */

.profile__section {
  margin-bottom: 40px;
}

.profile__heading {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e8e0d4;
}

/* Личные данные */
.profile__data {
  background: var(--white);
  border: 1px solid #e8e0d4;
  border-radius: 12px;
  padding: 24px;
}

.profile__data-row {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}

.profile__data-item {
  flex: 1;
  min-width: 200px;
}

.profile__data-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.profile__data-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

/* Карта лояльности */
.loyalty-card {
  display: flex;
  gap: 32px;
  background: var(--burgundy);
  border-radius: 12px;
  padding: 28px 32px;
  color: var(--white);
}

.loyalty-card__left {
  flex: 1;
}

.loyalty-card__bonus-block {
  margin-bottom: 16px;
}

.loyalty-card__bonus-pending {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
}

.loyalty-card__bonus-current {
  font-size: 28px;
  font-weight: 700;
}

.loyalty-card__hint {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
  max-width: 400px;
}

.loyalty-card__right {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex-shrink: 0;
}

.loyalty-card__stat {
  text-align: right;
}

.loyalty-card__stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}

.loyalty-card__stat-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  max-width: 180px;
}

/* Карточка заказа */
.order-card {
  background: var(--white);
  border: 1px solid #e8e0d4;
  border-radius: 12px;
  overflow: hidden;
}

.order-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #f0f0f0;
}

.order-card__number {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.order-card__date {
  font-size: 14px;
  color: var(--text-muted);
}

.order-card__status {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 50px;
}

.order-card__status--preorder {
  background: #f5f0e8;
  color: var(--brown);
}

.order-card__delivery {
  padding: 16px 24px;
  font-size: 14px;
  color: var(--text-muted);
  border-bottom: 1px solid #f0f0f0;
}

.order-card__body {
  padding: 20px 24px;
}

.order-card__product {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.order-card__cover {
  width: 60px;
  height: 85px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.order-card__product-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.order-card__product-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.order-card__product-payment {
  font-size: 14px;
  color: var(--text-muted);
}

.order-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.order-card__price {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.order-card__cancel {
  padding: 10px 20px;
  background: transparent;
  border: 1px solid #d4c9b8;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.order-card__cancel:hover {
  background: #f5f0e8;
  border-color: var(--burgundy);
  color: var(--burgundy);
}

/* Пустое состояние */
.profile__empty {
  background: var(--white);
  border: 1px solid #e8e0d4;
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
}

.profile__empty-text {
  font-size: 15px;
  color: var(--text-muted);
}

/* ─── Модалка отзыва ─────────────────────────────────────────── */

.review-modal__book {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f0f0;
}

.review-modal__book img {
  width: 60px;
  height: 85px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.review-modal__book-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.review-modal__book-author {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.review-modal__stars {
  display: flex;
  gap: 4px;
}

.review-modal__stars .review-star {
  font-size: 26px;
}

.review-modal__textarea {
  width: 100%;
  min-height: 140px;
  padding: 12px 16px;
  border: 1px solid #d4c9b8;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  outline: none;
  resize: vertical;
  transition: border-color 0.2s;
}

.review-modal__textarea:focus {
  border-color: var(--brown-light);
}

.review-modal__success {
  display: none;
  text-align: center;
  padding: 28px 0;
}

.review-modal__success p:first-child {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.review-modal__success-sub {
  font-size: 14px;
  color: var(--text-muted);
}


/* Адаптивность профиля */
@media (max-width: 768px) {
  .loyalty-card {
    flex-direction: column;
    gap: 20px;
  }

  .loyalty-card__right {
    flex-direction: row;
    gap: 16px;
  }

  .loyalty-card__stat {
    flex: 1;
    text-align: left;
  }

  .order-card__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .order-card__footer {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }

  .order-card__cancel {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .profile__data-row {
    flex-direction: column;
    gap: 16px;
  }
}

/* ==========================================
   FIREBOOKS — улучшение дизайна сайта
   ========================================== */

/* 1. Расширяем содержимое страниц */
.container {
  max-width: 1400px;
  padding-left: 24px;
  padding-right: 24px;
}

.cabinet__wrapper {
  max-width: 1400px;
  padding-left: 24px;
  padding-right: 24px;
}

/* 2. Приводим шапку к единому виду */
.header__inner {
  column-gap: 22px;
  row-gap: 14px;
  flex-wrap: wrap;
}

.header .nav__list {
  gap: 20px;
  align-items: center;
}

.header .nav__item,
.header .nav__link {
  white-space: nowrap;
}

/* 3. Защищаем поиск от сжатия */
.header .search {
  flex: 0 1 300px;
  width: 300px;
  min-width: 190px;
  max-width: 300px;
  align-items: center;
}

.header .search__input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 50px;
  border-radius: 25px 0 0 25px;
  border-right: none;
}

.header .search__btn {
  position: relative;
  flex: 0 0 50px;
  width: 50px;
  min-width: 50px;
  height: 50px;
  padding: 0;
  border-radius: 50%;
  color: #fff;
  font-size: 0;
}

/* Одинаковая аккуратная лупа на всех страницах */
.header .search__btn svg {
  display: none;
}

.header .search__btn::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: calc(50% - 10px);
  left: calc(50% - 10px);
  border: 2px solid currentColor;
  border-radius: 50%;
}

.header .search__btn::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 2px;
  top: calc(50% + 6px);
  left: calc(50% + 3px);
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: left center;
}

/* 4. Даём итоговой стоимости место в корзине */
.cart__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.cart__summary {
  flex: 1 1 190px;
  min-width: 190px;
  text-align: center;
}

.cart__total-price {
  display: inline-block;
  white-space: nowrap;
  font-size: 24px;
  font-weight: 700;
}

.cart__footer button {
  flex-shrink: 0;
  white-space: nowrap;
}

/* 5. Убираем только нижний логотип */
.footer > .footer__logo {
  display: none !important;
}

/* FIREBOOKS — размер верхнего меню */

.header .nav__link {
  font-size: 18px;
  font-weight: 500;
  white-space: nowrap;
}

.header .nav__link--login {
  font-weight: 700;
}

/* FIREBOOKS — цельное поле поиска */

.header .search {
  display: flex;
  align-items: center;
  height: 54px;
  padding: 3px;
  border: 1px solid #dcdcdc;
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}

.header .search__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0 16px;
  border: none;
  border-radius: 0;
  background: transparent;
  outline: none;
}

.header .search__btn {
  flex: 0 0 46px;
  width: 46px;
  min-width: 46px;
  height: 46px;
  border-radius: 50%;
  margin: 0;
}

/* FIREBOOKS — просторное верхнее меню */

.header .nav__list {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 32px;
}

.header .nav__item {
  flex-shrink: 0;
}

.header .nav__link {
  white-space: nowrap;
  font-size: 18px;
}

/* FIREBOOKS — главный баннер в виде карточки */

.hero {
  background: transparent;
  padding: 36px 24px 24px;
  overflow: visible;
}

.hero__inner {
  max-width: 1352px;
  margin: 0 auto;
  padding: 48px 64px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 56px;

  background: var(--burgundy);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(74, 14, 30, 0.12);
}

.hero__text {
  flex: 1 1 0;
  min-width: 0;
  max-width: 580px;
}

.hero__badge {
  color: #e7c9a8;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

.hero__title {
  color: #ffffff;
  font-size: 46px;
  line-height: 1.15;
  margin-bottom: 18px;
}

.hero__desc,
.hero__author {
  color: #f1dedc;
}

.hero__desc {
  margin-bottom: 20px;
}

.hero__author {
  margin-bottom: 28px;
}

.hero .btn--hero {
  border-radius: 8px;
}

.hero__dots .dot {
  background: rgba(255, 255, 255, 0.3);
}

.hero__dots .dot--active {
  background: #ffffff;
}

@media (max-width: 850px) {
  .hero__inner {
    padding: 36px 28px;
    gap: 28px;
    flex-direction: column;
    align-items: flex-start;
  }

  .hero__cover {
    width: 100%;
    flex: none;
  }

  .hero__title {
    font-size: 36px;
  }
}

/* FIREBOOKS — компактнее главный баннер */

.hero {
  padding-top: 26px;
  padding-bottom: 20px;
}

.hero__inner {
  padding: 34px 64px;
}

/* FIREBOOKS — интригующий текст в баннере */

.hero__teaser {
  max-width: 520px;
  margin: 16px 0 24px;
  color: #f1dfd9;
}

.hero__teaser-title {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.4;
}

.hero__teaser p {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
}

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

/* FIREBOOKS — читаемый текст главного баннера */

.hero .hero__teaser,
.hero .hero__teaser-title,
.hero .hero__teaser p {
  color: #ffffff;
}

.hero .hero__teaser-title {
  font-size: 21px;
  font-weight: 600;
}

.hero .hero__teaser p {
  font-size: 16px;
  line-height: 1.55;
}

/* FIREBOOKS — более длинная строка поиска */

.header .search {
  flex: 0 1 390px;
  width: 390px;
  max-width: 390px;
  min-width: 220px;
}

/* FIREBOOKS — переключатели баннеров */

.hero__dots {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero__dots .dot {
  display: block;
  width: 12px;
  height: 12px;
  min-width: 12px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.hero__dots .dot--active {
  background: #ffffff;
}

.hero__dots .dot:focus-visible {
  outline: 2px solid #d9b58a;
  outline-offset: 4px;
}

/* FIREBOOKS — одинаковый размер всех трёх баннеров */

.hero__inner {
  min-height: 620px;
  box-sizing: border-box;
  align-items: center;
}

/* Одинаковое пространство для текста */
.hero__text {
  flex: 1 1 0;
  min-width: 0;
}

/* Ограничиваем область обложки */
.hero__cover {
  flex: 0 0 360px;
  width: 360px;
  height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Не позволяем обложкам менять размер баннера */
.hero__cover img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* На узких экранах оставляем адаптивную высоту */
@media (max-width: 850px) {
  .hero__inner {
    min-height: 0;
  }

  .hero__cover {
    flex: none;
    width: 100%;
    height: 340px;
  }
}

/* FIREBOOKS — книжные разделы главной страницы */

.books-section .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.books-section .section-all {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Четыре книги в одном ряду */
.books-section .book-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

/* Подготовка к небольшим экранам */
@media (max-width: 900px) {
  .books-section .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 550px) {
  .books-section .book-grid {
    grid-template-columns: 1fr;
  }
}

/* FIREBOOKS — правильное расположение книжных разделов */

/* Заголовок и книги больше не стоят бок о бок */
.books-section > .container {
  display: block;
  width: 100%;
}

/* Заголовок слева, ссылка справа */
.books-section .section-head {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.books-section .section-title {
  margin: 0;
  flex: 0 1 auto;
}

.books-section .section-all {
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
}

.books-section .book-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
}

/* На небольших экранах */
@media (max-width: 900px) {
  .books-section .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 550px) {
  .books-section .book-grid {
    grid-template-columns: 1fr;
  }
}

/* FIREBOOKS — сводные мобильные правила.
   Добавить ПОСЛЕ десктопных стилей в static/style.css.
   Заменяет старые присланные мобильные блоки, а не дополняет их.
   Вёрстку profile.html / library.html не изменяет. */

.mobile-promo { display: none; }

@media (max-width: 768px) {
  /* Общая ширина */
  .container {
    width: 100%;
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
    gap: 20px;
  }

  /* Шапка */
  .header { padding: 16px 0; }
  .header .header__inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .header .logo { justify-content: center; }
  .header .logo__img { width: 115px; height: 115px; }
  .header .nav { width: 100%; }
  .header .nav__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 12px;
  }
  .header .nav__item { flex-shrink: 0; }
  .header .nav__list > .nav__item:last-child {
    position: static;
    margin: 0;
  }
  .header .nav__link,
  .header .nav__link--login,
  .header .nav__link--user {
    font-size: 13px;
    white-space: nowrap;
  }
  .header .search {
    flex: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 48px;
  }
  .header .search__btn {
    flex: 0 0 40px;
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  /* Оригинальный баннер: финальная одобренная версия */
  .hero {
    display: block;
    padding: 18px 14px 10px;
    overflow: visible;
  }
  .hero .hero__inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 105px;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 290px;
    min-height: 290px;
    max-height: 290px;
    padding: 18px 16px;
    box-sizing: border-box;
    overflow: hidden;
    background: var(--burgundy);
    background-image: none;
    border-radius: 18px;
  }
  .hero .hero__text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: none;
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding-bottom: 24px;
    box-sizing: border-box;
  }
  .hero .hero__badge { font-size: 11px; margin-bottom: 6px; }
  .hero .hero__title {
    font-size: 20px;
    line-height: 1.2;
    margin-bottom: 8px;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .hero .hero__author { font-size: 13px; margin-bottom: 8px; }
  .hero .hero__desc,
  .hero .hero__teaser p { display: none; }
  .hero .hero__teaser { margin: 6px 0 12px; }
  .hero .hero__teaser-title {
    font-size: 12px;
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .hero .btn--hero {
    display: inline-block;
    align-self: flex-start;
    max-width: 100%;
    padding: 10px 12px;
    font-size: 12px;
    border-radius: 8px;
    background: var(--brown-light);
    background-image: none;
  }
  .hero .hero__cover {
    display: flex;
    grid-column: 2;
    grid-row: 1;
    flex: none;
    width: 105px;
    height: 175px;
    min-width: 0;
    align-self: center;
    justify-self: center;
    align-items: center;
    justify-content: center;
  }
  .hero .hero__cover img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }
  .hero .hero__dots {
    position: absolute;
    display: flex;
    gap: 8px;
    left: 16px;
    bottom: 14px;
    margin: 0;
    padding: 0;
  }
  .hero .hero__dots .dot {
    width: 9px;
    height: 9px;
    min-width: 9px;
  }

  /* Книжные разделы — две карточки */
  .books-section { padding: 28px 0; }
  .books-section > .container { display: block; }
  .books-section .section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }
  .books-section .section-title { font-size: 23px; }
  .books-section .section-all { font-size: 14px; }
  .books-section .book-grid,
  .catalog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .book-card { min-width: 0; }
  .book-card__info { padding: 10px; }
  .book-card__title { font-size: 13px; line-height: 1.35; }
  .book-card__author,
  .book-card__type { font-size: 12px; }
  .book-card__new-price { font-size: 15px; }
  .book-card__old-price { font-size: 12px; }
  .book-card__prices { flex-wrap: wrap; gap: 4px 6px; }
  .book-card__btn { font-size: 13px; padding: 10px 5px; }
  .book-card__discount { font-size: 11px; padding: 3px 6px; }

  /* Каталог */
  .catalog-page > .container { display: block; width: 100%; }
  .catalog-heading,
  .catalog-toolbar,
  .catalog-results,
  .catalog-grid { width: 100%; min-width: 0; }
  .catalog-toolbar { flex-direction: column; align-items: stretch; }
  .catalog-filters { flex-wrap: wrap; }

  /* Заказы и личный кабинет */
  .cabinet { padding: 24px 0 36px; }
  .cabinet > .container {
    display: block;
    width: 100%;
    max-width: 100%;
  }
  .cabinet__wrapper { gap: 20px; padding: 0 16px; }
  .cabinet__title {
    font-size: 24px;
    line-height: 1.3;
    margin-bottom: 16px;
  }
  .cabinet__section { width: 100%; min-width: 0; }
  .cabinet__section .section-title { font-size: 20px; line-height: 1.35; }
  .cabinet__section .section-head { margin-bottom: 18px; }
  #orders-list { width: 100%; min-width: 0; }
  .sidebar {
    width: 100%;
    padding: 12px 0;
    border-radius: 14px;
  }
  .sidebar__user { padding: 0 14px 12px; margin-bottom: 8px; }
  .sidebar__avatar { width: 36px; height: 36px; font-size: 16px; }
  .sidebar__nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 0 10px;
  }
  .sidebar__item {
    min-width: 0;
    min-height: 44px;
    padding: 9px 8px;
    margin: 0;
    font-size: 13px;
    gap: 6px;
    justify-content: flex-start;
  }
  .sidebar__item svg { width: 17px; height: 17px; }
  .sidebar__badge { margin-left: auto; padding: 2px 7px; font-size: 11px; }
  .sidebar__bottom {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 10px 14px 0;
    margin-top: 8px;
  }
  .sidebar__bottom-link { font-size: 12px; }
  .profile__heading { font-size: 19px; margin-bottom: 14px; }
  .cabinet__content .section-head { flex-wrap: wrap; gap: 10px; }
  .btn--logout { font-size: 12px; padding: 8px 12px; }

  /* Корзина */
  .cart { padding: 24px 0 40px; }
  .cart > .container {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 0 16px;
  }
  .cart__title { font-size: 26px; margin-bottom: 10px; }
  .cart__select-all { margin-bottom: 16px; padding: 8px 0; }
  .cart__items {
    width: 100%;
    min-width: 0;
    margin-bottom: 20px;
    overflow: hidden;
  }
  .cart__item {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 12px 10px;
    align-items: center;
    padding: 16px 12px;
  }
  .cart__item > .checkbox { grid-column: 1; grid-row: 1; }
  .cart__product {
    grid-column: 2 / 4;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }
  .cart__image { flex: 0 0 68px; }
  .cart__image img { width: 68px; height: 94px; object-fit: cover; }
  .cart__info { min-width: 0; overflow-wrap: anywhere; }
  .cart__item-title { font-size: 15px; line-height: 1.35; }
  .cart__author { font-size: 13px; }
  .cart__price {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    align-items: flex-start;
  }
  .cart__new-price { font-size: 18px; }
  .cart__quantity { grid-column: 3; grid-row: 2; justify-self: end; }
  .btn--quantity { width: 30px; height: 34px; }
  .cart__input { width: 36px; height: 34px; font-size: 14px; }
  .cart__item > .btn--remove {
    grid-column: 3;
    grid-row: 3;
    justify-self: end;
  }
  .cart__footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    width: 100%;
    padding-top: 20px;
  }
  .cart__footer[hidden] { display: none; }
  #remove-selected { justify-content: center; width: 100%; }
  .cart__summary { flex: none; width: 100%; text-align: right; }
  .cart__total-price { font-size: 24px; }
  #cart-checkout {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    background: #6b1728;
    background-image: none;
  }

  /* Подвал */
  .footer { padding: 32px 0 24px; }
  .footer .footer__inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .footer .footer__bottom {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  .footer__copyright { text-align: left; overflow-wrap: anywhere; }
  .footer__socials { flex-wrap: wrap; }
}

.footer__recommend-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.footer__recommend-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer__recommend-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* FIREBOOKS — иконки социальных сетей */

.footer__socials .social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.footer__socials .social svg {
  display: block;
  width: 21px;
  height: 21px;
  fill: currentColor;
  transition: transform 0.2s ease;
}

.footer__socials .social:hover svg {
  transform: scale(1.1);
}

/* =========================================
   FIREBOOKS — ИСПРАВЛЕНИЯ БИБЛИОТЕКИ
   ========================================= */

/* Компактные карточки только в библиотеке */

#library-grid {
  display: grid;
  grid-template-columns: repeat(
    5,
    minmax(0, 1fr)
  );
  gap: 18px;
}

/* Изображения обложек */

#library-grid .book-card__cover img {
  object-fit: contain;
  background: #f8f5f0;
}

/* Информация под обложкой */

#library-grid .book-card__info {
  padding: 12px;
}

/* =========================================
   ОДИНАКОВЫЕ КРУГЛЫЕ СЧЁТЧИКИ
   ========================================= */

.cabinet .sidebar__badge {
  min-width: 30px;
  margin-left: auto;
  text-align: center;
  border-radius: 999px;
}

/* =========================================
   АДАПТИВНОСТЬ БИБЛИОТЕКИ
   ========================================= */

/* Средние экраны */

@media (max-width: 1399px) {
  #library-grid {
    grid-template-columns: repeat(
      4,
      minmax(0, 1fr)
    );
  }
}

/* Планшеты */

@media (max-width: 1000px) {
  #library-grid {
    grid-template-columns: repeat(
      3,
      minmax(0, 1fr)
    );
  }
}

/* Телефоны */

@media (max-width: 650px) {
  #library-grid {
    grid-template-columns: repeat(
      2,
      minmax(0, 1fr)
    );

    gap: 12px;
  }
}

/* Очень маленькие экраны */

@media (max-width: 360px) {
  #library-grid {
    grid-template-columns: 1fr;
  }
}

/* Кнопка «Купить» — без градиента */
#bp-buy {
  background: #8b2a24;
  background-image: none;
}

#bp-buy:hover {
  background: #8b2a24;
  background-image: none;
}

/* ==========================================
   FIREBOOKS — ТРИ КНИЖНЫЕ АТМОСФЕРЫ
   ========================================== */

/* Общая основа */

.hero .hero__inner {
  position: relative;
  isolation: isolate;
  border-radius: 20px;
  transition: background-color 0.3s ease;
}

/* Полностью убираем старые узоры */

.hero .hero__inner::before {
  content: none !important;
}

/* Содержимое баннера */

.hero .hero__inner > .hero__text,
.hero .hero__inner > .hero__cover {
  z-index: 1;
}

/* Надпись над названием */

.hero .hero__badge {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* Обложка и декорация за ней */

.hero .hero__cover {
  position: relative;
  z-index: 1;
}

.hero .hero__cover::before {
  content: "";
  position: absolute;
  inset: 7% 2%;
  z-index: 0;
  pointer-events: none;
}

.hero .hero__cover img {
  position: relative;
  z-index: 1;
}

/* ==========================================
   01 — ЧЕТВЁРТОЕ КРЫЛО
   ========================================== */

.hero .hero__inner[data-pattern="dragons"] {
  background:
    radial-gradient(
      circle at 77% 48%,
      rgba(214, 185, 137, 0.22),
      transparent 34%
    ),
    linear-gradient(
      115deg,
      #293a46 0%,
      #334754 55%,
      #4b606b 100%
    );
}

.hero .hero__inner[data-pattern="dragons"] .hero__badge,
.hero .hero__inner[data-pattern="dragons"] .hero__teaser-title {
  color: #d6b989;
}

.hero .hero__inner[data-pattern="dragons"] .hero__cover::before {
  border: 1px solid rgba(214, 185, 137, 0.45);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(214, 185, 137, 0.12),
    transparent 70%
  );
  box-shadow: 0 0 60px rgba(214, 185, 137, 0.12);
}

.hero .hero__inner[data-pattern="dragons"] .btn--hero {
  background: #b18a58;
  background-image: none;
  color: #fff;
}

/* ==========================================
   02 — АКАДЕМИЯ ВАМПИРОВ
   ========================================== */

.hero .hero__inner[data-pattern="feathers"] {
  background:
    radial-gradient(
      circle at 78% 48%,
      rgba(207, 137, 160, 0.2),
      transparent 36%
    ),
    linear-gradient(
      115deg,
      #3a1729 0%,
      #481b30 52%,
      #733e57 100%
    );
}

.hero .hero__inner[data-pattern="feathers"] .hero__badge,
.hero .hero__inner[data-pattern="feathers"] .hero__teaser-title {
  color: #f1c4cd;
}

.hero .hero__inner[data-pattern="feathers"] .hero__cover::before {
  inset: 5% 3%;

  border: 1px solid rgba(241, 196, 205, 0.45);

  border-radius:
    180px 180px 12px 12px;

  background: linear-gradient(
    180deg,
    rgba(241, 196, 205, 0.13),
    rgba(50, 10, 30, 0.08)
  );

  box-shadow: 0 0 55px rgba(180, 95, 125, 0.13);
}

.hero .hero__inner[data-pattern="feathers"] .btn--hero {
  background: #a95f77;
  background-image: none;
  color: #fff;
}

/* ГОРДОСТЬ И ПРЕДУБЕЖДЕНИЕ — ЗОЛОТИСТО-БЕЖЕВЫЙ */

.hero .hero__inner[data-pattern="scales"] {
  background:
    radial-gradient(
      circle at 78% 45%,
      rgba(255, 241, 212, 0.20),
      transparent 48%
    ),
    linear-gradient(
      115deg,
      #e0cba7 0%,
      #d5ba8e 52%,
      #c6a46e 100%
    );
}

.hero .hero__inner[data-pattern="scales"] .hero__badge {
  color: #627c6b;
}

.hero .hero__inner[data-pattern="scales"] .hero__title {
  color: #374d41;
  font-family: Georgia, "Times New Roman", serif;
}

.hero .hero__inner[data-pattern="scales"] .hero__author,
.hero .hero__inner[data-pattern="scales"] .hero__desc {
  color: #647568;
}

.hero .hero__inner[data-pattern="scales"] .hero__teaser,
.hero .hero__inner[data-pattern="scales"] .hero__teaser-title,
.hero .hero__inner[data-pattern="scales"] .hero__teaser p {
  color: #45584b;
}

.hero .hero__inner[data-pattern="scales"] .hero__cover::before {
  inset: 5% 2%;

  border: 4px double rgba(130, 141, 112, 0.55);
  border-radius: 3px;

  background: rgba(255, 255, 255, 0.16);
}

.hero.hero__inner[data-pattern="scales"] .btn--hero {
  background: #627c6b;
  background-image: none;
  color: #fff;
}

/* ==========================================
   ОБЩИЕ СТРЕЛКИ
   ========================================== */

.hero .hero__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 42px;
  height: 42px;
  padding: 0;

  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;

  background: rgba(255, 255, 255, 0.95);
  color: #374d41;

  font-size: 30px;
  line-height: 1;

  cursor: pointer;

  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
  transition: background-color 0.2s ease;
}

.hero .hero__arrow:hover {
  background: #f2e9dc;
}

.hero .hero__arrow:focus-visible {
  outline: 2px solid #b18a58;
  outline-offset: 3px;
}

/* Компьютер */

@media (min-width: 769px) {
  .hero .hero__inner {
    overflow: visible;
  }

  .hero .hero__arrow--prev {
    left: -21px;
  }

  .hero .hero__arrow--next {
    right: -21px;
  }
}

/* Телефон — существующий макет сохраняется */

@media (max-width: 768px) {
  .hero .hero__inner {
    overflow: hidden;
  }

  .hero .hero__cover::before {
    inset: 5% 0;
    border-width: 1px;
  }

  .hero .hero__arrow {
    top: auto;
    bottom: 9px;
    transform: none;

    width: 30px;
    height: 30px;

    font-size: 24px;
  }

  .hero .hero__arrow--prev {
    left: 12px;
  }

  .hero .hero__arrow--next {
    right: 12px;
  }

  .hero .hero__badge {
    font-size: 10px;
    letter-spacing: 0.5px;
  }
}

/* FIREBOOKS — стрелки внутри баннера */

@media (min-width: 769px) {
  .hero .hero__inner {
    overflow: hidden;
  }

  .hero .hero__arrow--prev {
    left: 12px;
  }

  .hero .hero__arrow--next {
    right: 12px;
  }
}

/* ==========================================
   FIREBOOKS — ПАТТЕРНЫ ТРЁХ КНИЖНЫХ МИРОВ
   ========================================== */

/* 1. Драконы */
.hero .hero__inner[data-pattern="dragons"] {
  --fb-pattern: url("/static/img/hero-dragons.png");
  --fb-pattern-opacity: 0.18;
}

/* 2. Перья */
.hero .hero__inner[data-pattern="feathers"] {
  --fb-pattern: url("/static/img/hero-feathers.png");
  --fb-pattern-opacity: 0.17;
}

/* 3. Чешуя */
.hero .hero__inner[data-pattern="scales"] {
  --fb-pattern: url("/static/img/hero-scales.png");
  --fb-pattern-opacity: 0.06;
}

/* Полупрозрачный декоративный слой */

.hero .hero__inner::before {
  content: "" !important;

  position: absolute;
  inset: 0;
  z-index: 0;

  border-radius: inherit;
  pointer-events: none;

  background-image: var(--fb-pattern, none);
  background-repeat: repeat;
  background-size: 160px auto;
  background-position: right center;

  opacity: var(--fb-pattern-opacity, 0.16);

  /* Плавное появление узора справа */

  -webkit-mask-image: linear-gradient(
    to right,
    transparent 35%,
    rgba(0, 0, 0, 0.25) 55%,
    #000 85%
  );

  mask-image: linear-gradient(
    to right,
    transparent 35%,
    rgba(0, 0, 0, 0.25) 55%,
    #000 85%
  );
}

/* На телефоне узор ещё нежнее */

@media (max-width: 768px) {
  .hero .hero__inner::before {
    background-size: 105px auto;
    opacity: 0.12;

    -webkit-mask-image: linear-gradient(
      to right,
      transparent 45%,
      #000 100%
    );

    mask-image: linear-gradient(
      to right,
      transparent 45%,
      #000 100%
    );
  }
}

/* ==========================================
   FIREBOOKS — ЧЁТКИЙ ПАТТЕРН ДЛЯ ДЖЕЙН ОСТИН
   ========================================== */

.hero .hero__inner[data-pattern="scales"]::before {
  opacity: 0.42;
  background-size: 145px auto;
  background-position: right center;

  -webkit-mask-image: linear-gradient(
    to right,
    transparent 35%,
    rgba(0, 0, 0, 0.5) 60%,
    #000 85%
  );

  mask-image: linear-gradient(
    to right,
    transparent 35%,
    rgba(0, 0, 0, 0.5) 60%,
    #000 85%
  );
}

/* На телефоне — чуть нежнее */

@media (max-width: 768px) {
  .hero .hero__inner[data-pattern="scales"]::before {
    opacity: 0.30;
    background-size: 100px auto;
  }
}

/* FIREBOOKS — выразительная чешуя для третьего баннера */

.hero .hero__inner[data-pattern="scales"]::before {
  opacity: 0.65;
  background-size: 230px auto;
  background-position: right center;
  mix-blend-mode: multiply;

  -webkit-mask-image: linear-gradient(
    to right,
    transparent 35%,
    rgba(0, 0, 0, 0.45) 55%,
    #000 85%
  );

  mask-image: linear-gradient(
    to right,
    transparent 35%,
    rgba(0, 0, 0, 0.45) 55%,
    #000 85%
  );
}

/* На телефоне сохраняем более нежный узор */

@media (max-width: 768px) {
  .hero .hero__inner[data-pattern="scales"]::before {
    opacity: 0.38;
    background-size: 135px auto;
  }
}

/* FIREBOOKS — небольшой отступ текста от левой стрелки */

@media (min-width: 769px) {
  .hero .hero__inner > .hero__text {
    transform: translateX(22px);
  }
}

/* ==========================================
   FIREBOOKS — ГОРДОСТЬ И ПРЕДУБЕЖДЕНИЕ

   Тёмный бежевый → светлый бежевый
   Крупная чешуя без зелёного оттенка
   Тонкая прямоугольная рамка
   Белый текст

   Только компьютерная версия
   ========================================== */

@media (min-width: 769px) {

  /* 1. ПЛАВНЫЙ ТЁПЛЫЙ БЕЖЕВЫЙ ГРАДИЕНТ */

  .hero .hero__inner[data-pattern="scales"] {
    background: linear-gradient(
      90deg,
      #70523e 0%,
      #80604a 28%,
      #947258 48%,
      #ae8c6b 65%,
      #ceb08e 82%,
      #eddbc0 100%
    );
  }

  /* 2. КРУПНАЯ ЧЕШУЯ БЕЗ ЗЕЛЕНОВАТОГО ОТТЕНКА */

  .hero .hero__inner[data-pattern="scales"]::before {
    content: "" !important;

    position: absolute;
    inset: 0;
    z-index: 0;

    border-radius: inherit;
    pointer-events: none;

    background-image: url("/static/img/hero-scales.png");
    background-repeat: repeat;
    background-size: 235px auto;
    background-position: right center;

    /* Убираем холодный цвет из рисунка */
    filter: grayscale(1) sepia(1) saturate(0.7);

    opacity: 0.45;
    mix-blend-mode: normal;

    /* Чешуя плавно проявляется слева направо */

    -webkit-mask-image: linear-gradient(
      to right,
      transparent 22%,
      rgba(0, 0, 0, 0.35) 43%,
      rgba(0, 0, 0, 0.75) 65%,
      #000 85%
    );

    mask-image: linear-gradient(
      to right,
      transparent 22%,
      rgba(0, 0, 0, 0.35) 43%,
      rgba(0, 0, 0, 0.75) 65%,
      #000 85%
    );
  }

  /* 3. ТОНКАЯ ПРЯМОУГОЛЬНАЯ РАМКА */

  .hero .hero__inner[data-pattern="scales"]
  .hero__cover::before {
    content: "";

    position: absolute;
    inset: 5% 3%;
    z-index: 0;

    pointer-events: none;

    border: 1px solid rgba(255, 248, 235, 0.30);
    border-radius: 10px;

    background: rgba(255, 248, 235, 0.025);

    box-shadow: none;
  }

  /* Обложка поверх рамки */

  .hero .hero__inner[data-pattern="scales"]
  .hero__cover img {
    position: relative;
    z-index: 1;
  }

  /* 4. БЕЛЫЕ НАДПИСИ */

  .hero .hero__inner[data-pattern="scales"] .hero__badge,
  .hero .hero__inner[data-pattern="scales"] .hero__desc,
  .hero .hero__inner[data-pattern="scales"] .hero__title,
  .hero .hero__inner[data-pattern="scales"] .hero__author,
  .hero .hero__inner[data-pattern="scales"] .hero__teaser,
  .hero .hero__inner[data-pattern="scales"] .hero__teaser-title,
  .hero .hero__inner[data-pattern="scales"] .hero__teaser p {
    color: #ffffff !important;
  }

}

/* ==========================================
   FIREBOOKS — ОФОРМЛЕНИЕ ЗАКАЗА
   Исправление только мобильной версии
   ========================================== */

@media (max-width: 768px) {

  /* Основной контейнер */
  .checkout {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .checkout > .container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
  }

  /* Вместо двух колонок — одна */
  .checkout__wrapper {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 28px;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }

  /* Форма и итог заказа */
  .checkout__form-side,
  .checkout__summary {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
  }

  /* Отключаем закрепление итогового блока */
  .checkout__summary {
    position: static !important;
  }

  /* Секции формы */
  .checkout__section,
  .checkout__field {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* Имя и телефон друг под другом */
  .checkout__row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
    gap: 16px;
  }

  /* Поля ввода */
  .checkout__input {
    display: block;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* Варианты доставки и оплаты */
  .checkout__options {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
    gap: 12px;
  }

  .checkout__option {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .checkout__option-content {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  /* Книги в итоговом заказе */
  .checkout__items,
  .checkout__item-info {
    min-width: 0;
    max-width: 100%;
  }

  .checkout__item-title {
    overflow-wrap: anywhere;
  }

  /* Кнопка оформления */
  .checkout__btn {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* ==========================================
   FIREBOOKS — ИСПРАВЛЕНИЕ ВНЕШНЕЙ СЕТКИ
   ОФОРМЛЕНИЯ ЗАКАЗА НА ТЕЛЕФОНЕ
   ========================================== */

@media (max-width: 768px) {

  /* Заголовок и форма больше не стоят рядом */
  .checkout > .container {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  /* Заголовок занимает отдельную строку */
  .checkout > .container > .cabinet__title {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
  }

  /* Форма и итог заказа идут друг под другом */
  .checkout > .container > .checkout__wrapper {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }
}

