/* ELLIE V81 FIXES — 2026-07-01
   Zbiorcze poprawki z raportu mobile/desktop klientki.
   Dotyczy: M1 logo, M2 kafelki, M5 instagram, M6b footer, M8 siatka, M9 serduszko, D1/D2 desktop
   ─────────────────────────────────────────────────────── */


/* ══ GLOBAL: Białe tło body (override generatedcss1.css — body{background:rgb(255,248,248)}) ══ */
body {
  background-color: #fff !important;
}


/* ══ M9: Ukryj ikonę Favourites/Ulubione z dolnego paska ══ */
li.el-favorites_single {
  display: none !important;
}


/* ══ M1: Logo ELLIE — klikalne na mobile ══
   Problem: kolumna ikon (position:absolute, z-index:5) może przechwytywać
   zdarzenia nad obszarem logo. Wymuszamy pointer-events:auto na logo
   i ustawiamy minimalny touch target 44×44px (wytyczne Apple/WCAG). */
@media (max-width: 767px) {
  body:not(#checkout) header#header .elementor-widget-pklogo {
    pointer-events: auto !important;
    position: relative !important;
    z-index: 20 !important;
  }
  body:not(#checkout) header#header .elementor-widget-pklogo a,
  body:not(#checkout) header#header .elementor-widget-pklogo .logo,
  body:not(#checkout) header#header .elementor-widget-pklogo .pk-logo {
    pointer-events: auto !important;
    display: flex !important;
    align-items: center !important;
    min-height: 44px !important;
    min-width: 80px !important;
    position: relative !important;
  }
  /* Kolumna ikon: wyłącz pointer-events na samym wrapper,
     włącz tylko na potomkach (ikony nadal klikalne) */
  body:not(#checkout) header#header .elementor-element-57a05491 {
    pointer-events: none !important;
  }
  body:not(#checkout) header#header .elementor-element-57a05491 a,
  body:not(#checkout) header#header .elementor-element-57a05491 button,
  body:not(#checkout) header#header .elementor-element-57a05491 .elementor-widget {
    pointer-events: auto !important;
  }
}


/* ══ M2: Kafelki kategorii na mobile ══
   Kafelki ustawiają się zbyt duże i z szarym filtrem.
   Wymuszamy pełną szerokość i naturalne wymiary obrazka.
   UWAGA: NIE nadpisujemy position — Alysum używa padding-top+position:absolute trick. */
@media (max-width: 767px) {
  .category-miniature {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    margin-bottom: 16px !important;
  }
  .category-miniature img {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    filter: none !important;
  }
}


/* ══ M4: Czarne kwadraty miniatur produktów (homepage + listing) ══
   thumbnail-container może mieć background:#000 z motywu Alysum.
   Resetujemy tło — NIE nadpisujemy position (Alysum używa position:absolute na img). */
@media (max-width: 767px) {
  .product-miniature .thumbnail-container,
  .js-product-miniature .thumbnail-container,
  .product-miniature .product-thumbnail,
  .js-product-miniature .product-thumbnail {
    background: transparent !important;
    background-color: transparent !important;
  }
  body#index .product-miniature .thumbnail-container,
  body#index .product-miniature .product-thumbnail {
    background: transparent !important;
    background-color: transparent !important;
  }
  body#index .product-miniature img,
  body#index .js-product-miniature img {
    opacity: 1 !important;
    visibility: visible !important;
  }
}


/* ══ M5: Sekcja Instagram — litery zachodzą na siebie ══
   Dwie kolumny Elementora obok siebie nie zawijają się na wąskim ekranie.
   Wymuszamy układ pionowy i naturalne zawijanie tekstu. */
@media (max-width: 767px) {
  .pkinstagram-container,
  .instagram-section {
    position: relative !important;
    overflow: visible !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .pkinstagram-container p,
  .instagram-section p,
  .pkinstagram-container ~ p,
  .pkinstagram-container + p,
  .instagram-section ~ p,
  .instagram-section + p {
    position: static !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
    text-align: center !important;
    margin: 8px auto !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow: visible !important;
  }
  /* Jeśli sekcja instagram jest w Elementor row — zawijamy kolumny pionowo */
  .elementor-widget-pkinstagram .elementor-row,
  .elementor-section:has(.pkinstagram-container) .elementor-row {
    flex-direction: column !important;
  }
  .elementor-widget-pkinstagram .elementor-column,
  .elementor-section:has(.pkinstagram-container) .elementor-column {
    width: 100% !important;
    max-width: 100% !important;
  }
}


/* ══ M6b: Footer — białe tło, nie różowe ══
   background:#fff8f8 z v55 jest dla headera, ale mogło "wlać się"
   do footer wrappera. Resetujemy footer do białego. */
@media (max-width: 767px) {
  footer#footer,
  footer#footer .footer-container,
  #footer,
  #footer .footer-container,
  .mobile-footer-wrapper,
  .mobile-footer-wrapper > * {
    background-color: #fff !important;
  }
  /* Resetuj tło na sekcjach CE w footerze (wyjątek: newsletter ma własny kolor) */
  #footer [class*="elementor-top-section"]:not([class*="newsletter"]),
  #footer .elementor-section:not([class*="newsletter"]) {
    background-color: transparent !important;
  }
}


/* ══ M8: Siatka produktów — 2 kolumny na mobile ══
   Docelowy kontener to .product-list-container.grid-container lub .product_list
   (NIE #products — ten zawiera też sort-bar i po moveFilters() filter-wrapper).
   WAŻNE: #products ma klasę .view_grid4 (Alysum) co injectuje 4-kolumnowy grid
   z selektorem #products.view_grid4 .product-list-container (ID+2 klasy = spec. 1,2,0).
   Nasze selektory muszą mieć wyższą specyficzność żeby wygrać z !important Alysum.
   body#category #products .product-list-container.grid-container = (2 ID + 2 klasy + 1 el) > (1,2,0). */
@media (max-width: 767px) {
  body#category #products .product-list-container,
  body#category #products .product-list-container.grid-container,
  body#category #products #js-product-list .product_list,
  body#category #products #js-product-list .products,
  body#category .product-list-container,
  body#category .product-list-container.grid-container,
  body#category #js-product-list .product_list,
  body#category #js-product-list .products,
  body#new-products #products .product-list-container,
  body#new-products #products .product-list-container.grid-container,
  body#new-products .product-list-container,
  body#new-products .product-list-container.grid-container,
  body#new-products #js-product-list .product_list,
  body#search #products .product-list-container,
  body#search #products .product-list-container.grid-container,
  body#search .product-list-container,
  body#search .product-list-container.grid-container,
  body#search #js-product-list .product_list,
  body#best-sales #products .product-list-container,
  body#best-sales #products .product-list-container.grid-container,
  body#best-sales .product-list-container,
  body#best-sales .product-list-container.grid-container,
  body#prices-drop #products .product-list-container,
  body#prices-drop #products .product-list-container.grid-container,
  body#prices-drop .product-list-container,
  body#prices-drop .product-list-container.grid-container {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 12px !important;
    row-gap: 24px !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  body#category .product-miniature,
  body#new-products .product-miniature,
  body#search .product-miniature,
  body#best-sales .product-miniature,
  body#prices-drop .product-miniature {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: none !important;
    float: none !important;
  }
}


/* ══ D1: Napis/CTA na hero banerze — desktop ══
   Elementy Elementora f9636a7→22bde92 (tytuł) i d875322 (przycisk)
   mogły być ukryte przez ustawienie visibility w CE lub błędny CSS.
   Wymuszamy widoczność. */
@media (min-width: 768px) {
  .elementor-element-22bde92,
  .elementor-element-d875322 {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  .elementor-element-22bde92 .elementor-heading-title,
  .elementor-element-22bde92 h1,
  .elementor-element-22bde92 h2,
  .elementor-element-22bde92 h3 {
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
  }
  .elementor-element-d875322 .elementor-button,
  .elementor-element-d875322 a {
    visibility: visible !important;
    opacity: 1 !important;
  }
}


/* ══ D2: Kafelki kategorii — desktop ══
   category-miniature mogły być ukryte przez hook lub CSS z innego modułu. */
.category-miniature,
section.category-miniature {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}


/* ══ FILTER PANEL: Ukryj niepotrzebne facety (Wybory + Kategorie) ══
   Wybory (feature): klasa facet-type-feature — do ukrycia
   Kategorie (facet-type-category): ukrywamy — ps_facetedsearch pokazuje ukryte kategorie,
     których nie ma w PS admin → nie możemy kontrolować listy → ukrywamy całość
   Rozmiar: facet-type-attribute_group (ale to samo co Kolor) — ukrywany przez JS w ellie_v81_fixes.js */
body#category #search_filters .facet.facet-type-feature,
body#category #search_filters .facet.facet-type-category {
  display: none !important;
}

/* ══ PKCATEGORYFILTER: Ukryj widget Kategorie na mobile ══
   Widget pkcategoryfilter (PromoKit) pojawia się w sidebarze zanim JS przeniesie filtr.
   Na mobile nie jest potrzebny — kategorie są w breadcrumbach. */
@media (max-width: 767px) {
  .elementor-widget-pkcategoryfilter,
  [class*="elementor-widget-pkcategoryfilter"] {
    display: none !important;
  }
}

/* ══ FACET TITLES: Zmniejsz nagłówki sekcji w filtrze ══
   Dostępność / Cena / Kolor — za duże i za grube na mobile. */
@media (max-width: 767px) {
  #search_filters .facet .facet-title,
  #search_filters .facet .module-title,
  #search_filters .module-title {
    font-size: 13px !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    margin: 0 0 6px !important;
    padding: 0 !important;
  }
}

