/**
 * Library / e-books listing — system-design/tokens/library-books.html
 * Figma External-Pages: listing 17966-169191 · My books 17902-11519 · My books empty 17966-169822
 * (file aPlCUPLhUHHbatGBxkcVGw). Theme :root + colors.json semantic aliases.
 */
/* ── Hero banner (Figma 17902-14648): solid primary, 20px radius, 42px vertical padding ── */
.books-store-ds .ds-hero-banner {
  margin-top: 16px;
  margin-bottom: 40px;
  background: var(--ds-primary, var(--color-primary-btn, #561db4));
  border-radius: var(--ds-radius-xl2);
  padding: 42px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 167px;
  text-align: center;
}

.books-store-ds .ds-hero-banner-decor {
  position: absolute;
  top: -50%;
  right: -5%;
  width: 520px;
  height: 520px;
  opacity: 0.18;
  background: radial-gradient(circle, #fff 0%, transparent 70%);
  pointer-events: none;
}

.books-store-ds .ds-hero-banner h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-white-forever, #fff);
  text-align: center;
  position: relative;
  margin: 0;
  line-height: 1.2;
}

.books-store-ds .ds-hero-banner .ds-hero-sub {
  font-size: 15px;
  color: var(--color-white-forever, #fff);
  opacity: 1;
  margin-top: 8px;
  position: relative;
  text-align: center;
  font-weight: 700;
  line-height: 32px;
}

.books-store-ds {
  /* Figma-aligned tokens, mapped to input.css semantic vars */
  --ds-primary: var(--color-primary-btn, #561db4);          /* primary fill (active tab, hero, pills) */
  --ds-primary-dark: var(--color-primary-text, #471895);     /* primary on white (text, outlines) */
  --ds-section-header: var(--color-section-header, #efe6ff); /* light purple count on active pill */
  --ds-tab-count-active: #d2a8ff;                            /* Figma: active tab count text */
  --ds-teal: var(--color-teal, #20b486);
  --ds-teal-text-sm: var(--color-teal-text-small, #1fad81);
  --ds-text: var(--color-text, #321f6b);
  --ds-title: var(--color-title, #6639c6);
  --ds-meta: var(--color-meta, #52525b);
  --ds-meta-light: var(--color-meta-light, #818182);
  --ds-sep: var(--color-separator, #d4d4d8);
  --ds-box-border: var(--color-box-border, #d4d4d8);
  --ds-box: var(--color-box, #ffffff);
  --ds-notif-red: var(--color-notif-red, #d2324f);
  --ds-field-muted: var(--color-field-muted, rgba(0, 0, 0, 0.05));
  --ds-radius-xl2: 20px;
  --ds-shadow-sharp: 0 2px 0 0 var(--color-sharp-shadow, #d4d4d8),
    0 20px 40px -15px rgba(16, 24, 40, 0.07);
  --ds-shadow-card-hover: var(--ds-shadow-sharp), 0 8px 24px rgba(86, 29, 180, 0.12);
}

/* ── Filter bar (Figma 17966-169191): cart pill on the inline-end side, tabs flow inline-start ── */
.books-store-ds .ds-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  min-height: 56px;
}

.books-store-ds .ds-filter-tabs--shell {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  /* Desktop: RTL so كتبي → جميع الكتب → categories reads correctly (bar parent stays LTR for cart). */
  direction: rtl;
}

.books-store-ds #books-store-tabs.ds-filter-tablist {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}

/* Vertical separator between tab groups (e.g. between "جميع الكتب" pill and "كتبي") */
.books-store-ds .ds-filter-tab-sep {
  display: inline-block;
  width: 1px;
  height: 16px;
  background: var(--ds-sep);
  margin: 0 12px;
  align-self: center;
}

/* "المزيد" — category overflow (mobile dropdown; desktop inline row) */
.books-store-ds .ds-filter-more-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.books-store-ds .ds-filter-more-trigger {
  display: none;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 10px 0 12px;
  margin: 0;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: var(--ds-primary-dark);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.books-store-ds .ds-filter-more-trigger:hover {
  background: rgba(86, 29, 180, 0.06);
}

.books-store-ds .ds-filter-more-wrap.has-category-active .ds-filter-more-trigger {
  background: var(--ds-primary);
  color: #fff;
}

.books-store-ds .ds-filter-more-wrap.has-category-active .ds-filter-more-trigger__icon {
  color: #fff;
}

.books-store-ds .ds-filter-more-trigger__icon {
  flex-shrink: 0;
  color: var(--ds-primary-dark);
  transition: transform 0.2s ease;
}

.books-store-ds .ds-filter-more-wrap.is-open .ds-filter-more-trigger__icon {
  transform: rotate(180deg);
}

.books-store-ds .ds-filter-more-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}

/* ≥1024px: category chips inline in the bar (no "المزيد" dropdown). Below that, same as phone — المزيد for iPad mini / iPad Air portrait, etc. */
@media (min-width: 1024px) {
  .books-store-ds .ds-filter-tabs--shell > .ds-filter-more-wrap {
    order: 2;
  }

  .books-store-ds .ds-filter-tabs--shell > #books-store-tabs {
    order: 1;
  }

  .books-store-ds #books-store-tabs > * {
    order: 0 !important;
  }

  .books-store-ds .ds-filter-more-trigger {
    display: none !important;
  }

  .books-store-ds .ds-filter-more-panel {
    display: flex !important;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    position: static;
    inset: auto;
    left: auto;
    right: auto;
    top: auto;
    min-width: 0;
    max-height: none;
    overflow: visible;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    z-index: auto;
  }
}

.books-store-ds .ds-filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ds-text);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  border: none;
  background: transparent;
  font-family: inherit;
}

.books-store-ds .ds-filter-tab:hover {
  background: rgba(86, 29, 180, 0.06);
}

.books-store-ds .ds-filter-tab .count {
  color: var(--ds-meta-light);
  font-size: 12px;
  font-weight: 500;
}

.books-store-ds .ds-filter-tab.is-active {
  background: var(--ds-primary);
  color: #fff;
}

.books-store-ds .ds-filter-tab.is-active .count {
  color: var(--ds-tab-count-active);
}

/* ─── Listing page (Figma Electronic Library) ─── */
.books-store-hero-bleed {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-bottom: 8px;
}

.books-store-ds .ds-hero-banner--listing-figma {
  align-items: stretch;
  text-align: right;
  padding: 48px 28px 44px;
  min-height: 200px;
}

.books-store-ds .ds-hero-banner--listing-figma .ds-hero-banner-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 42rem;
  margin-inline-start: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.books-store-ds .ds-hero-banner--listing-figma h1 {
  text-align: right;
  width: 100%;
}

.books-store-ds .ds-hero-banner--listing-figma .ds-hero-sub {
  text-align: right;
  width: 100%;
}

.books-store-ds .ds-hero-banner-pattern {
  position: absolute;
  inset: 0;
  inset-inline-start: 0;
  width: 48%;
  max-width: 440px;
  opacity: 0.12;
  background-image: repeating-linear-gradient(
    -36deg,
    transparent,
    transparent 10px,
    rgba(255, 255, 255, 0.4) 10px,
    rgba(255, 255, 255, 0.4) 11px
  );
  pointer-events: none;
  z-index: 1;
}

.books-store-ds .ds-filter-bar--figma {
  margin-bottom: 24px;
  margin-top: 8px;
  direction: ltr;
}

.books-store-ds .ds-filter-tab:not(.is-active) {
  color: var(--ds-primary-dark);
}
.books-store-ds .ds-filter-tab:not(.is-active) .count {
  color: var(--ds-meta-light);
}

/* ── Cart trigger pill (Figma 17902-89976): light-purple bg + 40px circular cart icon + "سلة الشراء" ── */
.books-store-ds .ds-filter-tab.ds-filter-tab--cart {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: auto;
  padding: 4px 16px 4px 4px;
  border-radius: 9999px;
  background: rgba(86, 29, 180, 0.08);
  border: 1px solid rgba(86, 29, 180, 0.3);
  color: var(--ds-primary-dark);
  font-size: 14px;
  font-weight: 700;
}

.books-store-ds .ds-filter-tab.ds-filter-tab--cart:hover {
  background: rgba(86, 29, 180, 0.14);
}

/* Inner circular cart icon — matches Figma 40px white-shadow pill */
.books-store-ds .ds-filter-cart-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  /* background: var(--ds-box); */
  /* color: var(--ds-primary-dark); */
  box-shadow: 0 12px 53px rgba(0, 0, 0, 0.04), 0 2.4px 8.6px rgba(0, 0, 0, 0.02);
  flex-shrink: 0;
}

.books-store-ds .ds-filter-cart-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

/* Red dot badge with count, top-left of the cart icon (RTL — visually appears on the inline-start) */
.books-store-ds .ds-filter-cart-badge {
  position: absolute;
  top: 2px;
  inset-inline-start: -2px;
  min-width: 18px;
  height: 18px;
  /* padding: 0 5px; */
  border-radius: 9999px;
  background: var(--ds-notif-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid #ffffff00;
  z-index: 1;
}

/* Open state — match purple pill with white icon button */
.books-store-ds .ds-filter-tab.ds-filter-tab--cart.aanaab-books-store-cart-tab--open {
  background: var(--ds-primary);
  border-color: transparent;
  color: #fff;
}

.dark .books-store-ds .ds-filter-tab.ds-filter-tab--cart {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #fafafa;
}

.dark .books-store-ds .ds-filter-cart-icon {
  /* background: var(--color-box-3, #40317d); */
  color: #fafafa;
}

.dark .books-store-ds .ds-filter-tab.ds-filter-tab--cart.aanaab-books-store-cart-tab--open {
  background: var(--ds-primary);
  color: #fff;
}

.books-store-listing--figma .ds-books-row--figma {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  justify-items: center;
  width: 100%;
}

@media (min-width: 1280px) {
  .books-store-listing--figma .ds-books-row--figma {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-items: stretch;
  }
}

.books-store-listing--figma .ds-books-row--figma .ds-book-card {
  width: 100%;
  max-width: 100%;
}

.books-store-listing--figma .ds-book-title {
  color: var(--ds-primary-dark);
}

.books-store-listing--figma .ds-pagination-row--figma {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  width: 100%;
  direction: rtl;
}

.books-store-listing--figma .ds-results-count {
  grid-column: 1;
  text-align: start;
  font-size: 16px;
  font-weight: 400;
  color: var(--ds-primary-dark);
}

/* ── Load more button (Figma 17902-14700): purple outline pill ── */
.books-store-listing--figma .ds-btn-load-more {
  grid-column: 2;
  justify-self: center;
  height: 43px;
  padding: 0 20px;
  border-radius: 9999px;
  border: 2px solid var(--ds-primary-dark);
  background: transparent;
  color: var(--ds-primary-dark);
  font-size: 14px;
  font-weight: 700;
  line-height: 16px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.books-store-listing--figma .ds-btn-load-more:hover {
  background: var(--ds-primary-dark);
  color: #fff;
}

.dark .books-store-listing--figma .ds-btn-load-more {
  border-color: rgba(255, 255, 255, 0.45);
  color: #fafafa;
}

.dark .books-store-listing--figma .ds-btn-load-more:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fafafa;
}

.books-store-listing--figma .ds-pagination-spacer {
  grid-column: 3;
}

/* ─────────────────────────────────────────────────────────────────────────────
 * ≤1023px — Figma filter row (phones + tablets / iPad mini & iPad Air portrait):
 *   One row LTR: [cart icon] [المزيد ▼] [primary pill] [|] [primary link]
 *   Category tabs live inside "المزيد" dropdown only.
 * ───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  /* Figma mobile: single horizontal toolbar (cart + tabs), white bar, no column stack */
  .books-store-ds .ds-filter-bar,
  .books-store-ds .ds-filter-bar--figma {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    padding: 8px 0;
    min-height: 0;
    background: var(--ds-box);
    border-radius: 0;
  }

  .books-store-ds .ds-filter-bar .aanaab-books-store-mini-wrap,
  .books-store-ds .ds-filter-bar .ds-filter-cart-wrap {
    align-self: center;
    flex: 0 0 auto;
  }

  .books-store-ds .ds-filter-tabs--shell {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    /* flex: 1 1 auto; */
    min-width: 0;
    gap: 16px;
    overflow: visible;
    padding-bottom: 0;
    /* Mobile Figma row: LTR so visual order stays cart | المزيد | جميع الكتب | | كتبي */
    direction: ltr;
    margin: auto;
  }

  /* LTR: المزيد (order 2) then tablist (order 3); inside tablist: جميع الكتب → | → كتبي */
  .books-store-ds .ds-filter-tabs--shell > .ds-filter-more-wrap {
    order: 2;
    flex: 0 0 auto;
    /* When the tab row is pixel-tight, keep "المزيد" above so the active pill never paints over it */
    z-index: 2;
  }

  .books-store-ds .ds-filter-tabs--shell > #books-store-tabs {
    order: 3;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    flex: 1 1 auto;
    min-width: 0;
    gap: 6px;
    align-items: center;
    z-index: 1;
  }

  .books-store-ds #books-store-tabs > .ds-filter-tab[data-filter="all"] {
    order: 3;
    flex: 0 1 auto;
    min-width: 0;
    direction: rtl;
  }

  .books-store-ds #books-store-tabs > .ds-filter-tab-sep--primary,
  .books-store-ds #books-store-tabs > .ds-filter-tab-sep {
    order: 4;
    flex: 0 0 auto;
    margin: 0 4px 0 8px;
    display: inline-block;
    height: 18px;
    align-self: center;
  }

  .books-store-ds #books-store-tabs > .ds-filter-tab[data-filter="my-books"] {
    order: 5;
    flex: 0 0 auto;
    direction: rtl;
  }

  .books-store-ds #books-store-tabs > .ds-filter-tab--primary {
    /* Default: tabs may shrink so the active pill does not overflow into "المزيد" */
    flex-shrink: 1;
    min-width: 0;
    height: 36px;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 700;
  }

  /* "كتبي" text link: keep from collapsing; "جميع الكتب" uses flex: 0 1 auto above */
  .books-store-ds #books-store-tabs > .ds-filter-tab[data-filter="my-books"].ds-filter-tab--primary {
    flex: 0 0 auto;
    flex-shrink: 0;
  }

  /* Inactive primary = purple text link (Figma); active = filled pill */
  .books-store-ds .ds-filter-tab.ds-filter-tab--primary:not(.is-active) {
    background: transparent;
    color: var(--ds-primary-dark);
    box-shadow: none;
  }

  .books-store-ds .ds-filter-tab.ds-filter-tab--primary:not(.is-active) .count {
    color: var(--ds-meta-light);
  }

  .books-store-ds .ds-filter-tab.ds-filter-tab--primary:not(.is-active):hover {
    background: rgba(86, 29, 180, 0.06);
  }

  .books-store-ds .ds-filter-tab.ds-filter-tab--primary.is-active {
    padding: 0 16px;
    font-weight: 700;
  }

  /* Count only on active pill (Figma shows e.g. جميع الكتب (35) in pill) */
  .books-store-ds #books-store-tabs > .ds-filter-tab--primary:not(.is-active) .count {
    display: none;
  }

  /* المزيد trigger visible on mobile */
  .books-store-ds .ds-filter-more-trigger {
    display: inline-flex !important;
  }

  .books-store-ds .ds-filter-more-wrap.is-open:not(.has-category-active) .ds-filter-more-trigger {
    background: rgba(86, 29, 180, 0.08);
  }

  .books-store-ds .ds-filter-more-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 60;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-width: min(280px, 63vw);
    max-height: min(60vh, 320px);
    overflow-y: auto;
    padding: 8px 0;
    margin: 0;
    border-radius: 12px;
    background: var(--ds-box);
    border: 1px solid var(--ds-sep);
    box-shadow: 0 12px 40px rgba(16, 24, 40, 0.12);
    -webkit-overflow-scrolling: touch;
  }

  .books-store-ds .ds-filter-more-wrap.is-open .ds-filter-more-panel {
    display: flex;
  }

  .books-store-ds .ds-filter-more-panel .ds-filter-tab--category {
    width: 100%;
    height: auto;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 0;
    justify-content: flex-start;
    font-size: 14px;
    font-weight: 600;
    white-space: normal;
    text-align: start;
    direction: rtl;
  }

  .books-store-ds .ds-filter-more-panel .ds-filter-tab--category.is-active {
    background: rgba(86, 29, 180, 0.08);
    color: var(--ds-primary-dark);
  }

  .dark .books-store-ds .ds-filter-more-panel {
    background: var(--color-box-3, #1e1e22);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  }

  .dark .books-store-ds .ds-filter-more-panel .ds-filter-tab--category.is-active {
    background: rgba(255, 255, 255, 0.08);
    color: #fafafa;
  }

  /* Cart: icon + badge only (Figma circular control) */
  .books-store-ds .ds-filter-tab.ds-filter-tab--cart {
    padding: 4px;
    gap: 0;
    border-radius: 9999px;
    font-size: 0;
  }

  .books-store-ds .ds-filter-cart-label {
    display: none !important;
  }

  .books-store-ds .ds-filter-cart-icon {
    width: 40px;
    height: 40px;
  }

  .books-store-ds .ds-filter-cart-icon svg {
    width: 22px;
    height: 22px;
  }
}

/* iPhone SE, Galaxy Z Fold outer display (~344–375px): tighter filter row so pill + المزيد + cart fit */
@media (max-width: 390px) {
  .books-store-ds .ds-filter-bar,
  .books-store-ds .ds-filter-bar--figma {
    gap: 4px;
    padding: 6px 0;
  }

  .books-store-ds .ds-filter-tabs--shell {
    gap: 4px;
  }

  .books-store-ds .ds-filter-tabs--shell > #books-store-tabs {
    gap: 3px;
  }

  .books-store-ds #books-store-tabs > .ds-filter-tab-sep--primary,
  .books-store-ds #books-store-tabs > .ds-filter-tab-sep {
    margin: 0 2px 0 4px;
  }

  .books-store-ds #books-store-tabs > .ds-filter-tab--primary {
    height: 32px;
    padding: 0 7px;
    font-size: 12px;
    gap: 3px;
  }

  .books-store-ds .ds-filter-tab.ds-filter-tab--primary.is-active {
    padding: 0 9px;
  }

  .books-store-ds #books-store-tabs > .ds-filter-tab--primary .count {
    font-size: 11px;
    font-weight: 600;
  }

  .books-store-ds .ds-filter-more-trigger {
    height: 32px;
    padding: 0 5px 0 6px;
    font-size: 12px;
    gap: 2px;
  }

  .books-store-ds .ds-filter-more-trigger__icon {
    width: 14px;
    height: 14px;
  }

  .books-store-ds .ds-filter-cart-icon {
    width: 34px;
    height: 34px;
  }

  .books-store-ds .ds-filter-cart-icon svg {
    width: 18px;
    height: 18px;
  }

  .books-store-ds .ds-filter-tab.ds-filter-tab--cart {
    padding: 6px;
  }
}

/* ≤767px — compact listing hero, phone grid & pagination (unchanged from Figma mobile) */
@media (max-width: 767px) {
  .books-store-ds .ds-hero-banner,
  .books-store-ds .ds-hero-banner--listing-figma {
    padding: 28px 18px 24px;
    margin-top: 12px;
    margin-bottom: 24px;
    border-radius: 16px;
    min-height: 140px;
  }

  .books-store-ds .ds-hero-banner h1 {
    font-size: 22px;
    line-height: 1.25;
  }

  .books-store-ds .ds-hero-banner .ds-hero-sub {
    font-size: 13px;
    line-height: 1.5;
    margin-top: 6px;
  }

  /* Books grid → single column on small phones, 2 columns ≥ 480px */
  .books-store-listing--figma .ds-books-row--figma {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .books-store-ds .ds-book-card {
    max-width: 100%;
  }

  .books-store-ds .ds-book-thumb {
    height: 280px;
  }

  .books-store-ds .ds-book-info {
    padding: 16px 16px 14px;
  }

  /* Pagination: stack vertically (count, load more, spacer hidden) */
  .books-store-listing--figma .ds-pagination-row--figma {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 24px;
  }

  .books-store-listing--figma .ds-results-count {
    grid-column: 1;
    text-align: center;
    font-size: 14px;
  }

  .books-store-listing--figma .ds-btn-load-more {
    grid-column: 1;
    justify-self: center;
    width: 100%;
    /* max-width: 280px; */
  }

  .books-store-listing--figma .ds-pagination-spacer {
    display: none;
  }

  /* Cart panel as full-width drawer beneath filter bar */
  .aanaab-books-store-mini-panel--tab {
    margin-top: 8px;
    padding: 16px 14px 18px;
    border-radius: 16px;
  }

  /* "My books" empty state: tighter padding */
  .books-store-my-books-empty {
    padding: 32px 16px 24px;
  }

  .books-store-my-books-empty__title {
    font-size: 18px;
  }

  .books-store-my-books-empty__desc {
    font-size: 14px;
  }
}

/* Phones ≥ 480px get 2-column grid */
@media (min-width: 480px) and (max-width: 767px) {
  .books-store-listing--figma .ds-books-row--figma {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .books-store-ds .ds-book-thumb {
    height: 240px;
  }
}

/* Tablets (768–1023px) — 3 columns, slightly tighter */
@media (min-width: 768px) and (max-width: 1023px) {
  .books-store-listing--figma .ds-books-row--figma {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
}

/* My books tab — empty state (Figma External-Pages 17966-169822).
 * Hidden by default — JS only shows it when active filter is `my-books` AND no
 * cards are visible. The `.hidden` Tailwind utility (display:none) gets
 * overridden by `display:flex` here unless we explicitly handle it. */
.books-store-my-books-empty.hidden,
.books-store-my-books-empty[hidden] {
  display: none !important;
}

.books-store-my-books-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 460px;
  margin-inline: auto;
  padding: 72px 20px 48px;
  text-align: center;
}

.books-store-my-books-empty__visual {
  position: relative;
  width: 96px;
  height: 96px;
  margin-bottom: 20px;
}

.books-store-my-books-empty__circle {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(210, 168, 255, 0.35) 0%,
    rgba(132, 71, 255, 0.18) 55%,
    rgba(239, 230, 255, 0.6) 100%
  );
  border: 1px solid rgba(86, 29, 180, 0.12);
}

.books-store-my-books-empty__icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  color: var(--ds-primary-dark);
  opacity: 0.9;
}

.books-store-my-books-empty__title {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text, var(--ds-text));
}

