/* theme2026 — صفحه اصلی به سبک دیجیکالا */

.bk-home {
  padding: 16px 0 40px;
  direction: rtl;
}

.bk-home-wrap {
  width: min(var(--dk-container), calc(100% - 32px));
  margin: 0 auto;
}

/* Hero — بنر اصلی گرد گوشه مثل دیجیکالا */
.bk-hero {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #e8e8ea;
  margin-bottom: 20px;
  aspect-ratio: 21 / 7;
  min-height: 160px;
}

.bk-hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  display: block;
}

.bk-hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

.bk-hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bk-hero-nav {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  pointer-events: none;
}

.bk-hero-nav button {
  pointer-events: auto;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.bk-hero:hover .bk-hero-nav button {
  opacity: 1;
}

.bk-hero-nav button:hover {
  background: #fff;
}

.bk-hero-nav img {
  width: 16px;
  height: 16px;
}

.bk-hero-progress {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 2;
  width: 28px;
  height: 28px;
}

.bk-hero-progress circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 2.5;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  stroke-dasharray: 56;
  stroke-dashoffset: 56;
}

.bk-hero-progress .is-running {
  animation: bk-hero-progress 4.1s linear forwards;
}

@keyframes bk-hero-progress {
  to {
    stroke-dashoffset: 0;
  }
}

/* Banner strip */
.bk-banners {
  margin-bottom: 20px;
}

.bk-banners .swiper-slide {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.bk-banners .swiper-slide img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 6;
  object-fit: cover;
}

/* Section rails */
.bk-rail-section {
  margin-bottom: 20px;
  background: #fff;
  border-radius: 12px;
  padding: 16px 12px 8px;
  border: 1px solid transparent;
}

.bk-rail-section.is-featured {
  background: linear-gradient(90deg, #ef4056 0%, #f57a8a 45%, #ef4056 100%);
  padding: 16px 12px 12px;
}

.bk-rail-section.is-featured .bk-rail-head h2 {
  color: #fff;
}

.bk-rail-section.is-featured .bk-rail-actions a {
  color: #fff;
}

.bk-rail-section.is-featured .bk-rail-btn {
  background: rgba(255, 255, 255, 0.95);
  border-color: transparent;
}

.bk-rail-section.is-featured .bk-book-card {
  border: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.bk-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 4px;
}

.bk-rail-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--dk-ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.bk-rail-head h2::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 4px;
  background: var(--dk-red);
  flex-shrink: 0;
}

.bk-rail-section.is-featured .bk-rail-head h2::before {
  background: #fff;
}

.bk-rail-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bk-rail-actions a {
  font-size: 12px;
  font-weight: 700;
  color: var(--dk-cyan);
  text-decoration: none !important;
  margin-left: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bk-rail-actions a:hover {
  color: var(--dk-red);
}

.bk-rail-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--dk-line);
  border-radius: 999px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.bk-rail-btn:hover:not(:disabled) {
  border-color: #c9c9cd;
  background: var(--dk-panel);
}

.bk-rail-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.bk-rail-btn img {
  width: 12px;
  height: 12px;
}

/* Product card — Digikala style */
.bk-books-swiper .swiper-slide {
  height: auto;
}

.bk-book-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid var(--dk-line);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none !important;
  color: inherit;
  transition: box-shadow 0.15s ease;
  padding-bottom: 4px;
}

.bk-book-card:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.bk-book-card-cover {
  background: #fff;
  padding: 12px 12px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 180px;
}

.bk-book-card-cover img {
  width: 100%;
  max-width: 130px;
  aspect-ratio: 2 / 3;
  object-fit: contain;
  display: block;
  background: #f7f7f8;
}

.bk-book-card-body {
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.bk-book-card-body h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.7;
  color: var(--dk-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}

.bk-book-price {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  width: 100%;
}

.bk-book-price .old {
  font-size: 11px;
  color: var(--dk-hint);
  text-decoration: line-through;
  align-self: flex-start;
  width: 100%;
  text-align: left;
  direction: ltr;
}

.bk-book-price .row-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  flex-direction: row-reverse;
}

.bk-book-price .now {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--dk-ink);
  direction: ltr;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.bk-book-price .now small {
  font-size: 11px;
  font-weight: 500;
  color: var(--dk-muted);
}

.bk-book-price .badge {
  background: var(--dk-red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  border-radius: 16px 16px 16px 2px;
  padding: 2px 7px;
  line-height: 1.4;
}

.bk-book-price .oos {
  color: var(--dk-muted);
  font-size: 12px;
  font-weight: 600;
  align-self: flex-start;
}

/* Spotlight: publisher / author */
.bk-spotlight {
  margin-bottom: 20px;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
}

.bk-spotlight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.bk-spotlight-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--dk-ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.bk-spotlight-head h2::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 4px;
  background: var(--dk-red);
}

.bk-spotlight-head a {
  font-size: 12px;
  font-weight: 700;
  color: var(--dk-cyan);
  text-decoration: none !important;
}

.bk-spotlight-head a:hover {
  color: var(--dk-red);
}

.bk-spotlight-grid {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.bk-spotlight-grid.is-author {
  grid-template-columns: 88px minmax(140px, 220px) minmax(0, 1fr);
}

.bk-spotlight-media img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--dk-line);
  object-fit: cover;
  background: var(--dk-panel);
  aspect-ratio: 3 / 4;
  display: block;
}

.bk-spotlight-grid.is-author .bk-spotlight-media img {
  aspect-ratio: 1;
  border-radius: 999px;
}

.bk-spotlight-meta h3,
.bk-spotlight-extra h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--dk-ink);
}

.bk-spotlight-meta p,
.bk-spotlight-extra p {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--dk-muted);
  line-height: 1.9;
}

.bk-spotlight-extra a {
  font-weight: 700;
  color: var(--dk-cyan);
}

@media (max-width: 992px) {
  .bk-hero {
    aspect-ratio: 16 / 7;
  }

  .bk-spotlight-grid,
  .bk-spotlight-grid.is-author {
    grid-template-columns: 110px minmax(0, 1fr);
  }

  .bk-spotlight-extra {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .bk-home {
    padding: 10px 0 28px;
  }

  .bk-home-wrap {
    width: min(var(--dk-container), calc(100% - 16px));
  }

  .bk-hero {
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    margin-bottom: 12px;
  }

  .bk-hero-nav button {
    opacity: 1;
    width: 32px;
    height: 32px;
  }

  .bk-rail-section,
  .bk-spotlight {
    padding: 12px 8px 6px;
    margin-bottom: 12px;
    border-radius: 10px;
  }

  .bk-rail-head h2,
  .bk-spotlight-head h2 {
    font-size: 0.95rem;
  }

  .bk-book-card-cover {
    min-height: 150px;
    padding: 8px 8px 2px;
  }

  .bk-book-card-cover img {
    max-width: 110px;
  }

  .bk-spotlight-grid,
  .bk-spotlight-grid.is-author {
    grid-template-columns: 1fr;
  }

  .bk-spotlight-media {
    max-width: 140px;
  }

  .bk-spotlight-grid.is-author .bk-spotlight-media {
    max-width: 80px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bk-hero-slide,
  .bk-book-card {
    transition: none;
  }

  .bk-hero-progress .is-running {
    animation: none;
  }
}
