/* =========================================================================
 * HBT 9.0 — system wyglądu (PODGLĄD: tylko body.hbt-v9, core/v9-preview.php)
 * -------------------------------------------------------------------------
 * Spis 28.10 (7 stron, 1440 px): 26 wariantów przycisku (wysokość 30–52,
 * promień 0/6/8/10/20/999, pismo 11–16 px, napis biały ALBO czarny na tej
 * samej zieleni), H1 48 i 32 px, pola z promieniem 0/6/10/999.
 *
 * Zasady 9.0:
 *   kolor   — zieleń jako TŁO z ciemnym napisem; zieleń jako TEKST tylko #3f6e1a
 *   pismo   — 12 / 13 / 14 / 16 / 20 / 24 / 32 (36 desktop H1)
 *   promień — 6 (małe), 10 (przyciski, pola, karty), 999 (pigułki)
 *   cień    — s / m / l
 *   przycisk— główny (zielony), drugi (obrys), ciemny; wysokość 44, duży 48
 *
 * Wszystko w @layer hbt-tokeny: ważna deklaracja w tej warstwie bije łatki 8.x
 * spoza warstwy (patrz v89-polish.css §13). Selektory z body.hbt-v9, więc bez
 * klasy (klienci) nic się nie zmienia.
 * ========================================================================= */