.books-store-my-books-empty__desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-meta, var(--ds-meta-light));
  max-width: 32em;
}

.dark .books-store-my-books-empty__circle {
  background: radial-gradient(
    circle at 30% 25%,
    rgba(132, 71, 255, 0.18) 0%,
    rgba(86, 29, 180, 0.12) 45%,
    rgba(30, 30, 34, 0.95) 100%
  );
  border-color: rgba(255, 255, 255, 0.12);
}

.dark .books-store-my-books-empty__title {
  color: #fafafa;
}

.dark .books-store-my-books-empty__desc {
  color: rgba(250, 250, 250, 0.72);
}

/* Figma 17966-169822 CTA — outline pill, primary-text color */
.books-store-my-books-empty__cta {
  margin-top: 28px;
  height: 44px;
  padding: 0 34px;
  border-radius: 9999px;
  border: 1.5px solid var(--ds-primary-dark);
  /* background: transparent; */
  /* color: var(--ds-primary-dark); */
  /* font-size: 14px; */
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
}

.books-store-my-books-empty__cta:hover {
  background: var(--ds-primary-dark);
  color: var(--color-white-forever, #fff);
}

.dark .books-store-my-books-empty__cta {
  border-color: rgba(255, 255, 255, 0.45);
  color: #fafafa;
}

.dark .books-store-my-books-empty__cta:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fafafa;
}

