/* ========================
   Estilos globales
   ======================== */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f9f9f9;
  color: #333;
}

header {
  background: #111;   /* negro */
  color: white;       /* letras blancas */
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: bold;
}

/* ========================
   Grilla de productos
   ======================== */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  max-width: 1200px;
  margin: 0 auto;
  gap: 20px;
  padding: 2rem;
}

@media (max-width: 768px) {
  .products {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 400px) {
  .products {
    grid-template-columns: 1fr;
  }
}

.product {
  border: 1px solid #ddd;
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
  height: 380px; /* altura uniforme */
  transition: transform 0.2s ease;
  text-align: center;
}

.product:hover {
  transform: translateY(-5px);
}

.product img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 5px;
  transition: transform 0.3s ease;
}

.product img:hover {
  transform: scale(1.05);
}

.product h3 {
  font-size: 1.1rem;
  margin: 0.5rem 0;
  text-align: center;
}

.product p {
  margin: 0.3rem 0;
  color: #555;
  text-align: center;
}

.btn {
  display: inline-block;
  background: #111;   /* negro */
  color: white;       /* letras blancas */
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.2s;
}

.btn:hover {
  background: #333;   /* gris oscuro al pasar el mouse */
  color: white;
}


/* ========================
   Detalle de producto
   ======================== */
.product-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  max-width: 1100px;
  margin: 2rem auto;
  align-items: flex-start;
  padding: 0 1rem;
}

.detail-left {
  flex: 1 1 55%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.detail-right {
  flex: 1 1 40%;
}

.detail-img {
  width: 100%;
  height: auto;        /* dejar que mantenga proporción */
  max-height: none;    /* quitar el límite que recorta */
  object-fit: contain; /* mostrar la imagen completa sin recorte */
}


.detail-img:hover {
  transform: scale(1.03);
}

.detail-right h2 {
  font-size: 26px;
  margin-bottom: 10px;
}

.description {
  font-size: 16px;
  margin-bottom: 20px;
  line-height: 1.5;
  white-space: pre-line; 
}

.btn-whatsapp {
  display: inline-block;
  background: #25D366;
  color: white;
  padding: 12px 20px;
  border-radius: 5px;
  font-size: 16px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.2s;
}

.btn-whatsapp:hover {
  background: #1ebe5b;
}

/* Responsive móviles */
@media (max-width: 768px) {
  .product-detail {
    flex-direction: column;
    text-align: center;
  }
  .detail-left, .detail-right {
    flex: 1 1 100%;
  }
}

/* ========================
   Galería de miniaturas
   ======================== */
.gallery {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.gallery img.thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 5px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border 0.2s, transform 0.2s;
}

.gallery img.thumb:hover {
  border: 2px solid #111;
  transform: scale(1.05);
}

/* ========================
   Tabla de precios
   ======================== */
.prices-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  border-radius: 8px;
  overflow: hidden;
}

.prices-table th, .prices-table td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: center;
  min-width: 100px; /* ✅ asegura que no se encoja demasiado */
  white-space: nowrap; /* ✅ evita que el texto se corte en varias líneas */
}

.prices-table th {
  background: #111; /* negro */
  color: white;     /* letras blancas */
  font-weight: bold;
}

.prices-table tr:nth-child(even) {
  background: #f9f9f9;
}

/* Estilo del link "Volver al catálogo" */
header nav a {
  color: white;              /* texto blanco */
  text-decoration: none;     /* sin subrayado */
  font-weight: bold;         /* en negrilla */
}

header nav a:hover {
  color: #00A0B7;            /* azul elegante cuando pasas el mouse */
  text-decoration: underline; 
}

/* Ajustes responsive para móviles */
@media (max-width: 768px) {
  .product-detail {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .detail-left, 
  .detail-right {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .detail-img {
    margin: 0 auto;
    display: block;
  }

  #product-name, 
  #product-description, 
  #product-prices, 
  #gallery, 
  #whatsapp-link {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }

@media (max-width: 768px) {
  .prices-table {
    width: 100%;      /* ocupar todo el ancho del contenedor */
    max-width: 600px; /* límite para que no se estire mucho */
    margin: 15px auto;
  }
}


  .btn-whatsapp {
    display: inline-block;
    margin: 20px auto;
  }
}

/* Modal de zoom */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.9);
}

.modal-content {
  display: block;
  margin: 5% auto;
  max-width: 90%;
  max-height: 80%;
  border-radius: 8px;
}

.modal-content:hover {
  transform: scale(1.05);
  transition: 0.3s;
}

/* Botón de cerrar */
.close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: #bbb;
}

/* ====== Barra de categorías ====== */
.catbar{
  position: sticky;        /* se queda pegada al top al hacer scroll */
  top: 56px;               /* ajusta si tu header es más alto */
  z-index: 50;
  background: #0f0f10;     /* oscuro elegante */
  border-bottom: 1px solid #1f1f22;
  padding: 8px 12px;
  overflow-x: auto;        /* scroll horizontal si hay muchas categorías */
  white-space: nowrap;
}

.cat-link{
  display: inline-block;
  color: #d6d6d6;
  text-decoration: none;
  padding: 8px 14px;
  margin-right: 8px;
  border: 1px solid #2a2a2e;
  border-radius: 999px;
  font-size: 14px;
  transition: background .2s, color .2s, border .2s, transform .1s;
}

.cat-link:hover{
  border-color: #00A0B7;
  color: #fff;
  transform: translateY(-1px);
}

.cat-link.active{
  background: #00A0B7;
  color: #fff;
  border-color: transparent;
}