/* ══ ACTIVE FILTERS X: Napraw klikanie × przy aktywnych filtrach ══
   addStyle() injectuje overflow:hidden na #search_filters_wrapper (wewnątrz @media mobile).
   Nadpisujemy overflow z wyższą specyficznością (html body # = spec. 1,0,2 > spec. 1,0,0).
   SVG <use> z external href (lib.svg#cross) może nie propagować clicków przez jQuery
   delegation na mobile Safari — fixuje to JS (fixActiveFilterX w ellie_v81_fixes.js). */
html body #search_filters_wrapper,
#search_filters_wrapper {
  overflow: visible !important;
}

/* FILTRY button — upewniamy się że jest zawsze nad innymi elementami.
   addStyle() daje z-index:20; my podnosimy do 200 żeby nic nie blokowało kliknięć. */
.ellie-mobile-filter-toggle {
  position: relative !important;
  z-index: 200 !important;
}

/* Active filters bar — brak position/z-index (static flow, bez nakładania się na button).
   JS (fixActiveFilterX) obsługuje kliknięcia na X w capture phase — z-index nie jest potrzebny.
   Zmniejszamy też rozmiar paska aktywnych filtrów (klientka: "pole info powinno być mniejsze"). */
#js-active-search-filters {
  pointer-events: auto !important;
  font-size: 12px !important;
  padding: 4px 0 2px !important;
  margin: 0 !important;
}
#js-active-search-filters .active-filter-title {
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  padding: 0 4px !important;
  margin: 0 !important;
}
#js-active-search-filters ul,
#js-active-search-filters .filter-block {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 4px !important;
  margin: 4px 0 !important;
  padding: 0 !important;
  list-style: none !important;
}
/* Każdy aktywny filtr jako małe pill z X */
#js-active-search-filters .js-search-link,
#js-active-search-filters li a {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: 11px !important;
  padding: 3px 8px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(0,0,0,0.18) !important;
  background: #f0f0f0 !important;
  color: #333 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  min-height: 28px !important;
  min-width: 28px !important;
  -webkit-tap-highlight-color: rgba(0,0,0,0.1) !important;
}
/* SVG i ikony wewnątrz X - wyłącz pointer-events żeby klik trafiał w <a> */
#js-active-search-filters .js-search-link svg,
#js-active-search-filters .js-search-link i,
#js-active-search-filters .js-search-link use {
  pointer-events: none !important;
  width: 10px !important;
  height: 10px !important;
}


