/* ============================================================
   PEKÁREŇ BZINCE — prémiový digitálny katalóg
   style.css — dizajnový systém, 3D flip kniha, animácie
   ============================================================ */

/* ------------------------------------------------------------
   1. CSS PREMENNÉ — svetlý a tmavý režim
------------------------------------------------------------ */
:root {
  /* farebná paleta: biela, krémová, béžová, hnedá, zlatá */
  --cream:        #faf6ee;
  --cream-2:      #f3ecdd;
  --beige:        #e9dcc5;
  --beige-2:      #ddcbac;
  --brown:        #5d4426;
  --brown-2:      #7a5c35;
  --brown-soft:   #9a7b52;
  --gold:         #b98a3e;
  --gold-light:   #d9b878;
  --gold-faint:   rgba(185, 138, 62, .16);
  --ink:          #3d2f1c;
  --ink-soft:     #6d5b41;

  /* plochy */
  --bg:           var(--cream);
  --page:         #fffdf8;
  --page-back:    #f7f0e2;
  --card:         rgba(255, 253, 248, .72);
  --glass:        rgba(255, 251, 242, .58);
  --glass-border: rgba(185, 138, 62, .25);

  /* tiene */
  --shadow-soft:  0 6px 24px rgba(93, 68, 38, .10);
  --shadow-med:   0 14px 44px rgba(93, 68, 38, .16);
  --shadow-book:  0 30px 80px rgba(70, 50, 25, .28);

  /* typografia */
  --serif: "Cormorant Garamond", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:  "Jost", "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  /* geometria a pohyb */
  --radius: 22px;
  --radius-s: 14px;
  --flip-ms: 850ms;                                /* trvanie otočenia strany */
  --ease-page: cubic-bezier(.45, .02, .18, 1);      /* plynulé zrýchlenie/spomalenie */
  --ease-pop: cubic-bezier(.2, 1.2, .3, 1);
}

[data-theme="dark"] {
  --cream:        #191410;
  --cream-2:      #201a14;
  --beige:        #2b2218;
  --beige-2:      #372c1e;
  --brown:        #e6d7bd;
  --brown-2:      #d3bf9c;
  --brown-soft:   #b49a72;
  --gold:         #d3a75c;
  --gold-light:   #e7c98c;
  --gold-faint:   rgba(211, 167, 92, .14);
  --ink:          #efe5d2;
  --ink-soft:     #c0ad8d;

  --bg:           #14100c;
  --page:         #241d15;
  --page-back:    #1d1710;
  --card:         rgba(36, 29, 21, .78);
  --glass:        rgba(26, 21, 15, .62);
  --glass-border: rgba(211, 167, 92, .28);

  --shadow-soft:  0 6px 24px rgba(0, 0, 0, .35);
  --shadow-med:   0 14px 44px rgba(0, 0, 0, .45);
  --shadow-book:  0 30px 80px rgba(0, 0, 0, .6);
}

/* ------------------------------------------------------------
   2. ZÁKLAD
------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--sans);
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;                 /* katalóg je "javisko", nie scrollovacia stránka */
  -webkit-font-smoothing: antialiased;
  transition: background .6s ease, color .6s ease;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

img { max-width: 100%; display: block; }

/* ------------------------------------------------------------
   3. LOADING SCREEN
------------------------------------------------------------ */
.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 90% at 50% 0%, var(--cream-2), transparent),
    var(--cream);
  transition: opacity .8s ease, visibility .8s ease;
}

.loader.is-done { opacity: 0; visibility: hidden; }

.loader__inner { text-align: center; animation: loaderIn .9s var(--ease-pop) both; }

.loader__logo {
  width: 108px;
  height: 108px;
  color: var(--gold);
  filter: drop-shadow(0 10px 24px rgba(185, 138, 62, .35));
}

.loader__ring {
  stroke-dasharray: 340;
  stroke-dashoffset: 340;
  animation: ringDraw 1.8s var(--ease-page) forwards;
}

.loader__wheat {
  color: var(--brown);
  transform-origin: 60px 60px;
  animation: wheatGrow 1.2s .4s var(--ease-pop) both;
}

.loader__name {
  margin: 18px 0 22px;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brown);
}

.loader__bar {
  width: 190px;
  height: 2px;
  margin: 0 auto;
  border-radius: 2px;
  background: var(--beige);
  overflow: hidden;
}

.loader__bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transition: width .35s ease;
}

@keyframes loaderIn   { from { opacity: 0; transform: translateY(24px) scale(.94); } }
@keyframes ringDraw   { to   { stroke-dashoffset: 0; } }
@keyframes wheatGrow  { from { opacity: 0; transform: scale(.5); } }

