/* ═══════════════════════════════════════════════════
   Ficha de Producto — Rediseño profesional completo
   Santa Cruz SRL
   ═══════════════════════════════════════════════════ */

/* ── Layout principal ── */
.producto-main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.75rem;
  font-size: 0.82rem;
  color: var(--color-muted);
}

.breadcrumb a {
  color: var(--brand-blue);
  font-weight: 500;
  transition: color 0.15s ease;
}

.breadcrumb a:hover {
  color: var(--brand-blue-dark);
}

.breadcrumb__sep {
  color: var(--color-border);
  font-size: 0.9rem;
  user-select: none;
}

.breadcrumb__current {
  color: var(--color-text-secondary);
  font-weight: 500;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Two-column grid ── */
.producto-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 860px) {
  .producto-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}

/* ── Image Column ── */
.producto-gallery {
  position: sticky;
  top: calc(var(--nav-h, 50px) + 1rem);
}

.producto-main-img-wrap {
  background: var(--color-white);
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 6px 32px rgba(0, 74, 153, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--color-border-light);
  aspect-ratio: 1;
  cursor: zoom-in;
  position: relative;
  transition: box-shadow 0.3s ease;
}

.producto-main-img-wrap:hover {
  box-shadow:
    0 12px 48px rgba(0, 74, 153, 0.18),
    0 4px 16px rgba(0, 0, 0, 0.1);
}

.producto-main-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: block;
  padding: 1rem;
}

.producto-main-img-wrap:hover img {
  transform: scale(1.04);
}

.producto-zoom-hint {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(4px);
  letter-spacing: 0.02em;
}

.producto-main-img-wrap:hover .producto-zoom-hint {
  opacity: 1;
}

/* ── Info Column ── */
.producto-info-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Category tag */
.producto-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-blue);
  background: var(--brand-blue-soft);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: fit-content;
}

/* Product name */
.producto-nombre {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--brand-blue-dark);
  text-transform: uppercase;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

@media (max-width: 900px) {
  .producto-nombre {
    font-size: 1.4rem;
  }
}

/* Product code */
.producto-codigo {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--color-muted);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  padding: 0.32rem 0.72rem;
  border-radius: var(--radius-sm);
  width: fit-content;
}

/* Price section */
.producto-price-section {
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f3ff 100%);
  border: 1px solid rgba(0, 74, 153, 0.1);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
}

.producto-price-section .tachado {
  text-decoration: line-through;
  color: var(--color-muted);
  font-size: 1rem;
  margin: 0 0 0.3rem;
}

.producto-price-section .actual {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--brand-blue);
  margin: 0;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.promo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: linear-gradient(135deg, #e53e3e, #c53030);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
}

/* Description */
.producto-desc-section {
  border-top: 1px solid var(--color-border-light);
  padding-top: 1.25rem;
}

.producto-desc-section h3 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  margin: 0 0 0.65rem;
}

.producto-desc {
  line-height: 1.75;
  color: var(--color-text-secondary);
  font-size: 0.92rem;
}

/* ── Compartir ── */
.producto-compartir {
  display: flex;
}

.btn-compartir {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  border: 1.5px solid var(--color-border);
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-compartir:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  background: var(--brand-blue-soft);
}

.btn-compartir.copied {
  border-color: #22c55e;
  color: #16a34a;
  background: #f0fdf4;
}

/* ── WhatsApp Section ── */
.wa-section {
  background: var(--color-white);
  border: 1px solid rgba(37, 211, 102, 0.2);
  border-radius: 18px;
  padding: 1.4rem 1.5rem;
  box-shadow: 0 2px 16px rgba(37, 211, 102, 0.08);
}

.wa-section-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.4rem;
}

.wa-section-header h2 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.wa-section-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25d366, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(37, 211, 102, 0.32);
}

.wa-section-icon svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.wa-hint {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin: 0 0 1rem;
  line-height: 1.5;
}

.wa-buttons-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.wa-btn-sucursal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #25d366, #22c55e);
  color: #fff !important;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.78rem 1.25rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-decoration: none !important;
  transition: all 0.22s ease;
  box-shadow: 0 3px 12px rgba(37, 211, 102, 0.3);
  width: 100%;
  letter-spacing: 0.01em;
}

.wa-btn-sucursal:hover {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
}

.wa-btn-sucursal svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

.wa-btn-sucursal .sucursal-name {
  font-weight: 600;
  opacity: 0.9;
  font-size: 0.78rem;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
}

/* ── Back link ── */
.producto-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand-blue);
  padding: 0.4rem 0.9rem;
  border: 1.5px solid var(--brand-blue);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.producto-back:hover {
  background: var(--brand-blue);
  color: #fff;
  text-decoration: none;
  transform: translateX(-2px);
}

/* ── Related Products ── */
.relacionados-section {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.relacionados-section .section-title {
  margin-top: 0;
}

@media (max-width: 900px) {
  .wa-section {
    padding: 1.15rem 1rem;
    border-radius: 14px;
  }

  .wa-btn-sucursal {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    justify-items: start;
    column-gap: 0.5rem;
    row-gap: 0.4rem;
    min-height: 48px;
    padding: 0.72rem 1rem;
    font-size: 0.84rem;
    border-radius: 14px;
    text-align: left;
  }

  .wa-btn-sucursal svg {
    grid-row: 1;
    grid-column: 1;
  }

  .wa-btn-sucursal > span:not(.sucursal-name) {
    grid-row: 1;
    grid-column: 2;
    line-height: 1.25;
  }

  .wa-btn-sucursal .sucursal-name {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-self: stretch;
    max-width: none;
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    margin-left: 0;
    font-size: 0.76rem;
    text-align: center;
    line-height: 1.3;
  }
}

/* ── Image Lightbox ── */
.producto-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.22s ease;
  cursor: zoom-out;
  padding: 2rem;
  backdrop-filter: blur(8px);
}

.producto-lightbox img {
  max-width: min(90vw, 680px);
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  animation: scaleIn 0.25s ease;
}

.producto-lightbox__close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.producto-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1) rotate(90deg);
}

@media (max-width: 860px) {
  .producto-gallery {
    position: static;
  }

  .producto-main-img-wrap {
    border-radius: 16px;
  }
}

/* Barra fija consulta (móvil) */
.producto-mobile-bar {
  display: none;
}

@media (max-width: 900px) {
  .producto-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(4.35rem + env(safe-area-inset-bottom, 0px));
    z-index: 1095;
    padding: 0.55rem max(0.75rem, env(safe-area-inset-left, 0px))
      0.55rem max(0.75rem, env(safe-area-inset-right, 0px));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 74, 153, 0.1);
    box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.12);
  }

  .producto-mobile-bar__price {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
  }

  .producto-mobile-bar__now {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--brand-blue);
    line-height: 1.15;
  }

  .producto-mobile-bar__old {
    font-size: 0.72rem;
    color: var(--color-muted);
    text-decoration: line-through;
  }

  .producto-mobile-bar__actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
  }

  .producto-mobile-bar__share {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1.5px solid var(--color-border);
    background: #fff;
    color: var(--brand-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .producto-mobile-bar__share.is-ok {
    border-color: #22c55e;
    color: #16a34a;
    background: #f0fdf4;
  }

  .producto-mobile-bar__wa {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0 1rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #25d366, #22c55e);
    color: #fff !important;
    font-weight: 800;
    font-size: 0.85rem;
    text-decoration: none !important;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
  }

  .producto-main {
    padding-bottom: 1rem;
  }
}
