@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Open+Sans:wght@300;400;500;600;700&family=Playpen+Sans:wght@100..800&family=Roboto:wght@100;300;400;500&display=swap');

html {
  scroll-behavior: smooth;
}

/* ==============================
   🔹 БАЗОВЫЕ ПЕРЕМЕННЫЕ
============================== */
:root {
  --bg: #f7f8fb;
  --bg-alt: #e9eef6;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #667085;
  --brand: #2ac0cf;
  --brand-2: #4eced9;
  --accent: #27c88d;
  --warning-bg: #fff7ed;
  --warning-border: #fdba74;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 6px 18px rgba(17, 24, 39, 0.08);
}

/* ==============================
   🔹 БАЗОВЫЕ СТИЛИ
============================== */
* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
}

/* ==============================
   🔹 КОНТЕЙНЕР
============================== */
.mybooks-container {
  max-width: 1280px;
  width: calc(100% - 32px);
  margin: 0 auto;
  padding: 16px;
  min-height: calc(100vh - 240px);
}

@media (max-width: 900px) { .mybooks-container { padding: 14px; } }
@media (max-width: 520px) { .mybooks-container { width: calc(100% - 20px); padding: 10px; } }

/* ==============================
   🔹 ЗАГОЛОВОК
============================== */
.page-title {
  margin: 24px 4px 18px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .2px;
}

/* ==============================
   🔹 СЕТКА КНИГ
============================== */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  align-items: stretch;
  margin-bottom: 60px;
}
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; gap: 20px; } }

/* ==============================
   🔹 КАРТОЧКИ КНИГ
============================== */
.book-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 2px 4px 4px 4px;
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.book-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(17, 24, 39, .12);
}

/* Обложка */
.cover-wrap { position: relative; background: #f2f4f8; }
.img_cover { width: 100%; display: block; border-radius: 2px 8px 8px 2px; }

/* Имитация корешка */
.book-spine { position: absolute; top: 0; height: 100%; pointer-events: none; border-radius: 4px; }
.book-spine.layer1 { left: 0; width: 3px; background: rgba(255,255,255,.8); filter: blur(.8px); }
.book-spine.layer2 { left: 3%; width: 1.5px; background: rgba(0,0,0,.09); filter: blur(1.6px); }
.book-spine.layer3 { left: 3.7%; width: 1.6px; background: rgba(0,0,0,.18); filter: blur(.7px); }

/* Плейсхолдер */
.no-cover {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 4;
  background: linear-gradient(180deg, #eef2f7, #e6ebf3);
  color: #7b8794;
  font-size: 12px;
  text-transform: uppercase;
}

/* Название */
.book-title {
  padding: 12px 14px 8px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  word-wrap: break-word;
}

/* Метаданные */
.book-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 14px 10px;
  gap: 10px;
}
.book-meta__left {
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
}

/* Нижняя панель */
.book-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 14px;
  margin-top: auto;
}

/* ==============================
   🔹 КНОПКИ
============================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, transform .06s ease;
}
.btn:hover { background: var(--brand-2); }
.btn:active { transform: translateY(1px); }

.btn--accent { background: var(--accent); border-color: var(--accent); }
.btn--light { background: #fff; color: #701a53; border-color: #fff; }
.btn--light:hover { background: #ffffff; border-color: #f3889a; }
.btn-pink { background: #f591a2 !important; border-color: #f3889a !important; }
.btn-brand { background: var(--brand); border-color: var(--brand); }

/* ==============================
   🔹 ЦЕНЫ
============================== */
.price-tag,
.price-new {
  font-size: 16px;
  color: #d02a2a;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: bold;
  line-height: 1;
  white-space: nowrap;
}
.price-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}
.price-old {
  font-size: 14px;
  color: #6b7280;
  text-decoration: line-through;
}
@media (max-width: 520px) {
  .price-tag, .price-new { font-size: 15px; }
  .price-old { font-size: 13px; }
}

/* ==============================
   🔹 БЕЙДЖ СКИДКИ
============================== */
.discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  min-width: 52px;
  height: 52px;
  border-radius: 7px;
  font-family: "Inter", sans-serif;
  background: radial-gradient(circle at 30% 30%, black, black 65%);
  color: red;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 6px 18px rgba(208,42,42,.28), inset 0 0 0 1px black;
}
@media (max-width: 520px) {
  .discount-badge {
    min-width: 44px;
    height: 44px;
    font-size: 14px;
    top: 8px;
    right: 8px;
  }
}

/* ==============================
   🔹 PROMO-БАННЕР
============================== */
.promo-banner {
  background: #ffe5eb;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 500px;
  margin: 12px 0 24px;
}

.promo-inner {
  display: grid;
  grid-template-columns: 1fr 1fr; /* текст / видео */
  gap: 32px;
  padding: 30px;
  align-items: stretch;
  height: 100%;
}

.promo-text {
  align-self: center;
  max-width: 640px;
  padding: 30px;
}

.promo-eyebrow {
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #9b3a7a;
  margin-bottom: 8px;
}

.promo-title {
  margin: 0 0 10px;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 800;
  color: #701a53;
}

.promo-subtitle {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.6;
  color: #7b3b66;
}

.promo-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.promo-actions a {
  text-decoration: none;
}

/* Видео справа */
.promo-video {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px;

  /* квадрат 600×600 */
  width: 100%;
  max-width: 450px;
  aspect-ratio: 1 / 1;
  margin-left: auto; /* прижимает видео вправо */
}

.promo-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

/* ==============================
   🔹 АДАПТИВНОСТЬ
============================== */
@media (max-width: 900px) {
  .promo-inner { grid-template-columns: 1fr; gap: 10px; padding: 0px; }
  .promo-banner { min-height: 420px; }
  .promo-title { font-size: 26px; }
}
@media (max-width: 520px) {
  .promo-banner { min-height: 360px; }
  .promo-title { font-size: 22px; }
  .promo-subtitle { font-size: 14px; }
}

/* На мобильных — видео сверху, текст снизу */
@media (max-width: 900px) {
  .promo-inner {
    display: flex;
    flex-direction: column; /* превращаем grid в column layout */
  }

  .promo-video {
    order: -1; /* поднимаем видео вверх */
  }

  .promo-text {
    padding: 10px 10px 20px 10px;
  }
}

@media (max-width: 900px) {
  .promo-video {
    max-width: 90vw;
    margin: 0 auto;
  }
}