/* ------------------------------------------------------------
   4. HORNÁ LIŠTA — glassmorphism
------------------------------------------------------------ */
.topbar {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, calc(100% - 28px));
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: var(--shadow-soft);
  animation: barDrop .9s .2s var(--ease-pop) both;
}

@keyframes barDrop { from { opacity: 0; transform: translate(-50%, -26px); } }

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

.topbar__logo { width: 34px; height: 34px; color: var(--gold); flex: none; }

.topbar__name {
  font-family: var(--serif);
  font-size: 1.16rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--brown);
}
.topbar__name em { font-style: normal; color: var(--gold); }

.topbar__tools { display: flex; align-items: center; gap: 6px; }

.tool {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--brown-2);
  transition: background .3s ease, color .3s ease, transform .3s var(--ease-pop);
}

.tool svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool:hover { background: var(--gold-faint); color: var(--gold); transform: translateY(-2px); }
.tool:active { transform: scale(.9); }

/* prepínacie ikony (zvuk / autoplay / téma / fullscreen) */
.tool .ico-off { display: none; }
.tool.is-off .ico-on { display: none; }
.tool.is-off .ico-off { display: block; }

.tool--pdf {
  width: auto;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .1em;
}

/* ------------------------------------------------------------
   5. INDIKÁTOR PRIEBEHU
------------------------------------------------------------ */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 70;
  background: transparent;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  box-shadow: 0 0 12px rgba(185, 138, 62, .55);
  transition: width .9s var(--ease-page);
}

/* ------------------------------------------------------------
   6. JAVISKO A ANIMOVANÉ POZADIE
------------------------------------------------------------ */
.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vh, 26px);
  min-height: 100dvh;
  padding: clamp(74px, 11vh, 110px) 16px calc(14px + env(safe-area-inset-bottom, 0px));
}

.stage__bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }

/* plávajúce farebné škvrny — jemný pohyb pozadia */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .55;
  animation: blobFloat 16s ease-in-out infinite alternate;
}

.blob--1 { width: 46vw; height: 46vw; left: -12vw; top: -14vw; background: radial-gradient(circle, var(--beige), transparent 70%); }
.blob--2 { width: 38vw; height: 38vw; right: -10vw; top: 22vh; background: radial-gradient(circle, var(--gold-faint), transparent 70%); animation-delay: -6s; animation-duration: 20s; }
.blob--3 { width: 42vw; height: 42vw; left: 26vw; bottom: -20vw; background: radial-gradient(circle, var(--cream-2), transparent 70%); animation-delay: -11s; animation-duration: 24s; }

@keyframes blobFloat {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(4vw, -3vh, 0) scale(1.12); }
}

/* jemné papierové zrno */
.grain {
  position: absolute;
  inset: 0;
  opacity: .5;
  background-image: radial-gradient(rgba(93, 68, 38, .05) 1px, transparent 1.4px);
  background-size: 26px 26px;
}

/* ------------------------------------------------------------
   7. KNIHA — 3D scéna
------------------------------------------------------------ */
.book-wrap {
  position: relative;
  perspective: 2600px;            /* realistická perspektíva */
  perspective-origin: 50% 42%;
  animation: bookRise 1.1s .35s var(--ease-pop) both;
}

@keyframes bookRise { from { opacity: 0; transform: translateY(46px) rotateX(10deg); } }

.book {
  position: relative;
  width: calc(var(--page-w, 460px) * 2);
  height: var(--page-h, 620px);
  transform-style: preserve-3d;
  transition: transform .9s var(--ease-page);
}

/* zatvorená kniha (začiatok / koniec) je vycentrovaná na viditeľnú stranu */
.book:not(.is-single).at-start { transform: translateX(calc(var(--page-w, 460px) / -2)); }
.book:not(.is-single).at-end   { transform: translateX(calc(var(--page-w, 460px) /  2)); }

.book-wrap.at-start .corner--right { right: calc(var(--page-w, 460px) / 2); }
.book-wrap.at-end   .corner--left  { left:  calc(var(--page-w, 460px) / 2); }

/* v režime jednej strany je kniha široká ako jedna strana */
.book.is-single { width: var(--page-w, 460px); }

/* tieň knihy na "stole" */
.book::after {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: -26px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(60, 42, 20, .32), transparent 68%);
  filter: blur(10px);
  transform: translateZ(-80px);
  z-index: -1;
}

