body{
  margin-top: 70px;
}

.producto-detalle {
  display: flex;
  flex-wrap: wrap;
  gap: 3.5rem;
  align-items: flex-start;
}

.producto-imagen img {
    width: 100%;
    height: 480px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);

    opacity: 0;
    transform: scale(0.8);

    transition:
        opacity 1.2s ease,
        transform 0.6s ease,
        box-shadow 0.3s ease-in-out;
}


.producto-imagen img.fade-out {
  opacity: 0;
}

.producto-imagen img.loaded {
  opacity: 1;
  transform: scale(1);
}

.producto-info {
  flex: 1;
  min-width: 300px;
  margin-top: 0.5rem; /* más cerca de la imagen */
}

.producto-info h1 {
    font-size: 2.5rem;
    margin-top: -15px;
    margin-bottom: 0.3rem;
}

.precio {
    color: var(--brand-2);
    font-weight: 600;
    font-size: 1.3rem;
    margin-bottom: 1.2rem;
}

/* Sección de descripción adicional */
.producto-descripcion {
    margin-top: 60px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    animation: fadeIn 0.8s ease both;
}

.producto-descripcion.visible {
    opacity: 1;
    transform: translateY(0);
}

.producto-descripcion h2 {
    position: relative;
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.2rem;
    color: var(--text);
    margin-bottom: 1.5rem;
    text-align: center;
}

.producto-descripcion h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-1), var(--brand-2));
    border-radius: 1px;
}

/* Animación al volverse visible */
.producto-descripcion.visible h2::after {
    width: 175px;
}

@keyframes brillo {
    0% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.6);
    }
    100% {
        filter: brightness(1);
    }
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.producto-descripcion p {
    font-size: 1rem;
    line-height: 1.7;
    max-width: 700px;
    margin: 0 auto;
    color: #444;
}

/* Estilos para las opciones del producto */
.opciones-producto {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.opcion label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
    color: #333;
}

.opcion select {
    padding: 0.5rem 0.8rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    background-color: #fff;
    transition: border-color 0.3s ease;
}

.opcion select:focus {
    border-color: var(--brand-2);
    outline: none;
}

/* Sección de información extra del producto */
.producto-info-extra {
    background: #fff;
    padding: 3rem 1rem;
    margin-top: 3rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.producto-info-extra .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.extra-item h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.7rem;
    color: var(--brand-2);
    margin-bottom: 0.5rem;
}

.extra-item p {
    color: #555;
    line-height: 1.6;
    font-size: 1rem;
}

/* ================================
   💫 Productos recomendados (mismo estilo que catálogo)
   ================================ */
.productos-recomendados {
  margin-top: 4rem;
  padding-bottom: 2.5rem;
  background: var(--bg);
}

.productos-recomendados .container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

.productos-recomendados h2 {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.5rem;
  position: relative;
}

.productos-recomendados h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-1), var(--brand-2));
    border-radius: 2px;
}

/* Grid de productos recomendados */
.recomendados-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  justify-items: start;
}

.recomendado-item {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
  max-width: 260px;
}

.recomendado-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.recomendado-item img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  object-position: center top;
  border-radius: 10px;
  transition: transform 0.3s ease;
}

.recomendado-item:hover img {
  transform: scale(1.03);
}

.recomendado-item h4 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 600;
  margin: 1rem 0 0.4rem;
  color: var(--text);
}

.recomendado-item span {
  color: var(--brand-2);
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  margin-bottom: 0.8rem;
}

/* ======== COLORES ======== */
.colores-opciones {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

/* BOTÓN BASE */
.btn-color {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--color);
  cursor: pointer;

  /* Suavidad general */
  border: 1.8px solid rgba(0,0,0,0.12);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);

  transition: 
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    filter 0.22s ease;
}

/* =========================================
   BORDES ADAPTATIVOS SEGÚN BRILLO DEL COLOR
   ========================================= */

/* Colores claros → borde un poco más oscuro */
.btn-color[data-brightness="light"] {
  border-color: rgba(0,0,0,0.22);
}

/* Colores oscuros → borde más claro */
.btn-color[data-brightness="dark"] {
  border-color: rgba(255,255,255,0.55);
}

/* ============================
       HOVER
   ============================ */

.btn-color:hover {
  transform: scale(1.12);
  filter: brightness(1.06);
}

/* Hover en colores claros */
.btn-color[data-brightness="light"]:hover {
  box-shadow:
    0 2px 6px rgba(0,0,0,0.18),
    0 0 6px rgba(255,255,255,0.38);
}

/* Hover en colores oscuros */
.btn-color[data-brightness="dark"]:hover {
  box-shadow:
    0 2px 6px rgba(255,255,255,0.30),
    0 0 6px rgba(255,255,255,0.45);
}

/* ============================
       ACTIVE / SELECCIONADO
   ============================ */

.btn-color.active {
  transform: scale(1.18);
  filter: brightness(1.12);
}

/* Activo en colores claros */
.btn-color.active[data-brightness="light"] {
  border-color: rgba(0,0,0,0.45);
  box-shadow:
    0 0 0 5px rgba(255,255,255,0.35),
    0 2px 10px rgba(0,0,0,0.30);
}

