:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --bg-page: #fff;
  --bg-subtle: #f8fafc;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.18);

  --border-subtle: rgba(0, 0, 0, 0.06);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 6px 14px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 14px 34px rgba(15, 23, 42, 0.09);
  --shadow-lg: 0 22px 60px rgba(15, 23, 42, 0.12);

  /* Featured carousel spacing (desktop)
     Tuned for smaller featured books (requested: ~50% size) */
  --slot-x: 253;
  --slot-x-2: 140;


  --slide-dur: 580ms;
  --slide-ease: cubic-bezier(0.2, 0.85, 0.25, 1);

  --hover-dur: 220ms;
  --hover-ease: cubic-bezier(0.2, 0.85, 0.25, 1);
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-main);
  background: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;

  background-image:
    radial-gradient(1000px 700px at 12% 10%, rgba(37, 99, 235, 0.12) 0%, transparent 60%),
    radial-gradient(950px 650px at 88% 12%, rgba(245, 158, 11, 0.085) 0%, transparent 62%),
    radial-gradient(1050px 720px at 55% 92%, rgba(37, 99, 235, 0.09) 0%, transparent 65%),
    conic-gradient(from 210deg at 50% 20%, rgba(15, 23, 42, 0.035), rgba(255, 255, 255, 0), rgba(15, 23, 42, 0.03), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, rgba(15, 23, 42, 0.03), rgba(255, 255, 255, 0) 34%),
    repeating-linear-gradient(90deg, rgba(15, 23, 42, 0.028) 0px, rgba(15, 23, 42, 0.028) 1px, transparent 1px, transparent 96px),
    repeating-linear-gradient(0deg, rgba(15, 23, 42, 0.02) 0px, rgba(15, 23, 42, 0.02) 1px, transparent 1px, transparent 96px);
  background-attachment: fixed;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -30vh -20vw;
  pointer-events: none;
  z-index: -1;
  filter: blur(44px);
  opacity: .7;
}

body::before {
  background:
    radial-gradient(520px 380px at 22% 42%, rgba(37, 99, 235, 0.14), transparent 62%),
    radial-gradient(640px 460px at 76% 30%, rgba(245, 158, 11, 0.11), transparent 64%);
}

body::after {
  opacity: .55;
  background:
    radial-gradient(820px 560px at 52% 86%, rgba(37, 99, 235, 0.12), transparent 66%);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 900;
  letter-spacing: -0.025em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all .2s;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* NAVBAR */
.navbar {
  position: sticky;
  top: 12px;
  z-index: 100;
  background: transparent;
  border: none;
  transition: transform .22s ease;
}

.navbar__wrap {
  padding: 0;
}

.navbar__island {
  width: fit-content;
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 14px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.10);
  transform-origin: 50% 0%;
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease, border-color .22s ease;
}

.navbar--scrolled .navbar__island {
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.12);
  border-color: rgba(0, 0, 0, 0.07);
  transform: translateY(-2px) scaleX(0.965);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 950;
  font-size: 1.15rem;
}

.brand span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.10), rgba(37, 99, 235, 0.03));
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.nav-links {
  display: flex;
  gap: 22px;
  align-items: center;
}

/* Small current-page badge used in inner pages (library/reader/publisher) */
.nav-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .06);
  border: 1px solid rgba(148, 163, 184, .45);
  color: #0f172a;
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1;
}

.nav-links a:not(.btn) {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-muted);
  position: relative;
  padding: 10px 2px;
}

.nav-links a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 6px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0), rgba(37, 99, 235, 0.55), rgba(37, 99, 235, 0));
  opacity: 0;
  transform: translateY(4px);
  transition: all .22s ease;
}

.nav-links a:not(.btn):hover {
  color: var(--text-main);
}

.nav-links a:not(.btn):hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
}

.btn--sm {
  padding: 9px 16px;
  font-size: 0.9rem;
}

.btn--primary {
  background: var(--text-main);
  color: #fff;
}

.btn--primary:hover {
  background: #000;
}

.btn--accent {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.22);
}

.btn--accent:hover {
  background: var(--primary-hover);
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.28);
}

/* HERO */
.hero {
  padding: 96px 0 70px;
  text-align: center;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.06);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid rgba(37, 99, 235, 0.10);
  margin-bottom: 22px;
}

.hero__badge--below {
  margin: 22px auto 0;
  margin-bottom: 0;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--text-main);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.hero h1 {
  font-size: 3.35rem;
  line-height: 1.1;
  margin-bottom: 22px;
  background: linear-gradient(180deg, var(--text-main) 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.12rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 22px;
}

/* Featured */
.featured-block {
  margin-top: 30px;
}

.featured-head {
  display: flex;
  justify-content: center;
  text-align: center;
  margin-bottom: 12px;
}

.featured-head h2 {
  font-size: 1.05rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.featured-head p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.featured-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 8px;
}

.featured-nav {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease, box-shadow .12s ease;
  display: grid;
  place-items: center;
  user-select: none;
}

.featured-nav span {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1;
  transform: translateY(-1px);
}

.featured-nav:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.14);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.featured-nav:active {
  transform: translateY(0);
}

