/* =========================================================
   WszystkieGazetki.pl — podstrona gazetki (czytnik)
   Wspólne elementy (nagłówek, stopka, karty gazetek, kolory) są w styles.css.
   ========================================================= */

.reader-page { padding-bottom: 88px; }

/* ---------- Ścieżka nawigacji ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 4px 8px; padding-block: 11px; font-size: 13px; color: var(--muted); }
.crumbs a:hover { color: var(--green-ink); text-decoration: underline; text-underline-offset: 3px; }
.crumbs [aria-current] { color: var(--ink); }

/* ---------- Czytnik ---------- */
/* Układ: belka z tytułem na górze, pod nią strona gazetki, a po prawej miniatury.
   Miniatury stoją z boku, bo na szerokim ekranie brakuje wysokości, a nie szerokości. */
.reader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px;
  grid-template-areas:
    "head  head"
    "stage thumbs"
    "pager thumbs";
  border-radius: 22px; background: var(--forest); color: #fff; overflow: hidden;
}

/* Belka: logo, tytuł, daty i narzędzia */
.reader-head { grid-area: head; display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 12px 14px; }
.reader-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.reader-id .logo { flex-shrink: 0; width: 62px; height: 46px; border: 0; border-radius: 11px; }
.reader-id .logo img { padding: 6px 8px; }
.reader-title { min-width: 0; }
.reader-title h1 { font: 750 19px/1.2 var(--font-display); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-title h1 span { font-weight: 500; color: #cfe3d7; }
.reader-dates { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin-top: 4px; font-size: 13.5px; color: #bfe0cc; }
.reader-dates .ico { width: 16px; height: 16px; }
.reader-dates b { margin-left: 4px; padding: 1px 8px; border-radius: 6px; background: var(--sun); color: var(--sun-ink); font-size: 12.5px; font-weight: 800; }

.reader-tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.tool { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 10px; background: rgba(255, 255, 255, .06); color: #e9f4ee; font-size: 14px; font-weight: 600; white-space: nowrap; }
.tool:hover { background: rgba(255, 255, 255, .16); }
.tool[aria-pressed="true"] { border-color: #fff; background: #fff; color: var(--forest); }
.tool .ico { width: 18px; height: 18px; }
.reader-cta { margin-left: 6px; border-color: var(--sun); background: var(--sun); color: var(--sun-ink); font-weight: 800; }
.reader-cta:hover { background: #ffdf66; }

/* Scena ze stroną gazetki */
.stage-wrap { grid-area: stage; position: relative; min-width: 0; background: #072c20; }
/* Wysokość sceny: tyle, żeby cały czytnik mieścił się w oknie (250px zajmują nagłówek strony, belka i paginacja).
   container-type: size pozwala stronie gazetki liczyć swój rozmiar z rozmiaru sceny (jednostki cqw i cqh poniżej). */
.stage {
  --pages: 1;   /* ile stron widać obok siebie: 1 albo 2 (ustawia skrypt) */
  --zoom: 1;    /* 1 = strona dopasowana do sceny, 2 = powiększenie (ustawia skrypt) */
  display: flex; height: clamp(440px, calc(100vh - 250px), 960px); padding: 18px 66px;
  overflow: auto; overscroll-behavior: contain; container-type: size;
}
.stage:focus-visible { outline-offset: -3px; }
/* margin: auto środkuje kartkę, a po powiększeniu pozwala przewinąć scenę do każdej krawędzi */
.sheet { position: relative; display: flex; margin: auto; box-shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 30px 60px -24px rgba(0, 0, 0, .85); }
/* Wysokość strony to mniejsza z dwóch wartości: cała wysokość sceny (100cqh)
   albo taka, przy której strony mieszczą się na szerokość (100cqw / liczba stron / proporcje). */
.page {
  display: block; width: auto; max-width: none;
  height: calc(min(100cqh, 100cqw / var(--pages) / var(--ratio)) * var(--zoom));
  aspect-ratio: var(--ratio);
  background: #fff; cursor: zoom-in;
}
.page[hidden] { display: none; }
.stage.is-zoomed .page { cursor: zoom-out; }
.sheet.is-spread::after { /* cień na zgięciu między dwiema stronami */
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 36px; margin-left: -18px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)); pointer-events: none;
}

.stage-arrow { position: absolute; top: 50%; display: grid; place-items: center; width: 48px; height: 48px; margin-top: -24px; border-radius: 50%; background: #fff; color: var(--forest); box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .6); transition: transform .2s; }
.stage-arrow.is-prev { left: 10px; }
.stage-arrow.is-next { right: 10px; }
.stage-arrow:hover { transform: scale(1.08); }
.stage-arrow .ico { width: 24px; height: 24px; stroke-width: 2.2; }
/* Link bez celu (pierwsza i ostatnia strona) */
.stage-arrow[aria-disabled="true"], .pager-step[aria-disabled="true"] { opacity: .3; pointer-events: none; }
.stage.is-zoomed ~ .stage-arrow { display: none; }

/* Paginacja */
.pager { grid-area: pager; position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid rgba(255, 255, 255, .1); }
.progress { position: absolute; left: 0; top: -2px; width: 5%; height: 3px; border-radius: 0 3px 3px 0; background: var(--sun); transition: width .25s; }
.pager-step { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px; border-radius: 10px; background: rgba(255, 255, 255, .08); color: #fff; font-size: 14.5px; font-weight: 700; white-space: nowrap; }
.pager-step:hover { background: rgba(255, 255, 255, .18); }
.pager-step .ico { width: 18px; height: 18px; }
.pager-step.is-leaflet { background: var(--sun); color: var(--sun-ink); }
.pager-step.is-leaflet:hover { background: #ffdf66; }
.pager-step[hidden] { display: none; }
.pager-pages { display: flex; align-items: center; gap: 6px; }
.pager-pages a, .pager-pages span { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 10px; border-radius: 10px; font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pager-pages a { background: rgba(255, 255, 255, .08); color: #e9f4ee; }
.pager-pages a:hover { background: rgba(255, 255, 255, .18); }
.pager-pages a[aria-current] { background: var(--sun); color: var(--sun-ink); }
.pager-pages span { min-width: 18px; padding: 0; color: #9cc4ad; }
.pager-status { display: none; font-size: 14.5px; color: #cfe3d7; white-space: nowrap; }
.pager-status b { color: #fff; }

/* Miniatury. Okładka stoi w prawej kolumnie, więc kolejne wiersze to rozkładówki: 2–3, 4–5 itd. */
.thumbs-cell { grid-area: thumbs; position: relative; border-left: 1px solid rgba(255, 255, 255, .1); }
/* position: absolute sprawia, że długa lista miniatur przewija się w środku i nie rozpycha czytnika */
.thumbs { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: 12px 8px; padding: 14px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .3) transparent; }
.thumb { position: relative; display: block; border-radius: 4px; outline: 2px solid transparent; outline-offset: 2px; opacity: .7; transition: opacity .2s; }
.thumb:first-child { grid-column: 2; }
.thumb img { width: 100%; aspect-ratio: var(--ratio); border-radius: 4px; background: #fff; }
.thumb span { position: absolute; left: 4px; bottom: 4px; min-width: 24px; padding: 1px 6px; border-radius: 5px; background: rgba(7, 44, 32, .88); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.thumb:hover { opacity: 1; }
.thumb.is-active { opacity: 1; outline-color: var(--sun); }
.thumb.is-active span { background: var(--sun); color: var(--sun-ink); }

/* Pełny ekran: czytnik zakrywa całą stronę, scena bierze całą wolną wysokość */
body.reader-open { overflow: hidden; }
.reader.is-fullscreen { position: fixed; inset: 0; z-index: 100; grid-template-rows: auto minmax(0, 1fr) auto; border-radius: 0; }
.reader.is-fullscreen .stage { height: 100%; }

.reader-note { margin-top: 12px; font-size: 12.5px; color: var(--muted); }

/* ---------- Pod czytnikiem ---------- */
/* Tabela promocji z gazetki */
.offers-section { padding-top: 56px; }
.offers-count { margin-left: 6px; padding: 2px 10px; border-radius: 999px; background: var(--mint); color: var(--green-ink); font: 700 15px/1.6 var(--font); letter-spacing: 0; vertical-align: middle; }
/* Filtry: zwykłe pola select z własną strzałką */
.offers-filters { display: flex; align-items: center; gap: 8px; }
.select { position: relative; display: block; }
.select select { height: 44px; padding: 0 38px 0 14px; border: 1px solid #cfd8d1; border-radius: 12px; background: var(--paper); font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); text-overflow: ellipsis; appearance: none; -webkit-appearance: none; cursor: pointer; }
.select select:hover { border-color: var(--green); }
.select .ico { position: absolute; right: 13px; top: 50%; margin-top: -8px; color: var(--muted); pointer-events: none; }
.offers-reset { height: 44px; padding: 0 10px; border: 0; background: none; color: var(--green-ink); font-size: 14.5px; font-weight: 700; }
.offers-reset:hover { text-decoration: underline; text-underline-offset: 3px; }
.offers-empty { padding: 36px 20px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; }

.offers { border: 1px solid var(--line); border-radius: 22px; background: var(--paper); overflow: hidden; }
.offers-table { width: 100%; border-collapse: collapse; }
.offers-table th { padding: 14px 20px; background: #f8faf8; font-size: 13px; font-weight: 600; color: var(--muted); text-align: left; white-space: nowrap; }
.offers-table td { padding: 10px 20px; border-top: 1px solid var(--line); vertical-align: middle; }
.offers-table tbody tr:hover { background: #fafcfa; }
.offers-table tr[hidden] { display: none; }   /* wiersz ukryty przez filtr */

.offer-product { display: flex; align-items: center; gap: 16px; }
.offer-product img { flex-shrink: 0; width: 96px; height: 96px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #fff; object-fit: contain; }
.offer-product span { display: grid; gap: 2px; min-width: 0; }
.offer-icon { display: grid; place-items: center; flex-shrink: 0; width: 96px; height: 96px; border-radius: 12px; background: var(--mint); color: var(--green-ink); }
.offer-icon .ico { width: 44px; height: 44px; }
.offer-product b { font-weight: 650; font-size: 15.5px; line-height: 1.3; }
.offer-product small { font-size: 13px; color: var(--muted); }
.offer-product small a { color: var(--green-ink); font-weight: 600; }
.offer-product small a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* width: 1% zwęża kolumnę do jej zawartości, więc całe wolne miejsce dostaje nazwa produktu */
.offers-table .offer-price, .offers-table .offer-dates { width: 1%; padding-inline: 28px; white-space: nowrap; }
.offer-price strong { font: 800 19px/1.2 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.offer-price s { margin-left: 10px; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.offer-off { margin-left: 8px; padding: 2px 7px; border-radius: 6px; background: var(--sun); color: var(--sun-ink); font-size: 12.5px; font-weight: 800; }

.offer-dates { font-size: 14px; color: var(--muted); }
.offer-dates .is-short { color: var(--red); font-weight: 650; }   /* promocja krótsza niż cała gazetka */

.offer-page { width: 1%; white-space: nowrap; }   /* kolumna tak wąska, jak jej zawartość */
.offer-page a { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px 0 14px; border-radius: 10px; background: var(--mint); color: var(--green-ink); font-size: 14px; font-weight: 700; }
.offer-page a:hover { background: var(--green); color: #fff; }
.offer-page .ico { width: 16px; height: 16px; }

.next-section { padding-top: 56px; }

.alerts-wide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); align-items: center; gap: 24px 40px; padding: 28px 32px; }
.alerts-copy { display: flex; align-items: center; gap: 18px; }
.alerts-wide .alerts-ico { margin-bottom: 0; }
.alerts-wide h2 { max-width: none; font-size: 22px; }
.alerts-wide p { margin-top: 4px; color: #c4dccd; font-size: 15px; }
.alerts-wide .alert-row { margin-top: 0; }

/* =========================================================
   Responsywność
   ========================================================= */
@media (max-width: 1180px) {
  .tool span { display: none; }            /* same ikony narzędzi */
  .tool { width: 40px; padding: 0; }
  .reader-cta { width: auto; padding: 0 12px; }
  .reader { grid-template-columns: minmax(0, 1fr) 190px; }
  .alerts-wide { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  /* Telefon i mały tablet: zawsze jedna strona na całą szerokość ekranu, miniatury w rzędzie pod spodem */
  .crumbs { padding-block: 9px; }
  .crumbs-title, .crumbs-title-slash, .reader-note-keys { display: none; }   /* krótsza ścieżka, bez podpowiedzi o klawiaturze */
  .reader { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "stage" "pager" "thumbs"; margin-inline: calc(var(--gutter) * -1); border-radius: 0; }
  .reader-head { flex-wrap: wrap; }
  .reader-title h1 { font-size: 17px; white-space: normal; }
  .reader-tools { width: 100%; }
  .tool-view { display: none; }
  .reader-cta { flex: 1; margin-left: 0; }
  /* Strona ma pełną szerokość, a wysokość wynika z obrazka, więc scena nie potrzebuje stałej wysokości */
  .stage { height: auto; padding: 0; container-type: normal; }
  .sheet { width: calc(100% * var(--zoom)); box-shadow: none; }
  .page { width: 100%; height: auto; }
  .stage-arrow { width: 42px; height: 42px; margin-top: -21px; opacity: .92; }
  .stage-arrow.is-prev { left: 6px; }
  .stage-arrow.is-next { right: 6px; }
  .pager-pages { display: none; }
  .pager-status { display: block; }
  .thumbs-cell { border-left: 0; border-top: 1px solid rgba(255, 255, 255, .1); }
  .thumbs { position: relative; inset: auto; display: flex; gap: 8px; padding: 12px 14px; overflow-x: auto; overflow-y: hidden; }
  .thumb { flex: 0 0 64px; }
  .thumb:first-child { grid-column: auto; }
  /* Pełny ekran na telefonie: strona dopasowana do ekranu, bez miniatur */
  .reader.is-fullscreen { margin: 0; grid-template-rows: auto minmax(0, 1fr) auto; }
  .reader.is-fullscreen .stage { height: 100%; padding: 8px; container-type: size; }
  .reader.is-fullscreen .sheet { width: auto; }
  .reader.is-fullscreen .page { width: auto; height: calc(min(100cqh, 100cqw / var(--pages) / var(--ratio)) * var(--zoom)); }
  .reader.is-fullscreen .thumbs-cell { display: none; }
  .next-section, .offers-section { padding-top: 40px; }
  /* Wąski ekran: mniejsze odstępy w tabeli promocji, żeby nazwa produktu miała więcej miejsca */
  .offers-table th, .offers-table td { padding-inline: 14px; }
  .offers-table .offer-price, .offers-table .offer-dates { padding-inline: 12px; }
}

@media (max-width: 640px) {
  /* Tabela promocji na telefonie: wiersz staje się kartą.
     Po lewej miniatura, obok niej kolejno: nazwa, cena, a w ostatniej linii termin i link do strony gazetki.
     Selektory zaczynają się od .offers-table, żeby wygrały z ogólną regułą dla komórek. */
  .offers-filters { width: 100%; flex-wrap: wrap; }
  .select { flex: 1; min-width: 0; }
  .select select { width: 100%; font-size: 16px; }   /* 16px: iPhone nie powiększa strony po kliknięciu w pole */
  .offers-reset { flex-basis: 100%; height: 30px; padding: 0 2px; text-align: left; }   /* „Wyczyść" w osobnej linii pod polami */
  .offers-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .offers-table, .offers-table tbody { display: block; }
  .offers-table { margin-top: -1px; }   /* chowa górną linię pierwszego widocznego wiersza */
  .offers-table tr { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; grid-template-areas: "img name name" "img price badge" "img dates page"; align-items: center; gap: 6px 12px; padding: 14px 14px 14px 12px; border-top: 1px solid var(--line); }
  .offers-table td, .offers-table .offer-price, .offers-table .offer-dates { display: block; width: auto; padding: 0; border: 0; }
  /* display: contents „rozpakowuje" komórkę: miniatura i nazwa stają się osobnymi polami siatki wiersza */
  .offers-table .offer-product { display: contents; }
  .offers-table .offer-product img, .offers-table .offer-icon { grid-area: img; align-self: start; width: 84px; height: 84px; }
  .offers-table .offer-product span { grid-area: name; }
  .offers-table .offer-product b { font-size: 15px; }
  .offers-table .offer-price { grid-area: price; }
  .offers-table .offer-badge { grid-area: badge; align-self: start; width: auto; }   /* na telefonie etykieta obok ceny, po prawej */
  .offers-table .offer-dates { grid-area: dates; font-size: 13px; }
  .offers-table .offer-page { grid-area: page; width: auto; }
  .pager-step:not(.is-next) span { display: none; }   /* „Poprzednia" jako sama strzałka */
  .pager-step:not(.is-next) { width: 42px; padding: 0; justify-content: center; }
  .alerts-wide { padding: 26px 22px; }
  .alerts-copy { align-items: flex-start; }
  .alerts-wide h2 { font-size: 20px; }
}

/* =========================================================
   Uzupełnienia v4
   ========================================================= */

/* Wybór wersji regionalnej gazetki w pasku narzędzi czytnika */
.reader-variant { display: flex; gap: 6px; }
.reader-variant .select select { height: 40px; max-width: 260px; font-size: 14px; }

@media (max-width: 640px) {
  .reader-variant .select select { max-width: 150px; }
}

/* Lupa na telefonie: scena jest flexem, a element flexa domyślnie się kurczy.
   Obrazek w kartce ma width: 100%, więc nic nie trzyma szerokości i powiększona kartka (200%)
   wracała do szerokości ekranu. flex-shrink: 0 zostawia jej pełną szerokość, a scena przewija się w bok. */
@media (max-width: 900px) {
  .sheet { flex-shrink: 0; }
}

/* Piksele reklamodawcy gazetki promowanej: obecne na stronie, ale niewidoczne */
.tracking-pixels { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Promocje z feedu: dopiski do ceny i dat, stronicowanie pełnej listy */
.offer-lowest { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
.offer-dates .is-unresolved { color: var(--muted); font-style: italic; }
.offers-note { margin-top: 16px; font-size: 13px; color: var(--muted); }
.offers-page { padding-top: 8px; }
.offers-page h1 { font: 750 clamp(24px, 2.4vw, 32px)/1.15 var(--font-display); letter-spacing: -.03em; }
.offers-pages { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 24px; color: var(--muted); }
.offer-terms { display: block; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
/* Kolumna ceny w pionie i o stałej szerokości, żeby nic nie wchodziło na „Obowiązuje”:
   cena w jednej linii, pod nią jednostka, niżej cena przekreślona i rabat, na końcu „najniższa z 30 dni”.
   Tekst zamiast ceny (np. „Drugi tańszy 50% taniej”) łamie się w tej szerokości. */
@media (min-width: 641px) {
  .offers-table .offer-price { width: 190px; min-width: 150px; white-space: normal; }
  /* Kolumna z etykietą rabatu: tak wąska jak etykieta, dosunięta do ceny */
  .offers-table .offer-badge { width: 1%; padding-inline: 12px 0; text-align: right; white-space: nowrap; }
}
.offer-price strong { display: block; white-space: nowrap; }
.offer-price .offer-price-text { white-space: normal; font-size: 16px; line-height: 1.25; }
.offer-unit { display: block; margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--muted); }
.offer-price .offer-was { display: block; margin: 4px 0 0; }
.offer-badge .offer-off { margin-left: 0; }

/* ---------- Strona sieci: gazetki i „O sieci” po lewej, pasek ze sklepami po prawej ---------- */
/* Większe logo w nagłówku strony sieci (i listy sklepów) — w rozmiarze z czytnika ginęło. */
.retailer-head { gap: 20px; }
.retailer-head .logo { width: 120px; height: 80px; border: 1px solid var(--line); border-radius: 16px; }
.retailer-head .logo img { padding: 8px 10px; }
.retailer-head .logo-text { font-size: 34px; }

/* Pasek zajmuje oba wiersze; nadmiar wysokości (gdy pasek jest dłuższy niż gazetki) idzie do wiersza z „O sieci”,
   więc boks stoi tuż pod gazetkami. Półka ma tu 3 kolumny zamiast 4, bo pasek zabiera szerokość. */
.retailer-layout { display: grid; gap: 40px; }
.retailer-layout.has-shops {
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-rows: auto 1fr;
  grid-template-areas: "main aside" "about aside";
  align-items: start;
}
.retailer-layout.has-shops .rack { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Obszary tylko w układzie z paskiem; bez sklepów gazetki i „O sieci” idą po prostu jedno pod drugim. */
.retailer-layout.has-shops .retailer-main { grid-area: main; }
.retailer-layout.has-shops .retailer-aside { grid-area: aside; }
.retailer-layout.has-shops .about { grid-area: about; }
.retailer-aside { display: grid; gap: 14px; }

.retailer-aside .shops-more-title { margin: 10px 0 0; font-size: 17px; }
/* Wysokość z treści: przy dłuższej nazwie sieci tekst zawija się w dwa wiersze i zostaje w przycisku. */
.retailer-aside .shops-all { width: 100%; height: auto; min-height: 48px; margin-top: 4px; padding: 10px 16px; text-align: center; }

.about { padding: 26px; border-radius: 22px; background: var(--paper); border: 1px solid var(--line); }
.about-head { display: flex; align-items: center; gap: 14px; }
.about-head .logo { flex-shrink: 0; }
.about-head h2 { font: 750 22px/1.2 var(--font-display); letter-spacing: -.02em; text-wrap: balance; }
.about-head p { margin-top: 4px; font-size: 14px; color: var(--muted); }

.shops-more-title { margin: 32px 0 14px; font: 750 20px/1.2 var(--font-display); letter-spacing: -.02em; }
.shop-location { margin-top: 8px; color: var(--muted); }

/* Najbliższy sklep: mapa po lewej, dane po prawej */
.shop-main { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); border-radius: 22px; background: var(--paper); border: 1px solid var(--line); overflow: hidden; }
.shop-main.no-map { grid-template-columns: minmax(0, 1fr); }
.shop-map { min-height: 380px; background: #e7ece8; }
.shop-map iframe { display: block; width: 100%; height: 100%; min-height: 380px; border: 0; }
.shop-info { display: grid; align-content: start; gap: 16px; padding: 26px; }
.shop-head h3 { font: 750 24px/1.2 var(--font-display); letter-spacing: -.02em; }
.shop-address { margin-top: 4px; color: var(--muted); }
.shop-meta { margin-top: 6px; font-size: 14px; color: var(--muted); }
.shop-meta b { color: var(--ink); font-weight: 650; }
.shop-meta .text-link { font-weight: 500; }
.shop-status { font-size: 14px; font-weight: 700; }
.shop-status.is-open { color: var(--green); }
.shop-status.is-closed { color: var(--red); }
.shop-hours { width: 100%; border-collapse: collapse; font-size: 14px; }
.shop-hours th, .shop-hours td { padding: 6px 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.shop-hours th { font-weight: 500; }
.shop-hours td { text-align: right; font-variant-numeric: tabular-nums; }
.shop-hours small { color: var(--muted); font-size: 12px; }
.shop-hours td small { display: block; }
.shop-hours .is-today th, .shop-hours .is-today td { font-weight: 700; }
.shop-hours .is-special td { color: var(--green-ink); }
.shop-note, .shop-phone { font-size: 14px; color: var(--muted); }
.shop-phone a { color: var(--ink); font-weight: 650; }
.shop-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.shop-actions .btn { height: 46px; padding: 0 20px; }

/* Kolejne sklepy: małe kafelki bez mapy */
.shop-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.shop-tile { display: grid; align-content: start; gap: 6px; padding: 18px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); }
.shop-tile-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.shop-tile h3 { font: 750 17px/1.25 var(--font-display); letter-spacing: -.02em; }
.shop-head h3 a:hover, .shop-tile h3 a:hover { color: var(--green-ink); text-decoration: underline; text-underline-offset: 3px; }
.shop-distance { flex-shrink: 0; font-size: 13px; font-weight: 700; color: var(--green-ink); }
.shop-tile .shop-address { margin-top: 0; font-size: 14px; }
.shop-today { font-size: 14px; }
.shop-tile .text-link { justify-self: start; margin-top: 4px; font-size: 14px; }

/* Sklepy w wąskim pasku: mapa nad danymi, kafelki jeden pod drugim */
.retailer-aside .shop-main { grid-template-columns: minmax(0, 1fr); border-radius: 18px; }
.retailer-aside .shop-map, .retailer-aside .shop-map iframe { min-height: 220px; }
.retailer-aside .shop-info { gap: 12px; padding: 18px; }
.retailer-aside .shop-head h3 { font-size: 19px; }
.retailer-aside .shop-actions .btn { flex: 1; height: 42px; padding: 0 12px; font-size: 14px; white-space: nowrap; }
.retailer-aside .shop-tiles { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.retailer-aside .shop-tile { padding: 14px 16px; border-radius: 16px; }

/* Lista miejscowości z liczbą sklepów */
.shop-cities { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 16px; }
.shop-cities a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.shop-cities a:hover, .shop-cities a[aria-current] { color: var(--green-ink); font-weight: 650; }
.shop-cities small { color: var(--muted); }

@media (max-width: 1180px) {
  .retailer-layout.has-shops { grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; }
  .retailer-layout.has-shops .rack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Na telefonie i tablecie jedna kolumna: gazetki, sklepy, „O sieci”. */
@media (max-width: 900px) {
  .retailer-layout.has-shops { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "main" "aside" "about"; }
  .retailer-layout.has-shops .rack { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shop-main { grid-template-columns: minmax(0, 1fr); }
  .shop-map, .shop-map iframe { min-height: 260px; }
}

@media (max-width: 640px) {
  .retailer-head { gap: 14px; }
  .retailer-head .logo { width: 88px; height: 60px; border-radius: 13px; }
  .retailer-head .logo img { padding: 6px 8px; }
  .retailer-layout.has-shops .rack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about, .shop-info { padding: 18px; }
  .shop-head h3 { font-size: 20px; }
  .shop-actions .btn { flex: 1; padding: 0 12px; font-size: 15px; white-space: nowrap; }
}

/* ---------- Strona sklepu (/sklep/{sieć}/{id}-{slug}) ---------- */
.store-alert { margin-bottom: 20px; padding: 16px 20px; border-radius: 16px; background: #fdecea; color: #7a1e12; font-weight: 600; }
.store-head { align-items: center; }
.store-head .retailer-head > a { flex-shrink: 0; }
.store-head-address { display: flex; align-items: flex-start; gap: 6px; }
.store-head-address .ico { flex-shrink: 0; width: 16px; height: 16px; margin-top: 3px; color: var(--green); }
.store-format { display: inline-block; margin-top: 8px; padding: 2px 10px; border-radius: 999px; background: var(--mint); color: var(--green-ink); font-size: 13px; font-weight: 650; }
.store-head .shop-status { margin-top: 6px; }
.store-head-actions { display: flex; flex-wrap: wrap; gap: 10px; flex-shrink: 0; }
.store-head-actions .btn { height: auto; min-height: 48px; padding: 8px 20px; line-height: 1.2; text-align: center; }

/* Po lewej mapa (1. wiersz), pod nią usługi, otoczenie i gazetki (2. wiersz); po prawej przez oba wiersze godziny,
   kontakt i sklepy tej sieci w okolicy. Drugi wiersz 1fr: gdy prawa kolumna jest wyższa, dodatkowe miejsce idzie
   tam, a nie pod mapę. Bez mapy lewa treść zajmuje oba wiersze. */
.store-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: auto 1fr; gap: 20px 40px; align-items: start; }
.store-map-wrap, .store-main, .store-side { display: grid; gap: 20px; }
.store-map-wrap { grid-column: 1; grid-row: 1; }
.store-main { grid-column: 1; grid-row: 2; }
.store-layout:not(.has-map) .store-main { grid-row: 1 / span 2; }
.store-side { grid-column: 2; grid-row: 1 / span 2; }
.store-map { overflow: hidden; border-radius: 22px; border: 1px solid var(--line); background: #e7ece8; }
.store-map iframe { display: block; width: 100%; height: 420px; border: 0; }
.map-source { margin: -12px 0 0; font-size: 13px; }
.store-cards { display: grid; gap: 20px; align-items: start; }
.store-card { display: grid; align-content: start; gap: 14px; padding: 24px; border-radius: 22px; background: var(--paper); border: 1px solid var(--line); }
.store-card h2, .store-aside h2, .store-section-head h2 { font: 750 20px/1.2 var(--font-display); letter-spacing: -.02em; }
.store-subtitle { margin-top: 4px; font-size: 13px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }

.store-facts { display: grid; gap: 12px; font-size: 15px; }
.store-facts div { display: grid; gap: 2px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.store-facts div:last-child { padding-bottom: 0; border-bottom: 0; }
.store-facts dt { font-size: 13px; color: var(--muted); }
.store-facts dd { margin: 0; font-weight: 600; }
.store-facts dd a[href^="tel:"] { color: var(--ink); }

.store-amenities { display: grid; gap: 18px; }
.store-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.store-chips li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--page); font-size: 14px; }
.store-chips .ico { width: 14px; height: 14px; color: var(--green); }

/* Otoczenie sklepu (paczkomaty, ładowarki EV) */
.poi-group { margin-top: 12px; font-size: 15px; font-weight: 700; }
.poi-list { display: grid; }
.poi { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.poi:first-child { padding-top: 8px; border-top: 0; }
.poi > .ico { width: 22px; height: 22px; margin-top: 1px; color: var(--green); }
.poi-body { display: grid; gap: 2px; font-size: 14px; }
.poi-title b { font-size: 15px; }
.poi-code { margin-left: 4px; padding: 1px 6px; border-radius: 6px; background: var(--page); font-size: 13px; font-weight: 600; }
.poi-place, .poi-facts { color: var(--muted); }
.poi-closure { color: var(--red); font-weight: 600; }
.poi-side { display: grid; justify-items: end; align-content: start; gap: 4px; font-size: 14px; }
.poi-side b { color: var(--green-ink); white-space: nowrap; }

.store-intro { color: var(--muted); max-width: 75ch; }
.store-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 16px; }
.store-section-head p { color: var(--muted); font-size: 14px; }
.store-leaflets { margin-top: 12px; }
.store-leaflets .rack { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.store-aside { display: grid; gap: 12px; padding: 22px; border-radius: 22px; background: var(--paper); border: 1px solid var(--line); }
.store-aside-note { margin-top: -6px; font-size: 14px; color: var(--muted); }
.store-list-item { display: grid; gap: 2px; padding: 12px 0; border-top: 1px solid var(--line); }
.store-list-item a { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-weight: 650; }
.store-list-item a:hover .store-list-name { color: var(--green-ink); text-decoration: underline; text-underline-offset: 3px; }
.store-list-city { font-size: 13px; color: var(--muted); }
.store-list-item .shop-status { font-size: 13px; }
.store-aside-links { display: grid; gap: 12px; margin-top: 4px; }
.store-aside-links .btn { height: auto; min-height: 46px; padding: 10px 16px; text-align: center; }
.store-aside-links .text-link { justify-self: center; font-size: 14px; }

/* Inne sieci w okolicy: kafelek na sieć z najbliższym sklepem */
.store-others { margin-top: 48px; }
.chain-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.chain-tile { display: grid; align-content: start; gap: 12px; padding: 18px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); }
.chain-tile-head { display: flex; align-items: center; gap: 12px; }
.chain-tile-head .logo { flex-shrink: 0; width: 62px; height: 46px; border: 1px solid var(--line); border-radius: 11px; }
.chain-tile-head .logo img { padding: 6px 8px; }
.chain-tile h3 { font: 750 17px/1.25 var(--font-display); letter-spacing: -.02em; }
.chain-tile h3 a:hover { color: var(--green-ink); text-decoration: underline; text-underline-offset: 3px; }
.chain-tile-head p { font-size: 13px; color: var(--muted); }
.chain-tile-store { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.chain-tile-store b { flex-shrink: 0; color: var(--green-ink); }
.chain-tile .text-link { justify-self: start; font-size: 14px; }

@media (max-width: 1180px) {
  .store-layout { grid-template-columns: minmax(0, 1fr) 320px; column-gap: 28px; }
}

@media (max-width: 900px) {
  /* Jedna kolumna w kolejności z HTML: mapa, godziny i kontakt, inne sklepy sieci, usługi, otoczenie, gazetki. */
  .store-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .store-map-wrap, .store-main, .store-layout:not(.has-map) .store-main, .store-side { grid-column: auto; grid-row: auto; }
  .store-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .store-map iframe { height: 320px; }
}

@media (max-width: 640px) {
  /* Logo nad nazwą: długa nazwa sklepu ma całą szerokość ekranu. */
  .store-head .retailer-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .store-head-actions { width: 100%; }
  .store-head-actions .btn { flex: 1; padding: 8px 12px; font-size: 15px; }
  .store-chips li { font-size: 13px; }
  /* Inne sieci: zwarte wiersze zamiast wysokich kafelków (w mieście bywa ich ponad 20). Link do gazetki jest też
     na stronie sklepu, do której prowadzi nazwa sieci. */
  .chain-tiles { gap: 8px; }
  .chain-tile { gap: 6px; padding: 12px 14px; border-radius: 14px; }
  .chain-tile-head .logo { width: 48px; height: 36px; border-radius: 9px; }
  .chain-tile-head .logo img { padding: 4px 6px; }
  .chain-tile .text-link { display: none; }
  .store-cards { grid-template-columns: minmax(0, 1fr); }
  .store-card, .store-aside { padding: 18px; }
  .store-map iframe { height: 260px; }
  .store-leaflets .rack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