/* Activo en colores oscuros */
.btn-color.active[data-brightness="dark"] {
  border-color: rgba(255,255,255,0.85);
  box-shadow:
    0 0 0 5px rgba(255,255,255,0.45),
    0 2px 10px rgba(0,0,0,0.30);
}

/* ======== TAMAÑO ======== */
.tamanos-opciones {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn-tamano {
  padding: 0.45rem 0.9rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-tamano:hover {
  background-color: var(--brand-1);
  border-color: var(--brand-2);
  color: #fff;
}


.btn-tamano.active {
  background: var(--brand-1);
  color: #fff;
  border-color: var(--brand-2);
  box-shadow: 0 0 6px rgba(0,0,0,0.1);
  transform: scale(0.95);
}

/* ======== CANTIDAD ======== */
.cantidad-control {
  display: flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 8px;
  width: fit-content;
  overflow: hidden;
}

.cantidad-btn {
  background: #f7f7f7;
  border: none;
  padding: 0.4rem 0.8rem;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cantidad-btn:hover:not(.disabled) {
  background: var(--brand-1);
  color: #fff;
}
.cantidad-btn.disabled{
  background: #e3e3e3;
}

#cantidad {
  width: 55px;
  text-align: center;
  border: none;
  font-size: 1rem;
  padding: 0.3rem;
  outline: none;
}

/* ==========================
   💻 TABLETS (≤1024px)
   ========================== */
@media (max-width: 1024px) {

    /* Layout detalle del producto: info a la izquierda, imagen centrada */
    .producto-detalle {
        display: flex;
        flex-direction: row;
        gap: 2rem;
        align-items: flex-start;
        justify-content: space-between;
        margin-top: 2.5rem;
    }

    /* Información más grande y a la izquierda */
    .producto-info {
      margin-top: 20px;
        flex: 1;
        min-width: 350px;
        max-width: 480px;
    }
    .producto-info h1 {
        font-size: 2rem;
    }
    .producto-info .precio {
        font-size: 1.4rem;
    }
    /* Imagen centrada */
    .producto-imagen {
        flex: 0 1 clamp(260px, 40%, 340px) !important;
        display: flex;
        justify-content: center;
    }

    .producto-imagen img {
        max-width: 320px;
        width: 100%;
        height: auto;
        border-radius: 12px;
    }

    /* Descripción adicional */
    .producto-descripcion h2 {
        font-size: 2.2rem;
    }
    .producto-descripcion p {
        font-size: 1.4rem;
        padding: 0 1rem;
    }

    /* Opciones del producto */
    .opciones-producto {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem !important;
    }

    /* 🔹 Botón añadir al carrito más pequeño */
    .btn{
        padding: 0.8rem 1.4rem !important;
        font-size: 1rem !important;
        border-radius: 8px !important;
    }

    /* Productos recomendados */
    .recomendados-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        justify-items: center;
    }
    .producto-info-extra{
      margin-top: 0;
      padding-top: 0;
      margin-bottom: 0;
      padding-bottom: 0;
    }
    /* Info extra del producto */
    .producto-info-extra .container {
        grid-template-columns: 1fr 1fr;
    }
    .extra-item h3{
      font-size: 2rem;
    }
    .extra-item p{
      font-size: 1.2rem;
    }
    .productos-recomendados h2{
      font-size: 2.3rem;
    }
    .recomendado-item img{
      width: 320px;
      height: 460px;
    }
}

/* ==========================
   📱 MÓVILES (≤600px)
   ========================== */
@media (max-width: 600px) {
    /* Layout detalle del producto: columna */
    .producto-detalle {
        flex-direction: column;
        gap: 1.5rem;
        margin-top: 0.5rem;
        align-items: center;
    }

    /* Información más grande y centrada horizontalmente */
    .producto-info {
        width: 100%;
        max-width: none;
        text-align: left;
        margin-top: 0px;
        padding: 1.5rem;
    }

    /* Imagen centrada */
    .producto-imagen {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: -15px;
    }

    .producto-imagen img {
        width: 90%;
        max-width: 380px; /* imagen más pequeña */
        height: auto;
        display: block;
        margin: 0 1rem;
    }

    /* Titulos y textos más legibles */
    .producto-info h1 {
        font-size: 1.6rem;
    }
    .producto-info .precio {
        font-size: 1.2rem;
    }
    .producto-descripcion{
      margin-top: 15px;
    }
    .producto-descripcion h2 {
        font-size: 1.8rem;
    }
    .producto-descripcion p {
        font-size: 1.1rem;
        padding: 0 0.5rem;
    }

    /* Opciones: más compactas */
    .opciones-producto {
        width: 100%;
    }
    .tamanos-opciones{
      gap:0.4rem;
    }
    .colores-opciones {
        justify-content: flex-start;
        gap: 0.8rem;
    }
    .productos-recomendados{
      margin-top: 0;
      padding-top: 0;
    }
    /* Productos recomendados: una columna */
    .recomendados-grid {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    /* Info extra del producto */
    .producto-info-extra .container {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    .producto-descripcion {
        margin-bottom: -10px;
    }
    .producto-info-extra {
        margin-top: 1.5rem;
        margin-bottom: 1.5rem;
    }
    /* Ajusta el grid interno por si tiene mucho gap */
    .producto-info-extra .container {
        gap: 1rem !important;
    }
}

