/* 4BAKE CMS informational pages — APPROVED visual direction: Proposal #3
   Brand colours from 4BAKE identity guide:
   gold RGB 192/134/41  = #C08629
   brown RGB 100/58/29  = #643A1D
   Scope this file to CMS content only. Do not alter global header/footer. */

.b4-cms {
  --b4-gold: #C08629;
  --b4-gold-deep: #A66E18;
  --b4-brown: #643A1D;
  --b4-espresso: #3A2416;
  --b4-ink: #211A15;
  --b4-copy: #534A43;
  --b4-muted: #776D65;
  --b4-ivory: #FBF8F3;
  --b4-warm: #F4EDE2;
  --b4-line: #E6D9C7;
  --b4-white: #FFFFFF;
  --b4-shadow: 0 12px 35px rgba(58, 36, 22, .08);
  --b4-radius: 12px;
  color: var(--b4-ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

.b4-cms *, .b4-cms *::before, .b4-cms *::after { box-sizing: border-box; }
.b4-cms img { max-width: 100%; height: auto; display: block; }
.b4-cms a { color: inherit; }

.b4-cms__shell {
  width: min(1180px, calc(100% - 32px));
  margin: 26px auto 54px;
}

/* HERO — Proposal #3: editorial left side + bakery media slot right side */
.b4-hero {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  border: 1px solid var(--b4-line);
  border-radius: var(--b4-radius);
  background:
    linear-gradient(90deg, rgba(251,248,243,.995) 0%, rgba(251,248,243,.97) 46%, rgba(244,237,226,.73) 68%, rgba(100,58,29,.14) 100%),
    radial-gradient(circle at 82% 28%, rgba(192,134,41,.16), transparent 34%),
    linear-gradient(135deg, #FBF8F3 0%, #F4EDE2 72%, #E8D8C2 100%);
  box-shadow: var(--b4-shadow);
}

.b4-hero::after {
  content: "";
  position: absolute;
  inset: 0 0 0 54%;
  pointer-events: none;
  opacity: .78;
  background-image: var(--b4-hero-image, url("/themes/4bake-child/assets/img/cms/hero-bakery-pattern.svg"));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  mix-blend-mode: multiply;
}

.b4-hero__content {
  position: relative;
  z-index: 2;
  width: min(650px, 62%);
  padding: 50px 54px 44px;
}

.b4-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  color: var(--b4-gold-deep);
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.b4-eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border: 2px solid var(--b4-gold);
  transform: rotate(45deg);
}

.b4-hero h1 {
  margin: 0;
  max-width: 640px;
  color: var(--b4-brown);
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: clamp(46px, 5.4vw, 74px);
  line-height: .98;
  font-weight: 700;
  letter-spacing: -.035em;
}

.b4-hero__rule {
  width: 54px;
  height: 3px;
  margin: 22px 0 20px;
  border-radius: 99px;
  background: var(--b4-gold);
}

.b4-hero__lead {
  max-width: 515px;
  margin: 0;
  color: var(--b4-copy);
  font-size: 17px;
  line-height: 1.65;
}

/* KPI cards */
.b4-kpis {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: -34px 28px 0;
}

.b4-kpi {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 16px;
  align-items: center;
  min-height: 126px;
  padding: 24px 26px;
  border: 1px solid var(--b4-line);
  border-radius: 11px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 10px 28px rgba(58,36,22,.07);
}
.b4-kpi__icon { width: 50px; height: 50px; color: var(--b4-gold); }
.b4-kpi__value {
  display: block;
  color: var(--b4-brown);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 31px;
  line-height: 1;
  font-weight: 700;
}
.b4-kpi__label { display: block; margin-top: 7px; color: var(--b4-copy); font-size: 14px; }

/* Step strip */
.b4-section { margin-top: 28px; }
.b4-section__title {
  margin: 0 0 18px;
  color: var(--b4-brown);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 27px;
  line-height: 1.2;
}

.b4-process {
  padding: 26px 28px;
  border: 1px solid var(--b4-line);
  border-radius: var(--b4-radius);
  background: var(--b4-white);
}
.b4-process__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}
.b4-step {
  position: relative;
  padding: 4px 24px 4px 68px;
  min-height: 82px;
}
.b4-step + .b4-step { border-left: 1px solid var(--b4-line); }
.b4-step__number {
  position: absolute;
  left: 20px;
  top: 4px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--b4-gold);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}
.b4-step strong { display: block; margin-bottom: 4px; color: var(--b4-ink); font-size: 14px; }
.b4-step span { display: block; color: var(--b4-muted); font-size: 12.5px; line-height: 1.45; }

