/* css/components/product-section.css */

.product-section {
  background: #fff;
  margin: 5rem 0;
}

.product-section:first-of-type {
  margin-top: 6.5rem;
}

/* WRAPPER */
.product-wrapper {
  border: 1px solid #4caf50;
  background: #fff;
}

/* HERO */
.product-hero {
  position: relative;
  height: 360px;
  overflow: hidden;
  background: #000;
}

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

/* Título */
.product-hero h2 {
  position: absolute;
  inset: 0;
  display: grid;
  justify-items: center;
  align-content: start;
  padding-top: 1.25rem;
  margin: 0;

  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* PANEL */
.product-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* IZQUIERDA */
.panel-left {
  padding: 1rem 3rem;
  border-right: 1px solid #e3e3e3;
  background: #f3f4f6;
}

.panel-left h3 {
  color: #4caf50;
  margin: 0 0 1rem;
}

.panel-left p {
  margin: 0 0 1.25rem;
  color: #666;
  line-height: 1.8;
}

.panel-left p:last-child {
  margin-bottom: 0;
}

/* DERECHA */
.panel-right {
  padding: 1rem 3rem;
  position: relative;
  background: #ffffff;

  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* Imagen + texto */
.panel-media {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2rem;

  flex: 1;
  align-content: center;
  justify-content: center;
  align-items: start;
}

.panel-media img {
  max-width: 200px;
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* Texto derecha */
.panel-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
}

.panel-info strong {
  color: #4caf50;
  display: block;
  margin-bottom: 0.5rem;
}

/* ARROWS */
.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #4caf50;
  font-size: 2.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  z-index: 3;
}

.arrow-left {
  left: 1rem;
}

.arrow-right {
  right: 1rem;
}

/* LINK inferior */
.panel-link {
  display: block;
  text-align: center;
  margin-top: auto;
  padding-top: 2rem;

  color: #4caf50;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ========================= */
/* BOTONES ASTRO (FIJADOS)   */
/* ========================= */

/* Por defecto horizontal, sin wrap */
.panel-astro-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: nowrap; /* ✅ SIEMPRE HORIZONTAL */
}

/* ✅ Esto es la clave: si está hidden, NO se ve aunque exista display:flex */
.panel-astro-actions[hidden] {
  display: none !important;
}

/* Botón pequeño y mismo tamaño */
.btn--sm {
  padding: 0.55rem 1.15rem;
  font-size: 0.78rem;
  letter-spacing: 0.35px;
  min-width: 132px;
  justify-content: center;
  white-space: nowrap;
}

/* ========================= */
/* ======= RESPONSIVE ===== */
/* ========================= */

@media (max-width: 992px) {
  .product-panel {
    grid-template-columns: 1fr;
  }

  .panel-left {
    border-right: none;
    border-bottom: 1px solid #e3e3e3;
  }
}

@media (max-width: 768px) {
  .product-hero {
    height: 280px;
  }

  .product-hero h2 {
    padding-top: 1rem;
    font-size: clamp(1.15rem, 4.2vw, 1.45rem);
    line-height: 1.15;
    padding-inline: 1rem;
    letter-spacing: -0.1px;
    text-align: center;
  }

  .panel-left,
  .panel-right {
    padding: 2rem 1.5rem;
  }

  .panel-media {
    grid-template-columns: 1fr;
    text-align: center;
    flex: 1;
    position: relative;
  }

  .panel-info {
    min-height: auto;
    align-items: center;
  }

  /* Flechas visibles y táctiles */
  .arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;
    border-radius: 999px;

    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);

    color: #4caf50;
    font-size: 28px;
    line-height: 1;

    top: 46%;
    transform: translateY(-50%);
    z-index: 5;
  }

  .arrow-left {
    left: 8px;
  }
  .arrow-right {
    right: 8px;
  }

  /* Astro actions centrados pero HORIZONTALES */
  .panel-astro-actions {
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: nowrap; /* ✅ mantiene horizontal */
  }

  .btn--sm {
    min-width: 128px; /* un pelín menos para que entren */
  }
}
