/* =========================================================
   Bernstein Woo — single product
   ========================================================= */

.product { padding-bottom: 64px; }

.product__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
}

@media only screen and (min-width: 992px) {
  .product__grid {
    grid-template-columns: minmax(0, 1.384fr) minmax(0, 1fr);
    gap: 42px;
    align-items: start;
  }
}

/* ---------- Gallery ---------- */

.product__gallery { position: relative; }

.product-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media only screen and (min-width: 768px) {
  .product-gallery { gap: 24px; }
}

.product-gallery__item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: var(--color-gray-ultra-light);
  cursor: zoom-in;
}

.product-gallery__item--wide { grid-column: 1 / -1; }

.product-gallery__image {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.product-gallery__item:hover .product-gallery__image { transform: scale(1.03); }

.product-gallery__zoom {
  position: absolute;
  right: 12px; bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--color-black);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.product-gallery__item:hover .product-gallery__zoom { opacity: 1; }

/* Badges over the gallery */

.product-badges--large {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 3;
  flex-direction: row;
  gap: 6px;
}

.product-badges--large .product-badges__item {
  height: 38px;
  padding: 0 10px;
  font-size: 16px;
  font-weight: 700;
  line-height: 38px;
}

.pdp-wishlist {
  position: absolute;
  top: 8px; right: 8px;
  z-index: 3;
}

.pdp-wishlist .wishlist_button { width: 60px; height: 60px; }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  background-color: rgba(17, 17, 17, 0.92);
}

.lightbox__image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.12);
  color: var(--color-white);
  transition: background-color var(--dur) var(--ease);
}

.lightbox__close:hover,
.lightbox__nav:hover { background-color: rgba(255, 255, 255, 0.28); }

.lightbox__close { top: 16px; right: 16px; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }

/* ---------- Summary header ---------- */

.product__content-inner { display: flex; flex-direction: column; }

.product__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 24px;
}

.product__brand {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product__title { line-height: 1.25; }
.product__subtitle { margin: 0; }
.product__sku { margin-top: 4px; }

.product .woocommerce-product-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 0;
  font-size: 13px;
}

/* ---------- Price ---------- */

.price--single { display: block; margin-top: 12px; }

.price--single .price__main {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.price--single .product-badges--price {
  position: static;
  flex-direction: row;
  gap: 6px;
  width: 100%;
  margin-bottom: 8px;
}

.price--single .product-badges__item {
  height: 24px;
  line-height: 24px;
  font-size: 11px;
  font-weight: 700;
}

.product-badges__item--saved {
  background-color: #c6f3b7;
  color: #174f21;
}

.price__now { font-size: 24px; font-weight: 700; line-height: 1.25; }
.price--on-sale .price__now { color: var(--color-red-discount); }
.price--on-sale .price__now .amount { color: inherit; }

.price__old del {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-gray);
  text-decoration: line-through;
}

.price__old del .amount { color: inherit; font-weight: inherit; }

.price__tax-note { margin: 6px 0 0; }

/* ---------- Options / chips ---------- */

.product-options { margin-bottom: 8px; }
.product-options__row + .product-options__row { margin-top: 24px; }
.product-options__label { margin-bottom: 16px; font-size: 16px; }

.chips--colors .colors {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.colors__item-image--large { width: 42px; height: 42px; cursor: pointer; }

.colors__item input:checked + .colors__item-image {
  box-shadow: 0 0 0 2px var(--color-white), 0 0 0 3px var(--color-black);
}

.colors__item input:focus-visible + .colors__item-image {
  outline: 2px solid var(--color-blue);
  outline-offset: 3px;
}

/* Non-colour attributes keep a styled native select. */
.product-options__select select {
  width: 100%;
  height: 48px;
  padding: 0 40px 0 16px;
  border: 1px solid var(--color-gray-medium);
  border-radius: 24px;
  background-color: var(--color-white);
  font-size: 16px;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.product-options__reset { min-height: 20px; margin-top: 8px; }
.product-options__reset .reset_variations { font-size: 13px; color: var(--color-gray); text-decoration: underline; }

/* ---------- Stock and delivery ---------- */

.product .stock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 500;
}

.product .stock::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background-color: var(--color-green);
}