.featured-nav[disabled] {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

.featured-nav[hidden] {
  display: none !important;
}

/* PROMOWANE */
.hero__showcase {
  position: relative;
  width: min(620px, 100%);
  margin: 0 auto;
  /* Restore large featured books (desktop) */
  height: 500px;
  padding: 18px 0;
  perspective: 1100px;
}

.book-wrapper {
  position: absolute;
  left: 50%;
  bottom: 90px;
  transform-style: preserve-3d;
  cursor: pointer;
  will-change: transform, opacity;
  transition: transform var(--hover-dur) var(--hover-ease), opacity 180ms ease;
}

.book-wrapper.pos-left,
.book-wrapper.pos-right {
  width: 200px;
  height: 288px;
}

.book-wrapper.pos-center {
  width: 253px;
  height: 368px;
}

.book-wrapper.pos-left {
  transform: translateX(calc(-50% + (var(--slot-x) * -1px))) rotateY(16deg) translateZ(-45px) translateY(10px);
  z-index: 5;
}

.book-wrapper.pos-right {
  transform: translateX(calc(-50% + (var(--slot-x) * 1px))) rotateY(-16deg) translateZ(-45px) translateY(10px);
  z-index: 5;
}

.book-wrapper.pos-center {
  transform: translateX(-50%) translateZ(26px);
  z-index: 10;
  animation: floatCenter 6.5s ease-in-out infinite;
}

.hero__showcase.two-only .book-wrapper.pos-left {
  transform: translateX(calc(-50% + (var(--slot-x-2) * -1px))) rotateY(14deg) translateZ(-42px) translateY(8px);
}

.hero__showcase.two-only .book-wrapper.pos-right {
  transform: translateX(calc(-50% + (var(--slot-x-2) * 1px))) rotateY(-14deg) translateZ(-42px) translateY(8px);
}

.hero__showcase.two-only .book-wrapper.two-center {
  width: 264px;
  height: 384px;
  z-index: 10;
  transform: translateX(calc(-50% + (var(--slot-x-2) * 0.55px))) translateZ(26px);
  animation: floatRight2 6.5s ease-in-out infinite;
}

.book-wrapper:hover {
  transform: translateX(-50%) rotateY(0deg) translateZ(38px) scale(1.055);
  z-index: 30;
}

.book-wrapper.pos-left:hover {
  transform: translateX(calc(-50% + (var(--slot-x) * -1px))) rotateY(0deg) translateZ(38px) scale(1.03);
}

.book-wrapper.pos-right:hover {
  transform: translateX(calc(-50% + (var(--slot-x) * 1px))) rotateY(0deg) translateZ(38px) scale(1.03);
}

.hero__showcase.two-only .book-wrapper.pos-left:hover {
  transform: translateX(calc(-50% + (var(--slot-x-2) * -1px))) rotateY(0deg) translateZ(34px) scale(1.03);
}

.hero__showcase.two-only .book-wrapper.pos-right:hover {
  transform: translateX(calc(-50% + (var(--slot-x-2) * 1px))) rotateY(0deg) translateZ(34px) scale(1.03);
}

.hero__showcase.two-only .book-wrapper.two-center:hover {
  transform: translateX(calc(-50% + (var(--slot-x-2) * 1px))) rotateY(0deg) translateZ(42px) scale(1.06);
}

.book-ring {
  position: absolute;
  inset: -8px;
  border-radius: 18px;
  border: 1px solid rgba(37, 99, 235, 0);
  transition: border-color .2s ease;
  pointer-events: none;
}

.book-wrapper:hover .book-ring {
  border-color: rgba(37, 99, 235, 0.14);
}

.book-cover {
  position: absolute;
  inset: 0;
  border-radius: 8px 14px 14px 8px;
  background: linear-gradient(135deg, #fff 0%, #f1f5f9 100%);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: inset 3px 0 12px rgba(0, 0, 0, 0.05), 0 26px 60px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px 16px;
  overflow: hidden;
  /* Featured "spine" width — the cover image fills only the right page area */
  --book-spine: 12%;
}

.book-img {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--book-spine);
  width: calc(100% - var(--book-spine));
  height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: saturate(1.02) contrast(1.02);
  border-radius: 0 14px 14px 0;
}

.book-fallback {
  position: relative;
  z-index: 1;
  font-size: 3.7rem;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.14));
  margin-bottom: 14px;
  transform: translateZ(15px);
  opacity: 0;
  transition: opacity .18s ease;
}

/* Cena w prawym górnym rogu (zawsze ten sam rozmiar) */
.book-price {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  font-size: 0.78rem;
  font-weight: 950;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(37, 99, 235, 0.12);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.10);
  backdrop-filter: blur(8px);
  padding: 6px 10px;
  border-radius: 999px;
}

.book-price {
  overflow: hidden;
}

.book-price .bp-price {
  display: block;
  transition: opacity .18s ease, filter .18s ease;
}

.book-price .bp-buy {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 950;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(2px) scale(0.98);
  transition: opacity .18s ease, transform .18s ease;
}

.book-wrapper:hover .book-price .bp-price {
  opacity: 0;
  filter: blur(6px);
}