/* chrbát knihy */
.book__spine {
  position: absolute;
  left: 50%;
  top: 1%;
  bottom: 1%;
  width: 26px;
  transform: translateX(-50%) translateZ(-6px);
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(93,68,38,.22), rgba(93,68,38,.5), rgba(93,68,38,.22));
  filter: blur(1px);
}
.book.is-single .book__spine { display: none; }

/* ---------- LIST (leaf) = jeden fyzický papier s dvomi stranami ---------- */
.leaf {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  transform-style: preserve-3d;
  transform-origin: left center;                       /* otáčanie okolo chrbta */
  transition: transform var(--flip-ms) var(--ease-page);
  will-change: transform;
}

.book.is-single .leaf { width: 100%; transform-origin: left center; }

.leaf.is-flipped { transform: rotateY(-180deg); }

/* počas otáčania je list navrchu */
.leaf.is-turning { z-index: 99 !important; }

/* ---------- STRANA (predná / zadná plocha listu) ---------- */
.face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--page);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0.1px);      /* stabilita renderovania */
  box-shadow: inset 0 0 0 1px rgba(185, 138, 62, .12);
}

.face--front { border-radius: 0 var(--radius) var(--radius) 0; }
.face--back  {
  transform: rotateY(180deg) translateZ(0.1px);
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--page-back);
}

.book.is-single .face--front { border-radius: var(--radius-s) var(--radius) var(--radius) var(--radius-s); }

/* ohyb papiera — jemný valcový gradient pri chrbte */
.face--front::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: linear-gradient(90deg,
    rgba(80, 55, 25, .12) 0%,
    rgba(80, 55, 25, .045) 4%,
    rgba(255, 255, 255, .06) 9%,
    transparent 16%);
}

.face--back::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: linear-gradient(-90deg,
    rgba(80, 55, 25, .12) 0%,
    rgba(80, 55, 25, .045) 4%,
    rgba(255, 255, 255, .06) 9%,
    transparent 16%);
}

/* jemný tieň pri ohybe papiera počas otáčania (bez svetelného odlesku) */
.face::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  opacity: 0;
  background: linear-gradient(100deg,
    transparent 45%,
    rgba(60, 42, 20, .16) 68%,
    transparent 92%);
  transition: opacity calc(var(--flip-ms) / 2) ease;
}

.leaf.is-turning .face::after { opacity: 1; }

/* tieň, ktorý turning list vrhá na stranu pod ním */
.book__cast {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  z-index: 90;
  pointer-events: none;
  opacity: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: linear-gradient(90deg, rgba(60, 40, 18, .38), transparent 62%);
  transition: opacity calc(var(--flip-ms) * .5) ease;
}

.book__cast.is-left {
  right: auto;
  left: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  background: linear-gradient(-90deg, rgba(60, 40, 18, .38), transparent 62%);
}

.book__cast.is-on { opacity: 1; }

.book.is-single .book__cast { width: 100%; }

/* ------------------------------------------------------------
   8. OBSAH STRÁN
------------------------------------------------------------ */
.page { height: 100%; }

.page-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: clamp(18px, 4.4cqw, 34px);
  container-type: size;
  /* orezáva až vonkajšia .face — vďaka tomu môže JS obsah zmenšiť tak,
     aby sa celý zmestil (namiesto scrollovania, ktoré na mobile v 3D nefunguje) */
  overflow: visible;
  transform-origin: top center;
  transition: transform .4s var(--ease-page);
}

.face { container-type: inline-size; }

/* hlavička strany */
.page-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: clamp(8px, 2cqh, 16px);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold);
}

.page-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--gold-light), transparent); }

/* pätička strany s číslom */
.page-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  font-size: .64rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--brown-soft);
}

.page-foot b { font-weight: 500; color: var(--gold); }

/* --- reveal animácie obsahu pri otočení strany --- */
.rv { opacity: 0; transform: translateY(26px); }

.page.is-live .rv {
  animation: rvUp .8s var(--ease-pop) forwards;
  animation-delay: calc(var(--d, 0) * 90ms + 120ms);
}

.page.is-live .rv--zoom { transform: scale(.82); animation-name: rvZoom; }
.page.is-live .rv--left { transform: translateX(-30px); animation-name: rvSide; }
.page.is-live .rv--right { transform: translateX(30px); animation-name: rvSide; }

@keyframes rvUp   { to { opacity: 1; transform: translateY(0); } }
@keyframes rvZoom { to { opacity: 1; transform: scale(1); } }
@keyframes rvSide { to { opacity: 1; transform: translateX(0); } }