.product .stock.out-of-stock::before { background-color: var(--color-red); }

/* ---------- Cart form ---------- */

.product form.cart {
  margin: 24px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--color-gray-light);
}

.product form.cart::after { content: ""; display: table; clear: both; }

.woocommerce-variation-add-to-cart,
.product form.cart:not(.variations_form) {
  display: flex;
  align-items: center;
  gap: 16px;
}

@media only screen and (min-width: 480px) {
  .woocommerce-variation-add-to-cart,
  .product form.cart:not(.variations_form) { gap: 24px; }
}

.quantity {
  position: relative;
  flex: none;
  width: 140px;
}

.quantity input.qty,
.quantity input[type="number"] {
  width: 100%;
  height: 48px;
  padding: 0 40px;
  border: 1px solid var(--color-gray);
  border-radius: 24px;
  background-color: transparent;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}

.quantity input::-webkit-outer-spin-button,
.quantity input::-webkit-inner-spin-button { appearance: none; margin: 0; }

.quantity__button {
  position: absolute;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 48px;
  color: var(--color-black);
}

.quantity__button--minus { left: 4px; }
.quantity__button--plus { right: 4px; }
.quantity__button:disabled { opacity: 0.35; cursor: not-allowed; }

.quantity--hidden { display: none; }

.product .single_add_to_cart_button {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 24px;
  background-color: var(--color-black);
  color: var(--color-white);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease);
}

.product .single_add_to_cart_button:hover { background-color: var(--color-black-light); }
.product .single_add_to_cart_button.disabled { opacity: 0.4; cursor: not-allowed; }

.woocommerce-variation-price { margin-bottom: 16px; }
.woocommerce-variation-price .price__now { font-size: 20px; }
.woocommerce-variation-availability { margin-bottom: 12px; }

/* ---------- Payments row ---------- */

.product__payments { margin-top: 20px; }
.product__payments ul { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Detail accordions ---------- */

.product__details { margin-top: 32px; }

.details { border-top: 1px solid var(--color-gray-light); }
.details:last-child { border-bottom: 1px solid var(--color-gray-light); }

.details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0;
  cursor: pointer;
  list-style: none;
}

.details summary::-webkit-details-marker { display: none; }
.details summary h2 { margin: 0; }
.details__caret { transition: transform var(--dur) var(--ease); }
.details[open] summary .details__caret { transform: rotate(180deg); }
.details__content { padding-bottom: 24px; }

.details__content table,
.woocommerce-product-attributes {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.woocommerce-product-attributes th,
.woocommerce-product-attributes td {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-gray-light);
  text-align: left;
  vertical-align: top;
}

.woocommerce-product-attributes th { width: 40%; font-weight: 500; color: var(--color-black); }
.woocommerce-product-attributes td { color: var(--color-gray); }
.woocommerce-product-attributes td p { margin: 0; }

/* ---------- Reassurance icons ---------- */

.product__icons { margin-top: 32px; }

.product__icons ul {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.product__icons li {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.product__icons svg { color: var(--color-blue); }
.product__icons p { margin: 0; line-height: 1.35; }

/* ---------- Related products ---------- */

.related, .up-sells { margin-top: 64px; }
.related > h2, .up-sells > h2 { margin-bottom: 24px; font-size: 32px; }

@media only screen and (min-width: 1400px) {
  .related > h2, .up-sells > h2 { font-size: 48px; }
}

/* ---------- Reviews ---------- */

#reviews .commentlist { margin: 0 0 24px; }
#reviews .comment_container { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--color-gray-light); }
#reviews .comment_container img { width: 48px; height: 48px; border-radius: 50%; }
#reviews .meta { margin-bottom: 6px; font-size: 13px; color: var(--color-gray); }