.books-store-ds .ds-books-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.books-store-ds .ds-books-row {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

.books-store-ds .ds-book-card {
  width: 282px;
  max-width: 100%;
  background: var(--ds-box);
  border: 1px solid var(--ds-box-border);
  border-radius: var(--ds-radius-xl2);
  box-shadow: var(--ds-shadow-sharp);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}

.books-store-ds .ds-book-card:hover {
  box-shadow: var(--ds-shadow-card-hover);
  transform: translateY(-2px);
}

.books-store-ds .ds-book-thumb {
  position: relative;
  height: 327px;
  overflow: hidden;
}

.books-store-ds .ds-book-thumb-bg {
  position: absolute;
  inset: 0;
  border-radius: 5px 5px 0 0;
}

.books-store-ds .ds-book-thumb img {
  position: absolute;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  /* top: 34px; */
  /* width: 58%; */
  height: 338px;
  object-fit: cover;
  border-radius: 4px;
  /* box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18); */
}

/* "جديد" badge — Figma 17902-14695: solid teal, rounded inline-end side, white bold ── */
.books-store-ds .ds-book-badge-new {
  position: absolute;
  top: 30px;
  inset-inline-start: 0;
  z-index: 2;
  background: var(--ds-teal);
  color: var(--color-white-forever, #fff);
  font-size: 14px;
  font-weight: 700;
  padding: 4px 11px 4px 14px;
  border-radius: 0 50px 50px 0;
  line-height: 1;
  letter-spacing: -0.14px;
  display: none;
}

.books-store-ds .ds-book-info {
  padding: 20px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  background: var(--ds-box);
}

.books-store-ds .ds-book-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ds-text);
  text-align: center;
  line-height: 1.75;
  height: 56px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 0;
}

