/* AgroKrajna – mobile quick wins (ładowane tylko dla max-width: 767px)
   1) niższy nagłówek  2) listing 2 kolumny  3) większe pola dotyku */

/* --- 1. Nagłówek: z ~370 px do ~200 px --- */
#header .navbar-inverse { display: none; }          /* czarny pasek "Sklep zootechniczny" – na mobile i tak pusty */
#header-blocks { padding-top: 6px; }
#shop-logo img { max-height: 44px; width: auto; }  /* logo 295x83 -> ~156x44 */
#shop-logo { margin-bottom: 2px; }
#search_block_top { padding: 4px 15px 6px; }
#columns { padding-top: 6px; }

/* --- 2. Listing: 2 produkty w rzędzie zamiast 1 --- */
.product_list > li.col-xs-6 { padding-left: 5px; padding-right: 5px; }
.product_list > li.col-xs-6 .product-container { padding: 6px; }
.product_list > li.col-xs-6 h4.product-name,
.product_list > li.col-xs-6 a.product-name {
  font-size: 13.5px; line-height: 1.3; margin: 4px 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 3.9em;                                 /* równe wysokości kart */
}
.product_list > li.col-xs-6 .product-desc { display: none; }
.product_list > li.col-xs-6 .price.product-price { font-size: 17px; font-weight: 700; }
.product_list > li.col-xs-6 .ajax_add_to_cart_button,
.product_list > li.col-xs-6 .btn.product-description {
  display: block; width: 100%; min-height: 44px; padding: 11px 4px; font-size: 13px; white-space: normal;
}
.product_list > li.col-xs-6 .functional-buttons,
.product_list > li.col-xs-6 .quick-view { display: none; }

/* --- 3. Pola dotyku min. 44 px (audyt: 15 elementów <44 px na karcie produktu) --- */
.product_attributes .btn.btn-default,                /* - / + ilości */
#quantity_wanted_p .btn { min-width: 44px; min-height: 44px; }
#footer a[href^="tel:"], #footer a[href^="mailto:"] { display: inline-block; padding: 10px 0; }

/* --- 4. Kafelki podkategorii: długie nazwy (h3 23px -> 16px, dzielenie wyrazów, równe wysokości) --- */
#category-subcategories .list-grid > li { padding-left: 5px; padding-right: 5px; margin-bottom: 10px; }
#category-subcategories .thumbnail { margin-bottom: 0; padding: 6px; height: 100%; }
#category-subcategories .caption { padding: 8px 2px 4px; }
#category-subcategories .subcategory-title {
  font-size: 15.5px !important;
  font-weight: 600;
  line-height: 1.25;
  min-height: 3.75em;                       /* zawsze miejsce na 3 linie = równe kafelki */
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  -webkit-hyphens: auto; hyphens: auto;     /* "oddecho-wych", "ostrzegaw-cze" zamiast ucinania */
  overflow-wrap: break-word;                /* awaryjnie, gdy przeglądarka nie dzieli po polsku */
}
#category-subcategories .subcategory-title a { color: #1f5f99; }

/* --- 5. Rozwinięte menu kategorii (cttopmenu) --- */
#cttopmenu { margin-top: 6px; }
/* pasek "Menu": napis i hamburger w jednej osi, cały pasek klikalny */
#cttopmenu .navbar-header { display: flex; align-items: center; min-height: 52px; }
#cttopmenu .navbar-header:before, #cttopmenu .navbar-header:after { display: none; }
#cttopmenu .navbar-header .navbar-brand {
  order: 1; flex: 1 1 auto; float: none; display: flex !important; align-items: center;
  height: auto; min-height: 52px; margin: 0 !important; padding: 0 16px;
  font-size: 16px; font-weight: 600; line-height: 1.2; color: #22303c;
}
#cttopmenu .navbar-header .navbar-toggle { order: 2; float: none; margin: 4px 8px 4px 0; }
#cttopmenu .navbar-collapse { padding: 0; }
#cttopmenu .navbar-nav { margin: 0; }
#cttopmenu .navbar-nav > li { border-top: 1px solid #e6ecf2; }
#cttopmenu .navbar-nav > li.cttm-item-custom-link:first-child { display: none; }   /* pusty wiersz z domkiem – logo i tak prowadzi na główną */

