/* ==========================================================================
   GrillWeb – strona główna
   Makieta „SG - 1440 - High Content” (desktop 1920, kontener 1760 px, marginesy 80 px).
   Korzysta z tokens.css i main.css (nagłówek, stopka, flagi, przyciski, licznik, product box).
   ========================================================================== */

.home-section { display: flex; flex-direction: column; gap: var(--sp-16); padding-block: var(--sp-40); }
.home-h2 { font-size: var(--hs-l); font-weight: 600; line-height: 1; }
.home-head { display: flex; flex-direction: column; align-items: flex-start; }
.home-head .home-h2 { line-height: 34px; }

.more {
  display: inline-flex; align-items: center; gap: var(--sp-4);
  font-size: var(--fs-base); color: var(--txt-main); text-decoration: none;
}
.more:hover { text-decoration: underline; }
.more img { width: 24px; height: 24px; flex: none; }

/* Przycisk CTA na hero i banerach (makieta: bg-color/brand, radius 4, 16 px semibold) */
.cta {
  display: inline-flex; align-items: center; align-self: flex-start;
  padding: var(--sp-12) var(--sp-24); border-radius: var(--radius-4);
  background: var(--bg-brand); color: var(--txt-inverse);
  font-size: var(--fs-m); font-weight: 600; text-decoration: none; white-space: nowrap;
}
.cta:hover { background: var(--btn-primary-bg-hover); }

/* ---------- Hero ---------- */
.hero { padding-top: var(--sp-20); }
.hero__slide { position: relative; height: 500px; border-radius: var(--radius-4); overflow: hidden; background: #2b3a22; }
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 5%; }
.hero__slide::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: min(820px, 100%); z-index: 1;
  background: linear-gradient(to right, rgba(0,0,0,.65), rgba(0,0,0,0));
}
.hero__content {
  position: absolute; z-index: 2; left: 120px; top: 13.9%;
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-24);
  color: var(--txt-inverse); max-width: calc(100% - 240px);
}
.hero__tag { background: rgba(0,0,0,.85); border-radius: var(--radius-4); padding: var(--sp-6) var(--sp-12); font-size: 13px; font-weight: 700; letter-spacing: .52px; }
.hero__title { font-size: 56px; font-weight: 800; line-height: 1.1; }
.hero__lead { font-size: var(--hs-s); }
.hero__arrow {
  position: absolute; z-index: 3; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; display: grid; place-items: center; padding: 0; cursor: pointer;
  background: rgba(255,255,255,.8); border: 1px solid rgba(232,232,232,.4); border-radius: var(--radius-4);
}
.hero__arrow:hover { background: #fff; }
.hero__arrow--prev { left: 21px; }
.hero__arrow--next { right: 12px; }
.hero__pause {
  position: absolute; z-index: 3; right: 24px; bottom: 24px; width: 24px; height: 24px; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: var(--radius-4); background: #fff; cursor: pointer;
}
.hero__pause[aria-pressed="true"] { outline: 2px solid var(--gw-500); }

/* ---------- Kategorie ---------- */
.cats { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--sp-12); }
.cats li { flex: 1 1 0; min-width: 0; display: flex; }
.cat {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-12);
  min-height: 163px; padding: var(--sp-24) var(--sp-4); border-radius: 12px; background: var(--bg-main);
  font-size: var(--fs-m); font-weight: 600; text-align: center; text-decoration: none; color: var(--txt-main);
  transition: box-shadow .15s ease;
}
.cat:hover { box-shadow: 0 0 0 1px var(--border-main); }
.cat img { flex: none; }

/* ---------- Product box (wariant z ceną promocyjną) ---------- */
.products-wrap { position: relative; }
.products {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 5 * var(--sp-12)) / 6);
  gap: var(--sp-12); overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
}
.products::-webkit-scrollbar { display: none; }
.products > * { scroll-snap-align: start; }
.products .pbox { position: relative; min-height: 0; padding: var(--sp-12) var(--sp-12) var(--sp-16); justify-content: flex-start; }
.pbox__media { display: flex; flex-direction: column; justify-content: space-between; }
.pbox__img-link { position: absolute; inset: 0; }
.pbox__img-link img { width: 100%; height: 100%; object-fit: contain; }
.pbox__flags { position: relative; display: flex; justify-content: space-between; align-items: flex-start; }
.pbox__flags .pbox__fav { position: static; }
.pbox__disc { position: relative; align-self: flex-start; height: auto; padding: var(--sp-4) var(--sp-8); }
.pbox__info { display: flex; flex-direction: column; gap: var(--sp-2); }
.pbox__info .pbox__name { font-size: var(--fs-base); line-height: normal; min-height: 34px; }
.pbox__prices { display: flex; flex-direction: column; gap: var(--sp-6); }
.pbox__price-row { display: flex; align-items: center; gap: var(--sp-6); white-space: nowrap; }
.pbox__now { font-size: var(--fs-l); font-weight: 600; color: var(--txt-promotion); }
.pbox__old { font-size: var(--fs-s); color: var(--txt-alt); text-decoration: line-through; }
.pbox__omnibus { display: flex; align-items: center; gap: var(--sp-4); font-size: var(--fs-s); color: var(--txt-alt); }
.pbox__omnibus img, .pbox__ship .info-tip img { width: 16px; height: 16px; }
.pbox__ship .info-tip { display: inline-flex; cursor: help; }
.pbox__ship { white-space: nowrap; }