/* ------------------------------------------------------------
   9. TITULNÁ STRANA (cover)
------------------------------------------------------------ */
.page--cover {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 26px;
  overflow: hidden;
  background:
    radial-gradient(90% 60% at 50% 0%, var(--gold-faint), transparent 60%),
    linear-gradient(160deg, var(--page) 0%, var(--cream-2) 60%, var(--beige) 130%);
}

.page--cover::before,
.page--cover::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid var(--gold-light);
  border-radius: calc(var(--radius) - 8px);
  opacity: .55;
  pointer-events: none;
}
.page--cover::after { inset: 18px; opacity: .3; }

.cover__logo {
  width: clamp(64px, 18cqw, 96px);
  height: auto;
  color: var(--gold);
  filter: drop-shadow(0 12px 26px rgba(185, 138, 62, .4));
  animation: floaty 5.5s ease-in-out infinite;
}

.cover__eyebrow {
  margin: 16px 0 4px;
  font-size: .66rem;
  font-weight: 500;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--brown-soft);
}

.cover__title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 11cqw, 3.4rem);
  font-weight: 700;
  line-height: 1.02;
  color: var(--brown);
}

.cover__title em { font-style: italic; color: var(--gold); }

.cover__rule {
  width: 74px;
  height: 1px;
  margin: 18px auto;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  position: relative;
}
.cover__rule::after {
  content: "✦";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: .6rem;
  color: var(--gold);
  background: transparent;
}

.cover__claim {
  max-width: 34ch;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: clamp(.95rem, 4.4cqw, 1.18rem);
  font-style: italic;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* hero fotografia na obálke */
.cover__hero {
  position: relative;
  flex: 0 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  width: clamp(150px, 52cqw, 250px);
  margin: clamp(10px, 3cqh, 26px) auto;
}

.cover__hero::before {
  content: "";
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 249, 235, .95), var(--gold-faint) 55%, transparent 72%);
}

[data-theme="dark"] .cover__hero::before {
  background: radial-gradient(circle, rgba(211, 167, 92, .22), transparent 70%);
}

.cover__hero img {
  position: relative;
  width: auto;
  max-width: 100%;
  max-height: clamp(150px, 30cqh, 240px);
  animation: floaty 6s .8s ease-in-out infinite;
  filter: drop-shadow(0 22px 30px rgba(70, 48, 22, .38));
}

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-.6deg); }
  50%      { transform: translateY(-10px) rotate(.8deg); }
}

/* hlavné CTA tlačidlo */
.btn-gold {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 30px;
  border-radius: 999px;
  overflow: hidden;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #fffaf0;
  background: linear-gradient(135deg, var(--gold), #a1712c 55%, var(--gold));
  background-size: 200% 200%;
  box-shadow: 0 12px 28px rgba(185, 138, 62, .45);
  transition: transform .4s var(--ease-pop), box-shadow .4s ease, background-position .6s ease;
}

.btn-gold:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 18px 38px rgba(185, 138, 62, .55);
  background-position: 100% 100%;
}

.btn-gold:active { transform: translateY(0) scale(.97); }

/* lesk prechádzajúci cez tlačidlo */
.btn-gold::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 45%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .5), transparent);
  transform: skewX(-24deg);
  animation: shine 3.6s ease-in-out infinite;
}

@keyframes shine { 0%, 55% { left: -80%; } 90%, 100% { left: 140%; } }

/* ------------------------------------------------------------
   10. ÚVODNÁ STRANA + OBSAH (TOC)
------------------------------------------------------------ */
.intro__title, .toc__title, .divider__title {
  margin: 4px 0 10px;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 8cqw, 2.2rem);
  font-weight: 700;
  line-height: 1.06;
  color: var(--brown);
}

.intro__text {
  margin: 0 0 14px;
  font-size: clamp(.82rem, 3.6cqw, .95rem);
  line-height: 1.75;
  color: var(--ink-soft);
}

.intro__values { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }

.value-card {
  padding: 12px 14px;
  border-radius: var(--radius-s);
  background: var(--card);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft);
  transition: transform .35s var(--ease-pop), box-shadow .35s ease;
}

.value-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-med); }

.value-card b {
  display: block;
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--brown);
}

.value-card span { font-size: .72rem; line-height: 1.5; color: var(--ink-soft); }

/* obsah — zoznam kategórií */
.toc__list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }

.toc__item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-s);
  text-align: left;
  background: var(--card);
  border: 1px solid transparent;
  transition: border-color .3s ease, transform .35s var(--ease-pop), background .3s ease;
}

