/* Single product page — odstęp od nav, okruszki, meta layout. */

/* Zeruj margin-top z theme.json (1.6rem na 2. child wp-site-blocks) */
body.single-product .wp-site-blocks > .wp-block-group{
  margin-top: 0;
  padding-top: 0;
}

/* Breadcrumbs jak na archive — subtle gray, wyśrodkowane */
body.single-product .wp-block-woocommerce-breadcrumbs,
body.single-product .wc-block-breadcrumbs,
body.single-product .woocommerce-breadcrumb{
  font-size: 13px;
  color: #6b7280;
  padding: 24px 0 8px;
  margin: 0 auto;
  text-align: center;
}
body.single-product .wp-block-woocommerce-breadcrumbs a,
body.single-product .wc-block-breadcrumbs a,
body.single-product .woocommerce-breadcrumb a{
  color: #6b7280;
  text-decoration: none;
}
body.single-product .wp-block-woocommerce-breadcrumbs a:hover,
body.single-product .wc-block-breadcrumbs a:hover{
  color: #007236;
}

/* Produkt meta (kategorie + marki) — ujednolicony layout */
.wp-block-woocommerce-product-meta{
  margin-top: 18px;
  padding: 16px 0;
  border-top: 1px solid #f3f4f6;
}
.wp-block-woocommerce-product-meta > .wp-block-group{
  display: flex !important;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.wp-block-woocommerce-product-meta .wp-block-post-terms{
  font-size: 13px;
  color: #4b5563;
}
.wp-block-woocommerce-product-meta .wp-block-post-terms__prefix{
  color: #6b7280;
  font-weight: 600;
  margin-right: 4px;
}
.wp-block-woocommerce-product-meta .wp-block-post-terms a{
  color: #1f2937;
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: border-color .15s, color .15s;
}
.wp-block-woocommerce-product-meta .wp-block-post-terms a:hover{
  color: #007236;
  border-bottom-color: #007236;
}
.wp-block-woocommerce-product-meta .wp-block-post-terms__separator{
  color: #9ca3af;
}

/* === Related products — karty jak na archive === */
.wp-block-woocommerce-related-products .wp-block-heading,
.wc-block-product-related-products .wp-block-heading{
  font-size: 22px;
  font-weight: 600;
  margin: 48px 0 24px;
  color: #1f2937;
}

.wp-block-woocommerce-related-products .wp-block-post,
.wc-block-product-related-products .wp-block-post{
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  transition: box-shadow .2s, border-color .2s, transform .2s;
  display: flex !important;
  flex-direction: column;
  gap: 8px;
}
.wp-block-woocommerce-related-products .wp-block-post:hover,
.wc-block-product-related-products .wp-block-post:hover{
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  border-color: #d1d5db;
  transform: translateY(-2px);
}

/* Obraz related */
.wp-block-woocommerce-related-products .wp-block-woocommerce-product-image,
.wc-block-product-related-products .wp-block-woocommerce-product-image{
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f9fafb;
  aspect-ratio: 1 / 1;
}
.wp-block-woocommerce-related-products .wp-block-woocommerce-product-image img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
  box-sizing: border-box;
}

