/* --- Estilos Generales del Catálogo --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8f9fa;
    color: #343a40;
    margin: 0;
}
.catalog-header {
    background-color: #AD6683; /* Fondo Rojo */
    color: white;
    text-align: center;
    padding: 40px 20px;
}
.catalog-header h1 { margin: 0; font-size: 2.5rem; }
.catalog-header p { margin: 10px 0 0; font-size: 1.1rem; color: #f8f9fa; }
.product-grid-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}
.current-filter-title { margin-bottom: 20px; color: #495057; border-bottom: 2px solid #007bff; padding-bottom: 10px; display: inline-block; }

/* ========= ESTILOS PARA LA NUEVA BARRA DE NAVEGACIÓN (TOPNAV) ========= */
.topnav {
    background-color: #333;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* === AJUSTE PARA RESTAURAR EL FONDO Y LA ALTURA DE LA BARRA === */
.topnav::after {
  content: "";
  display: table;
  clear: both;
}
/* =============================================================== */

.topnav a, .topnav .dropbtn {
    float: left;
    display: block;
    color: #f2f2f2;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
    font-size: 17px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}
.topnav a:hover, .dropdown:hover .dropbtn {
    background-color: #ddd;
    color: black;
}
.topnav a.active {
    background-color: #007bff;
    color: white;
}
.topnav .icon {
    display: none;
}

/* Contenedor del Dropdown */
.dropdown {
    float: left;
    position: relative;
}

/* Contenido del Dropdown (oculto por defecto) */
.dropdown-content {
    display: block; 
    position: absolute;
    background-color: #f9f9f9;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 101;
}
.dropdown-content.ng-hide {
    display: none !important;
}
.dropdown-content a {
    float: none;
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
}
.dropdown-content a:hover {
    background-color: #ddd;
}

/* ========= ESTILOS PARA EL CONTENEDOR DE BÚSQUEDA ========= */
.search-section {
    background-color: #e9ecef;
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid #dee2e6;
}
.search-section h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5rem;
    color: #343a40;
    font-weight: 600;
}
.search-section input {
    width: 100%;
    max-width: 600px;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 1rem;
}
.search-section input:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}


/* --- Rejilla de Productos Responsiva --- */
.product-grid { display: grid; gap: 30px; grid-template-columns: 1fr; }
@media screen and (min-width: 600px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media screen and (min-width: 900px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media screen and (min-width: 1200px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }

/* --- Estilos de Tarjeta, Botón y Modal (Sin cambios) --- */
.product-card { background-color: white; border-radius: 8px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); overflow: hidden; display: flex; flex-direction: column; }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12); transition: all 0.3s ease; }
.product-image-container { position: relative; height: 250px; cursor: pointer; }
.product-image-container img { width: 100%; height: 100%; object-fit: cover; }
.product-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); color: white; display: flex; justify-content: center; align-items: center; font-size: 1.2rem; font-weight: 600; opacity: 0; transition: opacity 0.3s ease; }
.product-card:hover .product-overlay { opacity: 1; }
.product-info { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.product-name { font-size: 1.2rem; margin: 0 0 5px 0; color: #212529; }
.product-brand { font-size: 0.9rem; color: #6c757d; margin: 0 0 15px 0; flex-grow: 1; }
.product-pricing { display: flex; align-items: baseline; gap: 10px; }
.product-price { font-size: 1.4rem; font-weight: 700; color: #007bff; }
.product-price-old s { color: #AD6683; font-size: 1rem; font-weight: 400; }
.btn-whatsapp { display: block; background-color: #25D366; color: white; text-align: center; padding: 12px; text-decoration: none; font-weight: 600; transition: background-color 0.2s; margin-top: auto; }
.btn-whatsapp:hover { background-color: #1EBE57; }
.gallery-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.85); display: flex; justify-content: center; align-items: center; z-index: 2000; }
.gallery-modal-content { position: relative; width: 90%; max-width: 900px; max-height: 90vh; }
.gallery-close { position: absolute; top: -40px; right: 0; font-size: 2.5rem; color: white; background: none; border: none; cursor: pointer; }
.gallery-main-image { position: relative; display: flex; justify-content: center; align-items: center; }
.gallery-main-image img { max-width: 100%; max-height: 70vh; border-radius: 4px; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); background-color: rgba(0, 0, 0, 0.5); color: white; border: none; font-size: 2rem; cursor: pointer; padding: 10px 15px; border-radius: 50%; width: 50px; height: 50px; line-height: 1; }
.gallery-nav.prev { left: -60px; }
.gallery-nav.next { right: -60px; }
.gallery-thumbnails { margin-top: 20px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.gallery-thumbnails img { width: 80px; height: 80px; object-fit: cover; cursor: pointer; border-radius: 4px; border: 2px solid transparent; transition: border-color 0.2s; }
.gallery-thumbnails img.active, .gallery-thumbnails img:hover { border-color: #007bff; }


/* --- Media Query para Menú Responsivo (SECCIÓN CLAVE) --- */
@media screen and (max-width: 900px) {
  .topnav a, .topnav .dropbtn {
      display: none;
  }
  .topnav a.icon {
    float: right;
    display: block;
  }
  .topnav.responsive {position: relative;}
  .topnav.responsive .icon {
    position: absolute;
    right: 0;
    top: 0;
  }
  .topnav.responsive a, .topnav.responsive .dropbtn {
    float: none;
    display: block;
    text-align: left;
  }
  .topnav.responsive .dropdown {
      float: none;
  }
  .topnav.responsive .dropdown-content {
      position: relative;
  }
  .topnav.responsive .dropdown .dropbtn {
    display: block;
    width: 100%;
    text-align: left;
  }

  .gallery-nav.prev { left: 5px; }
  .gallery-nav.next { right: 5px; }
}