.toc__item:hover { border-color: var(--gold-light); transform: translateX(6px); background: var(--gold-faint); }

.toc__item .n {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
  min-width: 1.4em;
}

.toc__item .t { font-size: .92rem; font-weight: 500; color: var(--brown); }
.toc__item .dots { flex: 1; border-bottom: 1px dotted var(--beige-2); transform: translateY(-4px); }
.toc__item .p { font-size: .78rem; letter-spacing: .1em; color: var(--brown-soft); }

/* ------------------------------------------------------------
   11. ODDEĽOVACIE STRANY KATEGÓRIÍ
------------------------------------------------------------ */
.page--divider {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 26px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(70% 50% at 50% 100%, var(--gold-faint), transparent 70%),
    linear-gradient(200deg, var(--page), var(--cream-2));
}

.divider__no {
  font-family: var(--serif);
  font-size: clamp(3.4rem, 26cqw, 6rem);
  font-weight: 700;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--gold-light);
  opacity: .8;
}

.divider__title { font-size: clamp(1.7rem, 10cqw, 2.6rem); margin: 6px 0; }

.divider__sub {
  max-width: 30ch;
  margin: 6px auto 18px;
  font-family: var(--serif);
  font-style: italic;
  font-size: .98rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.divider__img { width: clamp(120px, 44cqw, 210px); margin: 0 auto; }
.divider__img img { animation: floaty 6.5s ease-in-out infinite; filter: drop-shadow(0 18px 26px rgba(70,48,22,.35)); }

/* ------------------------------------------------------------
   12. PRODUKTOVÉ KARTY A LAYOUTY STRÁN
------------------------------------------------------------ */
.product {
  position: relative;
  border-radius: var(--radius-s);
  cursor: pointer;
  transition: transform .4s var(--ease-pop);
}

.product:hover { transform: translateY(-5px); }
.product:active { transform: scale(.97); }

.product__media {
  position: relative;
  display: grid;
  place-items: center;
}

/* svetelný kruh pod produktom */
.product__media::before {
  content: "";
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--cream-2) 0%, var(--gold-faint) 52%, transparent 74%);
  transition: transform .5s var(--ease-pop);
}

[data-theme="dark"] .product__media::before {
  background: radial-gradient(circle, rgba(211,167,92,.16) 0%, transparent 70%);
}

.product:hover .product__media::before { transform: scale(1.1); }

/* absolútne pozicovanie — obrázok sa vždy zmestí do svojho boxu,
   nech má fotografia akýkoľvek pomer strán */
.product__media img {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 14px 18px rgba(70, 48, 22, .32));
  transition: transform .55s var(--ease-pop);
}

.product:hover .product__media img { transform: scale(1.06) rotate(1.2deg); }

.product__name {
  margin: 8px 0 2px;
  font-family: var(--serif);
  font-size: 1.06rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--brown);
}

.product__desc {
  margin: 0;
  font-size: .72rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.product__row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  flex-wrap: wrap;
}

.weight {
  font-size: .68rem;
  letter-spacing: .06em;
  color: var(--brown-soft);
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--beige-2);
  white-space: nowrap;
}

/* ikonové odznaky 🥖 ⭐ 🌾 ❤️ */
.badges { display: flex; gap: 5px; flex-wrap: wrap; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--brown-2);
  background: var(--gold-faint);
  border: 1px solid var(--glass-border);
  transition: transform .3s var(--ease-pop);
}

.badge:hover { transform: scale(1.08); }