.book-wrapper:hover .book-price .bp-buy {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Szczegóły: mała "wyspa" na dole, która rozwija się po najechaniu */
.book-details {
  position: absolute;
  /* Trzymamy panel w obrębie okładki (żeby nie był zbyt szeroki na mniejszych ebookach) */
  left: 12px;
  right: 12px;
  top: 10px;
  bottom: 10px;
  z-index: 3;
  pointer-events: auto;
  /* wyspa reaguje na hover */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.book-details__pill {
  border: none;
  pointer-events: auto;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.80rem;
  font-weight: 950;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  /* Bez "glass blur" – na części ekranów powodował wrażenie rozmycia okienka */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.book-details__panel {
  pointer-events: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 44px;
  /* Bez transform – na niektórych przeglądarkach tekst robił się lekko rozmyty */
  transform: none;

  /* Dopasowanie do szerokości okładki (responsywnie) */
  width: auto;
  max-width: none;
  /*
    Maksymalna wysokość panelu:
    - nie większa niż 280px (żeby na dużych okładkach nie robił się przesadnie wysoki)
    - jednocześnie nie większa niż wysokość okładki minus "wyspa" + margines (żeby na małych ebookach nie był zbyt wysoki)
  */
  /*
    Panel ma zawsze pokazać minimum: tytuł + autor + krótki opis.
    100% odnosi się do wysokości okładki (bo .book-details ma top+bottom).
  */
  /*
    Docelowo panel ma pokazać: tytuł + autor + krótki opis.
    100% odnosi się do wysokości okładki (bo .book-details ma top+bottom).
  */
  --bd-maxh: min(340px, calc(100% - 64px));

  /* Lekko skalujemy typografię razem z oknem (na małych okładkach tekst jest mniejszy) */
  font-size: clamp(0.72rem, 0.66rem + 0.45vw, 0.90rem);

  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
  /* Bez blur (patrz wyżej) */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 16px;

  padding: clamp(12px, 10px + 1vw, 18px);

  opacity: 0;
  max-height: 0;
  /* gdy panel się otwiera, pilnujemy żeby nie był "mikroskopijny" */
  min-height: 0;
  overflow: hidden;
  transition: opacity .20s ease, max-height .20s ease;
  transform-origin: bottom center;

  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Panel rozwija się WYŁĄCZNIE gdy użytkownik najedzie na przycisk "Szczegóły".
   Dodatkowo pozwalamy utrzymać otwarty panel, gdy kursor jest na samym panelu (żeby dało się czytać). */
.book-details__pill:hover+.book-details__panel,
.book-details__panel:hover {
  opacity: 1;
  max-height: var(--bd-maxh);
  /* pilnujemy sensownej wysokości na małej i dużej okładce */
  min-height: clamp(150px, 55%, 260px);
  transform: none;
  overflow: auto;
  pointer-events: auto;
}

/* Ukrycie widocznego paska przewijania, ale scroll nadal działa */
.book-details__pill:hover+.book-details__panel,
.book-details__panel:hover {
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE/Edge legacy */
}

.book-details__pill:hover+.book-details__panel::-webkit-scrollbar,
.book-details__panel:hover::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* Mniejsza okładka (lewa pozycja w polecanych) – ciaśniejsza typografia, żeby zmieścił się krótki opis */
.book-wrapper.pos-left .book-details__panel {
  --bd-maxh: min(280px, calc(100% - 60px));
  font-size: clamp(0.62rem, 0.58rem + 0.35vw, 0.78rem);
  padding: clamp(10px, 8px + 0.8vw, 14px);
}

.book-wrapper.pos-left .bd-title {
  font-size: 1.00em;
  -webkit-line-clamp: 2;
}

.book-wrapper.pos-left .bd-author {
  font-size: 0.72em;
  padding: 3px 7px;
}

.book-wrapper.pos-left .bd-sub {
  font-size: 0.96em;
  -webkit-line-clamp: 3;
}

.book-wrapper.pos-left .bd-note {
  font-size: 0.78em;
}

.book-details__panel::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  background: rgba(255, 255, 255, 0.86);
  border-left: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transform: translateX(-50%) rotate(45deg);
  box-shadow: 8px 8px 18px rgba(15, 23, 42, 0.10);
}

.bd-title {
  font-size: 1.05em;
  line-height: 1.18;
  font-weight: 950;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.bd-author {
  font-size: 0.90em;
  font-weight: 900;
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.10);
  width: fit-content;
  padding: 5px 10px;
  border-radius: 12px;
  /* idealne wyśrodkowanie w panelu */
  margin: 0 auto;
  text-align: center;
  align-self: center;
  /* na małych okładkach chcemy 1 linię (bez zawijania) */
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bd-sub {
  margin-top: 2px;
  font-size: 0.98em;
  font-weight: 850;
  color: var(--text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bd-note {
  margin-top: 4px;
  /* delikatnie mniejsze w dużej wersji */
  font-size: 0.84em;
  font-weight: 850;
  color: var(--text-muted);
  line-height: 1.45;
}

.bd-sub {
  font-size: 1em;
  font-weight: 850;
  color: var(--text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-cover::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--book-spine);
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  box-shadow: inset -10px 0 18px rgba(15, 23, 42, 0.06);
  opacity: 1;
}

.book-cover::after {
  content: "";
  position: absolute;
  inset: -40% -40% auto auto;
  width: 160%;
  height: 160%;
  transform: rotate(20deg);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.00) 0%, rgba(15, 23, 42, 0.18) 70%, rgba(15, 23, 42, 0.28) 100%),
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.38), transparent 55%);
  opacity: .58;
  transition: opacity .25s ease;
}

.book-wrapper:hover .book-cover::after {
  opacity: .82;
}



@keyframes floatCenter {

  0%,
  100% {
    transform: translateX(-50%) translateZ(26px) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateZ(26px) translateY(-10px);
  }
}

@keyframes floatRight2 {

  0%,
  100% {
    transform: translateX(calc(-50% + (var(--slot-x-2) * 1px))) translateZ(26px) translateY(0);
  }

  50% {
    transform: translateX(calc(-50% + (var(--slot-x-2) * 1px))) translateZ(26px) translateY(-10px);
  }
}

.hero__showcase.is-animating .book-wrapper {
  pointer-events: none;
}

.book-wrapper.slider-move {
  transition: transform var(--slide-dur) var(--slide-ease), opacity 360ms ease;
}

.book-wrapper.t-off-left {
  opacity: 0;
  transform: translateX(calc(-50% + (var(--slot-x) * -1px) - 92px)) rotateY(18deg) translateZ(-92px) translateY(14px) scale(0.96);
}

.book-wrapper.t-off-right {
  opacity: 0;
  transform: translateX(calc(-50% + (var(--slot-x) * 1px) + 92px)) rotateY(-18deg) translateZ(-92px) translateY(14px) scale(0.96);
}

/* SECTIONS */
.section {
  padding: 84px 0;
}

.section-head {
  text-align: center;
  margin-bottom: 56px;
}

.section-head--left {
  text-align: left;
  margin-bottom: 0;
}

.section-head h2 {
  font-size: 2.1rem;
  margin-bottom: 12px;
}

.section-head--left h2 {
  margin-bottom: 8px;
}

.section-head p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.section--catalog {
  background:
    radial-gradient(900px 420px at 14% 10%, rgba(37, 99, 235, 0.05), transparent 62%),
    radial-gradient(900px 420px at 86% 10%, rgba(245, 158, 11, 0.035), transparent 64%),
    rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.catalog-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.catalog-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.searchbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.searchbox__icon {
  color: var(--text-light);
  font-weight: 900;
}

.searchbox input {
  width: 230px;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-main);
  font-weight: 800;
  color: var(--text-main);
}

.searchbox input::placeholder {
  color: var(--text-light);
  font-weight: 800;
}

.sortbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sortbtn {
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-xs);
  font-weight: 950;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.sortbtn:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.14);
  background: #fff;
}

.sortbtn.is-active {
  border-color: rgba(37, 99, 235, 0.20);
  background: rgba(37, 99, 235, 0.06);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

/* cards */
.item {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 16px;
  padding-top: 35px;
  padding-bottom: 35px;
  box-shadow: var(--shadow-xs);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: stretch;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  --item-bg: rgba(255, 255, 255, 0.86);
  --wipe-left: 9999px;
  /* will be set from JS */
}

.item::before {
  content: "";
  position: absolute;
  left: -18%;
  top: -55%;
  width: 160%;
  height: 160%;
  background: radial-gradient(circle at 30% 30%, rgba(37, 99, 235, 0.07), transparent 56%);
  opacity: 0;
  transition: opacity .18s ease;
  pointer-events: none;
  z-index: 0;
}

.item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(0, 0, 0, 0.08);
}

.item:hover::before {
  opacity: 0;
}

.item-left {
  display: flex;
  gap: 14px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.item-right {
  position: relative;
  z-index: 1;
}

.item-cover {
  width: 84px;
  min-width: 84px;
  aspect-ratio: 2 / 3;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.09), rgba(248, 250, 252, 0.85));
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.item-cover::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  border-radius: 16px 0 0 16px;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.60), rgba(37, 99, 235, 0.10));
  z-index: 2;
}

.item-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.item-cover,
.item-img {
  cursor: zoom-in;
}

.item-emoji {
  font-size: 30px;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.10));
  z-index: 3;
}

/* ===== Cover zoom (Nasze ebooki) ===== */
.cover-zoom-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 18, 0.55);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .22s ease;
  z-index: 9999;
}

.cover-zoom-overlay.is-open {
  opacity: 1;
}

.cover-zoom-img {
  position: fixed;
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  z-index: 10000;
  will-change: left, top, width, height, transform;
  transition: left .28s ease, top .28s ease, width .28s ease, height .28s ease;
}


.item-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.item-title {
  font-weight: 950;
  font-size: 1.02rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-sub {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: default;
  position: relative;
}

/* subtle "hold" progress indicator */
.item.is-holding .item-sub::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 3px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  overflow: hidden;
}