/* ── Add-to-cart outline button (Figma 17902-14690): purple outline, embedded prices + label ── */
.books-store-ds .ds-btn-add-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 43px;
  max-height: 43px;
  padding: 0 20px;
  border: 1px solid var(--ds-primary-dark);
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ds-primary-dark);
  cursor: pointer;
  background: transparent;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  text-decoration: none;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  line-height: 16px;
}

.books-store-ds .ds-btn-add-cart:hover {
  /* background: var(--ds-primary-dark); */
  /* color: #fff; */
}

.books-store-ds .ds-btn-add-cart:hover .price-original,
.books-store-ds .ds-btn-add-cart:hover .divider {
  /* color: rgba(255, 255, 255, 0.7); */
}

.books-store-ds .ds-btn-add-cart .price-original {
  color: var(--ds-meta-light);
  font-size: 12px;
  font-weight: 500;
  text-decoration: line-through;
}

.books-store-ds .ds-btn-add-cart .divider {
  color: var(--ds-meta-light);
  font-weight: 400;
  margin: 0 2px;
}

.dark .books-store-ds .ds-btn-add-cart {
  border-color: rgba(255, 255, 255, 0.6);
  color: #fafafa;
}

/* ── "Continue reading" / "Start reading" outline (Figma 17902-14693): teal-text-small outline ── */
.books-store-ds .ds-btn-browse {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 43px;
  padding: 0 20px;
  border: 1px solid var(--ds-teal-text-sm);
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 700;
  line-height: 16px;
  color: var(--ds-teal-text-sm);
  cursor: pointer;
  background: transparent;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}