/* ===== LAYOUT: FEATURE — 1 produkt na celú stranu ===== */
.layout-feature { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.layout-feature .product { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.layout-feature .product__media { flex: 1; min-height: 0; margin: 4px 0 10px; }
.layout-feature .product__media img { max-height: 100%; }

.layout-feature .product__name { font-size: clamp(1.4rem, 7.6cqw, 2rem); }
.layout-feature .product__desc { font-size: .82rem; max-width: 42ch; }

/* variant B — text hore, obrázok dole */
.layout-feature.alt .product { flex-direction: column-reverse; }
.layout-feature.alt .product__media { margin: 10px 0 4px; }

/* ===== LAYOUT: DUO — 2 produkty diagonálne ===== */
.layout-duo { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; }

.layout-duo .product {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 42% 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: var(--radius-s);
  background: var(--card);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
}

.layout-duo .product:nth-child(2) { grid-template-columns: 1fr 42%; }
.layout-duo .product:nth-child(2) .product__media { order: 2; }

.layout-duo .product__media { height: 100%; min-height: 0; }
.layout-duo .product__media img { max-height: 24cqh; }

/* ===== LAYOUT: TRIO — 1 veľký + 2 menšie ===== */
.layout-trio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.layout-trio .product {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  background: var(--card);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
}

.layout-trio .product:first-child {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 14px;
}

.layout-trio .product:first-child .product__media { width: 38%; height: 100%; flex: none; }
.layout-trio .product:first-child .product__body { flex: 1; }

.layout-trio .product__media { flex: 1; min-height: 0; }
.layout-trio .product__media img { max-height: 100%; }

.layout-trio .product:not(:first-child) .product__name { font-size: .9rem; }
.layout-trio .product:not(:first-child) .product__desc { display: none; }
.layout-trio .product:not(:first-child) .badges { display: none; }
.layout-trio .product:not(:first-child) .weight { font-size: .6rem; padding: 2px 7px; }

/* zrkadlový variant tria */
.layout-trio.alt .product:first-child { flex-direction: row-reverse; }

/* ===== STRANA TORTY NA OBJEDNÁVKU ===== */
.page--torty {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 28px;
  background:
    radial-gradient(80% 55% at 50% 8%, var(--gold-faint), transparent 65%),
    var(--page);
}

.torty__art { font-size: clamp(2.6rem, 15cqw, 4rem); animation: floaty 5s ease-in-out infinite; }

.torty__note {
  margin: 14px auto 0;
  max-width: 34ch;
  font-size: .85rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.torty__contact {
  display: inline-block;
  margin-top: 18px;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
  transition: background .3s ease, color .3s ease, transform .35s var(--ease-pop);
}

.torty__contact:hover { background: var(--gold); color: #fffaf0; transform: translateY(-3px); }

/* ===== ZADNÁ STRANA / KONTAKT ===== */
.page--contact { text-align: center; }

.contact__grid { display: grid; gap: 10px; margin-top: 14px; }

.contact__item {
  padding: 12px;
  border-radius: var(--radius-s);
  background: var(--card);
  border: 1px solid var(--glass-border);
}

.contact__item b { display: block; font-size: .68rem; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.contact__item span { font-size: .88rem; color: var(--ink); }

/* ------------------------------------------------------------
   13. NAVIGÁCIA KNIHY
------------------------------------------------------------ */
.booknav {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: navUp .9s .55s var(--ease-pop) both;
}

@keyframes navUp { from { opacity: 0; transform: translateY(26px); } }

.booknav__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--brown-2);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
  transition: transform .35s var(--ease-pop), box-shadow .35s ease, color .3s ease, border-color .3s ease;
}

.booknav__btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.booknav__btn:hover:not(:disabled) { transform: translateY(-3px); color: var(--gold); border-color: var(--gold-light); box-shadow: var(--shadow-med); }

.booknav__btn:disabled { opacity: .35; cursor: default; }

.booknav__indicator {
  min-width: 76px;
  text-align: center;
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--brown);
}

/* klikacie rohy strán */
.corner {
  position: absolute;
  bottom: 0;
  width: 64px;
  height: 64px;
  z-index: 50;
  opacity: 0;
  transition: opacity .3s ease;
}

.corner--right { right: 0; cursor: pointer; border-radius: 100% 0 var(--radius) 0; }
.corner--left  { left: 0;  cursor: pointer; border-radius: 0 100% 0 var(--radius); }

.corner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(315deg, var(--beige-2) 0%, var(--page) 46%, transparent 50%);
  border-radius: inherit;
  box-shadow: -6px -6px 14px rgba(70, 48, 22, .18);
}

.corner--left::before {
  background: linear-gradient(45deg, var(--beige-2) 0%, var(--page) 46%, transparent 50%);
  box-shadow: 6px -6px 14px rgba(70, 48, 22, .18);
}

.corner:hover { opacity: 1; }
.corner.is-hidden { display: none; }

/* ------------------------------------------------------------
   14. VYHĽADÁVANIE — glass overlay
------------------------------------------------------------ */
.search {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: start center;
  padding: clamp(16px, 6vh, 60px) 16px 24px;
  visibility: hidden;
  opacity: 0;
  background: rgba(46, 33, 17, .35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity .45s ease, visibility .45s ease;
}

.search.is-open { visibility: visible; opacity: 1; }

.search__panel {
  width: min(860px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(26px) saturate(1.35);
  -webkit-backdrop-filter: blur(26px) saturate(1.35);
  box-shadow: var(--shadow-book);
  transform: translateY(26px) scale(.97);
  transition: transform .5s var(--ease-pop);
}

.search.is-open .search__panel { transform: translateY(0) scale(1); }

.search__head { display: flex; gap: 10px; }

.search__field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--glass-border);
  transition: border-color .3s ease, box-shadow .3s ease;
}

.search__field:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-faint); }