/* działy: wysokie wiersze, strzałka po prawej */
#cttopmenu .navbar-nav > li > a {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 50px; padding: 12px 16px; line-height: 1.3;
  font-size: 15.5px; font-weight: 600; color: #22303c;
}
#cttopmenu .navbar-nav > li > a .caret {
  flex: 0 0 auto; width: 9px; height: 9px; margin: 0 2px 0 12px;
  border: 0; border-right: 2px solid #8a97a3; border-bottom: 2px solid #8a97a3;
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s;
}
#cttopmenu .navbar-nav > li.open > a,
#cttopmenu .navbar-nav > li.open > a:hover,
#cttopmenu .navbar-nav > li.open > a:focus { background: #e2effa; color: #0b70b8 !important; box-shadow: inset 4px 0 0 #0b70b8; }
#cttopmenu .navbar-nav > li.open > a .caret { transform: rotate(-135deg) translate(-2px, -2px); border-color: #0b70b8; }

/* panel rozwinięty */
#cttopmenu .navbar-nav .open .dropdown-menu { background: #fff; padding: 0 0 6px; margin: 0; border: 0; box-shadow: none; font-size: 1em; }

/* "Zobacz cały dział" – pierwszy wiersz panelu */
#cttopmenu .navbar-nav .open .dropdown-menu > li.cttm-see-all > a {
  display: flex; align-items: center; min-height: 46px; padding: 10px 16px 10px 28px;
  font-size: 14.5px; font-weight: 700; line-height: 1.3; color: #0b70b8; white-space: normal;
  text-decoration: underline; text-underline-offset: 3px;
}
#cttopmenu .navbar-nav .open .dropdown-menu > li.cttm-see-all > a:after { content: "\203A"; margin-left: 6px; font-size: 20px; line-height: 1; text-decoration: none; }
#cttopmenu .dropdown-content { padding: 0; }
#cttopmenu .dropdown-content .row { margin: 0; }
#cttopmenu .dropdown-content [class*="col-"] { float: none; width: auto; padding: 0; }
#cttopmenu .dropdown-content ul { list-style: none; margin: 0; padding: 0; }

/* 2. poziom: podkategorie */
#cttopmenu .dropdown-content .list-unstyled > li > a {
  display: flex; align-items: center; min-height: 46px; padding: 10px 16px 10px 28px;
  font-size: 15px; font-weight: 600; line-height: 1.3; color: #1a4f9f;
  border-top: 1px solid #f0f3f6; white-space: normal;
}
/* 3. poziom: mniejsze, wcięte, z kropką */
#cttopmenu .dropdown-content .sub-list > li > a {
  position: relative; display: flex; align-items: center; min-height: 40px; padding: 7px 16px 7px 46px;
  font-size: 14px; font-weight: 400; line-height: 1.3; color: #3f4a55; white-space: normal;
}
#cttopmenu .dropdown-content .sub-list > li > a:before {
  content: ""; position: absolute; left: 33px; top: 50%; width: 5px; height: 5px; margin-top: -2px;
  border-radius: 50%; background: #9cc8ea;
}
#cttopmenu .dropdown-content a:active { background: #eef5fb; }

/* linki informacyjne (marki, dostawa, poradniki, kontakt) – lżej, pod działami */
#cttopmenu .navbar-nav > li.cttm-item-manufacturer-list > a,
#cttopmenu .navbar-nav > li.cttm-item-cms-link > a,
#cttopmenu .navbar-nav > li.cttm-item-cms-category-tree > a,
#cttopmenu .navbar-nav > li.cttm-item-custom-link:not(:first-child) > a {
  min-height: 44px; font-size: 14px; font-weight: 500; color: #56616c !important; background: #f6f9fc;
}