.item.is-holding .item-sub::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 3px;
  width: 0;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.55);
  animation: itemHoldFill 1.5s linear forwards;
}

@keyframes itemHoldFill {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

/* Cursor ring loader (appears while hovering the short description) */
.hover-hold-ring {
  position: fixed;
  left: 0;
  top: 0;
  width: 38px;
  height: 38px;
  transform: translate(-50%, -50%);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease;
}

.hover-hold-ring.is-on {
  opacity: 1;
}

.hover-hold-ring svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hover-hold-ring .bg {
  stroke: rgba(255, 255, 255, 0.70);
  stroke-width: 3.5;
  fill: none;
}

.hover-hold-ring .fg {
  stroke: rgba(0, 0, 0, 0.55);
  stroke-width: 3.5;
  fill: none;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  stroke-dasharray: 138.2;
  /* 2*pi*r where r≈22 */
  stroke-dashoffset: 138.2;
}

.hover-hold-ring.is-anim .fg {
  animation: holdRingFill 1.5s linear forwards;
}

@keyframes holdRingFill {
  from {
    stroke-dashoffset: 138.2;
  }

  to {
    stroke-dashoffset: 0;
  }
}


.item {
  --lock-h: auto;
  --wipe-left: 0px;
  --wipe-shift: 0px;
  --peek-left: 0px;
  --peek-top: 0px;
  --peek-clip-start: 0px;
}

/* Height lock must also hold during the reverse animation */
.item.is-peek,
.item.is-locking {
  height: var(--lock-h);
}

/* ===== Hold-to-expand (Nasze ebooki) =====
   Implementation notes (stable + smooth):
   - We DO NOT animate width/left (avoids reflow + end-of-animation stutter).
   - A "curtain" (.item-wipe) scales from the divider to the right, applying strong blur to what's under it.
   - The real divider (.item-divider) physically moves with the curtain edge.
*/

.item-wipe {
  position: absolute;
  /* cover the whole right side; the card clips it so there are no visible edges */
  top: 0;
  bottom: 0;
  /* start blur a bit earlier than the divider so icons (eye/price) are fully blurred */
  left: var(--wipe-blur-left, var(--wipe-left));
  right: 0;
  border-radius: 0;

  /* strong blur, but with a feathered left edge so there is NO visible outline/seam */
  /* stronger blur + slight desaturation, with a neutral tint to avoid color "smearing" */
  background: rgba(248, 250, 252, 0.56);
  /* stronger blur, slightly less saturation to avoid color smearing */
  backdrop-filter: blur(58px) saturate(0.72);
  -webkit-backdrop-filter: blur(58px) saturate(0.72);

  /* feather the left edge (the divider side) */
  -webkit-mask-image: linear-gradient(to right, transparent 0px, black 60px);
  mask-image: linear-gradient(to right, transparent 0px, black 60px);

  transform-origin: left center;
  transform: scaleX(0);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: transform 2.25s cubic-bezier(.2, .9, .18, 1), opacity .18s ease;
  will-change: transform;
}


/* This is the actual divider that starts at the original split and moves with the wipe */
.item-divider {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: var(--wipe-left);
  width: 1px;
  background: rgba(0, 0, 0, 0.10);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  transform: translateX(0);
  transition: transform 2.25s cubic-bezier(.2, .9, .18, 1), opacity .18s ease;
  will-change: transform;
}

.item.is-peek .item-wipe {
  opacity: 1;
  transform: scaleX(1);
}

.item.is-peek .item-divider {
  opacity: 1;
  transform: translateX(var(--wipe-shift));
}

/* Expanded text overlay (reveals more text *horizontally* without changing card height) */
.item-peekcopy-wrap {
  position: absolute;
  left: var(--peek-left);
  top: var(--peek-top);
  right: 16px;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  /* start clipped to the original text width, then reveal into the blurred right area */
  clip-path: inset(0 var(--peek-clip-start) 0 0);
  transition: clip-path 2.25s cubic-bezier(.2, .9, .18, 1), opacity .12s ease;
  will-change: clip-path;
}

.item.is-peek .item-peekcopy-wrap {
  opacity: 1;
  clip-path: inset(0 16px 0 0);
}

.item-peekcopy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

/* The peek copy reuses the exact same classes as the original text.
   Intentionally no extra typography rules here, to keep it pixel-identical.
*/

/* Keep actions rendered (so they are visible behind the blur), but disable interaction */
.item.is-peek .item-right {
  opacity: 1;
  transform: translateX(0);
  pointer-events: none;
  border-left-color: transparent;
}

/* Keep the original text unchanged (prevents any height changes); overlay handles the reveal */
.item.is-peek .item-left {
  position: relative;
  z-index: 4;
}

/* Hide the original text when expanded to prevent double-rendering.
   The overlay is pixel-aligned and acts as a seamless reveal.
*/
.item-main {
  transition: opacity .12s ease;
}

/* Hide instantly on activation to avoid any perceived "double text".
   The revealed copy takes over in the exact same place.
*/
.item.is-peek .item-main {
  position: relative;
  z-index: 4;
  opacity: 0;
  transition: none;
}

.item.is-peek .item-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.item.is-peek .item-sub {
  -webkit-line-clamp: 2;
}

/* A small, quality fade-in for the revealed (masked) copy */
.item.is-peek .item-peekcopy-wrap {
  animation: itemPeekCopy .28s ease .10s both;
}

@keyframes itemPeekCopy {
  from {
    opacity: 0;
    transform: translateY(1px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.item-author {
  color: var(--text-light);
  font-size: 0.82rem;
  font-weight: 900;
  margin-top: 1px;
}

.item-right {
  min-width: 132px;
  max-width: 200px;
  border-left: 1px solid rgba(0, 0, 0, 0.04);
  padding-left: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
}

/* keep layout stable; we don't collapse the column anymore (no reflow + no end-of-animation "lag") */
.item.is-peek .item-right {
  border-left-color: transparent;
}

.item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
}

.item-actions__bottom {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.item-free {
  appearance: none;
  -webkit-appearance: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(248, 250, 252, 0.92);
  /* jak "Szczegóły" */
  box-shadow: var(--shadow-xs);
  font-weight: 950;
  user-select: none;
  position: relative;
  padding: 0;
  cursor: pointer;
}

.item-free svg {
  width: 20px;
  height: 20px;
  display: block;
}

.item-free--yes {
  background: rgba(255, 255, 255, 0.98);
  color: rgba(22, 163, 74, 0.95);
}
.item-free--yes:hover {
  border-color: rgba(22, 163, 74, 0.45);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.item-free--no {
  background: rgba(248, 250, 252, 0.92);
  color: rgba(15, 23, 42, 0.70);
  cursor: not-allowed;
}

.item-free[disabled] {
  opacity: 0.9;
}

/* Tooltip for free chapters icon */
.item-free[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  right: 0;
  top: -10px;
  transform: translateY(-100%);
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-weight: 850;
  font-size: 0.78rem;
  padding: 8px 10px;
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.22);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
}

.item-free[data-tip]::before {
  content: "";
  position: absolute;
  right: 14px;
  top: -10px;
  transform: translateY(-100%) translateY(6px) rotate(45deg);
  width: 10px;
  height: 10px;
  background: rgba(15, 23, 42, 0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}

.item-free:hover::after {
  opacity: 1;
  transform: translateY(-100%) translateY(-6px);
}

.item-free:hover::before {
  opacity: 1;
}

.item-details {
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 950;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(248, 250, 252, 0.92);
  /* lekko ciemniejsze od tła karty */
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.item-details:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.18);
  box-shadow: var(--shadow-sm);
}

.item-details:active {
  transform: translateY(0);
}

/* Details modal */
.details-author {
  font-weight: 950;
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.10);
  padding: 8px 12px;
  border-radius: 14px;
  width: fit-content;
  margin-bottom: 14px;
}

.details-desc {
  color: var(--text-muted);
  font-weight: 750;
  line-height: 1.65;
  white-space: pre-wrap;
  max-height: 40vh;
  overflow: auto;
  padding-right: 6px;
}

.details-free {
  margin-top: 18px;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(248, 250, 252, 0.72);
  padding: 14px;
}

.details-free__head {
  font-weight: 950;
  margin-bottom: 6px;
}

.details-free__info {
  color: var(--text-muted);
  font-weight: 800;
  margin-bottom: 12px;
}

.item-price {
  font-weight: 950;
  font-size: 1.05rem;
}

.item-buy {
  position: relative;
  z-index: 5;
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 950;
  border: 1px solid rgba(22, 163, 74, 0.35);
  background: rgba(22, 163, 74, 0.92);
  color: #fff;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.item-buy:hover {
  transform: translateY(-1px);
  border-color: rgba(22, 163, 74, 0.55);
  box-shadow: var(--shadow-sm);
}

.item-buy:active {
  transform: translateY(0);
}

/* ======= NOWA SEKCJA: ZAKUP BEZ KONTA ======= */
.purchase-steps {
  margin-top: 26px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 18px;
}

/* Nadpisanie “starej” prezentacji steps (zostawiamy kompatybilność) */
.step-item {
  position: relative;
  padding: 18px 18px 18px 18px;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.step-item::before {
  content: "";
  position: absolute;
  inset: -35% -25% auto auto;
  width: 130%;
  height: 130%;
  transform: rotate(18deg);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.60), transparent 55%);
  opacity: .75;
  pointer-events: none;
}

.step-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 54px rgba(15, 23, 42, 0.11);
  border-color: rgba(37, 99, 235, 0.14);
}

.step-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.step-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  background: rgba(37, 99, 235, 0.06);
  color: var(--primary);
  font-weight: 950;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.step-ico {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07);
  display: grid;
  place-items: center;
  font-weight: 950;
}