.search__field svg { width: 18px; height: 18px; fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; }

.search__field input {
  flex: 1;
  padding: 13px 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: .95rem;
  color: var(--ink);
  outline: none;
}

.search__field input::placeholder { color: var(--brown-soft); }

.search__close {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--brown-2);
  background: var(--card);
  border: 1px solid var(--glass-border);
  transition: transform .35s var(--ease-pop), color .3s ease;
}

.search__close svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.search__close:hover { transform: rotate(90deg); color: var(--gold); }

.search__cats { display: flex; gap: 7px; flex-wrap: wrap; margin: 14px 0 4px; }

.chip {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--brown-2);
  background: var(--card);
  border: 1px solid var(--glass-border);
  transition: all .3s var(--ease-pop);
}

.chip:hover { transform: translateY(-2px); border-color: var(--gold-light); }

.chip.is-active {
  color: #fffaf0;
  background: linear-gradient(135deg, var(--gold), #a1712c);
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(185, 138, 62, .4);
}

.search__count { margin: 10px 4px 8px; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--brown-soft); }

.search__results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  overflow-y: auto;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-light) transparent;
}

.result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-s);
  text-align: left;
  background: var(--card);
  border: 1px solid var(--glass-border);
  opacity: 0;
  transform: translateY(18px);
  transition: transform .35s var(--ease-pop), border-color .3s ease, box-shadow .3s ease;
}

/* reveal cez IntersectionObserver */
.result.is-in { opacity: 1; transform: translateY(0); transition: opacity .5s ease, transform .55s var(--ease-pop), border-color .3s ease, box-shadow .3s ease; }

.result:hover { border-color: var(--gold-light); box-shadow: var(--shadow-soft); transform: translateY(-3px); }

.result img { width: 52px; height: 52px; object-fit: contain; flex: none; filter: drop-shadow(0 6px 8px rgba(70,48,22,.28)); }

.result b { display: block; font-family: var(--serif); font-size: .95rem; color: var(--brown); line-height: 1.15; }
.result span { font-size: .7rem; color: var(--gold); font-weight: 600; }

.search__empty {
  grid-column: 1 / -1;
  padding: 34px 10px;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--brown-soft);
}

/* ------------------------------------------------------------
   15. PRODUKTOVÝ MODAL
------------------------------------------------------------ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 18px;
  visibility: hidden;
  pointer-events: none;
}

.modal.is-open { visibility: visible; pointer-events: auto; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: rgba(40, 28, 13, .5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: opacity .5s ease;
}

.modal.is-open .modal__backdrop { opacity: 1; }

.modal__card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(880px, 100%);
  max-height: min(600px, calc(100dvh - 36px));
  border-radius: calc(var(--radius) + 6px);
  overflow: hidden;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(30px) saturate(1.4);
  -webkit-backdrop-filter: blur(30px) saturate(1.4);
  box-shadow: var(--shadow-book);
  opacity: 0;
  transform: translateY(46px) scale(.92);
  transition: transform .6s var(--ease-pop), opacity .45s ease;
}

.modal.is-open .modal__card { opacity: 1; transform: translateY(0) scale(1); }

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--brown-2);
  background: var(--card);
  border: 1px solid var(--glass-border);
  transition: transform .35s var(--ease-pop), color .3s ease;
}

.modal__close svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.modal__close:hover { transform: rotate(90deg) scale(1.06); color: var(--gold); }

.modal__media {
  position: relative;
  display: grid;
  place-items: center;
  padding: 34px;
  min-height: 300px;
  background:
    radial-gradient(75% 60% at 50% 55%, var(--gold-faint), transparent 75%),
    linear-gradient(150deg, var(--cream-2), var(--beige));
}

[data-theme="dark"] .modal__media { background: radial-gradient(75% 60% at 50% 55%, rgba(211,167,92,.14), transparent 75%), linear-gradient(150deg, #2a2118, #1d1710); }

.modal__halo {
  position: absolute;
  width: 66%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px dashed var(--gold-light);
  opacity: .6;
  animation: spinSlow 26s linear infinite;
}

@keyframes spinSlow { to { transform: rotate(360deg); } }

.modal__media img {
  position: relative;
  max-height: 340px;
  filter: drop-shadow(0 26px 34px rgba(60, 40, 18, .42));
  animation: floaty 5.5s ease-in-out infinite;
}

.modal__body { padding: 34px 30px; overflow-y: auto; }

.modal__cat {
  margin: 0 0 6px;
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--gold);
}

.modal__title {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4.5vw, 2.3rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--brown);
}

.modal__desc { margin: 0 0 16px; font-size: .92rem; line-height: 1.75; color: var(--ink-soft); }

.modal__badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.modal__badges .badge { font-size: .7rem; padding: 5px 12px; }

.modal__meta { display: flex; gap: 10px; }

.meta-box {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-s);
  background: var(--card);
  border: 1px solid var(--glass-border);
}

.meta-box__label { display: block; font-size: .62rem; letter-spacing: .26em; text-transform: uppercase; color: var(--brown-soft); margin-bottom: 3px; }
.meta-box__value { font-family: var(--serif); font-size: 1.4rem; font-weight: 700; color: var(--gold); }

/* obsah modalu sa objavuje postupne */
.modal.is-open .modal__cat    { animation: rvUp .6s .15s var(--ease-pop) both; }
.modal.is-open .modal__title  { animation: rvUp .6s .22s var(--ease-pop) both; }
.modal.is-open .modal__desc   { animation: rvUp .6s .3s var(--ease-pop) both; }
.modal.is-open .modal__badges { animation: rvUp .6s .38s var(--ease-pop) both; }
.modal.is-open .modal__meta   { animation: rvUp .6s .46s var(--ease-pop) both; }

