/* ==========================================================================
   Oto Ciastko v2 – podstrony: kategorie, produkty, strony prawne, 404
   (korzysta z tokenów i komponentów z base.css oraz home.css)
   ========================================================================== */

/* ---------- Ścieżka (okruszki) ---------- */
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
  margin: 0 0 1.5rem; padding: 0; list-style: none;
  font-size: var(--fs-small);
  color: var(--c-ink-soft);
}
.crumbs li { display: inline-flex; align-items: center; gap: 0.4rem; }
.crumbs li + li::before { content: "/"; opacity: 0.5; }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--c-brand); text-decoration: underline; text-underline-offset: 3px; }
.crumbs [aria-current] { color: var(--c-ink); }

/* ---------- Nagłówek podstrony ---------- */
.page-hero {
  padding-top: calc(var(--header-h) + clamp(1.5rem, 5vw, 3.5rem));
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}
.page-hero__title { font-size: var(--fs-h2); color: var(--c-brand-deep); }
.page-hero__title::first-letter { text-transform: uppercase; }
.page-hero .lead { margin-top: 1.25rem; }

/* ---------- Kategoria: hero z opisem i animacją ---------- */
.cat-hero__grid { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.cat-hero__title { font-size: var(--fs-hero); color: var(--c-brand-deep); }
.cat-hero__title::first-letter { text-transform: uppercase; }
/* opis kategorii – edytowany w panelu (musi zostać <div class="portfolio-text"><h3>) */
.cat-hero .portfolio-text h3 {
  margin-top: 1.5rem;
  max-width: 36rem;
  font-size: var(--fs-lead);
  font-weight: 400;
  line-height: 1.5;
  color: var(--c-ink-soft);
}
.cat-hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.cat-hero__media {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  clip-path: inset(0 round var(--r-lg));
  background: var(--c-paper);
}
.cat-hero__media video, .cat-hero__media img, .cat-hero__media svg { display: block; width: 100%; height: auto; }
.ill.is-paused * { animation-play-state: paused !important; }
@media (min-width: 900px) {
  .cat-hero__grid { grid-template-columns: 1.2fr 1fr; }
}

/* ---------- Sekcje SEO i FAQ (HTML z get-seo-section.php / get-faq-section.php) ---------- */
.seo-section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.seo-section + .seo-section { padding-top: 0; }
.seo-section .portfolio-grid {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid;
  gap: clamp(1.5rem, 4vw, 4rem);
}
.seo-section .portfolio-text h3 {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  line-height: 1.02;
  color: var(--c-brand-deep);
}
.seo-section .seo-text { display: grid; gap: 1rem; max-width: 44rem; color: var(--c-ink-soft); }
.seo-section .seo-text p { white-space: pre-line; }
@media (min-width: 900px) {
  .seo-section .portfolio-grid { grid-template-columns: 1fr 1.3fr; }
  .seo-section .content-section { position: sticky; top: calc(var(--header-h) + 2rem); align-self: start; }
}

/* FAQ jako rozwijana lista (JS zamienia pytania w przyciski) */
.faq-section { background: var(--c-cream); padding-top: clamp(3.5rem, 8vw, 6.5rem) !important; }
.faq-section .faq-content { gap: 0; }
.faq-spacer { display: none; }
.faq-item { border-bottom: 1px solid var(--c-line); }
.faq-item:first-child { border-top: 1px solid var(--c-line); }
.faq-question { margin: 0; font-size: 1.125rem; font-weight: 500; color: var(--c-ink); }
.faq-question button {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  width: 100%;
  padding: 1.35rem 0;
  border: 0; background: none;
  text-align: left; font: inherit; color: inherit;
  cursor: pointer;
}
.faq-question button:hover { color: var(--c-brand); }
.faq-icon { position: relative; flex: none; width: 1.75rem; height: 1.75rem; border: 1.5px solid currentColor; border-radius: 50%; }
.faq-icon::before, .faq-icon::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 0.7rem; height: 1.5px; background: currentColor;
  transform: translate(-50%, -50%);
  transition: transform var(--t-fast) var(--ease-out);
}
.faq-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq-item.is-open .faq-icon::after { transform: translate(-50%, -50%) rotate(0deg); }
.faq-answer-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.45s var(--ease-out); }
.faq-answer-wrap > div { overflow: hidden; }
.faq-item.is-open .faq-answer-wrap { grid-template-rows: 1fr; }
.faq-answer { padding-bottom: 1.5rem; max-width: 40rem; color: var(--c-ink-soft); }
/* bez JS: odpowiedzi zawsze widoczne */
.faq-item:not(.is-ready) .faq-answer { display: block; }