.products__arrow {
  position: absolute; z-index: 2; top: 204px; right: -30px;
  width: 48px; height: 48px; display: grid; place-items: center; padding: 0; cursor: pointer;
  background: rgba(255,255,255,.8); border: 1px solid rgba(232,232,232,.4); border-radius: var(--radius-4);
}
.products__arrow--prev { right: auto; left: -30px; }
.products__arrow:disabled { display: none; }

/* ---------- Banery ---------- */
.banners { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-20); padding-block: var(--sp-40); }
.banner { position: relative; height: 400px; border-radius: var(--radius-4); overflow: hidden; background: var(--bg-body); color: var(--txt-inverse); text-decoration: none; }
.banner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.banner:hover > img { transform: scale(1.02); }
.banner::after { content: ""; position: absolute; inset: auto 0 0; height: 240px; background: linear-gradient(to top, rgba(0,0,0,.7), rgba(0,0,0,0)); }
.banner__content { position: absolute; z-index: 1; left: 40px; right: 40px; bottom: 40px; display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-8); }
.banner__kicker { font-size: 13px; font-weight: 700; letter-spacing: .78px; }
.banner__title { font-size: 34px; font-weight: 800; }
.banner__lead { font-size: 17px; margin-bottom: var(--sp-8); }
.banner:hover .cta { background: var(--btn-primary-bg-hover); }

/* ---------- Marki ---------- */
.brands { background: var(--bg-main); }
.brands .home-section { gap: var(--sp-20); }
.brands__list { list-style: none; margin: 0; padding: 0; display: flex; justify-content: space-between; gap: var(--sp-24); }
.brands__list a { display: grid; place-items: center; width: 202px; height: 64px; }
.brands__list img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }

/* ---------- Akademia (blog) ---------- */
.posts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-16); }

/* ---------- SEO ---------- */
.seo { background: var(--bg-main); opacity: .8; }
.seo__inner { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-16); padding-block: var(--sp-40); }
.seo__text { display: flex; flex-direction: column; gap: var(--sp-16); }
.seo__block { display: flex; flex-direction: column; gap: var(--sp-6); font-size: var(--fs-s); }
.seo__block h2, .seo__block h3 { font-size: var(--fs-l); font-weight: 600; }
.seo__block p + p { margin-top: 14px; }
.seo__block strong { font-weight: 700; }
.seo__block ul { margin: 0; padding-left: 18px; }
.seo__more { display: inline-flex; align-items: center; gap: var(--sp-4); border: 0; background: none; padding: 0; cursor: pointer; font-size: var(--fs-s); }
.seo__more[aria-expanded="true"] img { transform: rotate(180deg); }

/* ==========================================================================
   Responsywność strony głównej
   ========================================================================== */
@media (max-width: 1600px) {
  .products { grid-auto-columns: calc((100% - 4 * var(--sp-12)) / 5); }
}
@media (max-width: 1440px) {
  .products { grid-auto-columns: calc((100% - 3 * var(--sp-12)) / 4); }
  .hero__content { left: 96px; }
}
@media (max-width: 1100px) {
  .products { grid-auto-columns: calc((100% - 2 * var(--sp-12)) / 3); }
  .cats { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .cats::-webkit-scrollbar { display: none; }
  .cats li { flex: 0 0 160px; scroll-snap-align: start; }
  .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero__slide { height: 440px; }
  .hero__title { font-size: 44px; }
  .hero__lead { font-size: var(--fs-l); }
  .banner__title { font-size: 28px; }
  .brands__list a { width: auto; flex: 1; }
}
@media (max-width: 900px) {
  .banners { grid-template-columns: 1fr; }
  .products__arrow { display: none; }
}
@media (max-width: 768px) {
  .products { grid-auto-columns: calc((100% - var(--sp-12)) / 2.2); }
  .home-section, .banners { padding-block: var(--sp-24); }
  .home-h2 { font-size: 22px; }
  .hero { padding: 0; }                       /* baner od krawędzi do krawędzi */
  .hero__slide { border-radius: 0; }
  .hero__slide { height: 420px; }
  .hero__img { object-position: 70% 5%; }
  .hero__slide::before { width: 100%; background: linear-gradient(to top, rgba(0,0,0,.75) 20%, rgba(0,0,0,0) 75%); }
  .hero__content { left: 20px; right: 20px; top: auto; bottom: 24px; max-width: none; gap: var(--sp-12); }
  .hero__title { font-size: 32px; }
  .hero__lead { font-size: var(--fs-m); }
  .hero__tag { font-size: 11px; }
  .hero__arrow { display: none; }
  .hero__pause { bottom: 24px; right: 20px; }
  .banner { height: 320px; }
  .banner__content { left: 20px; right: 20px; bottom: 20px; }
  .banner__title { font-size: 24px; }
  .banner__lead { font-size: var(--fs-base); }
  .brands__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brands__list a { width: 100%; }
  .seo__inner { padding-block: var(--sp-24); }
  .seo__text:not(.is-expanded) { max-height: 220px; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent); mask-image: linear-gradient(to bottom, #000 70%, transparent); }
}
@media (max-width: 600px) {
  .products { grid-auto-columns: 72%; }
  .posts { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .posts::-webkit-scrollbar { display: none; }
  .posts > li { scroll-snap-align: start; }
  .cats li { flex-basis: 132px; }
  .cat { min-height: 140px; font-size: var(--fs-base); }
  .cat img { width: auto; max-width: 64px; height: auto; max-height: 64px; }
}
@media (min-width: 769px) {
  .seo__more { display: none; }   /* na desktopie cały tekst jest widoczny – jak w makiecie */
}
