.book-pack-section,
.digital-library {
  position: relative;
  overflow: hidden;
  padding: 78px 0 84px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(700px 260px at 50% 0%, rgba(251, 191, 36, 0.13), transparent 66%),
    #050505;
}

.book-pack-section::before,
.digital-library::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.34), transparent);
}

.book-pack-head,
.digital-library-head {
  width: min(840px, calc(100% - 32px));
  margin: 0 auto 28px;
  text-align: center;
}

.book-pack-kicker,
.digital-library-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border: 1px solid rgba(251, 191, 36, 0.38);
  border-radius: 999px;
  padding: 7px 14px;
  color: var(--gold, #fbbf24);
  background: rgba(251, 191, 36, 0.08);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.digital-library-kicker {
  text-transform: none;
  font-size: 0.88rem;
}

.book-pack-head h2,
.digital-library-head h2 {
  margin-bottom: 12px;
  color: var(--text, #f8fafc);
  font-size: clamp(2rem, 4.4vw, 3.8rem);
  line-height: 1.04;
  font-weight: 900;
}

.book-pack-head p,
.digital-library-head p {
  max-width: 720px;
  margin: 0 auto;
  color: #d4d4d8;
  font-size: 1.05rem;
}

.book-carousel {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 28px 0 36px;
  cursor: grab;
}

.book-carousel::before,
.book-carousel::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: min(130px, 16vw);
  pointer-events: none;
}

.book-carousel::before {
  left: 0;
  background: linear-gradient(to right, #050505, transparent);
}

.book-carousel::after {
  right: 0;
  background: linear-gradient(to left, #050505, transparent);
}

.book-carousel-track {
  display: flex;
  gap: 22px;
  width: max-content;
  padding: 8px 0;
  animation: book-scroll 48s linear infinite;
  will-change: transform;
}

.book-carousel:hover .book-carousel-track {
  animation-play-state: paused;
}

.book-cover {
  width: 156px;
  height: 220px;
  flex: 0 0 156px;
  border: 1px solid rgba(251, 191, 36, 0.24);
  border-radius: 8px;
  background: #111114;
  object-fit: cover;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.52);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
  user-select: none;
}

.book-cover:hover {
  transform: translateY(-8px) scale(1.04);
  border-color: rgba(251, 191, 36, 0.65);
  filter: brightness(1.06);
  box-shadow: 0 24px 58px rgba(251, 191, 36, 0.18), 0 18px 42px rgba(0, 0, 0, 0.58);
}

@keyframes book-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.digital-library {
  font-family: "Inter", system-ui, sans-serif;
}

.digital-library[dir="rtl"] {
  font-family: "Cairo", "Inter", system-ui, sans-serif;
}

.digital-library-grid {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.digital-library-card {
  overflow: hidden;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(17, 17, 20, 0.86);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.32);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.digital-library-card:hover {
  transform: translateY(-7px);
  border-color: rgba(251, 191, 36, 0.58);
  box-shadow: 0 24px 58px rgba(251, 191, 36, 0.13), 0 18px 46px rgba(0, 0, 0, 0.42);
}

.digital-library-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0f0f0f;
}

.digital-library-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: brightness(0.72);
  transition: transform 0.35s ease, filter 0.35s ease;
}

.digital-library-card:hover .digital-library-media img {
  transform: scale(1.06);
  filter: brightness(1);
}

.digital-library-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.digital-library-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.digital-library-name {
  margin: 0;
  color: var(--text, #f8fafc);
  font-size: 1.02rem;
  font-weight: 900;
}

.digital-library-count {
  flex-shrink: 0;
  border-radius: 6px;
  padding: 3px 9px;
  color: var(--gold, #fbbf24);
  background: rgba(251, 191, 36, 0.11);
  font-size: 0.78rem;
  font-weight: 900;
}

.digital-library-desc {
  min-height: 42px;
  margin: 0;
  color: #8b8b95;
  font-size: 0.9rem;
  line-height: 1.55;
}

.digital-library-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  padding: 12px 16px;
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.92rem;
  font-weight: 900;
  text-align: center;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.digital-library-btn:hover {
  transform: translateY(-1px);
  border-color: var(--gold, #fbbf24);
  color: #111111;
  background: linear-gradient(180deg, #fde68a, var(--gold, #fbbf24) 54%, var(--gold-2, #f59e0b));
}

.digital-library-footer {
  margin-top: 38px;
  text-align: center;
}

.digital-library-note {
  margin: 14px 0 0;
  color: #71717a;
  font-size: 0.82rem;
}

@media (max-width: 920px) {
  .digital-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .book-pack-section,
  .digital-library { padding: 54px 0 58px; }
  .book-pack-head,
  .digital-library-head { margin-bottom: 18px; }
  .book-carousel { overflow-x: auto; padding: 18px 16px 24px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .book-carousel::before,
  .book-carousel::after { display: none; }
  .book-carousel-track { animation: none; gap: 14px; padding-right: 16px; }
  .book-cover { width: 132px; height: 186px; flex-basis: 132px; scroll-snap-align: center; }
  .digital-library-head h2 { font-size: 2.25rem; }
  .digital-library-grid { grid-template-columns: 1fr; gap: 14px; }
  .digital-library-body { padding: 16px; }
  .digital-library-footer .btn { width: min(100%, 360px); }
}
