/* M16 Warianty łyżek — kafelki (pills) pod krótkim opisem */
.m16bv {
  margin: 18px 0 12px;
  padding: 16px 18px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fafafa;
}
.m16bv-title {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #ececec;
  font-size: 16px;
  font-weight: 700;
  color: #333;
}
.m16bv-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 8px 0;
}
.m16bv-row + .m16bv-row {
  border-top: 1px solid #ececec;
}
.m16bv-label {
  flex: 0 0 100%;
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 2px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.m16bv-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}
.m16bv-pill {
  appearance: none;
  cursor: pointer;
  min-width: 52px;
  padding: 9px 14px;
  border: 1px solid #cfcfcf;
  border-radius: 6px;
  background: #fff;
  color: #333;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 500;
  transition: border-color .12s, background-color .12s, color .12s, box-shadow .12s;
}
.m16bv-pill:hover {
  border-color: #7a9d3f;
  color: #43611b;
}
.m16bv-pill.is-active {
  background: #7a9d3f;
  border-color: #7a9d3f;
  color: #fff;
  box-shadow: 0 1px 4px rgba(122, 157, 63, .35);
  cursor: default;
}
.m16bv-pill.is-loading {
  opacity: .55;
}

/* Przycisk „więcej / mniej" (mobile) — wygląd linku-akcji, wyraźnie inny niż kafelki */
.m16bv-more {
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 6px;
  border: 0;
  background: transparent;
  color: #43611b;
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.m16bv-more::after {
  content: '\25BE'; /* ▾ */
  font-size: 11px;
  text-decoration: none;
  transition: transform .15s ease;
}
.m16bv-row.is-expanded .m16bv-more::after {
  transform: rotate(180deg);
}
.m16bv-more:hover {
  color: #2f4712;
}

/* Mobile-first: nadmiar ukryty, odsłaniany przyciskiem */
.m16bv-pill.is-extra {
  display: none;
}
.m16bv-row.is-expanded .m16bv-pill.is-extra {
  display: inline-flex;
}

/* Motyw ukrywa .availability w kafelku (display:none) — odsłaniamy status + czas dostawy. */
.js-product-miniature .product_desc .availability,
.product-miniature .product_desc .availability,
.js-product-miniature .availability,
.product-miniature .availability {
  display: block !important;
  margin-top: 6px;
}

/* Status magazynowy na kafelkach (kategoria / strona główna) */
.m16bv-avail {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 4px 0 2px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}
.m16bv-avail .material-icons {
  font-size: 16px;
  line-height: 1;
}
.m16bv-avail--in {
  color: #5a8a1e;
}
.m16bv-avail--out {
  color: #c0392b;
}

/* Desktop: pokaż wszystko, schowaj przycisk „więcej" */
@media (min-width: 768px) {
  .m16bv-pill.is-extra {
    display: inline-flex;
  }
  .m16bv-more {
    display: none;
  }
}

/* =========================================================================
   Karta produktu — mocniejsze CTA: „Dodaj do koszyka" (zielony) + „Kup teraz"
   (pomarańczowy, hero). Scope .js-product-add-to-cart = tylko strona produktu,
   nie dotyka przycisków na kafelkach.
   ====================================================================== */
.js-product-add-to-cart button.btn.btn-primary.add-to-cart,
.js-product-add-to-cart button.btn.btn-primary.buy-now {
  border: 0 !important;
  border-radius: 10px !important;
  color: #fff !important;
  font-weight: 800 !important;
  font-size: 16px !important;
  letter-spacing: .2px;
  min-height: 54px;
  padding: 14px 22px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: transform .14s ease, box-shadow .14s ease, background-color .14s ease, filter .14s ease;
  cursor: pointer;
}

/* Dodaj do koszyka — pełny zielony (ten sam co aktywny kafelek wariantu), bez gradientu */
.js-product-add-to-cart button.btn.btn-primary.add-to-cart {
  background: #7a9d3f !important;
  box-shadow: 0 3px 12px rgba(122, 157, 63, .30);
}
.js-product-add-to-cart button.btn.btn-primary.add-to-cart:hover:not(:disabled) {
  background: #6a8a34 !important;
  transform: translateY(-2px);
  box-shadow: 0 7px 18px rgba(122, 157, 63, .42);
}
.js-product-add-to-cart button.btn.btn-primary.add-to-cart:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(122, 157, 63, .38);
}
.js-product-add-to-cart button.btn.btn-primary.add-to-cart .material-icons {
  font-size: 22px;
}