/* --- 6. Nagłówek kategorii: mniejsza nazwa (29 px -> 21 px), mniejsza miniatura, opis zwinięty --- */
#category-info h1.page-heading,
#category-info h1.page-heading .cat-name { font-size: 21px !important; line-height: 1.2; font-weight: 700; }
#category-info h1.page-heading { padding: 10px 12px; margin-bottom: 10px; }
#category-info .aghc-cat-tile { max-width: 96px; }
#category-description { font-size: 14px; line-height: 1.5; margin-bottom: 4px; }
/* zwijanie tylko gdy skrypt dodał .ak-clamp – bez JS opis jest pełny */
#category-description.ak-clamp {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ak-desc-more[hidden] { display: none; }
.ak-desc-more {
  background: none; border: 0; padding: 6px 0 12px; min-height: 40px;
  color: #0b70b8; font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px;
}
#category-subcategories .page-heading { font-size: 18px !important; padding: 8px 12px; margin-bottom: 10px; }

/* --- 7. Karta produktu: cena i "Dodaj do koszyka" zaraz pod zdjęciem ---
   Kolejność na telefonie: nazwa -> galeria -> producent/indeks/dostępność -> CENA + KOSZYK -> zalety (6 punktów).
   Mikrodane/HTML bez zmian – zmienia się tylko kolejność wyświetlania. */
#product .primary_block { display: flex; flex-direction: column; }
#product .primary_block > .pb-left-column  { order: 2; }
#product .primary_block > .pb-right-column { order: 4; min-height: 0; }
#product .primary_block > .pb-center-column { display: contents; }
#product .pb-center-column > * { order: 3; margin-left: 15px; margin-right: 15px; }
#product .pb-center-column > h1 { order: 1; font-size: 20px; line-height: 1.3; margin-top: 2px; margin-bottom: 10px; }
#product .pb-center-column > .product-trust-badges { order: 5; margin-top: 4px; }
#az_mouseOverZoomContainer { background: #fff; }                  /* szare pasy nad/pod zdjęciem */
/* numer dostawcy i EAN (jak w oryginale, dwa ciągi obok siebie) – na telefonie czytelne zamiast xx-small */
#product .pb-center-column > p.ak-codes { font-size: 12.5px !important; color: #666; margin: 2px 15px 6px; letter-spacing: .3px; }
#product .product-brand-line,
#product .product-sku-line { margin: 4px 15px; }

/* --- 8. Sticky "Dodaj do koszyka" (agstickycart) – tylko zaokrąglenia spójne z resztą sklepu --- */
#ag-sticky-cart .agsc__button { border-radius: 10px; }

/* --- 9. Popup "Dodano do koszyka" (blockcart / ag-layer-cart) --- */
/* 9a. Akcesoria / "kupowane razem": global.css (linia ok. 10757, "OPTIONAL (recommended)") ma
       #layer_cart .crossseling { display:none !important } – zabijało zwijaną sekcję z modułu.
       Wyższa specyficzność przywraca ją tylko wtedy, gdy moduł ją przygotował (ma treść). */
#layer_cart.ag-lc-enhanced .crossseling.ag-lc-cross-collapsible { display: block !important; padding: 0 !important; }

/* 9b. Gdy w koszyku jest więcej niż 1 produkt – pokaż "Ilość produktów w Twoim koszyku: 2",
       inaczej "Łącznie produkty" większe niż "Suma" dodanego produktu wygląda na błąd. */
#layer_cart.ag-lc-enhanced .ag-lc-cart-count { display: block !important; margin: 0 0 6px; font-size: 13px; font-weight: 600; color: #555; }
#layer_cart.ag-lc-enhanced .ag-lc-cart-count .ajax_cart_product_txt { display: none !important; }   /* "Jest 1 produkt" – zbędne */

/* 9c. "Kontynuuj zakupy" jako drugi przycisk (rolnik często dobiera kolejne części) */
#layer_cart.ag-lc-enhanced .lc-continue-wrap .continue {
  display: block; min-height: 46px; line-height: 44px; padding: 0 12px; margin-top: 4px;
  border: 1.5px solid #2f7042; border-radius: 10px; background: #fff;
  color: #2f7042; font-size: 15px; font-weight: 700; text-decoration: none; text-align: center;
}