.modal__cat, .modal__title, .modal__desc, .modal__badges, .modal__meta { opacity: 0; transform: translateY(18px); }

/* ------------------------------------------------------------
   16. RESPONZIVITA
------------------------------------------------------------ */
@media (max-width: 1023px) {
  .topbar { padding: 8px 12px; }
  .topbar__name { font-size: 1rem; }
}

@media (max-width: 767px) {
  .topbar { top: 8px; gap: 8px; }
  .topbar__name { display: none; }
  .tool { width: 36px; height: 36px; }
  .tool--pdf span { display: none; }
  .tool--pdf { width: 36px; padding: 0; border: 0; }

  .stage { padding-top: 66px; }

  .booknav__btn span { display: none; }
  .booknav__btn { padding: 12px; }

  .modal__card { grid-template-columns: 1fr; max-height: calc(100dvh - 24px); }
  .modal__media { min-height: 220px; padding: 22px; }
  .modal__media img { max-height: 200px; }
  .modal__body { padding: 22px 20px 28px; }

  .search__results { grid-template-columns: 1fr 1fr; }
  .result { flex-direction: column; text-align: center; }

  .corner { width: 48px; height: 48px; }
}

@media (max-width: 420px) {
  .search__results { grid-template-columns: 1fr; }
  .result { flex-direction: row; text-align: left; }
}

/* ------------------------------------------------------------
   16b. DOPLNKY — skryté listy a toast notifikácia
------------------------------------------------------------ */

/* otočený list v režime jednej strany leží mimo knihy — skryjeme ho */
.leaf.is-gone { visibility: hidden; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 160;
  transform: translate(-50%, 20px);
  padding: 13px 24px;
  border-radius: 999px;
  font-size: .86rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--brown);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  box-shadow: var(--shadow-med);
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s ease, transform .5s var(--ease-pop);
}

.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------
   17. PRÍSTUPNOSŤ A TLAČ
------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* focus stavy */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }


/* ===== Logo pekárne (svetlý / tmavý režim) ===== */
.topbar__logo-img { height: 42px; width: auto; display: block; }
.topbar__logo-img--dark { display: none; }
[data-theme="dark"] .topbar__logo-img--light { display: none; }
[data-theme="dark"] .topbar__logo-img--dark { display: block; }

.loader__logo-img { height: 110px; width: auto; display: block; margin: 0 auto 14px; animation: loaderLogoPulse 1.8s ease-in-out infinite; }
.loader__logo-img--dark { display: none; }
[data-theme="dark"] .loader__logo-img--light { display: none; }
[data-theme="dark"] .loader__logo-img--dark { display: block; }
@keyframes loaderLogoPulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.05); opacity: .85; } }


/* ===== Logo na obálke katalógu ===== */
.cover__logo-img { width: 140px; max-width: 45%; height: auto; display: block; margin: 0 auto 14px; }
.cover__logo-img--sm { width: 95px; }
.cover__logo-img--dark { display: none; }
[data-theme="dark"] .cover__logo-img--light { display: none; }
[data-theme="dark"] .cover__logo-img--dark { display: block; }
