/* --- Estilos Generales --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #1a1a1a; /* Fondo oscuro principal */
    color: #ecf0f1;
    line-height: 1.6;
}

.productos-container { 
    max-width: 1100px; 
    margin: 0 auto; 
    padding: 20px; 
}

/* --- Caja de Selección de Tipo --- */
.tipo-selector-box {
    background: rgba(10, 20, 30, 0.9);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    color: white;
    max-width: 90%;
    width: 900px;
    margin: 20px auto 40px;
    border: 2px solid #e74c3c;
}
.tipo-selector-box h2 {
    margin-bottom: 30px;
    font-size: 2em;
    color: #ffffff;
}
.tipo-buttons-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}
.tipo-buttons-bar a {
    background: rgba(231, 76, 60, 0.8);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    transition: background 0.2s ease, transform 0.2s ease;
    border: none;
}
.tipo-buttons-bar a:hover {
    background: rgba(231, 76, 60, 1);
    transform: translateY(-3px);
}
.tipo-buttons-bar a.active {
    background: #c0392b; /* Un rojo un poco más oscuro para el activo */
    transform: translateY(1px);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}


/* --- Barra de Filtros --- */
.filters-bar { 
    background-color: rgba(0,0,0,0.6); 
    padding: 15px; 
    border-radius: 8px; 
    margin-bottom: 30px; 
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px; 
    border: 1px solid #555; 
}
.filters-bar form { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px; 
    width: 100%; 
    align-items: center;
}
.filters-bar input, .filters-bar select { 
    padding: 10px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    flex-grow: 1; 
    background: #333;
    color: #fff;
    border-color: #555;
}
.filters-bar button { 
    background: #e74c3c; 
    color: white; 
    border: none; 
    padding: 10px 15px; 
    cursor: pointer; 
    border-radius: 4px; 
    font-weight: bold; 
    transition: background 0.2s ease;
}
.filters-bar button:hover {
    background: #c0392b;
}

/* --- Filtros específicos de Luminaria --- */
.luminaria-filters {
    display: none; /* Oculto por defecto */
    flex-grow: 1;
    display: contents; /* Para que los hijos se integren en el flexbox del form */
}
.luminaria-filters.active {
    display: contents; /* Se muestra cuando la clase active está presente */
}


/* --- Paginación --- */
.pagination { text-align: center; margin: 30px 0; }
.pagination a, .pagination span { display: inline-block; padding: 8px 16px; margin: 0 4px; border-radius: 4px; text-decoration: none; color: #fff; background-color: rgba(0,0,0,0.6); border: 1px solid #555; transition: background-color 0.2s ease; }
.pagination a:hover { background-color: #e74c3c; border-color: #e74c3c; }
.pagination span.active { background-color: #e74c3c; border-color: #e74c3c; font-weight: bold; cursor: default; }
.pagination span.disabled { color: #666; background-color: rgba(0,0,0,0.3); cursor: not-allowed; }


/* --- Tarjeta de Producto --- */
.producto-card {
    background-color: rgba(10, 20, 30, 0.85);
    border: 2px solid #e74c3c;
    color: #ecf0f1;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "info gallery";
    gap: 20px;
    padding: 25px;
    overflow: hidden;
}
@media (max-width: 768px) { 
    .producto-card { 
        grid-template-columns: 1fr; 
        grid-template-areas: "info" "gallery"; 
    } 
}
.producto-gallery { grid-area: gallery; }
.producto-info { grid-area: info; display: flex; flex-direction: column; }

.producto-card.no-results {
    display: block;
    text-align: center;
    padding: 40px;
}

/* --- Información del Producto --- */
.producto-card h2 { 
    color: #ffffff; 
    margin-top: 5px; 
    margin-bottom: 10px;
}
.producto-card .producto-tipo { 
    font-weight: bold; 
    color: #e74c3c; 
    display: block; 
    margin-bottom: 5px; 
    text-transform: uppercase; 
}
.producto-card .producto-subtipo {
    font-style: italic;
    color: #bdc3c7;
    margin-bottom: 15px;
}
.producto-card .producto-descripcion { 
    color: #bdc3c7; 
    margin: 5px 0 15px; 
    line-height: 1.6; 
    max-height: 150px; 
    overflow-y: auto; 
    padding-right: 10px;
    flex-grow: 1; /* Empuja los links hacia abajo */
}
.producto-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #fff;
}
.producto-specs span {
    background-color: rgba(0,0,0,0.3);
    padding: 5px 10px;
    border-radius: 4px;
}

/* --- Links de producto --- */
.producto-links {
    margin-top: auto; /* Se alinea al final */
    padding-top: 15px;
    border-top: 1px solid #444;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.button-link {
    background: #e74c3c;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9em;
    transition: background 0.2s ease;
}
.button-link:hover {
    background: #c0392b;
}

/* --- Galería de Miniaturas y Lightbox --- */
.gallery-thumbnails { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); 
    gap: 10px; 
}
.gallery-thumbnails img {
    width: 100%;
    height: 90px;
    object-fit: contain;
    background-color: rgba(0,0,0,0.2);
    border-radius: 15px;
    cursor: pointer;
    border: 2px solid #555;
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.gallery-thumbnails img:hover { 
    transform: scale(1.05); 
    border-color: #e74c3c; 
}
.no-images {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 150px;
    border: 2px dashed #555;
    border-radius: 15px;
    color: #7f8c8d;
}

/* Clases para controlar el layout de la galería con pocas imágenes */
.gallery-count-1 { grid-template-columns: 1fr; }
.gallery-count-1 img { height: 250px; }
.gallery-count-2 { grid-template-columns: 1fr 1fr; }
.gallery-count-2 img { height: 180px; }
.gallery-count-3 { grid-template-columns: 1fr 1fr 1fr; }
.gallery-count-3 img { height: 120px; }

/* --- Estilos del Lightbox --- */
.lightbox-overlay { 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0, 0, 0, 0.9); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 99999; 
    opacity: 0; 
    visibility: hidden; 
    transition: opacity 0.3s ease, visibility 0.3s ease; 
}
.lightbox-overlay.active { 
    opacity: 1; 
    visibility: visible; 
}
.lightbox-content { 
    position: relative; 
    max-width: 90%; 
    max-height: 85%; 
}
.lightbox-content img { 
    width: auto; 
    height: auto; 
    max-width: 100%; 
    max-height: 100vh; 
    border-radius: 4px; 
}
.lightbox-arrow, .lightbox-close { 
    position: absolute; 
    background: rgba(20, 20, 20, 0.5); 
    color: white; 
    border: none; 
    cursor: pointer; 
    font-size: 30px; 
    font-weight: bold; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: background-color 0.2s ease; 
    z-index: 1001; 
}
.lightbox-arrow:hover, .lightbox-close:hover { 
    background-color: #e74c3c; 
}
.lightbox-arrow { 
    top: 50%; 
    transform: translateY(-50%); 
    width: 50px; 
    height: 50px; 
    border-radius: 50%; 
}
.lightbox-arrow.prev { left: -70px; }
.lightbox-arrow.next { right: -70px; }
.lightbox-close { 
    top: -40px; 
    right: -40px;
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    font-size: 24px; 
}

@media (max-width: 768px) {
    .lightbox-arrow.prev { left: 10px; }
    .lightbox-arrow.next { right: 10px; }
    .lightbox-close { top: 10px; right: 10px; }
}