.step-item h3 {
  font-size: 1.12rem;
  margin: 0 0 6px;
  font-weight: 950;
  position: relative;
  z-index: 1;
}

.step-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 750;
  line-height: 1.55;
  position: relative;
  z-index: 1;
}

.purchase-note {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
  color: var(--text-muted);
  font-weight: 800;
}

.purchase-note b {
  color: var(--text-main);
  font-weight: 950;
}

/* =============================== */

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 32px;
}

/* “Już wkrótce” */
.soon-panel {
  margin-top: 20px;
  border-radius: 22px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 52px rgba(15, 23, 42, 0.10);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.soon-panel::before {
  content: "";
  position: absolute;
  inset: -40% -30% auto auto;
  width: 140%;
  height: 140%;
  transform: rotate(18deg);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.70), transparent 55%);
  opacity: .75;
  pointer-events: none;
}

/* Distinct variant */
.soon-panel--distinct {
  border-color: rgba(37, 99, 235, 0.12);
  background:
    radial-gradient(900px 420px at 18% 20%, rgba(37, 99, 235, 0.10), transparent 62%),
    radial-gradient(760px 360px at 85% 15%, rgba(245, 158, 11, 0.08), transparent 64%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.62));
}

.soon-panel--distinct::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .55;
  background:
    repeating-linear-gradient(45deg, rgba(15, 23, 42, 0.018) 0px, rgba(15, 23, 42, 0.018) 1px, transparent 1px, transparent 14px);
}

.soon-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  position: relative;
  z-index: 1;
}

.soon-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 950;
  font-size: 0.82rem;
  width: fit-content;
}

.soon-title h3 {
  margin-top: 10px;
  font-size: 1.25rem;
  font-weight: 950;
}

.soon-title p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-weight: 700;
  max-width: 680px;
}

.soon-card {
  width: 220px;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.10), rgba(255, 255, 255, 0.70));
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.10);
  padding: 16px;
  text-align: left;
}

.soon-card__badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  font-weight: 950;
  font-size: 0.78rem;
}

.soon-card__big {
  margin-top: 10px;
  font-size: 1.75rem;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.soon-card__small {
  color: var(--text-muted);
  font-weight: 800;
  margin-top: 2px;
  font-size: 0.92rem;
}

.soon-grid {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  opacity: .95;
}

.soon-item {
  border-radius: 16px;
  border: 1px dashed rgba(0, 0, 0, 0.10);
  background: rgba(255, 255, 255, 0.62);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.soon-ico {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.soon-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.soon-meta b {
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.soon-meta span {
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.9rem;
}

/* ===== PREMIERY (Nadchodzące ebooki) ===== */
/* Uwaga: kontener korzysta z oryginalnej stylistyki .soon-panel/.soon-top/.soon-grid.
   Poniżej zostają tylko dodatki dla elementów dynamicznych (okładki, strzałki, układ w kaflach). */

.premiere-feature {
  /* bazowy wygląd bierze z .soon-card (oryginał) */
  /* szerszy kafel — mieści autora i datę premiery */
  width: 300px;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.premiere-feature:focus {
  outline: none;
}

.premiere-feature:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}

.premiere-feature__badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, 0.22);
  background: rgba(245, 158, 11, 0.10);
  color: rgba(15, 23, 42, 0.86);
  font-weight: 950;
  font-size: 0.78rem;
}

.premiere-feature__body {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.premiere-stage {
  margin-top: 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.premiere-nav {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  font-size: 22px;
  font-weight: 950;
  cursor: pointer;
  transition: transform .15s ease;
}

.premiere-nav:hover {
  transform: translateY(-1px);
}

.premiere-card {
  /* karta premier jest renderowana jako .soon-item (oryginał) */
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.premiere-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.10);
}

.premiere-card.is-empty {
  cursor: default;
  box-shadow: none;
  opacity: .85;
}

.premiere-card__body {
  display: flex;
  gap: 12px;
  align-items: center;
}

.premiere-card__empty {
  padding: 18px;
  text-align: center;
}

.premiere-card__emptyTitle {
  font-weight: 950;
}

.premiere-card__emptySub {
  margin-top: 4px;
  color: var(--text-muted);
  font-weight: 800;
}

/* okładka - zgodna z pozostałymi mini-okładkami */
.premiere-cover {
  width: 62px;
  height: 92px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  /* taki sam „kolorowy pasek” jak w kartach Nasze ebooki */
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.09), rgba(248, 250, 252, 0.85));
  overflow: hidden;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.premiere-cover::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  border-radius: 14px 0 0 14px;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.60), rgba(37, 99, 235, 0.10));
  z-index: 2;
}