.books-store-ds .ds-btn-browse:hover {
  background: var(--ds-teal-text-sm);
  color: #fff;
}

/* ── In-cart pill (Figma 17902-14691): segmented pill — red إزالة + info + check ── */
.books-store-ds .ds-btn-in-cart {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 47px;
  padding: 0 8px 0 0;
  border: 1px solid var(--ds-meta-light);
  border-radius: 9999px;
  background: var(--ds-field-muted);
  width: 100%;
  max-width: 260px;
  box-sizing: border-box;
  gap: 8px;
  /* Always RTL inside this pill: red إزالة on inline-start (visually right), info + check on inline-end (left) */
  direction: ltr;
}

.books-store-ds .ds-btn-remove {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 47px;
  padding: 0 14px;
  margin: -1px;
  background: var(--ds-notif-red);
  border-radius: 9999px;
  color: var(--color-white-forever, #fff);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  font-family: inherit;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 16px;
}

.books-store-ds .ds-btn-remove svg {
  flex-shrink: 0;
  display: block;
}

.books-store-ds .ds-btn-remove:hover {
  filter: brightness(0.95);
}

/* Info stack (RTL: appears on the inline-end / right side of the pill) */
.books-store-ds .ds-btn-in-cart-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  padding-inline-end: 4px;
  flex: 1;
  min-width: 0;
}

.books-store-ds .ds-in-cart-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ds-teal);
  white-space: nowrap;
  line-height: 16px;
}

.books-store-ds .ds-btn-in-cart .in-cart-prices {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  line-height: 16px;
  color: var(--ds-primary-dark);
  font-weight: 700;
}

.books-store-ds .ds-btn-in-cart .in-cart-prices .price-original {
  color: var(--ds-meta-light);
  text-decoration: line-through;
  font-weight: 500;
}

.books-store-ds .ds-btn-in-cart .in-cart-check {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  align-self: center;
}