/* --- 10. Karta produktu: porządek w boksie ceny i wyrównanie galerii --- */
/* 10a. Pusty pas pod galerią AjaxZoom (pasek miniatur ukryty na telefonie, ale z zarezerwowaną wysokością) */
#product .primary_block .pb-left-column,
#axZm_mouseOverWithGalleryContainer { min-height: 0 !important; }
#az_mouseOverZoomGallery.axZm_displayNone { display: none !important; min-height: 0 !important; height: 0 !important; }

/* 10b. Flaga w jednej linii z producentem, bez osobnego boksu "Kraj producenta" */
#product .product-brand-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
#product .product-origin-info { display: inline-flex; margin: 0 0 0 2px; padding: 0; background: none; border: 0; }
#product .product-origin-flag { width: 24px; height: 15px; }
#product .product-origin-text {                       /* zostaje dla czytników ekranu */
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* 10c. Jedno główne CTA: zielony "Dodaj do koszyka".
        "Szybka realizacja i wysyłka" znika (dubluje "Wysyłamy w 24h" i nową linię Dostawa),
        WhatsApp i "Zapytaj o produkt" obok siebie jako przyciski drugiego planu. */
#product .box-cart-bottom { display: flex; flex-wrap: wrap; gap: 8px; }
#product .box-cart-bottom > * { flex: 1 1 100%; min-width: 0; }
#product #product_payment_logos { display: contents; }
#product #product_payment_logos > * { flex: 1 1 100%; min-width: 0; }
#product #product_payment_logos .box-security { margin: 2px 0 0; }
#product #product_payment_logos .shipping-info-block { display: none !important; }
#product #product_payment_logos > p { flex: 1 1 calc(50% - 4px); margin: 0 !important; }
#product .box-cart-bottom > #send_aap_button_q { flex: 1 1 calc(50% - 4px); }
#product a.whatsapp-link.btn-success,
#product #send_aap_button_q {
  display: flex !important; align-items: center !important; justify-content: center !important; gap: 5px !important;
  min-height: 46px; margin: 0 !important; padding: 8px 3px !important; letter-spacing: -0.1px;
  background: #fff !important; background-color: #fff !important; box-shadow: none !important;
  font-size: 13px !important; font-weight: 600 !important; line-height: 1.2 !important; white-space: nowrap; text-align: center;
}
#product a.whatsapp-link.btn-success { color: #1b7a1b !important; border: 1.5px solid #1b7a1b !important; }
#product #send_aap_button_q { color: #3d4447 !important; border: 1.5px solid #8a9599 !important; }
@media (max-width: 374px) {
  #product #send_aap_button_q { white-space: normal; }
}

/* --- 11. Drobne poprawki karty produktu --- */
/* 11a. "WhatsApp" zamiast "Zapytaj na WhatsApp" na telefonie (desktop zostaje z pełnym tekstem) */
#product .whatsapp-link .ak-wa-long { display: none !important; }
#product .whatsapp-link .ak-wa-text { white-space: nowrap; }
/* 11b. Pole ilości tej samej wysokości co -/+ (było 34 px przy przyciskach 44 px);
        16 px = iPhone nie powiększa strony po kliknięciu w pole */
#quantity_wanted_p #quantity_wanted {
  height: 44px !important; min-height: 44px; font-size: 16px !important; font-weight: 700; color: #222; -webkit-text-fill-color: #222; box-shadow: none;
}
#quantity_wanted_p .input-group-btn .btn { height: 44px !important; width: 48px !important; font-size: 16px; color: #222; }
/* 11c. Sticky "Dodaj do koszyka": wyraźny biały tekst (motyw rozjaśniał napis) */
#ag-sticky-cart .agsc__button,
#ag-sticky-cart .agsc__button .agsc__button-text,
#ag-sticky-cart .agsc__button .agsc__cart-icon {
  color: #fff !important; -webkit-text-fill-color: #fff !important; opacity: 1 !important;
}
#ag-sticky-cart .agsc__button { font-size: 15px; letter-spacing: .1px; -webkit-font-smoothing: auto; text-shadow: 0 1px 0 rgba(0,0,0,.15); }