.premiere-cover {
  position: relative;
}

.premiere-cover__img {
  position: relative;
  z-index: 1;
}

.premiere-cover__emoji {
  position: relative;
  z-index: 3;
}

.premiere-cover__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.premiere-cover__emoji {
  font-size: 30px;
}

.premiere-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.premiere-h {
  font-weight: 950;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.premiere-a,
.premiere-d {
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 980px) {
  .premiere-top {
    grid-template-columns: 1fr;
  }

  .premiere-feature {
    width: 100%;
  }

  .premiere-stage {
    grid-template-columns: 1fr;
  }

  .premiere-nav {
    display: none !important;
  }

  .premiere-grid {
    grid-template-columns: 1fr;
  }
}


/* ===== AUDIOBOOKI (proste + wyróżnione) ===== */
.audio-panel {
  margin-top: 14px;
  border-radius: 24px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  overflow: hidden;
  position: relative;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.12);
}

/* prosta wersja: jasna, ale mocno inna od reszty (kontrast + “ink”) */
.audio-panel--simple {
  border-color: rgba(15, 23, 42, 0.10);
  background:
    radial-gradient(900px 520px at 18% 30%, rgba(15, 23, 42, 0.10), transparent 62%),
    radial-gradient(760px 460px at 88% 12%, rgba(37, 99, 235, 0.18), transparent 64%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.78));
  color: rgba(255, 255, 255, 0.92);
}

.audio-panel--simple::before {
  content: "";
  position: absolute;
  inset: -25% -20%;
  pointer-events: none;
  opacity: .22;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.10) 0px, rgba(255, 255, 255, 0.10) 1px, transparent 1px, transparent 18px);
}

.audio-panel--simple::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .55;
  background:
    radial-gradient(980px 440px at 55% 0%, rgba(245, 158, 11, 0.20), transparent 62%);
}

.audio-simple {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 22px 24px;
}

.audio-simple__pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 900;
  font-size: 0.9rem;
  width: fit-content;
}

.audio-simple__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.95);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18);
}

.audio-simple__title {
  margin-top: 12px;
  font-size: 1.45rem;
  line-height: 1.15;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.audio-simple__desc {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 650;
  max-width: 720px;
}

.audio-iconOrb {
  width: 120px;
  height: 120px;
  border-radius: 999px;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.16), transparent 55%),
    radial-gradient(circle at 70% 65%, rgba(245, 158, 11, 0.26), transparent 60%),
    rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.28);
}

.audio-iconOrb__ring {
  position: absolute;
  inset: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  opacity: .85;
}

.audio-iconOrb__icon {
  font-size: 38px;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.30));
}

/* ===== Zakup bez konta (sekcja między FAQ a Audiobooki) ===== */
.purchase-steps {
  margin-top: 26px;
}

.purchase-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  margin-top: 18px;
}

.purchase-card {
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 18px;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.purchase-card::before {
  content: "";
  position: absolute;
  inset: -40% -30% auto auto;
  width: 150%;
  height: 150%;
  transform: rotate(18deg);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.65), transparent 55%);
  opacity: .75;
  pointer-events: none;
}

.purchase-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 54px rgba(15, 23, 42, 0.11);
  border-color: rgba(37, 99, 235, 0.14);
}

.purchase-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.purchase-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  background: rgba(37, 99, 235, 0.06);
  color: var(--primary);
  font-weight: 950;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.purchase-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07);
  display: grid;
  place-items: center;
  font-weight: 950;
}

.purchase-title {
  font-weight: 950;
  font-size: 1.06rem;
  line-height: 1.25;
  position: relative;
  z-index: 1;
  margin-bottom: 6px;
}

.purchase-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 750;
  line-height: 1.55;
  position: relative;
  z-index: 1;
}

.purchase-note {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
  color: var(--text-muted);
  font-weight: 800;
}

.purchase-note b {
  color: var(--text-main);
  font-weight: 950;
}

@media (max-width: 980px) {
  .purchase-grid {
    grid-template-columns: 1fr;
  }
}


/* FAQ */
.section--faq {
  background:
    radial-gradient(900px 420px at 50% 0%, rgba(37, 99, 235, 0.06), transparent 62%),
    rgba(255, 255, 255, 0.45);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.faq-head {
  text-align: center;
  margin-bottom: 34px;
}

.faq-kicker {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.70);
  font-weight: 950;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.faq-head h2 {
  margin-top: 14px;
  font-size: 2.1rem;
}

.faq-head p {
  margin: 8px auto 0;
  color: var(--text-muted);
  font-weight: 700;
  max-width: 640px;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.faq-item {
  align-self: start;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.09);
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateY(0);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.faq-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 54px rgba(15, 23, 42, 0.12);
  border-color: rgba(37, 99, 235, 0.14);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.faq-tag {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07);
}

.faq-q {
  font-weight: 950;
  line-height: 1.25;
  min-width: 0;
}

.faq-ic {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.78);
  display: grid;
  place-items: center;
  font-weight: 950;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.faq-item.is-open .faq-ic {
  transform: rotate(45deg);
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.18);
}

.faq-a {
  padding: 0;
  color: var(--text-muted);
  font-weight: 750;
  line-height: 1.55;
}

.faq-a__inner {
  padding: 0 16px 16px 16px;
}

@keyframes faqIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 200;
}

.modal-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, -45%) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform .25s ease, opacity .25s ease;
  z-index: 210;
}

.modal[aria-hidden="false"] .modal-overlay {
  opacity: 1;
  pointer-events: auto;
}

.modal[aria-hidden="false"] .modal-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 950;
  margin-bottom: 8px;
}

.field-input {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.field-input:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px var(--primary-light);
  background: #fff;
}

/* DETAILS MODAL */
.details-author {
  font-weight: 950;
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.10);
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.details-desc {
  color: var(--text-muted);
  font-weight: 750;
  line-height: 1.65;
  white-space: pre-wrap;
  max-height: 38vh;
  overflow: auto;
  padding-right: 6px;
}