.dark .books-store-ds .ds-btn-in-cart {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

.dark .books-store-ds .ds-btn-in-cart .in-cart-prices {
  color: var(--color-text, #fafafa);
}

.books-store-ds .ds-pagination-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}

.books-store-ds .ds-results-count {
  font-size: 16px;
  color: var(--ds-primary-dark);
  font-weight: 400;
}

.dark .books-store-ds .ds-book-card {
  /* background: var(--color-box-3, #40317d); */
  /* border-color: rgba(255, 255, 255, 0.12); */
}

.dark .books-store-ds .ds-book-title {
  color: var(--color-text-invert, #fafafa);
}

/* ─── Single product (PDP) — same shell as books-store-listing + card CTAs ─── */
/* Page background: Tailwind bg-bg-alt / dark:bg-dark on PDP wrapper. */

/* Main white card — library “surface” */
.books-store-pdp .pdp-main-card {
  background: var(--color-box, #fff);
  border: 1px solid var(--color-box-border, #d4d4d8);
  border-radius: 20px;
  box-shadow: 0 2px 0 0 #d4d4d8, 0 20px 40px -15px rgba(16, 24, 40, 0.07);
  padding: 24px;
}

@media (min-width: 1024px) {
  .books-store-pdp .pdp-main-card {
    padding: 40px 48px;
  }
}

.dark .books-store-pdp .pdp-main-card {
  background: var(--color-box-3, #40317d);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Two columns: book thumb (same as grid card) + summary */
.books-store-pdp .pdp-layout-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

@media (min-width: 1024px) {
  .books-store-pdp .pdp-layout-inner {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 48px;
  }
}

.books-store-pdp .pdp-visual {
  flex-shrink: 0;
  width: 100%;
  max-width: 282px;
}

/* Reuse listing thumb geometry — .ds-book-thumb inside .books-store-ds */
.books-store-pdp .pdp-book-thumb {
  margin: 0 auto;
}

.books-store-pdp .pdp-thumb-placeholder {
  position: absolute;
  left: 50%;
  top: 34px;
  transform: translateX(-50%);
  width: 58%;
  height: 283px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.35);
}

.books-store-pdp .pdp-summary {
  flex: 1;
  min-width: 0;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
}

@media (min-width: 1024px) {
  .books-store-pdp .pdp-summary {
    text-align: right;
    align-items: stretch;
  }
}

.books-store-pdp .pdp-filter-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

@media (min-width: 1024px) {
  .books-store-pdp .pdp-filter-chips {
    justify-content: flex-start;
  }
}

.books-store-pdp .pdp-chip.ds-filter-tab {
  cursor: default;
  pointer-events: none;
}

.books-store-pdp .pdp-excerpt {
  font-size: 14px;
  line-height: 1.75;
  color: var(--color-meta, #52525b);
  margin-bottom: 20px;
}

.books-store-pdp .pdp-excerpt p {
  margin: 0 0 0.5rem;
}

.dark .books-store-pdp .pdp-excerpt {
  color: var(--color-meta-dark, #d2d2d5);
}

/* Cart row — full-width pill like listing card */
.books-store-pdp .pdp-cart-actions {
  width: 100%;
  max-width: 100%;
}

.books-store-pdp .pdp-cart-actions .ds-btn-in-cart {
  max-width: 100%;
}

.books-store-pdp .pdp-cart-actions .ds-btn-browse {
  width: 100%;
}

.books-store-pdp .pdp-add-to-cart form.cart.pdp-cart-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
}

@media (min-width: 1024px) {
  .books-store-pdp .pdp-add-to-cart form.cart.pdp-cart-form {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
}

.books-store-pdp .pdp-add-to-cart form.cart.pdp-cart-form .ds-btn-add-cart {
  width: 100%;
  flex: 1 1 auto;
}

.books-store-pdp .pdp-add-to-cart .quantity input.qty {
  min-width: 3.5rem;
  height: 43px;
  border: 1px solid var(--color-sep, #d4d4d8);
  border-radius: 9999px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  background: var(--color-box, #fff);
}

/* Theme/Woo may add .button — keep library outline look */
.books-store-pdp .pdp-add-to-cart .ds-btn-add-cart.button {
  line-height: 1.2;
}

.books-store-pdp .pdp-out-stock {
  font-size: 14px;
  color: var(--color-meta, #52525b);
}

.books-store-pdp .pdp-btn-browse {
  align-self: center;
}

@media (min-width: 1024px) {
  .books-store-pdp .pdp-btn-browse {
    align-self: flex-start;
  }
}

/* Long description block inside card */
.books-store-pdp .pdp-long-desc {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--color-sep, #d4d4d8);
}

.books-store-pdp .pdp-long-desc-title {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-title, #6639c6);
  text-align: right;
}

.books-store-pdp .pdp-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--color-text, #321f6b);
}

.books-store-pdp .pdp-content h2,
.books-store-pdp .pdp-content h3 {
  color: var(--color-title, #6639c6);
  margin-top: 1.25rem;
}

.dark .books-store-pdp .pdp-content {
  color: rgba(250, 250, 250, 0.92);
}

/* ─── Figma book PDP (single aanaab_books_store) ─── */
.books-store-pdp--figma .pdp-figma-intro {
  margin-top: 8px;
  margin-bottom: 0;
  text-align: right;
}

.books-store-pdp--figma .pdp-figma-title {
  margin: 0 0 8px;
  /* font-size: clamp(1.375rem, 3.5vw, 1.875rem); */
  font-weight: 700;
  color: var(--color-title, #6639c6);
  line-height: 1.35;
}

.books-store-pdp--figma .pdp-figma-author {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-meta, #52525b);
}

.books-store-pdp--figma .pdp-figma-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  direction: rtl;
}

.books-store-pdp--figma .pdp-figma-actions--lms-owned {
  justify-content: flex-start;
}

/* PDP cart: always compact like listing on mobile (icon + badge only at every viewport). */
.books-store-pdp--figma .pdp-mini-cart.ds-filter-tab--cart {
  padding: 4px;
  gap: 0;
  border-radius: 9999px;
  font-size: 0;
}

.books-store-pdp--figma .pdp-mini-cart .ds-filter-cart-label {
  display: none !important;
}

.books-store-pdp--figma .pdp-mini-cart .ds-filter-cart-icon {
  width: 40px;
  height: 40px;
}

.books-store-pdp--figma .pdp-mini-cart .ds-filter-cart-icon svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 390px) {
  .books-store-pdp--figma .pdp-mini-cart.ds-filter-tab--cart {
    padding: 6px;
  }

  .books-store-pdp--figma .pdp-mini-cart .ds-filter-cart-icon {
    width: 34px;
    height: 34px;
  }

  .books-store-pdp--figma .pdp-mini-cart .ds-filter-cart-icon svg {
    width: 18px;
    height: 18px;
  }
}

.books-store-pdp--figma .pdp-mini-cart-wrap {
  flex-shrink: 0;
}

.books-store-pdp--figma .pdp-figma-atc {
  flex: 1;
  min-width: min(100%, 260px);
}

.books-store-pdp--figma .pdp-btn-atc-primary {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  row-gap: 4px;
  width: 100%;
  min-height: 48px;
  padding: 0 22px !important;
  border-radius: 9999px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  background: var(--color-primary-btn, #561db4) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: none !important;
  transition: filter 0.15s, background 0.15s !important;
  line-height: 1.3 !important;
}

.books-store-pdp--figma .pdp-btn-atc-primary:hover {
  filter: brightness(1.06);
  color: #fff !important;
}

/* ≤1023px — PDP submit matches listing .ds-btn-add-cart (outline pill, prices + divider + label). */
@media (max-width: 1023px) {
  .books-store-pdp--figma .pdp-btn-atc-primary {
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    direction: ltr;
    min-height: 0 !important;
    height: 43px;
    max-height: 43px;
    padding: 0 20px !important;
    border-radius: 9999px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 16px !important;
    background: transparent !important;
    color: var(--ds-primary-dark) !important;
    border: 1px solid var(--ds-primary-dark) !important;
    box-shadow: none !important;
    white-space: nowrap;
    filter: none !important;
  }

  .books-store-pdp--figma .pdp-btn-atc-primary:hover {
    filter: none !important;
    background: transparent !important;
    color: var(--ds-primary-dark) !important;
  }

  .books-store-pdp--figma .pdp-btn-atc-primary .pdp-atc-price-line {
    order: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    direction: rtl;
    min-width: 0;
  }

  .books-store-pdp--figma .pdp-btn-atc-primary > .pdp-atc-sep {
    order: 2;
    color: var(--ds-meta-light);
    font-weight: 400;
    margin: 0 2px;
  }

  .books-store-pdp--figma .pdp-btn-atc-primary .pdp-atc-label {
    order: 3;
  }

  .books-store-pdp--figma .pdp-btn-atc-primary .pdp-atc-sep--inner {
    display: none;
  }

  .books-store-pdp--figma .pdp-btn-atc-primary .pdp-atc-now {
    order: 1;
  }

  .books-store-pdp--figma .pdp-btn-atc-primary .pdp-atc-was {
    order: 2;
    color: var(--ds-meta-light) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    text-decoration: line-through !important;
  }

  .dark .books-store-pdp--figma .pdp-btn-atc-primary {
    border-color: rgba(255, 255, 255, 0.6) !important;
    color: #fafafa !important;
  }

  .dark .books-store-pdp--figma .pdp-btn-atc-primary:hover {
    color: #fafafa !important;
  }

  .books-store-pdp--figma .pdp-figma-atc {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }
}

/* LMS-owned reader — Figma: white card + teal outline pill (ابدأ / أكمل / أعد القراءة) */
.books-store-pdp--figma .aanaab-books-store-owned-read-card {
  width: 100%;
  max-width: min(100%, 420px);
  margin-inline-start: auto;
  box-sizing: border-box;
  padding: 16px 18px;
  border-radius: 10px;
  /* background: var(--ds-box); */
  /* border: 1px solid var(--ds-box-border); */
}

.books-store-pdp--figma .pdp-add-to-cart--lms-owned-read .aanaab-books-store-owned-read-card .ds-btn-browse {
  min-height: 48px;
  padding: 0 28px;
  font-size: 15px;
  line-height: 1.35;
  white-space: normal;
  text-align: center;
}

.dark .books-store-pdp--figma .aanaab-books-store-owned-read-card {
  /* background: var(--color-box-3, #1e1e22); */
  /* border-color: rgba(255, 255, 255, 0.12); */
}

.dark .books-store-pdp--figma .pdp-add-to-cart--lms-owned-read .ds-btn-browse {
  border-color: var(--ds-teal);
  color: var(--ds-teal);
}

.dark .books-store-pdp--figma .pdp-add-to-cart--lms-owned-read .ds-btn-browse:hover {
  background: var(--ds-teal);
  color: #fff;
}

.books-store-pdp--figma .pdp-atc-sep {
  opacity: 0.9;
  font-weight: 400;
}

.books-store-pdp--figma .pdp-atc-was {
  text-decoration: line-through;
  opacity: 0.88;
  font-size: 0.88em;
  font-weight: 500;
}

.books-store-pdp--figma .pdp-main-card--figma {
  margin-top: 28px;
}

.books-store-pdp--figma .pdp-figma-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: start;
}

@media (min-width: 1024px) {
  .books-store-pdp--figma .pdp-figma-split {
    grid-template-columns: minmax(260px, 400px) 1fr;
    gap: 40px;
  }
}

/* Large cover — listing proportions, taller stage */
.books-store-pdp--figma .pdp-book-thumb--hero.ds-book-thumb {
  height: 420px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.books-store-pdp--figma .pdp-book-thumb--hero.ds-book-thumb img {
  top: 36px;
  width: 58%;
  height: 340px;
}

.books-store-pdp--figma .pdp-book-thumb--hero .pdp-thumb-placeholder {
  top: 36px;
  height: 340px;
}

.books-store-pdp--figma .pdp-desc-heading {
  margin: 0 0 16px;
  /* font-size: 20px; */
  font-weight: 700;
  color: var(--color-title, #6639c6);
  text-align: right;
}

.books-store-pdp--figma .pdp-content--figma {
  /* font-size: 16px; */
  line-height: 1.85;
  color: var(--color-text, #321f6b);
  text-align: right;
}

.books-store-pdp--figma .pdp-content--figma p {
  margin: 0 0 1rem;
}

.books-store-pdp--figma .pdp-content--figma ul {
  padding-right: 1.25rem;
  margin: 0 0 1rem;
}

/* Book PDP FAQ: summary title meta when closed, body text when open */
.books-store-pdp--figma .pdp-book-faq .faq-details .pdp-book-faq-summary-title {
  color: var(--color-meta, #52525b);
}

.books-store-pdp--figma .pdp-book-faq .faq-details[open] .pdp-book-faq-summary-title,
.books-store-pdp--figma .pdp-book-faq .faq-details.pdp-book-faq-details-open .pdp-book-faq-summary-title {
  color: var(--color-text, #321f6b);
}

.dark .books-store-pdp--figma .pdp-book-faq .faq-details .pdp-book-faq-summary-title {
  color: var(--color-meta-dark, #d2d2d4);
}

.dark .books-store-pdp--figma .pdp-book-faq .faq-details[open] .pdp-book-faq-summary-title,
.dark .books-store-pdp--figma .pdp-book-faq .faq-details.pdp-book-faq-details-open .pdp-book-faq-summary-title {
  color: rgba(250, 250, 250, 0.92);
}

/* FAQ chevron: points down when closed, rotates to point up when open */
.books-store-pdp--figma .pdp-book-faq .pdp-book-faq-chevron {
  display: block;
  transform: rotate(0deg);
  transform-origin: 50% 50%;
  transition: transform 0.2s ease-out;
}

.books-store-pdp--figma .pdp-book-faq .faq-details[open] .pdp-book-faq-chevron,
.books-store-pdp--figma .pdp-book-faq .faq-details.pdp-book-faq-details-open .pdp-book-faq-chevron {
  transform: rotate(180deg);
}

/* YouTube / oEmbed / block embeds in book description */
.books-store-pdp--figma .pdp-content--figma .wp-block-embed,
.books-store-pdp--figma .pdp-content--figma .wp-block-embed-youtube {
  margin: 0 0 1.25rem;
  width: 100%;
  max-width: 100%;
}

.books-store-pdp--figma .pdp-content--figma .wp-block-embed__wrapper {
  width: 100%;
  max-width: 100%;
}

.books-store-pdp--figma .pdp-content--figma .wp-block-embed__wrapper iframe,
.books-store-pdp--figma .pdp-content--figma iframe[src*="youtube.com/embed"],
.books-store-pdp--figma .pdp-content--figma iframe[src*="youtube-nocookie.com/embed"],
.books-store-pdp--figma .pdp-content--figma iframe[src*="youtu.be"] {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 0;
  border-radius: 10px;
  aspect-ratio: 16 / 9;
  height: auto;
}

.books-store-pdp--figma .pdp-content--figma h2,
.books-store-pdp--figma .pdp-content--figma h3 {
  color: var(--color-text, #1e1e1e);
  font-weight: 700;
  margin-top: 1.25rem;
}

.dark .books-store-pdp--figma .pdp-content--figma {
  color: rgba(250, 250, 250, 0.92);
}

.dark .books-store-pdp--figma .pdp-content--figma h2,
.dark .books-store-pdp--figma .pdp-content--figma h3 {
  color: #fafafa;
}

.books-store-pdp--figma .pdp-desc-empty {
  margin: 0;
  font-size: 15px;
}

.books-store-pdp--figma .pdp-related-section {
  margin-top: 48px;
}

/* Related books: mobile + iPad = horizontal slider; 1200px+ = static row (1900px+ = grid below). */
.books-store-pdp--figma .pdp-related-books-slider.testimonials-slider-article {
  padding-block: 0;
  overflow: hidden;
}

@media (min-width: 1200px) {
  .books-store-pdp--figma .pdp-related-books-slider.testimonials-slider-article {
    overflow: visible;
  }
}

.books-store-pdp--figma .pdp-related-slider-dots {
  display: flex;
}

@media (min-width: 1200px) {
  .books-store-pdp--figma .pdp-related-slider-dots {
    display: none;
  }
}

.books-store-pdp--figma .pdp-related-title {
  margin: 0 0 20px;
  /* font-size: 18px; */
  /* font-weight: 600; */
  /* color: var(--color-meta, #52525b); */
  text-align: right;
}

/* Track: full width in all modes */
.books-store-pdp--figma #pdp-related-books-track {
  width: 100%;
}

/* iPad mini & Air portrait band (~744–820px): 2 cards visible, snap scroll */
@media (min-width: 744px) and (max-width: 833px) {
  .books-store-pdp--figma #pdp-related-books-track {
    gap: 1rem;
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .books-store-pdp--figma #pdp-related-books-track .pdp-related-slide-card.ds-book-card {
    flex: 0 0 calc((100% - 1rem) / 2);
    width: calc((100% - 1rem) / 2);
    max-width: none;
    min-width: 0;
  }
}

/* iPad Pro (~834px+) up to desktop: 3 cards visible, snap scroll */
@media (min-width: 834px) and (max-width: 1199px) {
  .books-store-pdp--figma #pdp-related-books-track {
    gap: 1rem;
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .books-store-pdp--figma #pdp-related-books-track .pdp-related-slide-card.ds-book-card {
    flex: 0 0 calc((100% - 2rem) / 3);
    width: calc((100% - 2rem) / 3);
    max-width: none;
    min-width: 0;
  }
}

/* Desktop: wrapped row, fixed card width (no slider) */
@media (min-width: 1200px) and (max-width: 1899px) {
  .books-store-pdp--figma #pdp-related-books-track {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 1.5rem;
    overflow-x: visible;
    overflow-y: visible;
    scroll-snap-type: none;
    padding-block: 0;
  }

  .books-store-pdp--figma #pdp-related-books-track .pdp-related-slide-card.ds-book-card {
    flex: 0 0 auto;
    width: 282px;
    max-width: min(100%, 282px);
    min-width: 0;
  }
}

/* Very wide viewports: four equal columns so related cards span full content width (RTL keeps title edge aligned). */
@media (min-width: 1900px) {
  .books-store-pdp--figma #pdp-related-books-track {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
    flex-wrap: unset;
    overflow-x: visible;
    overflow-y: visible;
    scroll-snap-type: none;
  }

  .books-store-pdp--figma #pdp-related-books-track .pdp-related-slide-card.ds-book-card {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
}

.books-store-pdp--figma .pdp-cart-actions--figma .ds-btn-in-cart {
  max-width: 100%;
}

.books-store-pdp--figma .pdp-btn-browse-figma {
  display: flex;
  width: 100%;
  justify-content: center;
}

.books-store-pdp--figma .pdp-add-to-cart--figma form.cart.pdp-cart-form {
  flex-direction: column;
  align-items: stretch;
}

.books-store-pdp--figma .pdp-add-to-cart--figma .quantity input.qty {
  max-width: 100%;
}

@media (min-width: 1024px) {
  .books-store-pdp--figma .pdp-add-to-cart--figma form.cart.pdp-cart-form {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
}

/* Keep listing row as grid (avoid base .ds-books-row flex override). */
.books-store-listing--figma .ds-books-grid .ds-books-row.ds-books-row--figma {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  justify-items: center;
  width: 100%;
}

@media (min-width: 1280px) {
  .books-store-listing--figma .ds-books-grid .ds-books-row.ds-books-row--figma {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-items: stretch;
  }
}

.books-store-listing--figma .ds-books-grid .ds-books-row.ds-books-row--figma .ds-book-card {
  width: 100%;
  max-width: 100%;
}
