/**
 * Начало — витрина: двете книги + комплект
 */
body[data-page="home"] {
  background: #fafafa;
}

body[data-page="home"] #main {
  padding-top: 0.75rem;
  padding-bottom: clamp(2rem, 4vw, 3.5rem);
}

/* Showcase */
body[data-page="home"] .tvor-books-showcase {
  position: relative;
  padding: 0.35rem 0 clamp(3rem, 6vw, 5rem);
}

body[data-page="home"] .tvor-books-showcase .site-wrap {
  width: min(1440px, calc(100% - 1.5rem));
}

body[data-page="home"] .tvor-books-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.28fr) minmax(0, 0.78fr);
  gap: clamp(0.85rem, 1.8vw, 1.35rem);
  align-items: start;
}

/* Две книги без средния комплект */
body[data-page="home"] .tvor-books-grid--no-kit {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 980px;
  margin-inline: auto;
}

body[data-page="home"] .tvor-book-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 2px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
  body[data-page="home"] .tvor-book-card:hover {
    border-color: rgba(168, 28, 68, 0.35);
    box-shadow: 0 6px 24px rgba(168, 28, 68, 0.1);
  }
}

/* Kill sticky :hover / 300ms tap delay on phones */
body[data-page="home"] .tvor-book-card a,
body[data-page="home"] .tvor-book-card-btn,
body[data-page="home"] .tvor-book-kit-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body[data-page="home"] .tvor-books-grid.is-kit-active .tvor-book-card--single {
  opacity: 0.72;
  transition: opacity 0.35s ease;
}

body[data-page="home"] .tvor-book-card--single {
  transition: opacity 0.35s ease;
}

body[data-page="home"] .tvor-book-card-media {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  padding: 1.5rem 1.15rem 1rem;
  background: #fff;
}