.details-free {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.details-free__head {
  font-weight: 950;
}

.details-free__info {
  color: var(--text-muted);
  font-weight: 750;
}

/* FOOTER */
.site-footer {
  padding: 34px 0 28px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background:
    radial-gradient(700px 320px at 10% 0%, rgba(37, 99, 235, 0.06) 0%, transparent 60%),
    radial-gradient(700px 320px at 90% 0%, rgba(245, 158, 11, 0.05) 0%, transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.92));
}

.footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px;
  border-radius: 22px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.10);
  position: relative;
  overflow: hidden;
}

.footer-bar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0), rgba(37, 99, 235, 0.22), rgba(245, 158, 11, 0.12), rgba(37, 99, 235, 0));
  opacity: .9;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 950;
}

.footer-logo {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.10), rgba(37, 99, 235, 0.03));
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xs);
}

.footer-title {
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.footer-sub {
  font-weight: 800;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: 3px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-links a {
  color: var(--text-muted);
  font-weight: 850;
  padding: 6px 0;
  position: relative;
}

.footer-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0), rgba(37, 99, 235, 0.55), rgba(37, 99, 235, 0));
  opacity: 0;
  transform: translateY(3px);
  transition: all .18s ease;
}

/* =============================
   LIBRARY (Moja biblioteka)
   ============================= */
.library-page main {
  padding-top: 26px;
}

/* Navbar variant with centered title */
.navbar__island.navbar__island--library {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  /* In library we want a full-width island so the centered title doesn't collide */
  width: 100%;
}

.navbar__title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 950;
  color: var(--text-main);
  letter-spacing: -0.02em;
  pointer-events: none;
}

@media(max-width: 880px) {
  .navbar__title {
    position: static;
    transform: none;
    pointer-events: auto;
  }

  .navbar__island.navbar__island--library {
    flex-wrap: wrap;
    justify-content: center;
  }

  .navbar__island.navbar__island--library .navbar__left {
    order: 1;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .navbar__island.navbar__island--library .navbar__center {
    order: 2;
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 4px;
  }

  .navbar__island.navbar__island--library .navbar__right {
    order: 3;
    width: 100%;
    display: flex;
    justify-content: center;
  }
}

.library-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  align-items: start;
}

@media(max-width: 980px) {
  .library-shell {
    grid-template-columns: 1fr;
  }
}

.library-side {
  position: sticky;
  top: 92px;
}

@media(max-width: 980px) {
  .library-side {
    position: static;
    top: auto;
  }
}

.library-card {
  border-radius: 24px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.10);
  padding: 18px;
}

.library-side__kicker {
  font-weight: 950;
  font-size: 0.78rem;
  letter-spacing: .08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.library-side__title {
  font-weight: 950;
  font-size: 1.20rem;
  margin-top: 6px;
}

.library-side__sub {
  color: var(--text-muted);
  font-weight: 750;
  line-height: 1.55;
  margin-top: 8px;
}

.library-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.library-menu__btn {
  width: 100%;
  text-align: left;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.66);
  padding: 12px 12px;
  font-weight: 900;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.library-menu__btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(37, 99, 235, 0.16);
}

.library-menu__btn.is-active {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.18);
}

.library-menu__meta {
  font-weight: 900;
  color: var(--text-muted);
}

.library-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.library-stat {
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.62);
  padding: 12px;
}

.library-stat__label {
  font-weight: 900;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.library-stat__value {
  font-weight: 950;
  font-size: 1.35rem;
  margin-top: 6px;
}

.library-hint {
  margin-top: 12px;
  border: 1px dashed rgba(0, 0, 0, 0.12);
  background: rgba(248, 250, 252, 0.60);
  border-radius: 18px;
  padding: 14px;
}

.library-hint__t {
  font-weight: 950;
}

.library-hint__p {
  color: var(--text-muted);
  font-weight: 750;
  line-height: 1.55;
  margin-top: 8px;
}

.library-main__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.library-main__title {
  font-weight: 950;
  font-size: 1.25rem;
}

.library-main__email {
  color: var(--text-muted);
  font-weight: 800;
  margin-top: 6px;
}

.library-main__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding: 8px 0 2px;
}

/* Card based on featured book look */
.library-book {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.76);
  transition: transform .18s ease, box-shadow .18s ease;
}

.library-book:hover {
  transform: translateY(-2px);
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.22);
}

.library-book__click {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.library-book .book-wrapper {
  /* Override hero styles: in homepage .book-wrapper is absolutely positioned and transformed.
     In library cards it must behave like a normal container. */
  position: relative;
  left: auto;
  bottom: auto;
  width: 100%;
  /* Keep consistent book proportions (close to homepage featured cards)
     so covers don't look "cropped" by an odd aspect ratio. */
  height: auto;
  aspect-ratio: 2 / 3;
  transform: none;
  animation: none;
  transition: none;
}

.library-book .book-cover {
  height: 100%;
  /* Make the cover fill the card cleanly (no visible inner side margins) */
  border-radius: 26px;
  --book-spine: 8%;
}

.library-book .book-img {
  border-radius: 0 26px 26px 0;
}

.library-book .book-fallback {
  opacity: 1;
}

/* Smaller typography inside hover panel so more content fits */
.library-page .book-details__panel {
  font-size: clamp(0.66rem, 0.62rem + 0.38vw, 0.84rem);
  padding: clamp(11px, 9px + 0.9vw, 16px);
}

/* In library, the details panel should sit ABOVE the "Przeczytany" control (and cover it). */
.library-page .book-details {
  z-index: 8;
}

.library-page .book-details__panel {
  z-index: 9;
}

.library-page .bd-title {
  font-size: 1.02em;
  text-align: center;
}

.library-page .bd-sub {
  -webkit-line-clamp: 4;
}

.library-page .bd-note {
  text-align: center;
}

/* Read checkbox (custom rounded square like other UI) */
.lib-check {
  position: absolute;
  left: 12px;
  /* Move up so it doesn't collide with the Details island */
  bottom: 62px;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.12);
}

.lib-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.lib-check__box {
  width: 22px;
  height: 22px;
  border-radius: 9px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: rgba(255, 255, 255, 0.85);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10);
}

.lib-check__tick {
  /* Checkmark (ptaszek) drawn with borders */
  width: 10px;
  height: 6px;
  border-left: 3px solid rgba(37, 99, 235, 0);
  border-bottom: 3px solid rgba(37, 99, 235, 0);
  transform: rotate(-45deg) scale(0.85);
  transition: transform .16s ease, border-color .16s ease;
}

.lib-check input:checked+.lib-check__box .lib-check__tick {
  border-left-color: rgba(37, 99, 235, 0.95);
  border-bottom-color: rgba(37, 99, 235, 0.95);
  transform: rotate(-45deg) scale(1);
}

