/* Księgarnia — styl minimalistyczny */
:root {
  --papier: #f5f2ec;
  --tusz: #1a1714;
  --szary: #7d766c;
  --linia: #dcd6cb;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--papier);
  color: var(--tusz);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--tusz); outline-offset: 3px; }

/* ---------- nagłówek ---------- */
.gora {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 28px 24px;
  padding-top: max(28px, env(safe-area-inset-top));
}
.gora nav { display: flex; gap: 40px; }
.gora nav a {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .24em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.gora nav a:hover, .gora nav a[aria-current="page"] { border-bottom-color: var(--tusz); }

.mini-logo {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: block;
  width: 120px;
}
.mini-logo img { display: block; width: 100%; height: auto; }
.strona-start .mini-logo { display: none; }

/* ---------- start ---------- */
.srodek {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 160px);
  min-height: calc(100svh - 160px);
  padding: 0 24px 60px;
  text-align: center;
}
.logo { width: min(84vw, 620px); height: auto; }

/* stopka strony głównej: Certyfikat dla małych księgarni */
.strona-start { display: flex; flex-direction: column; }
.strona-start main { flex: 1; display: flex; flex-direction: column; }
.strona-start .srodek { flex: 1; min-height: 0; padding-bottom: 24px; }
.stopka-cmk {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px 28px;
  flex-wrap: wrap;
  padding: 20px 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--linia);
}
.stopka-loga { display: flex; align-items: center; gap: 4px; }
.stopka-cmk img { display: block; height: 64px; width: auto; }
.stopka-cmk p {
  margin: 0;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.5;
  color: var(--tusz);
}
@media (max-width: 600px) {
  .stopka-cmk { flex-direction: column; text-align: center; }
  .stopka-cmk img { height: 56px; }
}

/* ---------- nagłówki sekcji ---------- */
h1 {
  margin: 24px 0 40px;
  text-align: center;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--szary);
}

/* ---------- nowości ---------- */
.nowosci { padding-bottom: 60px; }
.rzad { position: relative; }
.tor {
  display: flex;
  gap: clamp(18px, 2.4vw, 32px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 6vw;
  padding: 10px 6vw 24px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tor::-webkit-scrollbar { display: none; }

.okladka {
  flex: 0 0 auto;
  width: clamp(150px, 17vw, 230px);
  margin: 0;
  scroll-snap-align: start;
}
.powieksz {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.okladka img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: #e8e3da;
  box-shadow: 0 1px 2px rgba(26, 23, 20, .12), 0 10px 24px -12px rgba(26, 23, 20, .35);
  transition: transform .35s ease, box-shadow .35s ease;
}
.powieksz:hover img {
  transform: translateY(-4px);
  box-shadow: 0 2px 4px rgba(26, 23, 20, .12), 0 18px 32px -14px rgba(26, 23, 20, .45);
}
.okladka figcaption {
  margin-top: 12px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--szary);
}

.strzalka {
  position: absolute;
  top: calc(10px + clamp(150px, 17vw, 230px) * 0.75);
  transform: translateY(-50%);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--linia);
  border-radius: 50%;
  background: rgba(245, 242, 236, .92);
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.strzalka:hover { background: var(--tusz); border-color: var(--tusz); color: var(--papier); }
.strzalka[hidden] { display: none; }
.strzalka svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.strzalka.lewo { left: 1.6vw; }
.strzalka.prawo { right: 1.6vw; }

.pusto { text-align: center; color: var(--szary); font-style: italic; }

.podglad {
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-out;
}
.podglad::backdrop { background: rgba(20, 18, 16, .88); }
.podglad img { display: block; max-width: 92vw; max-height: 90vh; height: auto; }

/* ---------- kontakt ---------- */
.kontakt {
  max-width: 420px;
  margin: 0 auto;
  padding: 0 24px 60px;
  text-align: center;
}
.kontakt address { font-style: normal; margin-bottom: 24px; }
.kontakt p { margin: 0 0 32px; }
.godziny { margin: 0; }
.godziny div {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--linia);
}
.godziny div:last-child { border-bottom: 1px solid var(--linia); }
.godziny dt { color: var(--szary); }
.godziny dd { margin: 0; }
.drobne { font-family: var(--sans); font-size: 13px; color: var(--szary); }
.kontakt .firma { margin-top: 40px; font-size: 12px; line-height: 1.7; }