@layer hbt-tokeny {

  html body.hbt-v9 {
    --v9-g900: #2c4f12;
    --v9-g700: #3f6e1a;   /* zieleń tekstu i linków — 6,4:1 na białym */
    --v9-g500: #6aa32f;   /* hover tła przycisku */
    --v9-g400: #7cb342;   /* zieleń marki — tylko tło, napis ciemny 8,5:1 */
    --v9-g100: #eef5e4;
    --v9-ink: #1a1714;
    --v9-ink2: #45413c;
    --v9-mute: #6b6b66;   /* jedyna szarość tekstu pomocniczego — 5,3:1 */
    --v9-line: #e3e2dc;
    --v9-line2: #cfcdc5;
    --v9-bg: #f6f6f2;
    --v9-r-s: 6px; --v9-r: 10px; --v9-r-pill: 999px;
    --v9-sh-s: 0 1px 2px rgb(26 23 20 / .06), 0 1px 1px rgb(26 23 20 / .04);
    --v9-sh-m: 0 4px 14px rgb(26 23 20 / .08);
    --v9-sh-l: 0 12px 32px rgb(26 23 20 / .12);
  }

  /* ── Nagłówki: jedna skala ─────────────────────────────────────────── */
  html body.hbt-v9 h1:not(#zz) { font-size: 32px !important; line-height: 1.15 !important; font-weight: 700 !important; letter-spacing: -.01em !important; text-wrap: balance; }
  html body.hbt-v9 .hbt-hero-slide h2:not(#zz), html body.hbt-v9 .hbt-hero-slide .hbt-hero-title:not(#zz) { font-size: 36px !important; }
  html body.hbt-v9 main h2:not(#zz), html body.hbt-v9 .site-main h2:not(#zz), html body.hbt-v9 #mainContent h2:not(#zz) { font-size: 24px !important; line-height: 1.2 !important; font-weight: 700 !important; text-wrap: balance; }
  @media (min-width: 1024px) { html body.hbt-v9 h1:not(#zz) { font-size: 36px !important; } }
  @media (max-width: 767.98px) {
    html body.hbt-v9 h1:not(#zz) { font-size: 26px !important; }
    html body.hbt-v9 main h2:not(#zz), html body.hbt-v9 .site-main h2:not(#zz), html body.hbt-v9 #mainContent h2:not(#zz) { font-size: 20px !important; }
    html body.hbt-v9 .hbt-hero-slide h2:not(#zz), html body.hbt-v9 .hbt-hero-slide .hbt-hero-title:not(#zz) { font-size: 24px !important; }
  }

  /* ── Przycisk główny: zielone tło, ciemny napis, 44 px, promień 10 ──── */
  html body.hbt-v9 :is(
      a.button, button.button, input[type=submit].button, .woocommerce-button,
      .hbt-loop-card__btn, .single_add_to_cart_button, .checkout-button,
      .about-btn, .btn-primary-contact, .hbt-map-click__show, .wpcf7-submit,
      .hbt-price-apply, .hbt-blog-loadmore-btn, .hbt-btn-primary, #place_order
    ):not(.alt-secondary):not(#zz) {
    min-height: 44px !important; height: auto !important;
    border-radius: var(--v9-r) !important;
    background: var(--v9-g400) !important; border: 1px solid var(--v9-g400) !important;
    color: var(--v9-ink) !important;
    font-size: 14px !important; font-weight: 600 !important; letter-spacing: 0 !important; text-transform: none !important;
    box-shadow: none !important;
  }
  html body.hbt-v9 :is(
      a.button, button.button, .woocommerce-button, .hbt-loop-card__btn, .single_add_to_cart_button, .checkout-button,
      .about-btn, .btn-primary-contact, .hbt-map-click__show, .wpcf7-submit, .hbt-price-apply, .hbt-blog-loadmore-btn, .hbt-btn-primary, #place_order
    ):not(#zz) :is(i, svg, span) { color: inherit !important; }
  html body.hbt-v9 :is(a.button, button.button, .woocommerce-button, .hbt-loop-card__btn, .single_add_to_cart_button, .checkout-button, .about-btn, .btn-primary-contact, .hbt-map-click__show, .wpcf7-submit, .hbt-price-apply, .hbt-blog-loadmore-btn, .hbt-btn-primary, #place_order):not(#zz):hover {
    background: var(--v9-g500) !important; border-color: var(--v9-g500) !important; color: var(--v9-ink) !important;
  }
  /* duży wariant: główne wezwania do zakupu */
  html body.hbt-v9 :is(.single_add_to_cart_button, .checkout-button, #place_order, .btn-primary-contact):not(#zz) { min-height: 48px !important; font-size: 15px !important; }

  /* ── Przycisk drugi: białe tło, obrys, ciemny napis ──────────────────── */
  html body.hbt-v9 :is(.sp-inquiry-btn, .sp-negotiate-btn, .blog-all-btn, .hbt-brands-more, .mm-brands-more, .sp-wishlist-btn, .hbt-fd-toggle):not(#zz) {
    min-height: 40px !important; height: auto !important;
    border-radius: var(--v9-r) !important;
    background: #fff !important; border: 1px solid var(--v9-line2) !important;
    color: var(--v9-ink) !important; font-size: 13px !important; font-weight: 600 !important;
  }
  html body.hbt-v9 :is(.sp-inquiry-btn, .sp-negotiate-btn, .blog-all-btn, .hbt-brands-more, .mm-brands-more, .sp-wishlist-btn, .hbt-fd-toggle):not(#zz):hover {
    border-color: var(--v9-g700) !important; color: var(--v9-g700) !important; background: var(--v9-g100) !important;
  }

  /* ── Przycisk ciemny (na zdjęciach / banerach) ───────────────────────── */
  html body.hbt-v9 :is(.hbt-hero-btn):not(#zz) { min-height: 44px !important; border-radius: var(--v9-r) !important; font-size: 14px !important; font-weight: 600 !important; }

  /* ── Pola formularzy: 44 px, promień 10, jeden obrys, wyraźny fokus ──── */
  html body.hbt-v9 :is(input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=search], select, textarea):not(.hbt-range):not(#zz) {
    min-height: 44px !important; border-radius: var(--v9-r) !important;
    border: 1px solid var(--v9-line2) !important; background-color: #fff !important; color: var(--v9-ink) !important;
  }
  html body.hbt-v9 textarea:not(#zz) { min-height: 120px !important; }
  html body.hbt-v9 :is(input, select, textarea):not(#zz):focus { border-color: var(--v9-g700) !important; outline: 2px solid var(--v9-g100) !important; outline-offset: 0 !important; }
  /* Wyszukiwarka w nagłówku: JEDNA ramka (formularz, r10), pole bez własnego obrysu,
   * przycisk z promieniem wewnętrznym 9 px (10 − 1 px ramki). Było: 12 / 10 / 8 px i podwójny obrys. */
  html body.hbt-v9 form.site-search:not(#zz) { border-radius: var(--v9-r) !important; border: 1px solid var(--v9-line2) !important; overflow: hidden !important; }
  html body.hbt-v9 form.site-search:not(#zz):focus-within { border-color: var(--v9-g700) !important; box-shadow: 0 0 0 3px var(--v9-g100) !important; }
  html body.hbt-v9 form.site-search .search-input:not(#zz) { border: 0 !important; border-radius: 0 !important; outline: 0 !important; background: transparent !important; box-shadow: none !important; }
  html body.hbt-v9 form.site-search .search-submit:not(#zz) { border-radius: 0 9px 9px 0 !important; }

  /* ── Karty: jeden promień, jedna linia, jeden cień ───────────────────── */
  html body.hbt-v9 :is(.hbt-loop-card, .sp-price-block, .contact-tile, .offer-card, .blog-card, .hbt-subcat-card):not(#zz) {
    border-radius: var(--v9-r) !important; border: 1px solid var(--v9-line) !important; box-shadow: var(--v9-sh-s) !important;
  }
  html body.hbt-v9 :is(.hbt-loop-card, .offer-card, .blog-card, .hbt-subcat-card):not(#zz):hover { box-shadow: var(--v9-sh-m) !important; }

  /* ── Tekst: jedna szarość pomocnicza, zieleń tekstu tylko #3f6e1a ───── */
  html body.hbt-v9 :is(.hbt-pc__net, .hbt-pc__omni, .hbt-pc__u, .woocommerce-result-count, .subcat-count, .hbt-subcat-count, .chip-count, .sp-price-net, .blog-meta, .entry-meta):not(#zz) { color: var(--v9-mute) !important; }
  html body.hbt-v9 :is(.entry-content, .hbt-seo-content, .woocommerce-product-details__short-description, .term-description) a:not(.button):not(#zz) { color: var(--v9-g700) !important; text-decoration: underline !important; text-underline-offset: 2px; }

  /* ── Pigułki (chipy kategorii, filtry): promień 999, 36 px ──────────── */
  html body.hbt-v9 :is(.hbt-cat-chip, .hbt-chip):not(#zz) { border-radius: var(--v9-r-pill) !important; min-height: 36px !important; }

  /* ── Dostępność: zieleń tekstu tylko ciemna ─────────────────────────── */
  html body.hbt-v9 .hbt-single-product .sp-avail.in-stock:not(#zz), html body.hbt-v9 .hbt-single-product .sp-avail.in-stock:not(#zz) * { color: var(--v9-g700) !important; }
  html body.hbt-v9 .hbt-single-product .sp-avail.in-stock:not(#zz) { background: var(--v9-g100) !important; border-radius: var(--v9-r) !important; }
  /* aktywny chip kategorii: liczba w kolorze napisu, nie szara na zieleni */
  html body.hbt-v9 :is(.hbt-cat-chip.active, .hbt-cat-chip.is-active, .hbt-cat-chip[aria-current]) .chip-count:not(#zz) { color: inherit !important; opacity: .85 !important; }
  html body.hbt-v9 .hbt-cat-chip.active:not(#zz) { background: var(--v9-g400) !important; border-color: var(--v9-g400) !important; color: var(--v9-ink) !important; }

  /* Karta na wąskim telefonie (2 kolumny po ~160 px): 14 px ucinało „Dowiedz się więcej” przy 360 px. */
  @media (max-width: 479.98px) {
    html body.hbt-v9 .hbt-loop-card .hbt-loop-card__btn:not(#zz) { font-size: 12px !important; padding-left: 8px !important; padding-right: 8px !important; gap: 6px !important; white-space: normal !important; line-height: 1.2 !important; }
  }
}
