/* =========================================================================
   AZORSOUL · Página de produto (template)
   Depende dos tokens de brand.css e das primitivas de main.css.
   ========================================================================= */

/* Layout: 2 colunas, full bleed. Esquerda = info (scroll), direita = galeria (sticky) */
.product-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

/* ---- ESQUERDA · informação ------------------------------------------ */
.pp__info {
  padding: calc(var(--nav-h) + clamp(1.5rem, 4vw, 3rem)) clamp(1.5rem, 4vw, 4rem) clamp(3rem, 7vw, 6rem);
  max-width: 44rem;
  margin-inline: auto;
  width: 100%;
}
.pp__breadcrumb {
  font-size: var(--step--1);
  color: var(--text-muted);
  margin-bottom: var(--space-m);
}
.pp__breadcrumb a { color: inherit; text-decoration: none; }
.pp__breadcrumb a:hover { color: var(--c-primary); }

.pp__name {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--step-3);
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  color: var(--c-primary);
  text-transform: none;
  margin: var(--space-2xs) 0 var(--space-s);
}

.pp__price {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  font-size: var(--step-2);
  margin-bottom: var(--space-m);
}
.pp__price s { color: var(--text-muted); font-size: var(--step-1); }
.pp__price b { color: var(--a-terracotta); font-weight: 700; }
.pp__save {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 700;
  color: #fff;
  background: var(--a-terracotta);
  border-radius: 4px;
  padding: .2em .5em;
  align-self: center;
}

.pp__short {
  font-size: var(--step-0);
  line-height: var(--lh-normal);
  color: var(--text-soft);
  max-width: 34rem;
  margin-bottom: var(--space-l);
}

/* ---- Compra (cor / tamanho / quantidade) ---------------------------- */
.pp__buy { display: flex; flex-direction: column; gap: var(--space-m); }
.pp__option { display: flex; flex-direction: column; gap: var(--space-2xs); }
.pp__label {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--step--1);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--c-ink-soft);
}
.pp__label .pp__value { text-transform: none; letter-spacing: 0; color: var(--c-primary); }

/* Cor (swatches) */
.pp__swatches { display: flex; gap: .6rem; }
.pp__swatch {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--sw);
  border: 0;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(38,41,15,.18);
  outline: 2px solid transparent;
  outline-offset: 3px;
  transition: outline-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.pp__swatch.is-active { outline-color: var(--c-primary); animation: pp-pop .32s var(--ease-out); }
.pp__swatch:active { transform: scale(.9); }

/* Tamanho */
.pp__sizes { display: flex; flex-wrap: wrap; gap: .5rem; }
.pp__size {
  min-width: 3rem;
  padding: .55em .3em;
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-control);
  font-family: var(--font-body);
  font-size: var(--step--1);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}
.pp__size:hover { border-color: var(--c-primary-300); }
.pp__size:active { transform: scale(.94); }
.pp__size.is-active { background: var(--c-primary); color: var(--c-paper); border-color: var(--c-primary); animation: pp-pop .32s var(--ease-out); }
.pp__sizeguide { font-size: var(--step--1); color: var(--c-primary); text-underline-offset: 2px; margin-top: .3rem; align-self: flex-start; }

/* Quantidade */
.pp__qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-control);
  overflow: hidden;
  width: max-content;
  background: var(--c-white);
}
.pp__qty-btn {
  width: 2.6rem; height: 2.6rem;
  background: none; border: 0; cursor: pointer;
  font-size: var(--step-1); color: var(--c-primary); line-height: 1;
}
.pp__qty-btn:hover { background: var(--c-secondary-100); }
.pp__qty-btn:active { transform: scale(.86); }
.pp__qty-input {
  width: 3rem; height: 2.6rem;
  border: 0; border-inline: 1px solid var(--c-line);
  text-align: center;
  font-family: var(--font-body); font-size: var(--step-0); color: var(--text);
  background: none;
}