/* ---------- panel /dodajnowosc ---------- */
.strona-panel { font-family: var(--sans); font-size: 16px; }
.panel {
  max-width: 520px;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 20px 48px;
}
.panel.waski { max-width: 360px; padding-top: 12vh; text-align: center; }
.logo-panel { width: 240px; margin: 0 auto 32px; display: block; }

.panel label[for="haslo"] { display: block; text-align: left; font-size: 13px; color: var(--szary); margin-bottom: 6px; }
.panel input[type="password"],
.edycja input[type="text"], .edycja input[type="tel"],
.edycja input[type="email"], .edycja input[type="url"] {
  width: 100%;
  padding: 14px 16px;
  font-size: 17px;
  border: 1px solid var(--linia);
  border-radius: 10px;
  background: #fff;
}
.guzik {
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  border: 0;
  border-radius: 10px;
  background: var(--tusz);
  color: var(--papier);
  font-size: 16px;
  cursor: pointer;
}

.ukryty { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.duzy-guzik {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 190px;
  border-radius: 18px;
  background: var(--tusz);
  color: var(--papier);
  font-size: 21px;
  letter-spacing: .02em;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s;
}
.duzy-guzik:active { transform: scale(.98); }
.duzy-guzik svg { width: 44px; height: 44px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
#wyslij .drobne { text-align: center; margin: 14px 8px 0; }

.komunikat {
  margin: 20px 0 0;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 15px;
  text-align: center;
}
.komunikat.ok { background: #e3eadc; color: #2f4a22; }
.komunikat.blad { background: #f2dfd9; color: #7a2e1c; }

.panel h2 {
  margin: 40px 0 16px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--szary);
}
.lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 12px;
}
.lista img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 4px;
  background: #e8e3da;
}
.lista span { display: block; margin-top: 6px; font-size: 12px; color: var(--szary); }
.usun {
  padding: 2px 0;
  border: 0;
  background: none;
  font-size: 12px;
  color: #a2412a;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.stopka-panelu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--linia);
  font-size: 14px;
}
.stopka-panelu form { margin: 0; }
.link { padding: 0; border: 0; background: none; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 14px; }

.wysylanie {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(245, 242, 236, .94);
  font-size: 20px;
}
.wysylanie[hidden] { display: none; }

/* ---------- panel /edycja ---------- */
.naglowek-panelu { margin: 8px 0 24px !important; }
.edycja fieldset { margin: 0 0 28px; padding: 0; border: 0; }
.edycja legend { margin-bottom: 10px; font-size: 12px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--szary); }
.edycja label { display: block; margin-bottom: 10px; font-size: 13px; color: var(--szary); }
.edycja label input { margin-top: 4px; }
.edycja fieldset > input { margin-bottom: 8px; }
.edycja input { display: block; padding: 12px 14px !important; font-size: 16px !important; color: var(--tusz); }
.edycja .drobne { margin: 0 0 10px; }
.wiersze-godzin { display: grid; gap: 8px; }
.wiersz { display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; }
.edycja .guzik { margin-top: 4px; font-size: 17px; padding: 16px; }
.komunikat a { color: inherit; }
.edycja .komunikat { margin: 0 0 24px; }

/* ---------- telefon ---------- */
@media (max-width: 600px) {
  .gora { justify-content: flex-end; padding: 22px 20px; }
  .strona-start .gora { justify-content: center; }
  .gora nav { gap: 28px; }
  .mini-logo { left: 20px; width: 92px; }
  .okladka { width: 42vw; }
  .strzalka { top: calc(10px + 42vw * 0.75); width: 40px; height: 40px; }
  h1 { margin: 12px 0 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
