/* ===== Product page (PDP) ===== */

.main-product {
  padding-top: 24px;
}

/* Filter de galeria por color (set por JS quando swatch clica) */
.pdp-thumb.is-color-hidden,
.pdp-main-img.is-color-hidden {
  display: none;
}

/* ===== Layout principal ===== */
.pdp {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 60px;
}

@media (min-width: 1024px) {
  .pdp {
    flex-direction: row;
    align-items: flex-start;
    gap: 40px;
  }
}

/* ===== Galeria ===== */
.pdp-gallery {
  width: 100%;
}
@media (min-width: 1024px) {
  .pdp-gallery {
    flex: 0 1 640px;
    max-width: 640px;
    display: flex;
    flex-direction: row-reverse;     /* main image LEFT visualmente, thumbs RIGHT */
    gap: 14px;
  }
}

/* Mobile: carrossel horizontal swipeable */
.pdp-main-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.pdp-main-track::-webkit-scrollbar { display: none; }

.pdp-main-img {
  flex: 0 0 100%;
  aspect-ratio: 3 / 4;
  background: var(--bg-soft);
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-quiet);
  letter-spacing: 0.1em;
  user-select: none;
  background:
    linear-gradient(135deg, #f0f0f0 25%, transparent 25%),
    linear-gradient(225deg, #f0f0f0 25%, transparent 25%),
    linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
    linear-gradient(315deg, #f0f0f0 25%, #f6f6f6 25%);
  background-size: 18px 18px;
  background-position: 9px 0, 9px 0, 0 0, 0 0;
}

/* Desktop: thumbnails strip + main image */
.pdp-thumbs { display: none; }

@media (min-width: 1024px) {
  .pdp-thumbs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 0 0 80px;
  }
  .pdp-thumb {
    width: 80px;
    aspect-ratio: 3 / 4;
    background: var(--bg-soft);
    cursor: pointer;
    border: 1px solid transparent;
    transition: border-color var(--t-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: var(--text-quiet);
    letter-spacing: 0.08em;
    background:
      linear-gradient(135deg, #f0f0f0 25%, transparent 25%),
      linear-gradient(225deg, #f0f0f0 25%, transparent 25%),
      linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
      linear-gradient(315deg, #f0f0f0 25%, #f6f6f6 25%);
    background-size: 10px 10px;
    background-position: 5px 0, 5px 0, 0 0, 0 0;
  }
  .pdp-thumb.is-active { border-color: var(--text); }
  .pdp-thumb:hover { border-color: var(--text-muted); }

  .pdp-main-track {
    flex: 1 1 auto;
    overflow: visible;
    scroll-snap-type: none;
  }
  .pdp-main-img {
    flex: 0 0 100%;
    width: 100%;
  }
  /* Desktop só mostra a 1ª (current) — outras são acessíveis via thumb click */
  .pdp-main-track .pdp-main-img:not(.is-active) { display: none; }
}

/* ===== Info panel ===== */
.pdp-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
  padding: 0 var(--pad-mobile);
}
@media (min-width: 1024px) {
  .pdp-info {
    flex: 0 0 340px;
    padding: 0;
  }
}

.pdp-name {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text);
  text-transform: uppercase;
  text-align: center;
}
.pdp-sku {
  font-family: var(--serif);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-align: center;
}
.pdp-price {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--text);
  text-align: center;
}
@media (min-width: 1024px) {
  .pdp-name, .pdp-sku, .pdp-price { text-align: left; }
}

.pdp-section-label {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--text);
  margin-top: 6px;
  text-transform: uppercase;
  font-weight: 600;
}

/* Color swatch (mini-image) */
.pdp-color {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.pdp-color-options { display: flex; gap: 8px; }
.pdp-color-swatch {
  width: 32px;
  height: 40px;
  background-color: var(--bg-soft);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color var(--t-fast);
  padding: 0;
  /* background-image inline pelo PHP cobre o swatch como mini imagem da variant */
}
.pdp-color-swatch.is-active { border-color: var(--text); border-width: 2px; }

/* Size selector */
.pdp-size {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.pdp-size-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pdp-size-btn {
  padding: 10px 18px;
  border: 1px solid var(--border);
  background: #fff;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  min-width: 56px;
  transition: border-color var(--t-fast);
}
.pdp-size-btn:hover { border-color: var(--text-muted); }
.pdp-size-btn.is-active {
  border: 1.5px solid var(--text);
}
/* Tamanho indisponível (out of stock pra cor selecionada) — fade out */
.pdp-size-btn[disabled],
.pdp-size-btn.is-unavailable {
  color: var(--text-quiet);
  border-color: var(--border-soft);
  cursor: not-allowed;
  position: relative;
}
.pdp-size-btn[disabled]:hover,
.pdp-size-btn.is-unavailable:hover {
  border-color: var(--border-soft);
}
/* Diagonal sutil indicando indisponibilidade (matches behaviour Shopify default) */
.pdp-size-btn[disabled]::after,
.pdp-size-btn.is-unavailable::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid var(--border);
  transform: rotate(-12deg);
  pointer-events: none;
  opacity: 0.5;
}

/* Quantity stepper */
.pdp-qty {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.pdp-qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  height: 34px;
  width: 110px;
}
.pdp-qty-btn {
  width: 34px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 300;
  color: var(--text);
  cursor: pointer;
  transition: background var(--t-fast);
}
.pdp-qty-btn:hover { background: var(--bg-soft); }
.pdp-qty-val {
  flex: 1;
  text-align: center;
  font-family: var(--serif);
  font-size: 14px;
}

/* CTA */
.pdp-cta {
  width: 100%;
  height: 46px;
  background: var(--black);
  color: #fff;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
  border: 1px solid var(--black);
  cursor: pointer;
  margin-top: 6px;
  transition: opacity var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.pdp-cta:hover { opacity: 0.85; }

/* Secondary CTA (Buy it now) — outline */
.pdp-cta-secondary {
  background: transparent;
  color: var(--black);
  margin-top: 8px;
}
.pdp-cta-secondary:hover {
  background: var(--black);
  color: #fff;
  opacity: 1;
}

/* Description */
.pdp-desc {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  text-align: left;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pdp-desc p { margin: 0; }
.pdp-final-sale { font-weight: 600; }

/* ===== You May Also Like ===== */
.ymal {
  margin-top: 40px;
  position: relative;
}
.ymal-title {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.18em;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 18px;
  text-align: left;
}
@media (max-width: 1023px) {
  .ymal-title { text-align: center; }
}

/* Mobile: grid 2-col idêntico ao product-grid */
.ymal-track {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

/* Desktop: carrossel horizontal */
@media (min-width: 1024px) {
  .ymal-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .ymal-track::-webkit-scrollbar { display: none; }
  .ymal-track > .product-card {
    flex: 0 0 calc((100% - 14px * 4) / 5);
    scroll-snap-align: start;
  }

  .ymal-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    z-index: 5;
    transition: background var(--t-fast);
  }
  .ymal-arrow:hover { background: #fff; }
  .ymal-arrow-prev { left: -18px; }
  .ymal-arrow-next { right: -18px; }
}

@media (max-width: 1023px) {
  .ymal-arrow { display: none; }
}

/* "+" dentro de YMAL cards usa estilo plano (igual category) */
.ymal-track .product-add-btn {
  align-self: center;
  margin: 0;
  padding: 8px 0 4px;
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 18px;
  color: var(--text-muted);
  position: static;
  z-index: auto;
}
.ymal-track .product-add-btn:hover {
  background: transparent;
  transform: none;
  opacity: 0.55;
}
.ymal-track .product-card { gap: 6px; }
