:root {
  --product-pad: clamp(14px, 2.5vw, 48px);
}

body.product-page {
  background: #fff;
  color: var(--text);
  min-height: 100vh;
  padding-top: 0 !important;
}

@media (min-width: 1024px) {
  body.product-page {
    padding-top: calc(var(--nav-height) + var(--nav-margin-top) + 20px) !important;
  }
}

.product-nav {
  position: sticky;
  top: 18px;
  z-index: 20;
  width: fit-content;
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .08);
  backdrop-filter: blur(24px) saturate(180%);
}

.product-nav a {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

.product-cart-link {
  position: relative;
  gap: 7px;
}

.product-cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.product-cart-count[hidden] {
  display: none !important;
}

.product-nav a:hover,
.product-nav a:focus-visible {
  background: rgba(0, 0, 0, .05);
  color: var(--text);
}

.product-brand {
  padding-inline: 10px !important;
}

.product-brand img {
  display: block;
  filter: invert(1);
}

.product-shell {
  width: min(1360px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 2.5vw, 36px) var(--product-pad) clamp(16px, 2vw, 32px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .78fr);
  gap: clamp(16px, 3vw, 48px);
  align-items: start;
  height: calc(100vh - 80px);
  max-height: 900px;
}

.product-gallery {
  display: grid;
  gap: 6px;
  height: 100%;
  max-height: calc(100vh - 120px);
  align-content: start;
}

.product-main-media {
  width: 100%;
  height: min(calc(100vh - 200px), 600px);
  min-height: 300px;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--surface);
  cursor: zoom-in;
  overflow: hidden;
}

.product-main-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center center;
  padding: 12px;
}

.product-main-media:focus-visible {
  outline: 2px solid #111;
  outline-offset: 4px;
}

.product-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 4px;
}

.product-thumbs button {
  border: 0;
  background: transparent;
  cursor: pointer;
  display: block;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  opacity: .68;
}

.product-thumbs button.active,
.product-thumbs button:hover,
.product-thumbs button:focus-visible {
  opacity: 1;
  outline: 2px solid #111;
  outline-offset: -2px;
}

.product-thumbs img {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  object-fit: cover;
}

.product-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 0;
  min-width: 0;
  height: 100%;
  max-height: calc(100vh - 120px);
  overflow: hidden;
}

.product-kicker {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.product-info h1 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
  overflow-wrap: break-word;
  word-break: break-word;
}

.precio {
  margin: 0;
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 800;
}

.descripcion {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.6;
  max-width: 58ch;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
}

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

.etiquetas span,
.size-note {
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  padding: 7px 11px;
  font-size: .84rem;
  font-weight: 700;
}

.product-option {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0;
}

.product-option > span {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

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

.tallas button {
  min-width: 48px;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: all var(--transition);
}

.tallas button.active,
.tallas button:hover,
.tallas button:focus-visible {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: 0;
}

.product-actions .btn {
  min-height: 48px;
  justify-content: center;
  text-decoration: none;
}

.product-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
}

.product-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: clamp(18px, 3vw, 40px);
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(18px) saturate(160%);
}

.product-lightbox[hidden] {
  display: none;
}

.product-lightbox img {
  max-width: min(1120px, 92vw);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .18);
  background: var(--surface);
}

.lightbox-close,
.lightbox-nav {
  position: fixed;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #111;
  cursor: pointer;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .08);
  backdrop-filter: blur(18px);
}

.lightbox-close {
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  font-size: 28px;
  line-height: 1;
}

.lightbox-nav {
  top: 50%;
  width: 46px;
  height: 46px;
  font-size: 34px;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: max(18px, env(safe-area-inset-left));
}

.lightbox-next {
  right: max(18px, env(safe-area-inset-right));
}

.lightbox-close:hover,
.lightbox-close:focus-visible,
.lightbox-nav:hover,
.lightbox-nav:focus-visible {
  background: #111;
  color: #fff;
}

.lightbox-nav[hidden] {
  display: none;
}

@media (max-width: 860px) {
  body.product-page {
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }

  .product-nav {
    top: 10px;
    max-width: calc(100vw - 20px);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .product-shell {
    grid-template-columns: 1fr;
    padding-top: 14px;
    gap: 16px;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .product-gallery {
    height: auto;
    max-height: none;
  }

  .product-info {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .product-main-media {
    height: min(45vh, 420px);
    min-height: 240px;
    border-radius: 14px;
  }

  .descripcion {
    -webkit-line-clamp: 4;
    line-clamp: 4;
  }

  .product-info h1 {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
  }

  .product-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .lightbox-nav {
    top: auto;
    bottom: max(18px, env(safe-area-inset-bottom));
    transform: none;
  }
}

@media (max-width: 520px) {
  .product-nav {
    gap: 4px;
    padding: 7px 9px;
  }

  .product-nav a {
    min-height: 36px;
    padding-inline: 10px;
    font-size: .9rem;
  }

  .product-cart-link span:first-child {
    display: none;
  }

  .product-main-media {
    height: min(44vh, 380px);
    min-height: 260px;
  }
}

/* ---------- Botón de pago express (Apple Pay / Google Pay / tarjeta) ---------- */
.product-actions .btn { 
  width: 100%; 
  justify-content: center; 
  font-size: 1.15rem; /* Larger, equal font size for both buttons */
}
.btn.buy-now {
  background: var(--personal-lime, #d4f870);
  color: var(--personal-ink, #0c0c0c);
  border: 1px solid var(--personal-lime, #d4f870);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: none;
}
.btn.buy-now:hover { 
  transform: translateY(-1px); 
  box-shadow: 0 4px 14px rgba(212, 248, 112, 0.4); 
}

/* ---------- Métodos de pago bajo botones ---------- */
.payment-methods {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  margin-bottom: 24px;
}
.payment-secure {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: -0.01em;
}
.payment-icons {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}
.payment-icons svg {
  height: 22px;
  width: auto;
  opacity: 0.9;
}
.btn.ghost-link {
  background: transparent; border-color: transparent; color: var(--muted);
  text-decoration: underline; box-shadow: none; font-weight: 600;
}
.btn.ghost-link:hover { color: var(--text); }

/* Enlace a la guía de tallas junto al selector */
.product-option-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.size-guide-link {
  font-size: .72rem; font-weight: 700; letter-spacing: .02em; text-transform: none;
  color: var(--muted); text-decoration: underline; text-underline-offset: 2px;
}
.size-guide-link:hover { color: var(--text); }