.pp__add { width: 100%; justify-content: center; margin-top: var(--space-2xs); }
/* linha do botão de compra + favorito (coração mais pequeno ao lado) */
.pp__actions { display: flex; gap: .6rem; align-items: stretch; margin-top: var(--space-2xs); }
.pp__actions .pp__add { width: auto; flex: 1; margin-top: 0; }
.pp__wish {
  flex: none;
  width: 3.2rem;
  display: grid; place-items: center;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-control);
  background: var(--c-white);
  color: var(--c-primary);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast), color var(--dur-fast);
}
.pp__wish .wish__icon { width: 22px; height: 22px; }
.pp__wish:hover { border-color: var(--c-primary-300); }
.pp__wish:active { transform: scale(.92); }
.pp__wish.is-active { background: var(--a-terracotta); border-color: var(--a-terracotta); color: #fff; }
.pp__add:active { transform: scale(.985); }
.pp__add.is-added { background: var(--c-primary-300); animation: pp-pop .32s var(--ease-out); }
.pp__note { font-size: var(--step--1); color: var(--text-muted); }

/* micro-interações: "pop" ao selecionar / bump na quantidade */
@keyframes pp-pop { 0% { transform: scale(1); } 40% { transform: scale(1.14); } 100% { transform: scale(1); } }
.pp__qty-input.is-bumped { animation: pp-pop .3s var(--ease-out); }
.pp__qty-btn { transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out); }
@media (prefers-reduced-motion: reduce) {
  .pp__swatch, .pp__size, .pp__qty-btn, .pp__add { transition: none; }
  .pp__swatch.is-active, .pp__size.is-active, .pp__qty-input.is-bumped, .pp__add.is-added { animation: none; }
}

/* One Tree Planted — bloco destacado na página de produto */
.otp-highlight {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  margin-top: var(--space-l);
  padding: var(--space-m);
  background: var(--c-primary-100);
  border-radius: var(--radius-m);
}
.otp-highlight__logo { flex: none; width: 68px; height: 68px; }
.otp-highlight h2 {
  font-family: var(--font-display); font-weight: 400;
  font-size: var(--step-1); color: var(--c-primary);
  text-transform: none; margin-bottom: .2rem;
}
.otp-highlight p { color: var(--text-soft); font-size: var(--step--1); line-height: var(--lh-snug); }
.otp-highlight a { color: var(--c-primary); text-underline-offset: 2px; }

/* Descrição (último bloco antes de o sticky terminar) */
.pp__desc { margin-top: var(--space-xl); }
.pp__desc h2 {
  font-family: var(--font-display); font-weight: 400;
  font-size: var(--step-2); color: var(--c-primary);
  margin-bottom: var(--space-s);
}
.pp__desc p { color: var(--text-soft); line-height: var(--lh-normal); }
.pp__desc p + p { margin-top: var(--space-s); }
.pp__desc ul { margin: var(--space-s) 0 0; padding-left: 1.1rem; color: var(--text-soft); display: grid; gap: .35rem; }

/* ---- DIREITA · galeria (carrossel sticky) --------------------------- */
.pp__gallery { position: sticky; top: 0; height: 100svh; }
.gallery { position: relative; height: 100%; overflow: hidden; background: var(--c-secondary-100); }
.gallery__track {
  display: flex;
  height: 100%;
  margin: 0; padding: 0; list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__slide {
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: start;
  /* placeholder cinzento (até haver fotografias) */
  background:
    repeating-linear-gradient(45deg, rgba(38,41,15,.04) 0 16px, rgba(38,41,15,.015) 16px 32px),
    #cfcdc2;
}
.gallery__slide--img { background: var(--c-paper); }
.gallery__slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* setas */
.gallery__nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px;
  display: grid; place-items: center;
  background: rgba(247,245,236,.85);
  border: 0; border-radius: 50%;
  color: var(--c-primary);
  cursor: pointer;
  box-shadow: var(--shadow-m);
  backdrop-filter: blur(4px);
  transition: background var(--dur-fast);
}
.gallery__nav:hover { background: var(--c-paper); }
.gallery__nav--prev { left: 1rem; }
.gallery__nav--next { right: 1rem; }
/* pontos */
.gallery__dots {
  position: absolute;
  left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  display: flex; gap: .5rem;
}
.gallery__dot {
  width: 9px; height: 9px; border-radius: 50%;
  border: 0; padding: 0; cursor: pointer;
  background: rgba(247,245,236,.6);
  box-shadow: inset 0 0 0 1px rgba(38,41,15,.2);
}
.gallery__dot.is-active { background: var(--c-primary); }

/* ---- MAIS FOTOS + ENTREGAS ------------------------------------------ */
.pp__more-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2vw, 1.75rem);
}
.pp__photo {
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  background:
    repeating-linear-gradient(45deg, rgba(38,41,15,.04) 0 16px, rgba(38,41,15,.015) 16px 32px),
    #cfcdc2;
}
.pp__delivery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--c-line);
}
.pp__delivery-col h2 {
  font-family: var(--font-display); font-weight: 400;
  font-size: var(--step-1); color: var(--c-primary);
  margin-bottom: var(--space-2xs);
}
.pp__delivery-col p { color: var(--text-soft); line-height: var(--lh-normal); font-size: var(--step-0); }