/* ══ NEWSLETTER: Zachowaj niebieskie tło sekcji newslettera ══
   Element .elementor-element-7479b7e2 jest sekcją wewnątrz .elementor-18010000
   i ma oryginalne tło rgb(122,183,245). Chronimy je przed nadpisaniem. */
.elementor-element-7479b7e2 {
  background-color: rgb(122, 183, 245) !important;
}


/* ══ M6a FIX: Tekst label przy checkboxach GDPR — widoczny kolor ══
   Na mobile label GDPR może mieć color:#fff lub transparent → niewidoczny na białym tle. */
@media (max-width: 767px) {
  .custom-checkbox label,
  .custom-checkbox .label,
  .condition-label,
  .form-group .custom-checkbox label,
  .checkout-step .custom-checkbox label,
  .register-form .custom-checkbox label,
  [class*="gdpr"] label,
  [class*="psgdpr"] label,
  [class*="gdpr"] span.label,
  [class*="psgdpr"] span.label,
  input[type="checkbox"][name*="gdpr"] ~ label,
  input[type="checkbox"][name*="gdpr"] ~ span,
  input[type="checkbox"][name*="consent"] ~ label,
  input[type="checkbox"][name*="consent"] ~ span {
    color: #333 !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}


/* ══ CATEGORY MOBILE: Układ Option B ══
   JS (customerjs1.js / moveFilters) przenosi #search_filters_wrapper
   z kolumny sidebar poza nią — przed #js-product-list-top w #products.
   Po przeniesieniu sidebar jest pusta → chowamy ją.
   Użyliśmy :has() dla przeglądarek które go wspierają (Chrome 105+, Safari 15.4+).
   ─────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  /* Sidebar .elementor-element-6f31031f jest POZA section#main — w CE row obok sekcji głównej.
     Chowamy ją po tym jak JS (moveFilters) przenosi #search_filters_wrapper do product_list_top.
     Sibling kolumna z produktami dostaje pełną szerokość przez ~ selektor. */
  body#category .elementor-element-6f31031f {
    display: none !important;
  }
  /* Wyjątek: sidebar z filtrem w środku (JS jeszcze nie uruchomiony) */
  body#category .elementor-element-6f31031f:has(#search_filters_wrapper) {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    order: -1 !important;
  }

  /* Kolumna z produktami (sibling po ukrytej sidebar) — pełna szerokość */
  body#category .elementor-element-6f31031f ~ .elementor-column,
  body#category .elementor-element-6f31031f ~ .elementor-column > .elementor-column-wrap {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }

  /* Sort-by-row — ukryj na mobile (Option B: tylko FILTRY+, bez Sortuj wg) */
  body#category .sort-by-row,
  body#category .js-sort-selector {
    display: none !important;
  }

  /* Filter-wrapper (po przeniesieniu jest w .product_list_top > #search_filters_wrapper) */
  body#category #search_filters_wrapper {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 0 8px !important;
    box-sizing: border-box !important;
  }
}