/* 11d. Popup koszyka: nazwy w "kupowane razem" w 2 liniach zamiast "Widły do..." */
#layer_cart .crossseling-content h4.product-name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em;
}

/* --- 12. Galeria AjaxZoom na telefonie --- */
/* 12a. Pusty pas pod zdjęciem = margin-bottom: 60px na #axZm_mouseOverWithGalleryContainer (miejsce na kropki).
        Kropki przenosimy na dół zdjęcia (jak w typowej galerii na telefonie), margines 12 px. */
#axZm_mouseOverWithGalleryContainer { margin-bottom: 12px !important; }
#az_mouseOverZoomContainer .axZm_mouseOverDotNavi {
  position: absolute !important; left: 0 !important; right: 0 !important; top: auto !important; bottom: 8px !important;
  width: auto !important; height: auto !important; margin: 0 !important; padding: 0 !important;
  z-index: 1000; text-align: center; line-height: 0;
}
#az_mouseOverZoomContainer .axZm_mouseOverDotNavi > div {
  display: inline-block !important; width: 8px !important; height: 8px !important; margin: 0 4px !important; padding: 0 !important;
  border: 0 !important; border-radius: 50% !important; background: rgba(0, 0, 0, .22) !important; cursor: pointer;
}
#az_mouseOverZoomContainer .axZm_mouseOverDotNavi > div.selected { width: 18px !important; border-radius: 4px !important; background: #2e7d32 !important; }

/* 12b. Placeholder przed startem AjaxZoom: bez paska miniatur (#views_block 110 px), którego AjaxZoom na telefonie
        i tak nie pokazuje – placeholder = zdjęcie + 10 px, czyli tyle co gotowa galeria (brak skoku strony / CLS). */
#views_block, #views_block.hidden { display: none !important; }

/* 13. Strona marki (manufacturer.tpl) – nagłówek jak w kategorii */
#manufacturer-info .ak-brand-head { gap: 10px; margin-bottom: 8px; }
#manufacturer-info .ak-brand-logo { width: 64px; height: 64px; padding: 4px; }
#manufacturer-info h1.page-heading { font-size: 21px !important; line-height: 1.2; font-weight: 700; padding: 10px 12px; }
#manufacturer-info .ak-brand-lead { font-size: 14px; line-height: 1.5; margin-bottom: 12px; }
#o-marce { margin-top: 20px; }
#o-marce .rte h2 { font-size: 18px; }
#o-marce .rte h3 { font-size: 16px; }

/* 14. Pasek sortowania listingu (kategoria, marka, wyszukiwarka): "Sortuj wg" i "Produktów na stronę"
   obok siebie zamiast pod sobą; górne "Pokaż wszystkie" i licznik schowane (zostają pod listą).
   Produkty zaczynają się ~200 px wyżej. */
.content_sortPagiBar .sortPagiBar { display: flex; flex-wrap: wrap; gap: 0 10px; }
.content_sortPagiBar .sortPagiBar > .form-group { flex: 1 1 140px; min-width: 0; margin: 0 0 8px; }
.content_sortPagiBar .sortPagiBar > #product-list-switcher { flex-basis: 100%; }
.content_sortPagiBar .sortPagiBar label { display: block; font-size: 13px; margin-bottom: 3px; }
.content_sortPagiBar .sortPagiBar select.form-control { width: 100%; height: 44px; font-size: 16px; }
.top-pagination-content .showall,
.top-pagination-content .product-count { display: none !important; }
.top-pagination-content .form-group { margin-bottom: 8px; }
#manufacturer-products > h2.page-heading,
#o-marce > h2.page-heading { font-size: 19px !important; line-height: 1.25; padding: 10px 12px; }