/* ---- Pop-up de confirmação (dialog) --------------------------------- */
.confirm {
  border: 0;
  padding: 0;
  border-radius: var(--radius-m);
  max-width: min(92vw, 30rem);
  background: var(--c-paper);
  color: var(--text);
  box-shadow: var(--shadow-l);
}
.confirm::backdrop { background: rgba(20,26,8,.45); backdrop-filter: blur(2px); }
.confirm[open] { animation: confirm-in .24s var(--ease-out); }
@keyframes confirm-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.confirm__box { padding: clamp(1.5rem, 4vw, 2.25rem); }
.confirm__title {
  font-family: var(--font-display); font-weight: 400;
  font-size: var(--step-2); color: var(--c-primary);
  margin-bottom: var(--space-2xs);
}
.confirm__msg { color: var(--text-soft); line-height: var(--lh-normal); }
.confirm__msg b { color: var(--c-primary); font-weight: 700; }
.confirm__variant {
  display: inline-block;
  font-size: var(--step--1);
  color: var(--c-ink-soft);
  background: var(--c-secondary-100);
  border-radius: 4px;
  padding: .1em .5em;
  white-space: nowrap;
}
.confirm__actions {
  display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center;
  margin-top: var(--space-l);
}
.confirm__actions .btn { padding: .6em 1.1em; font-size: var(--step--1); }
@media (prefers-reduced-motion: reduce) { .confirm[open] { animation: none; } }

/* ---- Responsivo ----------------------------------------------------- */
@media (max-width: 900px) {
  .product-page { grid-template-columns: 1fr; }
  .pp__gallery { position: static; height: auto; order: -1; }   /* galeria primeiro, sem sticky */
  .gallery { height: 68svh; }
  .pp__info { padding-top: clamp(2rem, 5vw, 3rem); max-width: 40rem; }
}
@media (max-width: 640px) {
  .pp__more-grid { grid-template-columns: 1fr 1fr; }
  .pp__delivery { grid-template-columns: 1fr; gap: var(--space-l); }
}

/* Campos do cartão-presente (email de quem recebe + mensagem) */
.gift-input {
  width: 100%;
  padding: .7em .9em;
  border: 1px solid var(--c-line);
  border-radius: 8px;
  background: var(--c-white);
  font-family: var(--font-body);
  font-size: var(--step-0);
  color: var(--text);
  resize: vertical;
}
.gift-input:focus-visible { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(65,76,10,.15); }
.gift-input::placeholder { color: var(--text-muted); }

/* =========================================================================
   PÁGINA DE PRODUTO — estética "palco + info" (redesign)
   ========================================================================= */
.pd {
  background: var(--c-secondary-100);
  padding-top: calc(var(--nav-h) + clamp(1rem, 3vw, 2.2rem));
  padding-bottom: clamp(2.5rem, 6vw, 5rem);
}
.pd__wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}

/* ---- ESQUERDA ---- */
.pd__left { position: sticky; top: calc(var(--nav-h) + 1rem); }
.pd__stage {
  position: relative;
  background: var(--c-white);
  border-radius: 24px;
  padding: clamp(1rem, 3vw, 2rem);
  box-shadow: 0 12px 34px rgba(38,41,15,.07);
}
.pd__stage .gallery { height: auto; background: transparent; border-radius: 16px; }
.pd__stage .gallery__track { aspect-ratio: 4 / 5; height: auto; }
.pd__stage .gallery__slide { height: auto; aspect-ratio: 4 / 5; border-radius: 16px; }
.pd__stage .gallery__slide--img { background: var(--c-paper); }
.pd__stage .gallery__nav { width: 40px; height: 40px; box-shadow: var(--shadow-s); }

.pd__badge {
  position: absolute;
  top: -16px; right: -12px;
  z-index: 3;
  width: 116px; height: 116px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--a-terracotta);
  color: #fff;
  text-align: center;
  font-family: var(--font-display);
  font-size: .64rem; line-height: 1.25;
  padding: .4rem;
  letter-spacing: .02em;
  transform: rotate(-8deg);
  box-shadow: 0 8px 20px rgba(38,41,15,.2);
}
.pd__badge b { font-weight: 700; }