/* Kup teraz — szary z paska nagłówka (#565655), na hoverze zielony wariantowy */
.js-product-add-to-cart button.btn.btn-primary.buy-now {
  background: #565655 !important;
  font-size: 17px !important;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.js-product-add-to-cart button.btn.btn-primary.buy-now::after {
  content: "\2192"; /* → */
  font-size: 19px;
  transition: transform .16s ease;
}
.js-product-add-to-cart button.btn.btn-primary.buy-now:hover:not(:disabled) {
  background: #7a9d3f !important;
  transform: translateY(-2px);
}
.js-product-add-to-cart button.btn.btn-primary.buy-now:hover:not(:disabled)::after {
  transform: translateX(4px);
}
.js-product-add-to-cart button.btn.btn-primary.buy-now:active:not(:disabled) {
  transform: translateY(0);
}

/* Stan wyłączony (brak stanu / niedostępny) — wyszarzony */
.js-product-add-to-cart button.btn.btn-primary.add-to-cart:disabled,
.js-product-add-to-cart button.btn.btn-primary.buy-now:disabled {
  filter: grayscale(.5);
  opacity: .5;
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  .js-product-add-to-cart button.btn.btn-primary.add-to-cart,
  .js-product-add-to-cart button.btn.btn-primary.buy-now { transition: none; }
}

/* Status dostępności przeniesiony pod cenę (karta produktu) */
.m16-availability-under-price {
  margin: 6px 0 14px;
}
.m16-availability-under-price #product-availability {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
}
.m16-availability-under-price #product-availability .material-icons {
  font-size: 19px;
  line-height: 1;
}
.m16-availability-under-price #product-availability .product-available {
  color: #5a8a1e;
}
.m16-availability-under-price #product-availability .product-unavailable {
  color: #c0392b;
}
.m16-availability-under-price #product-availability .product-last-items {
  color: #e67e22;
}
.m16-availability-under-price .product-minimal-quantity {
  margin: 4px 0 0;
  font-size: 13px;
  color: #777;
}
.m16-availability-under-price .product-minimal-quantity:empty {
  display: none;
}

/* =========================================================================
   Karta produktu — akcje w 2 wierszach na MOBILE:
   wiersz 1: ilosc + Dodaj do koszyka; wiersz 2: ulubione + porownaj + Kup teraz.
   Na desktopie wrappery znikaja (display:contents) — uklad bez zmian.
   ====================================================================== */
.js-product-add-to-cart .m16-line {
  display: contents;
}
@media (max-width: 767px) {
  .js-product-add-to-cart .m16-line {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    width: 100%;
  }
  .js-product-add-to-cart .m16-line1 {
    margin-bottom: 10px;
  }
  .js-product-add-to-cart .m16-line1 .qty { flex: 0 0 88px; width: 88px; margin: 0; }
  .js-product-add-to-cart .m16-line1 .add { flex: 1 1 auto; min-width: 0; margin: 0; }
  .js-product-add-to-cart .m16-line1 .add .add-to-cart { width: 100%; }

  .js-product-add-to-cart .m16-line2 .cart_button {
    flex: 0 0 88px;
    width: 88px;   /* rowna szerokosc z polem ilosci w linii wyzej */
    height: 48px;  /* rowna wysokosc z polem ilosci (stepper - 1 +) */
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
  }
  /* ikony ulubione/porownaj wyrownane do pionowego srodka (jak Kup teraz) */
  .js-product-add-to-cart .m16-line2 .cart_button > a,
  .js-product-add-to-cart .m16-line2 .cart_button > button,
  .js-product-add-to-cart .m16-line2 .cart_button > span,
  .js-product-add-to-cart .m16-line2 .cart_button .poscompare-add,
  .js-product-add-to-cart .m16-line2 .cart_button #wishlist_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    height: auto;
    line-height: 1;
  }
  .js-product-add-to-cart .m16-line2 .buy { flex: 1 1 auto; min-width: 0; width: auto !important; margin: 0; }
  .js-product-add-to-cart .m16-line2 .buy .buy-now { width: 100%; min-width: 0; }
  /* placeholdery (express checkout / error — zawieraja komentarze, wiec :empty nie dziala)
     ukrywamy wszystko poza ulubione/porownaj (cart_button) i Kup teraz (buy) */
  .js-product-add-to-cart .m16-line2 > div:not(.cart_button):not(.buy) { display: none; }
}
