/* Archive product page — tytuł lżejszy + ładne karty produktów. */

/* === Hero kategorii — full-bleed przez class .alignfull (theme.json mechanism) === */
.maxi-archive-hero{
  margin-top: 0;
  margin-bottom: 24px;
  background: #fdfaf4;
  border-bottom: 1px solid #f1ede4;
  padding-top: 64px;
  padding-bottom: 44px;
  box-sizing: border-box;
  width: auto;
}

/* Parent group archive content — bez margin-top żeby hero przylegał do nav.
   Theme.json daje 1.6rem margin-top na 2. children wp-site-blocks (header to 1.) */
body.tax-product_cat .wp-site-blocks > .wp-block-group,
body.woocommerce-shop .wp-site-blocks > .wp-block-group{
  margin-top: 0;
  padding-top: 0;
}
body.tax-product_cat .wp-block-group.has-global-padding > .alignfull:first-child,
body.tax-product_cat .wp-block-group.has-global-padding > *:first-child{
  margin-top: 0;
}
.maxi-archive-hero-inner{
  max-width: 1320px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.maxi-archive-hero-inner > *{
  width: 100%;
  text-align: center;
}

/* Breadcrumbs w hero */
/* Breadcrumb — stylowany NATYWNIE w edytorze (kontener + margines w ustawieniach bloku).
   Bez własnego CSS, żeby nie nadpisywać tego, co ustawisz w edytorze. */
.maxi-archive-hero a{
  color: #6b7280;
  text-decoration: none;
}
.maxi-archive-hero a:hover{
  color: #007236;
}

/* Linki W OPISIE kategorii (term-description) — widoczne: brand green + underline.
   Wygrywaja specyficznoscia (0,2,1) nad .maxi-archive-hero a (0,1,1). */
.maxi-archive-hero .maxi-archive-desc a,
.maxi-archive-hero .wp-block-term-description a{
  color: #007236;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.maxi-archive-hero .maxi-archive-desc a:hover,
.maxi-archive-hero .wp-block-term-description a:hover{
  color: #005c2b;
}
.maxi-archive-hero .maxi-archive-desc a strong,
.maxi-archive-hero .wp-block-term-description a strong{
  color: inherit;
}

/* Tytuł kategorii w hero */
.maxi-archive-hero h1.wp-block-query-title,
.maxi-archive-hero .wp-block-query-title{
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 auto 16px;
  color: #1f2937;
  line-height: 1.15;
  text-align: center;
  width: 100%;
}

/* Description term (SEO copy) — natywny blok term-description w hero */
.maxi-archive-hero .maxi-archive-desc,
.maxi-archive-hero .wp-block-term-description{
  max-width: 1200px;
  margin: 18px auto 0;
  color: #1f2937;
  font-size: 14px;
  line-height: 1.7;
  text-align: left;
}
.maxi-archive-hero .maxi-archive-desc p,
.maxi-archive-hero .wp-block-term-description p{
  margin: 0 0 0.9em;
  font-size: 14px;
  line-height: 1.7;
}
.maxi-archive-hero .maxi-archive-desc p:last-child,
.maxi-archive-hero .wp-block-term-description p:last-child{ margin-bottom: 0; }

/* Mobile: opis kategorii schowany wizualnie (zostaje w HTML dla SEO), żeby produkty
   były od razu pod tytułem. Hero zostaje zwięzły: breadcrumb + tytuł. */
@media (max-width: 768px){
  .maxi-archive-hero{
    padding-top: 16px;
    padding-bottom: 14px;
  }
  /* Mniejszy tytuł + mniejszy odstęp od breadcrumbs na mobile */
  .maxi-archive-hero h1.wp-block-query-title,
  .maxi-archive-hero .wp-block-query-title{
    font-size: 24px;
    margin-top: 4px;
    margin-bottom: 0;
  }
  .maxi-archive-hero .maxi-archive-desc,
  .maxi-archive-hero .wp-block-term-description{
    display: none !important;
  }
  /* Mobile: chowamy licznik wyników i select sortowania */
  .wp-block-woocommerce-product-results-count,
  .wc-block-product-results-count,
  .wp-block-woocommerce-catalog-sorting,
  .wc-block-catalog-sorting{
    display: none !important;
  }
  /* ...i pustą grupę, która je opakowuje (żeby nie został odstęp) */
  .wp-block-group:has(> .wp-block-woocommerce-catalog-sorting){
    display: none !important;
  }
}
.maxi-archive-desc p{
  margin: 0 0 1em;
  font-size: 12px;
  line-height: 1.55;
}
.maxi-archive-desc p:last-child{ margin-bottom: 0; }

/* Footer kategorii — reszta opisu pod produktami (normalny font) */
.maxi-archive-cat-footer{
  max-width: 1200px;
  margin: 48px auto 24px;
  padding: 32px clamp(20px, 4vw, 40px);
  background: #fafafa;
  border-radius: 12px;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.55;
}
.maxi-archive-cat-footer p{
  margin: 0 0 1em;
  font-size: 12px;
  line-height: 1.55;
}
.maxi-archive-cat-footer p:last-child{ margin-bottom: 0; }
.maxi-archive-cat-footer strong{
  color: #1f2937;
}

/* Fallback tytuł poza hero (np. shop bez breadcrumbs) */
h1.wp-block-query-title,
.wp-block-query-title{
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 24px 0 28px;
  color: #1f2937;
  line-height: 1.2;
}

/* === Karta produktu === */
.wc-block-product,
li.product.wc-block-product,
.wp-block-post.product{
  list-style: none;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
  display: flex !important;
  flex-direction: column;
  gap: 10px;
}
.wc-block-product:hover,
li.product.wc-block-product:hover,
.wp-block-post.product:hover{
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  border-color: #d1d5db;
  transform: translateY(-2px);
}

/* Obraz produktu */
.wc-block-product .wc-block-components-product-image,
.wc-block-product .wp-block-woocommerce-product-image,
li.product .wc-block-grid__product-image{
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f9fafb;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wc-block-product .wc-block-components-product-image img,
.wc-block-product .wp-block-woocommerce-product-image img,
li.product .wc-block-grid__product-image img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 12px;
  box-sizing: border-box;
}

/* Tytuł produktu — TYLKO struktura (2 linie clamp dla rownej wysokosci kart).
   Typografia (rozmiar, weight, kolor) zostawiona blockowi — ustaw w sidebar w FSE
   (preset z theme.json albo custom px). */
.wc-block-product .wp-block-post-title,
.wc-block-product h3,
li.product .wp-block-post-title{
  margin: 14px 0 4px;
  min-height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wc-block-product .wp-block-post-title a,
li.product .wp-block-post-title a,
.wc-block-product .wp-block-post-title a:visited{
  color: inherit;
  text-decoration: none;
  background: none;
}
.wc-block-product .wp-block-post-title a:hover,
li.product .wp-block-post-title a:hover{
  color: #007236;
  text-decoration: none;
}

/* Cena */
.wc-block-components-product-price,
li.product .price,
.wp-block-woocommerce-product-price{
  font-size: 17px;
  font-weight: 700;
  color: #007236;
  margin: 0 0 8px;
  display: block;
}
.wc-block-components-product-price ins,
.price ins{
  text-decoration: none;
  color: #007236;
  background: none;
}
.wc-block-components-product-price del,
.price del{
  color: #9ca3af;
  font-weight: 500;
  font-size: 14px;
  margin-right: 6px;
}
.wc-block-components-product-price__value{
  font-weight: 700;
}

/* "Do koszyka" button — full-width pill z ikoną SVG + hover lift */
.wp-block-woocommerce-product-button,
.wp-block-woocommerce-product-button .wp-block-button{
  margin: 0;
  width: 100%;
}
.wp-block-woocommerce-product-button .wp-block-button__link,
.wc-block-product .wp-block-button__link,
li.product .button.add_to_cart_button,
li.product .button{
  position: relative;
  background: #007236;
  background-color: #007236;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 12px 14px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  line-height: 1;
  white-space: nowrap;
  width: 100%;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 114, 54, .18);
  transition: background .15s, box-shadow .15s, transform .15s;
  opacity: 1;
  cursor: pointer;
}
.wp-block-woocommerce-product-button .wp-block-button__link:hover,
.wc-block-product .wp-block-button__link:hover,
li.product .button.add_to_cart_button:hover,
li.product .button:hover{
  background: #005c2b;
  box-shadow: 0 6px 14px rgba(0, 114, 54, .28);
  transform: translateY(-1px);
  opacity: 1;
}
.wp-block-woocommerce-product-button .wp-block-button__link:active,
li.product .button:active{
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 114, 54, .18);
}

/* Ikona koszyka przed tekstem (SVG mask, flat outline) */
.wp-block-woocommerce-product-button .wp-block-button__link::before,
.wc-block-product .wp-block-button__link::before,
li.product .button.add_to_cart_button::before{
  content: "";
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: inline-block;
  position: relative;
  top: -2px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 5h2.2l2.4 11h11l2-7H7'/><circle cx='9' cy='20' r='1.6'/><circle cx='18' cy='20' r='1.6'/></svg>") no-repeat center / contain;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 5h2.2l2.4 11h11l2-7H7'/><circle cx='9' cy='20' r='1.6'/><circle cx='18' cy='20' r='1.6'/></svg>") no-repeat center / contain;
}

/* Pasek "Wyświetlanie X wyników" */
/* === Pasek nad produktami (licznik + sortowanie) ===
   Blok jest alignwide (rozpychał się szerzej niż produkty). Ograniczamy do szerokości
   contentu. Jest już flex + space-between, więc licznik z lewej, sortowanie z prawej. */
body.tax-product_cat .wp-block-group:has(> .wp-block-woocommerce-catalog-sorting){
  max-width: 1200px;
  margin: 2px auto 16px;
  align-items: center;
}

/* Licznik wyników — subtelny pill z ikoną siatki (beż + brandowa zieleń) */
.wp-block-woocommerce-product-results-count{ margin: 0; }
.woocommerce-result-count{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #4b5563;
  background: #faf8f2;
  border: 1px solid #ece8dd;
  border-radius: 999px;
  padding: 6px 14px 6px 12px;
  margin: 0;
  line-height: 1.2;
}
.woocommerce-result-count::before{
  content: "";
  flex: none;
  width: 15px;
  height: 15px;
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23007236' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E");
}

/* Ładniejszy select sortowania */
.wp-block-woocommerce-catalog-sorting select,
.woocommerce-ordering select.orderby{
  font-size: 13px;
  color: #374151;
  padding: 7px 30px 7px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: #fff;
  cursor: pointer;
  transition: border-color .15s ease;
}
.wp-block-woocommerce-catalog-sorting select:hover,
.woocommerce-ordering select.orderby:hover{
  border-color: #007236;
}

/* Grid kontener — gap między kartami */
.wp-block-woocommerce-product-template{
  gap: 20px;
  --wp--style--block-gap: 20px;
}
.wp-block-post-template.is-layout-grid,
.wp-block-woocommerce-product-template.is-layout-grid{
  gap: 20px;
}

/* === Pagination — numerowane okrągłe pille + prev/next === */
.wp-block-query-pagination{
  display: flex !important;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 36px 0 24px;
  flex-wrap: wrap;
}

.wp-block-query-pagination-numbers{
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}

.wp-block-query-pagination .page-numbers,
.wp-block-query-pagination-previous,
.wp-block-query-pagination-next{
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  background: #fff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1;
  transition: background .15s, color .15s, border-color .15s;
}

.wp-block-query-pagination .page-numbers:hover,
.wp-block-query-pagination-previous:hover,
.wp-block-query-pagination-next:hover{
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #007236;
  text-decoration: none;
}

.wp-block-query-pagination .page-numbers.current{
  background: #007236;
  color: #fff;
  border-color: #007236;
  cursor: default;
}

.wp-block-query-pagination .page-numbers.dots{
  background: transparent;
  border: 0;
  color: #9ca3af;
  cursor: default;
  min-width: auto;
  padding: 0 4px;
}
.wp-block-query-pagination .page-numbers.dots:hover{
  background: transparent;
  color: #9ca3af;
}

.wp-block-query-pagination-previous,
.wp-block-query-pagination-next{
  padding: 0 18px;
  font-weight: 600;
}