/* Existing return widget wrapper — keep fb-ret__ functionality untouched */
.b4-return-widget {
  display: grid;
  grid-template-columns: minmax(250px, .7fr) minmax(420px, 1.3fr);
  gap: 34px;
  align-items: center;
  padding: 30px 34px;
  border: 1px solid #D8B981;
  border-radius: var(--b4-radius);
  background:
    linear-gradient(105deg, rgba(100,58,29,.98), rgba(58,36,22,.98) 54%, rgba(100,58,29,.94));
  color: #fff;
  box-shadow: var(--b4-shadow);
}
.b4-return-widget h2,
.b4-return-widget h3 {
  margin: 0 0 8px;
  color: #fff;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 30px;
  line-height: 1.15;
}
.b4-return-widget p { margin: 0; color: rgba(255,255,255,.82); font-size: 14px; }
.b4-return-widget__form { min-width: 0; }

/* Style native/existing controls without changing widget logic */
.b4-return-widget input:not([type="checkbox"]):not([type="radio"]),
.b4-return-widget select,
.b4-return-widget textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 15px;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 7px;
  background: #fff;
  color: var(--b4-ink);
  font: inherit;
  outline: none;
}
.b4-return-widget textarea { min-height: 104px; padding-top: 13px; }
.b4-return-widget input:focus,
.b4-return-widget select:focus,
.b4-return-widget textarea:focus { border-color: var(--b4-gold); box-shadow: 0 0 0 3px rgba(192,134,41,.18); }

.b4-return-widget button,
.b4-return-widget input[type="submit"],
.b4-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: 0 25px;
  border: 1px solid var(--b4-gold);
  border-radius: 7px;
  background: var(--b4-gold);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease;
}
.b4-return-widget button:hover,
.b4-return-widget input[type="submit"]:hover,
.b4-button:hover { background: var(--b4-gold-deep); transform: translateY(-1px); }

/* Trust row */
.b4-trust {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 25px 20px;
  border: 1px solid var(--b4-line);
  border-radius: var(--b4-radius);
  background: linear-gradient(180deg, #FFF, #FBF8F3);
}
.b4-trust__item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  padding: 2px 21px;
}
.b4-trust__item + .b4-trust__item { border-left: 1px solid var(--b4-line); }
.b4-trust__icon { width: 38px; height: 38px; color: var(--b4-gold); }
.b4-trust strong { display: block; color: var(--b4-ink); font-size: 13px; }
.b4-trust span { display: block; margin-top: 3px; color: var(--b4-muted); font-size: 11.5px; line-height: 1.4; }

/* Neutral CMS content blocks used by the other informational pages */
.b4-copy {
  margin-top: 28px;
  padding: 34px;
  border: 1px solid var(--b4-line);
  border-radius: var(--b4-radius);
  background: #fff;
}
.b4-copy h2 { color: var(--b4-brown); font-size: 28px; margin: 0 0 16px; }
.b4-copy h3 { color: var(--b4-ink); font-size: 20px; margin: 28px 0 10px; }
.b4-copy p, .b4-copy li { color: var(--b4-copy); }
.b4-copy a { color: var(--b4-brown); text-decoration-color: var(--b4-gold); text-underline-offset: 3px; }

@media (max-width: 920px) {
  .b4-cms__shell { width: min(100% - 22px, 760px); margin-top: 16px; }
  .b4-hero { min-height: auto; }
  .b4-hero::after { inset: 48% 0 0 0; opacity: .35; }
  .b4-hero__content { width: 100%; padding: 38px 30px 110px; }
  .b4-hero h1 { font-size: clamp(44px, 12vw, 64px); max-width: 92%; }
  .b4-hero__lead { max-width: 92%; }
  .b4-kpis { grid-template-columns: 1fr; margin: -52px 16px 0; gap: 10px; }
  .b4-kpi { min-height: 94px; padding: 18px 20px; }
  .b4-process__grid { grid-template-columns: 1fr 1fr; }
  .b4-step { padding-top: 14px; padding-bottom: 14px; }
  .b4-step + .b4-step { border-left: 0; }
  .b4-step:nth-child(even) { border-left: 1px solid var(--b4-line); }
  .b4-step:nth-child(n+3) { border-top: 1px solid var(--b4-line); }
  .b4-return-widget { grid-template-columns: 1fr; gap: 20px; padding: 26px; }
  .b4-trust { grid-template-columns: 1fr 1fr; }
  .b4-trust__item + .b4-trust__item { border-left: 0; }
  .b4-trust__item:nth-child(even) { border-left: 1px solid var(--b4-line); }
  .b4-trust__item:nth-child(n+3) { border-top: 1px solid var(--b4-line); padding-top: 18px; margin-top: 14px; }
}