/* ══ FILTER TYPOGRAPHY: Konsekwentny wygląd panelu filtrów (desktop + mobile) ══
   Klientka zgłosiła: czcionki w filtrze są różnej wielkości i różnego stylu.
   Standaryzujemy nagłówki sekcji i stylizację wartości. */

/* Nagłówki sekcji filtra — jednolita typografia */
#search_filters .facet .facet-title,
#search_filters .facet .module-title,
#search_filters_wrapper .facet .facet-title,
#search_filters_wrapper .facet .module-title {
  font-family: inherit !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: #1a1a1a !important;
  line-height: 1.3 !important;
  margin: 0 0 10px !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
}

/* Etykiety wartości faceta (checkboxy) — rozmiar i spójność */
#search_filters .facet ul li label,
#search_filters .facet ul li .facet-label,
#search_filters_wrapper .facet ul li label,
#search_filters_wrapper .facet ul li .facet-label {
  font-size: 13px !important;
  font-weight: 400 !important;
  color: #333 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

/* Wyróżnione (aktywne) wartości faceta */
#search_filters .facet ul li.active label,
#search_filters .facet ul li input:checked ~ label,
#search_filters_wrapper .facet ul li.active label {
  font-weight: 600 !important;
  color: #000 !important;
}

/* Zakres cen (wyświetlany pod sliderem) */
#search_filters .facet .ui-slider-filter p,
#search_filters .facet .slider-filter-prices,
#search_filters .facet [id*="slider-range"] ~ p,
#search_filters_wrapper [class*="price"] > p,
#search_filters .facet p {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #555 !important;
  margin: 6px 0 0 !important;
  letter-spacing: 0 !important;
  text-align: center !important;
}

/* Odstępy między sekcjami filtra */
#search_filters .facet,
#search_filters_wrapper .facet {
  padding: 14px 0 !important;
  border-bottom: 1px solid #eee !important;
  margin: 0 !important;
}
#search_filters .facet:last-child,
#search_filters_wrapper .facet:last-child {
  border-bottom: none !important;
}

/* Kolor swatche — spójna wielkość */
#search_filters .facet .color,
#search_filters_wrapper .facet .color {
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  display: inline-block !important;
  border: 1px solid rgba(0,0,0,0.15) !important;
}
#search_filters .facet ul.colors li,
#search_filters_wrapper .facet ul.colors li {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin: 3px 6px 3px 0 !important;
}
