/*
 * WebCreare Commerce — pagina prodotto (Fase 6).
 * Richiede le custom properties di theme.css.
 */

.wc-product {
  max-width: var(--wc-container-max);
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

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

.wc-gallery {
  position: sticky;
  top: 96px;
  display: flex;
  gap: 16px;
}

.wc-gallery__thumbs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 72px;
  flex-shrink: 0;
  max-height: 560px;
  overflow-y: auto;
}

.wc-gallery__thumb {
  border: 1px solid var(--wc-color-border);
  border-radius: var(--wc-radius-sm);
  overflow: hidden;
  padding: 0;
  background: none;
  cursor: pointer;
  aspect-ratio: 1;
  flex-shrink: 0;
  transition: border-color var(--wc-transition);
}

.wc-gallery__thumb.is-active {
  border-color: var(--wc-color-primary);
}

.wc-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wc-gallery__main {
  flex: 1;
  border-radius: var(--wc-radius-md);
  overflow: hidden;
  background: var(--wc-color-bg);
  aspect-ratio: 4 / 5;
}

.wc-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Buy-box ---------- */

.wc-buybox__name {
  font-family: var(--wc-font-heading);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: var(--wc-color-text);
}

.wc-buybox__rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13.5px;
  color: var(--wc-color-text-muted);
}

.wc-buybox__rating-count {
  color: var(--wc-color-primary);
  text-decoration: none;
  font-weight: 600;
}

.wc-buybox__rating-count:hover {
  text-decoration: underline;
}

.wc-buybox__price {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
}

.wc-buybox__price-now {
  font-size: 26px;
  font-weight: 800;
  color: var(--wc-color-text);
  font-variant-numeric: tabular-nums;
}

.wc-buybox__price-old {
  font-size: 16px;
  color: var(--wc-color-text-muted);
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
}

.wc-buybox__price-badge {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--wc-color-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.wc-buybox__short-desc {
  color: var(--wc-color-text-muted);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 0 0 24px;
}

/* ---------- Varianti ---------- */

.wc-variant-group {
  margin-bottom: 20px;
}

.wc-variant-group__label {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--wc-color-text);
}

.wc-variant-swatches,
.wc-variant-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.wc-variant-swatch {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  padding: 3px;
  cursor: pointer;
  background: var(--swatch-color);
  box-shadow: inset 0 0 0 1px var(--wc-color-border);
  outline-offset: 2px;
}

.wc-variant-swatch.is-selected {
  box-shadow: 0 0 0 2px var(--wc-color-surface), 0 0 0 4px var(--wc-color-secondary);
}

.wc-variant-swatch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.wc-variant-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border: 1px solid var(--wc-color-border);
  border-radius: var(--wc-radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--wc-color-text);
  cursor: pointer;
  transition: border-color var(--wc-transition), background var(--wc-transition), color var(--wc-transition);
}

.wc-variant-pill input {
  position: absolute;
  opacity: 0;
}

.wc-variant-pill.is-selected {
  border-color: var(--wc-color-secondary);
  background: var(--wc-color-secondary);
  color: #fff;
}

/* ---------- Quantità + CTA ---------- */

.wc-buybox__qty {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.wc-buybox__qty-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--wc-color-text);
}

.wc-qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--wc-color-border);
  border-radius: var(--wc-radius-sm);
  overflow: hidden;
}

.wc-qty-stepper__btn {
  width: 38px;
  height: 40px;
  border: 0;
  background: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--wc-color-text);
  transition: background var(--wc-transition);
}

.wc-qty-stepper__btn:hover {
  background: var(--wc-color-bg);
}

.wc-qty-stepper__input {
  width: 44px;
  height: 40px;
  border: 0;
  border-left: 1px solid var(--wc-color-border);
  border-right: 1px solid var(--wc-color-border);
  text-align: center;
  font-size: 14px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}

.wc-qty-stepper__input::-webkit-outer-spin-button,
.wc-qty-stepper__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.wc-buybox__cta {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: var(--wc-radius-md);
  background: var(--wc-color-secondary);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: background var(--wc-transition), transform 120ms ease;
}

.wc-buybox__cta:hover {
  background: var(--wc-color-primary);
}

.wc-buybox__cta:active {
  transform: scale(0.98);
}

.wc-buybox__cta--disabled {
  background: var(--wc-color-border);
  color: var(--wc-color-text-muted);
  cursor: not-allowed;
}

.wc-buybox__shipping-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--wc-color-text-muted);
  font-size: 13px;
}

/* ---------- Badge fiducia ---------- */

.wc-trust {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--wc-color-border);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wc-trust__payments-label,
.wc-trust__trustpilot-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--wc-color-text-muted);
  margin-bottom: 8px;
}

.wc-trust__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wc-trust__badge {
  padding: 7px 14px;
  border: 1px solid var(--wc-color-border);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--wc-color-text);
}

.wc-trust__reviews {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wc-trust__trustpilot-stars {
  color: #00B67A;
  letter-spacing: 1px;
}

.wc-trust__trustpilot-score {
  font-size: 13px;
  color: var(--wc-color-text-muted);
}

/* ---------- FAQ ---------- */

.wc-faq {
  margin-top: 32px;
}

.wc-faq__title {
  font-family: var(--wc-font-heading);
  font-size: 19px;
  font-weight: 800;
  margin: 0 0 4px;
  color: var(--wc-color-text);
}

.wc-faq__item {
  border-top: 1px solid var(--wc-color-border);
}

.wc-faq__item:last-child {
  border-bottom: 1px solid var(--wc-color-border);
}

.wc-faq__question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 2px;
  border: 0;
  background: none;
  text-align: left;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--wc-color-text);
  cursor: pointer;
  font-family: inherit;
}

.wc-faq__question svg {
  flex-shrink: 0;
  transition: transform var(--wc-transition);
}

.wc-faq__question[aria-expanded='true'] svg {
  transform: rotate(180deg);
}

/* .wc-faq__answer è anche .wc-accordion (regola in theme.css): qui solo la tipografia.
   Il padding vive sull'inner (.wc-accordion__inner) perché deve collassare a zero insieme
   al contenitore quando chiuso — un padding sul contenitore stesso lascerebbe uno spazio
   residuo visibile anche a grid-template-rows: 0fr. */
.wc-faq__answer {
  color: var(--wc-color-text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.wc-faq__answer .wc-accordion__inner {
  padding: 0 2px 16px;
}

.wc-faq__answer p {
  margin: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .wc-product {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 24px 16px 48px;
  }

  .wc-gallery {
    position: static;
    flex-direction: column-reverse;
  }

  .wc-gallery__thumbs {
    flex-direction: row;
    width: auto;
    max-height: none;
    overflow-x: auto;
  }

  .wc-gallery__thumb {
    width: 64px;
  }
}
