/*
 * Single product layout (WooCommerce default markup, no template override):
 * gallery left + summary right; tabs and related products span both columns.
 * Form controls, tabs and related products: pages-product-form-tabs.css.
 */

.woocommerce-content > .product {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
}

.woocommerce-content > .product > .woocommerce-tabs,
.woocommerce-content > .product > .related,
.woocommerce-content > .product > .upsells,
.woocommerce-content > .product > .product-questions {
  grid-column: 1 / -1;
}

@media (min-width: 900px) {
  .woocommerce-content > .product {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    column-gap: clamp(2.5rem, 5vw, 5rem);
  }

  /* Not sticky: the grid also holds the full-width tabs, so a sticky gallery slid over the description. */
  .woocommerce-content > .product > .woocommerce-product-gallery {
    align-self: start;
  }
}

/* ---------- Gallery (Woo flexslider + photoswipe lightbox markup) ---------- */
.woocommerce-product-gallery {
  position: relative;
  margin: 0;
}

.woocommerce-product-gallery__wrapper {
  margin: 0;
  padding: 0;
}

.woocommerce-product-gallery .flex-viewport,
.woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:only-child,
.woocommerce-product-gallery__image--placeholder {
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--color-sand);
  box-shadow: var(--shadow-md);
}

.woocommerce-product-gallery__image img,
.woocommerce-product-gallery__image--placeholder img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.flex-control-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
}

.flex-control-thumbs img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-md);
  opacity: 0.6;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.flex-control-thumbs img:hover,
.flex-control-thumbs img.flex-active {
  opacity: 1;
}

.flex-control-thumbs img.flex-active {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.woocommerce-content > .product > .onsale {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 10;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-on-primary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

/* ---------- Summary ---------- */
/* One even rhythm between blocks (title · price · variants · buy row · assurances); the price hugs the title. */
.product .summary {
  display: grid;
  gap: var(--space-5);
  align-content: start;
}

.product .summary > .price {
  margin-top: calc(-1 * var(--space-3));
}

.product .summary .product_title {
  display: grid;
  justify-items: start;
  gap: var(--space-2);
  font-size: var(--font-size-2xl);
}

/* Variant part of the name ("Hũ tròn") as a small badge above the product name. */
.product-title__variant {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.04em;
  line-height: 1.6;
}

.product .summary > .price {
  color: var(--color-text-muted);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-regular);
}

.product .summary > .price .amount {
  color: var(--color-price);
  font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.75rem); /* between xl and 2xl: a notch under the title */
  font-weight: var(--font-weight-semibold);
}

/* Sale: the old price stays muted and small. */
.product .summary > .price del .amount {
  color: var(--color-text-muted);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-regular);
}

.woocommerce-product-details__short-description {
  max-width: 52ch;
  color: var(--color-text-muted);
  font-size: var(--font-size-lg);
}

.woocommerce-product-details__short-description > * + * {
  margin-top: var(--space-3);
}

.product-assurances {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  list-style: none;
}

.product-assurances li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.product-assurances .icon {
  color: var(--color-primary);
}