/* ---------- Produkt: galeria + informacje ---------- */
.product-top { padding-top: calc(var(--header-h) + clamp(1rem, 3vw, 2.5rem)); padding-bottom: clamp(3rem, 7vw, 6rem); }
.product-top__grid { display: grid; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
@media (min-width: 960px) {
  .product-top__grid { grid-template-columns: 1.15fr 1fr; }
  .gallery { position: sticky; top: calc(var(--header-h) + 1.5rem); }
}

.gallery { display: grid; gap: 0.75rem; }
.gallery__main {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--r-lg);
  overflow: hidden;
  clip-path: inset(0 round var(--r-lg));
  background: var(--c-cream);
}
.gallery__main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.35s var(--ease-out); }
.gallery__main img.is-fading { opacity: 0; }
.gallery__thumbs { display: flex; gap: 0.6rem; margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.gallery__thumbs button {
  display: block;
  width: 5rem; aspect-ratio: 1;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--c-cream);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--t-fast), border-color var(--t-fast);
}
.gallery__thumbs button:hover { opacity: 1; }
.gallery__thumbs button[aria-current="true"] { border-color: var(--c-brand); opacity: 1; }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 960px) { .gallery__main { aspect-ratio: 1 / 1; } }

.product-info { display: grid; gap: 1.5rem; }
.product-info__title { font-size: clamp(2.4rem, 5vw, 4.25rem); color: var(--c-brand-deep); }
.product-info__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.product-info__price { font-family: var(--f-display); font-size: clamp(1.75rem, 3vw, 2.25rem); color: var(--c-brand); line-height: 1; }
.product-info__price small { font-family: var(--f-body); font-size: var(--fs-small); color: var(--c-ink-soft); }
.chip {
  display: inline-flex; align-items: center;
  padding: 0.45rem 0.9rem;
  border-radius: var(--r-pill);
  background: var(--c-cream);
  font-size: var(--fs-small); font-weight: 500;
  color: var(--c-ink);
}
.product-info__subtitle { font-size: var(--fs-lead); line-height: 1.5; color: var(--c-ink); }
.product-info__details { color: var(--c-ink-soft); }
.product-info__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.product-info__perks { display: grid; gap: 0.6rem; margin: 0.5rem 0 0; padding: 1.25rem 0 0; list-style: none; border-top: 1px solid var(--c-line); font-size: var(--fs-small); color: var(--c-ink-soft); }
.product-info__perks li { display: flex; gap: 0.6rem; align-items: baseline; }
.product-info__perks li::before { content: ""; flex: none; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--c-honey); transform: translateY(-1px); }