body[data-page="home"] .tvor-book-cover-link {
  display: block;
  width: 100%;
  color: inherit;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

body[data-page="home"] .tvor-book-kit-cover-link {
  display: block;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

body[data-page="home"] .tvor-book-frame {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
}

body[data-page="home"] .tvor-book-frame picture {
  display: block;
  width: 100%;
}

body[data-page="home"] .tvor-book-frame img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

body[data-page="home"] .tvor-book-card--single .tvor-book-card-media {
  min-height: 300px;
  padding: 0.15rem 0.1rem 0.1rem;
}

body[data-page="home"] .tvor-book-card--single .tvor-book-frame--mockup {
  width: 100%;
  max-width: none;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: none;
}

body[data-page="home"] .tvor-book-card--single .tvor-book-frame--mockup img {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  margin-inline: auto;
  object-fit: contain;
  image-rendering: auto;
}

body[data-page="home"] .tvor-book-card--single .tvor-book-card-body {
  padding: 0.95rem 1rem 0.7rem;
}

body[data-page="home"] .tvor-book-card--single .tvor-book-card-title {
  font-size: 1.12rem;
  margin-bottom: 0.4rem;
}

/* Simbal Regular + faux-bold прави вертикалните щрихи на „К“ бледи — ползваме UI шрифт */
body[data-page="home"] .tvor-book-card-title,
body[data-page="home"] .tvor-book-kit-badge {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-synthesis: none;
}

body[data-page="home"] .tvor-book-card--single .tvor-book-card-desc {
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 0.45rem;
}

body[data-page="home"] .tvor-book-card--single .tvor-book-card-price {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  margin-top: 0;
}

body[data-page="home"] .tvor-book-card--single .tvor-book-card-btn {
  min-width: 9.5rem;
  padding: 0.6rem 1.15rem;
  font-size: 0.92rem;
}

body[data-page="home"] .tvor-book-card-body {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  padding: 1.15rem 1.25rem 1.35rem;
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

body[data-page="home"] .tvor-book-card-title {
  margin: 0 0 0.4rem;
  font-size: 1.14rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-primary, #a81c44);
}

body[data-page="home"] .tvor-book-card-desc {
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
  line-height: 1.52;
  color: var(--color-muted, #484848);
  flex: 0 0 auto;
}

body[data-page="home"] .tvor-book-card-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary, #a81c44);
}

body[data-page="home"] .tvor-book-card-price-old {
  font-size: 0.95rem;
  font-weight: 500;
  color: #9a9a9a;
  text-decoration: line-through;
}

body[data-page="home"] .tvor-book-card-price-now {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary, #a81c44);
}

body[data-page="home"] .tvor-book-card-btn {
  align-self: center;
  min-width: 10.5rem;
  text-decoration: none;
}

/* Комплект */
body[data-page="home"] .tvor-books-grid-col--kit {
  display: flex;
  align-items: stretch;
  justify-content: center;
  margin-top: 0;
  padding-block: 0;
}

body[data-page="home"] .tvor-book-kit-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 480px;
  min-height: 0;
  padding: 0.85rem 1.25rem 1.15rem;
  text-align: center;
  background: #fff;
  border: 2px solid rgba(168, 28, 68, 0.14);
  border-radius: 16px;
  box-shadow: 0 2px 14px rgba(168, 28, 68, 0.06);
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s ease;
}

body[data-page="home"] .tvor-books-grid-col--kit.is-active .tvor-book-kit-card,
body[data-page="home"] .tvor-book-kit-card:focus-within {
  border-color: rgba(168, 28, 68, 0.4);
  box-shadow: 0 8px 28px rgba(168, 28, 68, 0.14);
  background: #fffcfc;
}

@media (hover: hover) and (pointer: fine) {
  body[data-page="home"] .tvor-book-kit-card:hover {
    border-color: rgba(168, 28, 68, 0.4);
    box-shadow: 0 8px 28px rgba(168, 28, 68, 0.14);
    background: #fffcfc;
  }
}

body[data-page="home"] .tvor-book-kit-preview {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1.05 / 1;
  height: auto;
  min-height: 400px;
  margin: -0.15rem auto 0.1rem;
  flex: 0 0 auto;
}

/* V is baked into PNGs — no CSS rotate (keeps cover text sharp). */
body[data-page="home"] .tvor-book-kit-preview-frame {
  position: absolute;
  top: 50%;
  width: 72%;
  aspect-ratio: 1;
  background: transparent;
  border-radius: 0;
  padding: 0;
  overflow: visible;
  box-shadow: none;
  isolation: isolate;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

body[data-page="home"] .tvor-book-kit-preview-frame picture {
  display: block;
  width: 100%;
  height: 100%;
}

body[data-page="home"] .tvor-book-kit-preview-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.16));
}

body[data-page="home"] .tvor-book-kit-preview-frame--left {
  left: 0;
  z-index: 1;
  transform: translate3d(0, -50%, 0);
}

body[data-page="home"] .tvor-book-kit-preview-frame--right {
  right: 0;
  z-index: 2;
  transform: translate3d(0, -50%, 0);
}

body[data-page="home"] .tvor-books-grid-col--kit.is-active .tvor-book-kit-preview-frame--left,
body[data-page="home"] .tvor-book-kit-card:focus-within .tvor-book-kit-preview-frame--left {
  transform: translate3d(8px, -50%, 0);
}

body[data-page="home"] .tvor-books-grid-col--kit.is-active .tvor-book-kit-preview-frame--right,
body[data-page="home"] .tvor-book-kit-card:focus-within .tvor-book-kit-preview-frame--right {
  transform: translate3d(-8px, -50%, 0);
}

@media (hover: hover) and (pointer: fine) {
  body[data-page="home"] .tvor-book-kit-card:hover .tvor-book-kit-preview-frame--left {
    transform: translate3d(8px, -50%, 0);
  }

  body[data-page="home"] .tvor-book-kit-card:hover .tvor-book-kit-preview-frame--right {
    transform: translate3d(-8px, -50%, 0);
  }
}

body[data-page="home"] .tvor-book-kit-badge {
  position: relative;
  z-index: 3;
  margin: 0.35rem 0 0.35rem;
  padding: 0.15rem 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-primary, #a81c44);
  background: #fff;
  animation: none;
}