/* Tytuł related — clamp 2 linie, normalny font */
.wp-block-woocommerce-related-products .wp-block-post-title,
.wc-block-product-related-products .wp-block-post-title{
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  margin: 12px 0 4px;
  color: #1f2937;
  letter-spacing: 0;
  text-align: center;
  min-height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wp-block-woocommerce-related-products .wp-block-post-title a,
.wc-block-product-related-products .wp-block-post-title a{
  color: inherit;
  text-decoration: none;
}
.wp-block-woocommerce-related-products .wp-block-post-title a:hover,
.wc-block-product-related-products .wp-block-post-title a:hover{
  color: #007236;
}

/* Cena related */
.wp-block-woocommerce-related-products .wp-block-woocommerce-product-price,
.wc-block-product-related-products .wp-block-woocommerce-product-price{
  font-size: 17px;
  font-weight: 700;
  color: #007236;
  text-align: center;
  margin: 0 0 8px;
}

/* Button related + ocen + wszystkie wp-element-button na single product = brand green */
body.single-product .wp-element-button,
body.single-product .wp-block-button__link,
body.single-product .add_to_cart_button,
body.single-product button.single_add_to_cart_button,
body.single-product .wp-block-woocommerce-related-products .wp-block-button__link,
body.single-product .woocommerce button[type="submit"]{
  background: #007236;
  background-color: #007236;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 13px 22px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .15s;
  box-shadow: 0 2px 6px rgba(0, 114, 54, .18);
}
/* === Variations form — większy select-button picker === */
body.single-product table.variations,
body.single-product .variations{
  border-collapse: collapse;
  margin: 20px 0;
  width: 100%;
}
body.single-product table.variations th.label,
body.single-product table.variations td.value{
  padding: 8px 0;
  vertical-align: middle;
}
body.single-product table.variations th.label label{
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
  text-transform: uppercase;
  letter-spacing: .04em;
}
body.single-product table.variations td.value{
  padding-left: 16px;
}
body.single-product .variations select{
  height: 48px;
  min-width: 200px;
  padding: 0 40px 0 18px;
  border: 2px solid #d1d5db;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  background: #fff;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f2937' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
body.single-product .variations select:hover,
body.single-product .variations select:focus{
  border-color: #007236;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(0,114,54,.12);
}

body.single-product .reset_variations{
  display: inline-block !important;
  margin-left: 14px;
  color: #6b7280;
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
body.single-product .reset_variations:hover{
  color: #007236;
  border-bottom-color: #007236;
}

/* === Form cart — quantity input + add to cart layout === */
body.single-product form.cart{
  display: flex !important;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  flex-wrap: wrap;
}
body.single-product .woocommerce-variation-add-to-cart{
  display: flex !important;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

body.single-product .quantity{
  display: inline-flex !important;
  align-items: center;
  margin: 0;
}
body.single-product .quantity .screen-reader-text{
  position: absolute;
  left: -9999px;
}
body.single-product .quantity input.qty,
body.single-product input.qty[name="quantity"]{
  width: 76px;
  height: 48px;
  padding: 0 10px;
  border: 2px solid #d1d5db;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  background: #fff;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
  -webkit-appearance: textfield;
  transition: border-color .15s, box-shadow .15s;
}
/* Wyłącz browser native +/- spinners — agresywnie, dla każdego input[type=number] na single product */
html body.single-product input[type="number"]::-webkit-outer-spin-button,
html body.single-product input[type="number"]::-webkit-inner-spin-button,
html body.single-product .quantity input::-webkit-outer-spin-button,
html body.single-product .quantity input::-webkit-inner-spin-button,
html body.single-product input.qty::-webkit-outer-spin-button,
html body.single-product input.qty::-webkit-inner-spin-button{
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  display: none !important;
  width: 0;
  height: 0;
  visibility: hidden !important;
}
html body.single-product input[type="number"],
html body.single-product input.qty{
  -moz-appearance: textfield;
  appearance: textfield;
  -webkit-appearance: textfield;
}
body.single-product .quantity input.qty:focus{
  outline: 0;
  border-color: #007236;
  box-shadow: 0 0 0 3px rgba(0,114,54,.12);
}

/* Add to cart button — większy, ciemnozielony (override lighter wp-element-button) */
body.single-product button.single_add_to_cart_button,
body.single-product .single_add_to_cart_button{
  height: 48px;
  padding: 0 28px;
  font-size: 14px;
  background: #007236;
  background-color: #007236;
  background-image: none;
  color: #fff;
  opacity: 1;
}
body.single-product button.single_add_to_cart_button:hover,
body.single-product .single_add_to_cart_button:hover{
  background: #005c2b;
  background-color: #005c2b;
  opacity: 1;
}

body.single-product .wp-element-button:hover,
body.single-product .wp-block-button__link:hover,
body.single-product .add_to_cart_button:hover,
body.single-product button.single_add_to_cart_button:hover,
body.single-product .woocommerce button[type="submit"]:hover{
  background: #005c2b;
  box-shadow: 0 6px 14px rgba(0, 114, 54, .28);
  transform: translateY(-1px);
}

/* ===================== MOBILE (single product) ===================== */
@media (max-width: 768px){
  /* Tytuł produktu mniejszy */
  body.single-product .wp-block-post-title,
  body.single-product h1.product_title,
  body.single-product .product_title{
    font-size: 24px;
    line-height: 1.25;
  }
  /* Dodaj do koszyka na pełną szerokość (lepszy tap), ilość nad nim */
  body.single-product form.cart .single_add_to_cart_button,
  body.single-product .woocommerce-variation-add-to-cart .single_add_to_cart_button{
    flex: 1 1 100%;
    width: 100%;
    justify-content: center;
  }
  /* Related products: 2 kolumny na mobile */
  .wp-block-woocommerce-related-products .is-layout-grid,
  .wc-block-product-related-products .is-layout-grid,
  .wp-block-woocommerce-related-products .wp-block-post-template,
  .wc-block-product-related-products .wp-block-post-template{
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  /* Galeria + podsumowanie układają się w kolumnę (gdyby core nie zestackował) */
  body.single-product .wp-block-columns:not(.is-not-stacked-on-mobile){
    flex-direction: column;
  }
}