@media (max-width: 560px) {
  .b4-cms__shell { width: calc(100% - 16px); }
  .b4-hero { border-radius: 9px; }
  .b4-hero__content { padding: 30px 22px 96px; }
  .b4-eyebrow { font-size: 11px; }
  .b4-hero h1 { font-size: 43px; }
  .b4-hero__lead { font-size: 15px; }
  .b4-kpis { margin-left: 10px; margin-right: 10px; }
  .b4-kpi { grid-template-columns: 44px 1fr; }
  .b4-kpi__icon { width: 40px; height: 40px; }
  .b4-kpi__value { font-size: 26px; }
  .b4-process { padding: 18px 14px; }
  .b4-process__grid { grid-template-columns: 1fr; }
  .b4-step, .b4-step:nth-child(even) { border-left: 0; border-top: 1px solid var(--b4-line); padding-left: 62px; }
  .b4-step:first-child { border-top: 0; }
  .b4-return-widget { padding: 22px 18px; }
  .b4-return-widget h2, .b4-return-widget h3 { font-size: 26px; }
  .b4-trust { grid-template-columns: 1fr; padding: 10px 16px; }
  .b4-trust__item, .b4-trust__item:nth-child(even), .b4-trust__item:nth-child(n+3) {
    border-left: 0;
    border-top: 1px solid var(--b4-line);
    padding: 16px 4px;
    margin: 0;
  }
  .b4-trust__item:first-child { border-top: 0; }
}

/* ==========================================================================
   INTEGRATION LAYER — dopisane przez CC podczas wdrożenia na 4bake.pl
   NIE JEST TO ZMIANA PROJEKTU. Wyłącznie naprawa kolizji między CSS paczki
   a istniejącym modułem `fourbake_returns` (returns.css) oraz jednej kolizji
   kaskady wewnątrz samej paczki. Każda reguła ma podany powód.
   Zero zmian w JS, w DOM formularza i w jego funkcjonalności.
   ========================================================================== */

/* [1] Duplikat nagłówka.
   Panel .b4-return-widget ma już własne <h2>„Zgłoś zwrot online" + lead po lewej
   stronie. Widget modułu niesie identyczny <h3> + lead w środku, więc ten sam
   tekst pojawiał się dwa razy. Chowamy TYLKO wstępny nagłówek i lead widgetu
   (selektor `>` — nie dotyka .fb-ret__lead w kroku wyboru pozycji). */
.b4-return-widget #fb-returns > h3,
.b4-return-widget #fb-returns > .fb-ret__lead {
  display: none;
}

/* [2] Nieczytelny tekst pomocniczy.
   Reguła paczki `.b4-return-widget p { color: rgba(255,255,255,.82) }` była
   pisana pod ciemny gradient panelu, ale widget renderuje się jako jasna karta
   (moduł ustawia tło przez #fb-returns, czyli selektor ID — nie do przebicia
   klasą). Biały tekst na kremowym tle dawał kontrast 1.1:1. Przywracamy kolory
   tekstu paczki dla treści wewnątrz karty. Alerty zachowują własne kolory. */
.b4-return-widget #fb-returns p:not(.fb-ret__alert) {
  color: var(--b4-copy);
}

.b4-return-widget #fb-returns .fb-ret__hint {
  color: var(--b4-muted);
}

.b4-return-widget #fb-returns label {
  color: var(--b4-ink);
}

/* [3] Widoczność obramowań pól.
   Paczka nadaje inputom `border-color: rgba(255,255,255,.34)` (pod ciemny
   panel). Na jasnej karcie taka ramka jest niewidoczna. Zostawiamy rozmiary
   i promienie z paczki, korygujemy wyłącznie kolor krawędzi. */
.b4-return-widget #fb-returns input:not([type="checkbox"]):not([type="radio"]),
.b4-return-widget #fb-returns select,
.b4-return-widget #fb-returns textarea {
  border-color: var(--b4-line);
}

/* [4] Numery kroków — kolizja kaskady WEWNĄTRZ paczki.
   `.b4-step span { color: var(--b4-muted); display:block; font-size:12.5px }`
   występuje po `.b4-step__number` i ma wyższą specyficzność (0,1,1 vs 0,1,0),
   więc nadpisywało deklarowany `color:#fff` i `display:grid`. Efekt: szara
   cyfra na złotym kółku, kontrast 1.61:1. Przywracamy intencję paczki. */
.b4-step span.b4-step__number {
  display: grid;
  color: #fff;
  font-size: 13px;
  line-height: 1;
}

@media (max-width: 560px) {
  #content[data-cms-id="14"] div[style*="display:flex;align-items:flex-start;gap:20px"] > div {
    min-width: 0;
  }

  #content[data-cms-id="14"] div[style*="grid-template-columns:1fr 1fr 1fr"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