/* ---------- Produkt: opis + formularz ---------- */
.order { border-top: 1px solid var(--c-line); }
.order__grid { display: grid; gap: clamp(2.5rem, 6vw, 5rem); align-items: start; }
.order__title { font-size: var(--fs-h2); color: var(--c-brand-deep); margin-bottom: 1.5rem; }
.prose { max-width: 40rem; color: var(--c-ink-soft); }
.prose > * + * { margin-top: 1rem; }
.prose h2 { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.1; color: var(--c-brand-deep); margin-top: 2.5rem; }
.prose h3 { font-size: 1.125rem; color: var(--c-ink); margin-top: 1.75rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li + li { margin-top: 0.4rem; }
.prose li::marker { color: var(--c-brand); }
.prose a { color: var(--c-brand); }
.prose strong { color: var(--c-ink); font-weight: 500; }
@media (min-width: 960px) {
  .order__grid { grid-template-columns: 1fr 1.05fr; }
  .order__info { position: sticky; top: calc(var(--header-h) + 2rem); }
}

.form-card { max-width: 40rem; }
.form-card__title { font-family: var(--f-display); font-weight: 400; font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1; color: var(--c-brand-deep); }
.form-card__intro { margin-top: 0.75rem; color: var(--c-ink-soft); font-size: var(--fs-small); }
.form { display: grid; gap: 1.25rem; margin-top: 2rem; }
.form__row { display: grid; gap: 1.25rem; }
.field { display: grid; gap: 0.4rem; }
.field label { font-weight: 500; font-size: 0.975rem; }
.field__optional { font-weight: 400; color: var(--c-ink-soft); }
.field__hint { font-size: 0.875rem; color: var(--c-ink-soft); }
.field input, .field textarea {
  width: 100%;
  height: 3.25rem;
  padding: 0.8rem 1rem;
  border: 1.5px solid rgba(46, 39, 32, 0.28);
  border-radius: var(--r-sm);
  background: transparent;
  font: inherit;
  color: var(--c-ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
/* pola tekstowe tej samej wysokości co pozostałe; rosną razem z wpisywanym tekstem */
.field textarea { height: auto; min-height: 3.25rem; line-height: 1.5; resize: vertical; field-sizing: content; }
.field input::placeholder, .field textarea::placeholder { color: #8a8174; }
.field input:hover, .field textarea:hover { border-color: rgba(46, 39, 32, 0.35); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--c-brand); box-shadow: 0 0 0 3px rgba(122, 58, 18, 0.15); }
.field__error { display: none; font-size: 0.875rem; font-weight: 500; color: #a3261b; }
.field.has-error input, .field.has-error textarea { border-color: #a3261b; }
.field.has-error .field__error, .check.has-error .field__error { display: block; }

.check { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.75rem; align-items: start; font-size: 0.9rem; color: var(--c-ink-soft); }
.check input {
  appearance: none; -webkit-appearance: none;
  width: 1.35rem; height: 1.35rem; margin: 0.1rem 0 0;
  border: 1.5px solid rgba(46, 39, 32, 0.45);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  display: grid; place-items: center;
}
.check input::after { content: ""; width: 0.7rem; height: 0.4rem; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.check input:checked { background: var(--c-brand); border-color: var(--c-brand); }
.check input:checked::after { opacity: 1; }
.check.has-error input { border-color: #a3261b; }
.check .field__error { grid-column: 2; }
.check a { color: var(--c-brand); }
.form__submit { display: grid; gap: 0.75rem; justify-items: start; margin-top: 0.5rem; }
.form__submit .btn { min-width: 14rem; }
.form__disclaimer { font-size: 0.875rem; color: var(--c-ink-soft); }
.form__status { font-weight: 500; color: #a3261b; }
.form__status:empty { display: none; }

/* Okienko „dziękujemy” */
.thanks {
  width: min(32rem, calc(100% - 2rem));
  padding: clamp(1.75rem, 5vw, 2.75rem);
  border: 0;
  border-radius: var(--r-lg);
  background: var(--c-paper);
  color: var(--c-ink);
  box-shadow: 0 30px 80px -20px rgba(46, 39, 32, 0.45);
}
.thanks::backdrop { background: rgba(46, 39, 32, 0.45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.thanks[open] { animation: thanks-in 0.5s var(--ease-out); }
@keyframes thanks-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
.thanks__title { font-family: var(--f-display); font-weight: 400; font-size: clamp(2rem, 5vw, 2.75rem); line-height: 1; color: var(--c-brand-deep); }
.thanks p { margin: 1rem 0 1.75rem; color: var(--c-ink-soft); }

/* Zobacz też */
.related__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.related__title { font-size: var(--fs-h2); color: var(--c-brand-deep); }

/* ---------- Strony prawne ---------- */
.legal { padding-bottom: var(--section); }
.legal .prose { max-width: 46rem; font-size: 1.0625rem; }
.legal .prose > h1:first-child { display: none; } /* tytuł jest w nagłówku strony */
.legal .prose table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.legal .prose th, .legal .prose td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--c-line); text-align: left; vertical-align: top; }

/* ---------- 404 ---------- */
.not-found { min-height: 80vh; display: grid; align-content: center; padding-top: var(--header-h); text-align: center; }
.not-found .not-found__code { margin: 0; font-family: var(--f-display); font-size: clamp(6rem, 22vw, 14rem); line-height: 0.9; color: var(--c-brand-deep); }
.not-found__title { margin-top: 1rem; font-size: var(--fs-h3); }
.not-found p { margin: 1rem auto 2rem; max-width: 30rem; color: var(--c-ink-soft); }
.not-found .btn { justify-self: center; }