body[data-page="home"] .tvor-book-kit-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.55rem;
  margin: 0.35rem 0 0.2rem;
}

body[data-page="home"] .tvor-book-kit-price-value {
  font-size: clamp(1.55rem, 2.6vw, 1.95rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-primary, #a81c44);
}

body[data-page="home"] .tvor-book-kit-price-compare {
  font-size: 1rem;
  font-weight: 500;
  color: #9a9a9a;
  text-decoration: line-through;
}

body[data-page="home"] .tvor-book-kit-save {
  position: relative;
  display: inline-block;
  margin: 0 0 0.65rem;
  /* Extra side padding → green oval a bit longer than the text */
  padding: 0.22rem 0.95rem;
  overflow: hidden;
  font-size: 0.88rem;
  font-weight: 600;
  color: #4f8a54;
  letter-spacing: 0.01em;
  background: transparent;
}

body[data-page="home"] .tvor-book-kit-save > span {
  position: relative;
  z-index: 1;
}

/* Soft green oval — static, no pulse */
body[data-page="home"] .tvor-book-kit-save::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1.2em;
  z-index: 0;
  pointer-events: none;
  border-radius: 999px;
  background: rgba(166, 216, 156, 0.55);
  transform: translateY(-50%);
  animation: none;
}

body[data-page="home"] .tvor-book-kit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 12rem;
  padding: 0.78rem 1.5rem;
  font-size: 1.05rem;
  margin-top: 0;
  text-decoration: none;
}