.lib-check__label {
  font-weight: 950;
  color: rgba(15, 23, 42, 0.70);
}

/* Status badge: circle with % normally; expands to text on hover */
.lib-status {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 10;
  height: 38px;
  width: 38px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  /* No padding when collapsed so the % is always readable */
  padding: 0;
  overflow: hidden;
  transition: width .22s ease, background .22s ease;
}

.lib-status__pct {
  font-weight: 950;
  color: rgba(15, 23, 42, 0.80);
  font-size: 0.74rem;
  /* Keep the % perfectly centered inside the collapsed 38x38 circle */
  flex: 0 0 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.lib-status__txt {
  font-weight: 950;
  color: rgba(15, 23, 42, 0.74);
  font-size: 0.74rem;
  white-space: nowrap;
  /* When collapsed we hide this text without affecting flex layout.
     Otherwise it can push the % outside the circle (invisible until hover). */
  opacity: 0;
  max-width: 0;
  transform: translateX(-4px);
  overflow: hidden;
  transition: opacity .18s ease, transform .18s ease, max-width .18s ease;
}

.library-book:hover .lib-status {
  width: 188px;
  justify-content: flex-start;
  padding: 0 10px;
}

.library-book:hover .lib-status__txt {
  opacity: 1;
  max-width: 160px;
  transform: translateX(0);
}

.footer-links a:hover {
  color: var(--text-main);
}

.footer-links a:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.footer-bottom {
  padding-top: 12px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.92rem;
  text-align: center;
}

.footer-bottom>div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
}

@media (max-width: 980px) {
  :root {
    --slot-x: 260;
    --slot-x-2: 160;
  }

  .hero h1 {
    font-size: 2.75rem;
  }

  .catalog-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .catalog-controls {
    justify-content: flex-start;
  }

  .searchbox input {
    width: 210px;
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .item {
    grid-template-columns: 1fr;
  }

  .item-right {
    border-left: none;
    padding-left: 0;
    min-width: 0;
    align-items: flex-start;
    flex-direction: row;
    justify-content: space-between;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    padding-top: 12px;
  }

  .footer-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .featured-stage {
    gap: 10px;
  }

  .faq-grid {
    grid-template-columns: 1fr;
  }

  .soon-top {
    grid-template-columns: 1fr;
  }

  .soon-card {
    width: 100%;
  }

  .soon-grid {
    grid-template-columns: 1fr;
  }

  .audio-simple {
    grid-template-columns: 1fr;
  }

  .audio-simple__right {
    display: none;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 86px 0 62px;
  }

  .hero h1 {
    font-size: 2.35rem;
  }

  .hero__showcase {
    height: auto;
    min-height: unset;
  }

  .book-wrapper {
    position: static;
    transform: none !important;
    width: 100% !important;
    max-width: 260px;
    height: 330px !important;
    margin: 0 auto 16px;
    animation: none !important;
  }

  .featured-nav {
    display: none !important;
  }

  .nav-links a:not(.btn) {
    display: none;
  }

  .navbar--scrolled .navbar__island {
    transform: translateY(-1px) scaleX(0.99);
  }
}

/* ===== Footer: linki prawne + wsparcie ===== */
.footer-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-support {
  white-space: nowrap;
}

@media (max-width: 980px) {
  .footer-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* ===== Modal: regulamin / polityka (scroll w środku) ===== */
.modal--legal .modal-panel--legal {
  width: min(860px, calc(100vw - 28px));
  padding: 18px 18px;
}

.legal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.legal-kicker {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 850;
  letter-spacing: .06em;
}

.legal-title {
  font-size: 1.4rem;
  margin: 6px 0 0;
  letter-spacing: -0.02em;
}

.legal-close {
  background: none;
  border: none;
  font-size: 1.7rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 0 8px;
}

.legal-close:hover {
  color: var(--text-main);
}

.legal-body {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 14px;
  max-height: min(62vh, 520px);
  overflow: auto;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  padding-right: 6px;
}

.legal-body:focus {
  outline: none;
}

.legal-body h4 {
  margin: 6px 0 10px;
  font-size: 1.05rem;
  font-weight: 950;
}

.legal-body h5 {
  margin: 14px 0 8px;
  font-size: 0.98rem;
  font-weight: 950;
  color: var(--text-main);
}

.legal-body p {
  margin: 8px 0;
  color: var(--text-muted);
  font-weight: 750;
  line-height: 1.65;
}

.legal-body ul,
.legal-body ol {
  margin: 8px 0 8px 20px;
  color: var(--text-muted);
  font-weight: 750;
  line-height: 1.65;
}

.legal-body li {
  margin: 6px 0;
}

/* ===== FAQ: płynne otwieranie/zamykanie (kompatybilne) ===== */
.faq-item .faq-a {
  overflow: hidden !important;
  max-height: 0 !important;
  opacity: 0 !important;
  transform: translateY(-2px);
  transition:
    max-height 320ms cubic-bezier(.2, .8, .2, 1),
    opacity 220ms cubic-bezier(.2, .8, .2, 1),
    transform 320ms cubic-bezier(.2, .8, .2, 1);
  will-change: max-height, opacity, transform;
}

/* UWAGA: max-height ustawiamy wysoko, żeby zmieścić treść (możesz zwiększyć jeśli masz długie odpowiedzi) */
.faq-item[open] .faq-a {
  max-height: 1000px !important;
  opacity: 1 !important;
  transform: translateY(0);
}

.faq-item .faq-a__inner {
  padding-top: 10px;
  /* opcjonalnie – możesz dopasować */
}

/* ===== FAQ override: nic nie animuje CSS-em, animuje JS (WAAPI) ===== */
.faq-item .faq-a {
  transition: none !important;
  max-height: none !important;
}

.faq-item .faq-a__inner {
  overflow: hidden;
}

/* =========================================
   V15: Navigation Arrow Improvements
   ========================================= */
.book-viewer-v8 {
  position: relative;
}

/* Nav buttons always centered vertically */
.book-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;

  /* Appearance */
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  color: var(--pub-gray-700);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;

  /* Initial state: hidden */
  opacity: 0;
  pointer-events: none;
}

/* Show on hover of the viewer container */
.book-viewer-v8:hover .book-nav {
  opacity: 1;
  pointer-events: auto;
}

.book-nav:hover {
  background: white;
  color: var(--pub-primary);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.book-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.book-nav--prev {
  left: -22px;
}

.book-nav--next {
  right: -22px;
}

@media (max-width: 768px) {
  .book-nav {
    opacity: 1;
    pointer-events: auto;
    width: 36px;
    height: 36px;
    left: 0;
    right: 0;
  }

  .book-nav--prev {
    left: -10px;
  }

  .book-nav--next {
    right: -10px;
  }
}
