/* ==========================================================================
   Bory Home — baner zgód cookie

   Wtyczka jest samodzielna: każda zmienna ma wartość zapasową, więc baner
   wygląda tak samo także w innym motywie. Gdy aktywny jest motyw Bory Home,
   dziedziczy jego tokeny — kolor marki zmieniony w `tokens.css` zmienia też
   baner.
   ========================================================================== */

.bhc {
  --bhc-accent:      var(--bh-accent, #FFEF3F);
  --bhc-accent-bg:   var(--bh-accent-bg, #FFFCE0);
  --bhc-ink:         var(--bh-ink, #0C1A22);
  --bhc-ink-soft:    var(--bh-ink-soft, #16262F);
  --bhc-surface:     var(--bh-surface, #FFFFFF);
  --bhc-surface-alt: var(--bh-surface-alt, #F7F9FA);
  --bhc-border:      var(--bh-border, #ECEFF1);
  --bhc-border-2:    var(--bh-border-strong, #E4E9EB);
  --bhc-text-2:      var(--bh-text-2, #6B7A84);
  --bhc-text-3:      var(--bh-text-3, #41535E);
  --bhc-text-4:      var(--bh-text-4, #9AA8B1);
  --bhc-font:        var(--bh-font, 'Plus Jakarta Sans', system-ui, sans-serif);
  --bhc-pill:        var(--bh-pill, 100px);
  --bhc-radius:      var(--bh-r-2xl, 26px);
  --bhc-t:           var(--bh-t-slow, .3s cubic-bezier(.2, .8, .2, 1));

  /* Odstęp od dołu ekranu. Skrypt podnosi go, gdy motyw pokazuje własny
     przyklejony pasek CTA na telefonie. */
  --bhc-bottom: 24px;

  position: relative;
  z-index: 9998;
}

.bhc *,
.bhc *::before,
.bhc *::after { box-sizing: border-box; }

.bhc [hidden] { display: none !important; }

/* --- Przyciski ------------------------------------------------------------- */

.bhc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 0;
  padding: 15px 22px;
  border: 0;
  border-radius: var(--bhc-pill);
  background: none;
  font: 700 14px/1 var(--bhc-font);
  color: var(--bhc-ink);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: filter .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
}
.bhc-btn--primary { background: var(--bhc-accent); color: var(--bhc-ink); }
.bhc-btn--primary:hover { filter: brightness(.94); }
.bhc-btn--ghost {
  border: 1px solid var(--bhc-border-2);
  color: var(--bhc-ink);
  padding: 14px 22px;
}
.bhc-btn--ghost:hover { border-color: var(--bhc-ink); }
.bhc-btn--sm { padding: 12px 18px; font-size: 13px; }
.bhc-btn:focus-visible,
.bhc-close:focus-visible,
.bhc-reopen:focus-visible,
.bhc-cat__more:focus-visible,
.bhc-link:focus-visible {
  outline: 2px solid var(--bhc-ink);
  outline-offset: 2px;
}

.bhc-link {
  padding: 0;
  border: 0;
  background: none;
  font: 600 13.5px/1.5 var(--bhc-font);
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--bhc-accent);
  text-decoration-thickness: 1px;
}
.bhc-link:hover { color: var(--bhc-ink); }

/* --- Baner ----------------------------------------------------------------- */

.bhc-banner {
  position: fixed;
  bottom: var(--bhc-bottom);
  left: 24px;
  width: min(420px, calc(100vw - 48px));
  z-index: 9998;
  background: var(--bhc-surface);
  border: 1px solid var(--bhc-border);
  border-radius: var(--bhc-radius);
  padding: 26px 26px 22px;
  /* Cień jest wyraźniejszy niż w kartach strony — baner ma odkleić się od
     treści, na której leży, nie wtopić się w nią. */
  box-shadow: 0 32px 64px -34px rgba(12, 26, 34, .42), 0 2px 6px rgba(12, 26, 34, .04);
  animation: bhc-rise .42s cubic-bezier(.2, .8, .2, 1) .28s backwards;
}
.bhc[data-bhc-position="right"] .bhc-banner { left: auto; right: 24px; }

@keyframes bhc-rise {
  from { opacity: 0; transform: translateY(20px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.bhc-banner__head { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.bhc-banner__icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 13px;
  background: var(--bhc-accent);
  color: var(--bhc-ink);
}
.bhc-banner__title {
  margin: 0;
  font: 800 16.5px/1.25 var(--bhc-font);
  letter-spacing: -.02em;
  color: var(--bhc-ink);
}

.bhc-banner__text {
  margin: 0 0 18px;
  font: 400 13.5px/1.62 var(--bhc-font);
  color: var(--bhc-text-2);
}
.bhc-banner__text a {
  color: var(--bhc-ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--bhc-accent);
  white-space: nowrap;
}
.bhc-banner__text a:hover { border-color: var(--bhc-ink); }

.bhc-banner__actions { display: grid; gap: 10px; }
.bhc-banner__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bhc-banner__row .bhc-btn { padding: 14px 12px; font-size: 13.5px; }

.bhc-banner__note {
  margin: 14px 0 0;
  font: 400 12px/1.45 var(--bhc-font);
  color: var(--bhc-text-4);
}

/* --- Wariant „pasek" ------------------------------------------------------- */

.bhc[data-bhc-layout="bar"] .bhc-banner {
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100vw;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 30px;
  border: 0;
  border-top: 1px solid var(--bhc-border);
  border-radius: 0;
  padding: 18px max(24px, calc((100% - 1280px) / 2 + 40px));
  box-shadow: 0 -22px 50px -40px rgba(12, 26, 34, .4);
}
.bhc[data-bhc-layout="bar"] .bhc-banner__head { grid-column: 1; margin: 0 0 6px; }
.bhc[data-bhc-layout="bar"] .bhc-banner__icon { width: 30px; height: 30px; border-radius: 11px; }
.bhc[data-bhc-layout="bar"] .bhc-banner__text { grid-column: 1; margin: 0; max-width: 96ch; }
/* W pasku dopisek pod przyciskami tylko dokłada wysokości — sam pasek i tak
   zostaje na ekranie do czasu decyzji. */
.bhc[data-bhc-layout="bar"] .bhc-banner__note { display: none; }
.bhc[data-bhc-layout="bar"] .bhc-banner__actions {
  grid-column: 2;
  grid-row: 1 / span 3;
  grid-auto-flow: column;
  align-items: center;
}
.bhc[data-bhc-layout="bar"] .bhc-banner__row { grid-auto-flow: column; grid-template-columns: none; }

/* --- Okno ustawień --------------------------------------------------------- */

.bhc-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.bhc-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 26, 34, .55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: bhc-fade .2s ease both;
}
@keyframes bhc-fade { from { opacity: 0; } to { opacity: 1; } }

.bhc-modal__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  background: var(--bhc-surface);
  border-radius: var(--bhc-radius);
  box-shadow: 0 46px 90px -50px rgba(12, 26, 34, .7);
  animation: bhc-rise .32s cubic-bezier(.2, .8, .2, 1) both;
  overflow: hidden;
}

.bhc-modal__head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 28px 18px;
}
.bhc-modal__eyebrow {
  display: block;
  font: 700 10.5px/1 var(--bhc-font);
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--bhc-text-4);
  margin: 0 0 10px;
}
.bhc-modal__title {
  margin: 0;
  font: 800 21px/1.2 var(--bhc-font);
  letter-spacing: -.025em;
  color: var(--bhc-ink);
}

/* Bliźniacza krawędź do tej nad stopką — przewijana lista nie urywa się
   twardo pod nagłówkiem. */
.bhc-modal__head::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -22px;
  height: 22px;
  background: linear-gradient(var(--bhc-surface), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.bhc-close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--bhc-border);
  border-radius: 50%;
  background: var(--bhc-surface);
  color: var(--bhc-text-2);
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.bhc-close:hover { border-color: var(--bhc-ink); color: var(--bhc-ink); }

.bhc-modal__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 28px 6px;
  overscroll-behavior: contain;
}
.bhc-modal__lead {
  margin: 0 0 20px;
  font: 400 13.5px/1.62 var(--bhc-font);
  color: var(--bhc-text-2);
}
.bhc-modal__policy {
  display: inline-block;
  margin: 4px 0 18px;
  font: 600 13px/1.4 var(--bhc-font);
  color: var(--bhc-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--bhc-accent);
}

/* --- Kategoria -------------------------------------------------------------- */

.bhc-cat { padding: 18px 0; border-top: 1px solid var(--bhc-border); }
.bhc-cat:first-of-type { border-top: 0; padding-top: 0; }

.bhc-cat__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.bhc-cat__name {
  font: 800 14.5px/1.3 var(--bhc-font);
  letter-spacing: -.015em;
  color: var(--bhc-ink);
  cursor: pointer;
}
.bhc-pill {
  flex: none;
  font: 700 10.5px/1 var(--bhc-font);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--bhc-text-2);
  background: var(--bhc-surface-alt);
  border-radius: var(--bhc-pill);
  padding: 9px 12px;
}

.bhc-cat__desc {
  margin: 8px 0 0;
  font: 400 13px/1.6 var(--bhc-font);
  color: var(--bhc-text-2);
  max-width: 62ch;
}

.bhc-cat__more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 12px 0 0;
  padding: 0;
  border: 0;
  background: none;
  font: 700 12.5px/1 var(--bhc-font);
  color: var(--bhc-ink);
  cursor: pointer;
}
.bhc-cat__more svg { transition: transform var(--bhc-t); }
.bhc-cat__more[aria-expanded="true"] svg { transform: rotate(180deg); }

.bhc-cat__services {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
}
.bhc-service {
  background: var(--bhc-surface-alt);
  border-radius: 16px;
  padding: 16px 18px;
}
.bhc-service__name {
  font: 700 12.5px/1.4 var(--bhc-font);
  color: var(--bhc-ink);
  margin: 0 0 10px;
}
.bhc-service__rows {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 7px 14px;
  margin: 0;
}
.bhc-service__rows dt {
  font: 700 10px/1.5 var(--bhc-font);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bhc-text-4);
}
.bhc-service__rows dd {
  margin: 0;
  font: 400 12.5px/1.5 var(--bhc-font);
  color: var(--bhc-text-3);
}

/* --- Przełącznik ------------------------------------------------------------ */

.bhc-switch { position: relative; flex: none; display: inline-flex; }
.bhc-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.bhc-switch__track {
  display: block;
  width: 46px;
  height: 28px;
  border-radius: var(--bhc-pill);
  background: var(--bhc-border-2);
  transition: background var(--bhc-t);
}
.bhc-switch__knob {
  display: block;
  width: 22px;
  height: 22px;
  margin: 3px;
  border-radius: 50%;
  background: var(--bhc-surface);
  box-shadow: 0 1px 3px rgba(12, 26, 34, .28);
  transition: transform var(--bhc-t), background var(--bhc-t);
}
.bhc-switch input:checked + .bhc-switch__track { background: var(--bhc-accent); }
.bhc-switch input:checked + .bhc-switch__track .bhc-switch__knob {
  /* Na żółtym tle biała gałka gubi się — ciemna czyta się jednoznacznie. */
  background: var(--bhc-ink);
  transform: translateX(18px);
}
.bhc-switch input:focus-visible + .bhc-switch__track {
  outline: 2px solid var(--bhc-ink);
  outline-offset: 2px;
}

/* --- Stopka okna ------------------------------------------------------------ */

.bhc-modal__foot {
  position: relative;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 28px 24px;
  border-top: 1px solid var(--bhc-border);
  background: var(--bhc-surface);
}

/* Miękka krawędź nad stopką — daje znać, że lista jeszcze się przewija,
   zamiast ucinać zdanie w połowie wiersza. */
.bhc-modal__foot::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -30px;
  height: 30px;
  background: linear-gradient(rgba(255, 255, 255, 0), var(--bhc-surface));
  pointer-events: none;
}

/* Galeria i menu telefoniczne zajmują cały ekran — warstwa zgody ma wtedy
   zejść z drogi, tak samo jak przycisk czatu. */
body.bh-noscroll .bhc-reopen,
body.bh-menu-open .bhc-reopen,
body.bh-fullscreen .bhc-reopen { display: none; }

/* --- Przycisk powrotu do wyboru --------------------------------------------- */

.bhc-reopen {
  position: fixed;
  bottom: var(--bhc-bottom);
  left: 24px;
  z-index: 9997;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--bhc-border);
  border-radius: 50%;
  background: var(--bhc-surface);
  color: var(--bhc-ink);
  cursor: pointer;
  box-shadow: 0 16px 34px -22px rgba(12, 26, 34, .5);
  transition: transform var(--bhc-t), border-color .2s ease;
}
.bhc-reopen:hover { transform: translateY(-2px); border-color: var(--bhc-border-2); }
.bhc[data-bhc-position="right"] .bhc-reopen { left: auto; right: 24px; }

/* --- Zaślepka osadzenia ------------------------------------------------------ */

.bhc-embed {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  background: var(--bh-surface-alt, #F7F9FA);
  border: 1px solid var(--bh-border, #ECEFF1);
  border-radius: var(--bh-r-xl, 20px);
  padding: 24px;
  text-align: center;
}
.bhc-embed__box { max-width: 42ch; }
.bhc-embed__title {
  font: 800 15px/1.3 var(--bh-font, 'Plus Jakarta Sans', sans-serif);
  color: var(--bh-ink, #0C1A22);
  margin: 0 0 8px;
}
.bhc-embed__text {
  font: 400 13px/1.6 var(--bh-font, 'Plus Jakarta Sans', sans-serif);
  color: var(--bh-text-2, #6B7A84);
  margin: 0 0 16px;
}

/* --- Telefon ---------------------------------------------------------------- */

@media (max-width: 640px) {
  /* Baner zajmował trzy czwarte ekranu telefonu i zasłaniał drugi przycisk
     hero. Treść zostaje w całości — schodzi skala pisma i odstępy, bo to one,
     a nie liczba słów, robiły z komunikatu ścianę. */
  .bhc-banner {
    left: 12px;
    right: 12px;
    width: auto;
    padding: 17px 17px 15px;
    border-radius: 20px;
  }
  .bhc-banner__head { gap: 10px; margin: 0 0 9px; }
  .bhc-banner__icon { width: 30px; height: 30px; border-radius: 11px; }
  .bhc-banner__icon svg { width: 16px; height: 16px; }
  .bhc-banner__title { font-size: 15.5px; }
  .bhc-banner__text { margin: 0 0 13px; font-size: 12.8px; line-height: 1.5; }
  .bhc-banner__actions { gap: 8px; }
  .bhc-banner .bhc-btn { padding: 12px 14px; font-size: 13px; }
  .bhc-banner__row { gap: 8px; }
  .bhc-banner__row .bhc-btn { padding: 11px 8px; font-size: 12.5px; }
  .bhc-banner__note { margin: 10px 0 0; font-size: 11.5px; line-height: 1.4; }
  .bhc[data-bhc-position="right"] .bhc-banner { right: 12px; }
  .bhc[data-bhc-layout="bar"] .bhc-banner {
    left: 0; right: 0;
    display: block;
    padding: 20px;
    border-radius: 0;
  }
  .bhc[data-bhc-layout="bar"] .bhc-banner__actions { margin-top: 16px; }
  .bhc[data-bhc-layout="bar"] .bhc-banner__note { display: block; margin-top: 12px; }
  .bhc[data-bhc-layout="bar"] .bhc-banner__row { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }

  /* Okno zamienia się w arkusz wysuwany od dołu — kciukiem bliżej przycisków. */
  .bhc-modal { padding: 0; align-items: flex-end; }
  .bhc-modal__panel {
    width: 100%;
    max-height: 88vh;
    border-radius: var(--bhc-radius) var(--bhc-radius) 0 0;
    animation-name: bhc-sheet;
  }
  .bhc-modal__head { padding: 22px 20px 16px; }
  .bhc-modal__body { padding: 0 20px 4px; }
  /* Dwie kolumny łamały „Akceptuję wszystkie" na dwa wiersze — na telefonie
     przyciski idą jeden pod drugim, główny najniżej, bliżej kciuka. */
  .bhc-modal__foot {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 16px 20px calc(20px + env(safe-area-inset-bottom));
  }
  .bhc-service__rows { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .bhc-service__rows dd { margin-bottom: 7px; }
  /* Na telefonie kółko zniknęło z ekranu. Razem z przyciskiem czatu zajmowały
     cały dolny pas i siadały na treści, a wybór cookies i tak jest w stopce
     („Ustawienia cookies") — czyli tam, gdzie ludzie szukają takich rzeczy.
     Na desktopie kółko zostaje: miejsca jest dość, a dostęp do zgody musi być
     w zasięgu jednego kliknięcia. */
  .bhc-reopen { display: none; }
}

@keyframes bhc-sheet {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bhc-banner,
  .bhc-modal__panel,
  .bhc-modal__backdrop { animation: none; }
  .bhc-switch__knob,
  .bhc-switch__track,
  .bhc-cat__more svg,
  .bhc-reopen { transition: none; }
}