body[data-page="home"] .tvor-book-kit-btn.btn-outline {
  background: #fff;
  color: var(--color-primary, #a81c44);
  border-color: var(--color-primary, #a81c44);
}

@media (hover: hover) and (pointer: fine) {
  body[data-page="home"] .tvor-book-kit-btn.btn-outline:hover {
    background: #fff;
    color: var(--color-primary, #a81c44);
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="home"] .tvor-book-card,
  body[data-page="home"] .tvor-book-kit-card,
  body[data-page="home"] .tvor-book-kit-preview-frame,
  body[data-page="home"] .tvor-book-card--single,
  body[data-page="home"] .tvor-book-kit-badge {
    transition: none;
    animation: none;
  }
}

@media (max-width: 1024px) {
  body[data-page="home"] .tvor-books-showcase {
    overflow-x: clip;
  }

  body[data-page="home"] .tvor-books-showcase .site-wrap {
    margin-inline: auto;
    width: min(640px, calc(100% - 1.5rem));
  }

  body[data-page="home"] .tvor-books-grid {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 640px;
    margin-inline: auto;
    justify-items: center;
  }

  body[data-page="home"] .tvor-book-card,
  body[data-page="home"] .tvor-books-grid-col--kit,
  body[data-page="home"] .tvor-book-kit-card {
    width: 100%;
    max-width: 520px;
    margin-inline: auto;
    box-sizing: border-box;
  }

  /* Mobile stack: Комплект → Фолклорни → Пътешествие */
  body[data-page="home"] .tvor-books-grid-col--kit {
    order: 1;
    justify-content: center;
  }
  body[data-page="home"] .tvor-book-card--right { order: 2; }
  body[data-page="home"] .tvor-book-card--left { order: 3; }

  body[data-page="home"] .tvor-book-card--single .tvor-book-frame--mockup {
    width: 100%;
  }

  body[data-page="home"] .tvor-book-kit-card {
    min-height: 0;
    overflow: visible;
    background: #fff;
    border: 2px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    padding: 0.85rem 0.85rem 1rem;
  }

  body[data-page="home"] .tvor-book-kit-preview {
    max-width: 480px;
    min-height: 380px;
    margin-inline: auto;
    overflow: visible;
    background: #fff;
  }

  body[data-page="home"] .tvor-book-kit-preview-frame {
    width: 68%;
    overflow: visible;
    background: transparent;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  body[data-page="home"] .tvor-books-showcase .site-wrap {
    width: min(1100px, calc(100% - 1.5rem));
  }

  body[data-page="home"] .tvor-books-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    max-width: 1100px;
    justify-items: stretch;
  }

  body[data-page="home"] .tvor-book-card,
  body[data-page="home"] .tvor-book-kit-card {
    max-width: none;
  }

  body[data-page="home"] .tvor-books-grid-col--kit {
    grid-column: 1 / -1;
    order: -1;
    max-width: 640px;
    margin-inline: auto;
  }
}

@media (min-width: 1025px) {
  body[data-page="home"] .tvor-books-grid-col--kit {
    margin-top: 0;
    padding-block: 0;
  }

  body[data-page="home"] .tvor-book-card--single .tvor-book-frame--mockup {
    width: 100%;
  }

  body[data-page="home"] .tvor-book-kit-card {
    max-width: 560px;
    min-height: 0;
    padding-top: 0.75rem;
  }

  body[data-page="home"] .tvor-book-kit-preview {
    max-width: 520px;
    min-height: 400px;
  }
}

@media (max-width: 640px) {
  /* Комплект → Фолклорни → Пътешествие */
  body[data-page="home"] .tvor-books-grid-col--kit { order: 1; }
  body[data-page="home"] .tvor-book-card--right { order: 2; }
  body[data-page="home"] .tvor-book-card--left { order: 3; }

  body[data-page="home"] .tvor-books-showcase .site-wrap {
    width: min(100%, calc(100% - 1rem));
    margin-inline: auto;
    padding-inline: 0;
  }

  body[data-page="home"] .tvor-books-grid {
    max-width: 100%;
    gap: 1rem;
  }

  body[data-page="home"] .tvor-book-card,
  body[data-page="home"] .tvor-books-grid-col--kit,
  body[data-page="home"] .tvor-book-kit-card {
    max-width: 100%;
  }

  body[data-page="home"] .tvor-book-card--single .tvor-book-card-media {
    min-height: 0;
    padding: 0.35rem 0.85rem 0.15rem;
  }

  /* Keep display size near native detail (~741px @2x) so phones look sharper */
  body[data-page="home"] .tvor-book-card--single .tvor-book-cover-link,
  body[data-page="home"] .tvor-book-card--single .tvor-book-frame--mockup {
    max-width: 360px;
    margin-inline: auto;
  }

  body[data-page="home"] .tvor-book-card--single .tvor-book-frame--mockup img {
    width: 100%;
    height: auto;
  }

  /* Same white “window” card as the two single books */
  body[data-page="home"] .tvor-book-kit-card {
    background: #fff;
    border: 2px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    padding: 0.7rem 0.65rem 0.9rem;
  }

  body[data-page="home"] .tvor-books-grid-col--kit.is-active .tvor-book-kit-card,
  body[data-page="home"] .tvor-book-kit-card:focus-within {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  }

  body[data-page="home"] .tvor-book-kit-preview {
    max-width: 100%;
    min-height: 0;
    aspect-ratio: 1.05 / 1;
    overflow: visible;
    background: #fff;
  }

  body[data-page="home"] .tvor-book-kit-preview-frame {
    width: 70%;
    overflow: visible;
    background: transparent;
  }

  body[data-page="home"] .tvor-book-kit-preview-img {
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.1));
    background: transparent;
  }

  body[data-page="home"] .tvor-books-grid-col--kit.is-active .tvor-book-kit-preview-frame--left,
  body[data-page="home"] .tvor-book-kit-card:hover .tvor-book-kit-preview-frame--left,
  body[data-page="home"] .tvor-book-kit-card:focus-within .tvor-book-kit-preview-frame--left,
  body[data-page="home"] .tvor-books-grid-col--kit.is-active .tvor-book-kit-preview-frame--right,
  body[data-page="home"] .tvor-book-kit-card:hover .tvor-book-kit-preview-frame--right,
  body[data-page="home"] .tvor-book-kit-card:focus-within .tvor-book-kit-preview-frame--right {
    transform: translate3d(0, -50%, 0);
  }
}