.pd__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: center;
  margin-top: var(--space-m);
}
.pd__thumbs .gallery__dot {
  width: 58px; height: 58px;
  border-radius: 50%;
  padding: 0;
  background-color: var(--c-secondary-100);
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px var(--c-line);
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: outline-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.pd__thumbs .gallery__dot:hover { transform: translateY(-2px); }
.pd__thumbs .gallery__dot.is-active { outline-color: var(--c-primary); }

/* ---- DIREITA ---- */
.pd__title { margin: var(--space-2xs) 0 .3rem; }
.pd__rating { display: flex; align-items: center; gap: .5rem; margin-bottom: var(--space-s); font-size: var(--step--1); color: var(--text-muted); }
.pd__stars { color: #e0a13c; letter-spacing: 1px; }
.pd__price { align-items: baseline; gap: .7rem; }
.pd__unit { font-size: var(--step--1); font-weight: 400; color: var(--text-muted); }

.pd__buy { display: flex; flex-direction: column; gap: var(--space-s); }
.pd__field {
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: 14px;
  padding: .9rem 1.1rem;
  display: flex; flex-direction: column; gap: .6rem;
}
.pd__field-label {
  font-family: var(--font-body); font-weight: 700;
  font-size: var(--step--1); letter-spacing: var(--tracking-wide);
  text-transform: uppercase; color: var(--c-ink-soft);
}
.pd__field-label .pp__value { text-transform: none; letter-spacing: 0; color: var(--c-primary); }

/* Benefícios (caixa com checks) */
.pd__benefits {
  list-style: none;
  margin: .2rem 0;
  padding: 1rem 1.1rem;
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem .9rem;
}
.pd__benefits li {
  position: relative;
  padding-left: 1.7rem;
  font-size: var(--step--1);
  color: var(--c-primary);
  line-height: 1.3;
}
.pd__benefits li::before {
  content: "";
  position: absolute; left: 0; top: .05em;
  width: 1.2rem; height: 1.2rem;
  border-radius: 50%;
  background: var(--c-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E") center/64% no-repeat;
}

/* Linha do cesto: quantidade + botão grande + coração */
.pd__cart { display: flex; align-items: stretch; gap: .6rem; margin-top: var(--space-2xs); }
.pd__cart .pp__qty { border-radius: 999px; }
.pd__add {
  flex: 1;
  justify-content: center;
  border-radius: 999px;
  padding: .6em 1.2em;
  font-size: var(--step-0);
}
/* linha do cesto mais baixa (menos padding vertical) */
.pd__cart .pp__qty-btn,
.pd__cart .pp__qty-input { height: 2.3rem; }
.pd__add-price { font-weight: 700; }
.pd__add-sep { opacity: .6; margin: 0 .15em; }
.pd__cart .pp__wish { border-radius: 50%; width: 3.4rem; }

/* Separadores (tabs) */
.pd__tabs { margin-top: var(--space-l); }
.pd__tablist { display: flex; gap: .35rem; }
.pd__tab {
  flex: 1;
  padding: .75em .6em;
  border: 0;
  border-radius: 12px 12px 0 0;
  background: var(--c-white);
  color: var(--text-soft);
  font-family: var(--font-body); font-weight: 700;
  font-size: var(--step--1);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.pd__tab:hover { color: var(--c-primary); }
.pd__tab.is-active { background: var(--c-primary); color: var(--c-paper); }
.pd__panel {
  display: none;
  background: var(--c-white);
  border-radius: 0 12px 12px 12px;
  padding: 1.2rem 1.3rem;
}
.pd__panel.is-active { display: block; }
.pd__panel p { color: var(--text-soft); line-height: var(--lh-normal); font-size: var(--step--1); }
.pd__panel ul { margin: 0; padding-left: 1.1rem; color: var(--text-soft); display: grid; gap: .35rem; font-size: var(--step--1); }

.pd__right .otp-highlight { margin-top: var(--space-l); }

/* ---- Responsivo ---- */
@media (max-width: 860px) {
  .pd__wrap { grid-template-columns: 1fr; }
  .pd__left { position: static; }
}
@media (max-width: 560px) {
  .pd__benefits { grid-template-columns: 1fr; }
  .pd__cart { flex-wrap: wrap; }
  .pd__add { order: 3; flex-basis: 100%; }
}

/* nota de IVA junto ao preço */
.pd__vat { margin-top: -.35rem; margin-bottom: var(--space-s); font-size: var(--step--1); color: var(--text-muted); }
