/* ======================= */
/* CONFIGURACIÓN GENERAL */
/* ======================= */
* {
 margin: 0;
 padding: 0;
 box-sizing: border-box;
 scroll-behavior: smooth;
 font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
 background: linear-gradient(to bottom, #0d0d0d, #1a1a1a);
 color: #f1f1f1;
 overflow-x: hidden;
}

/* ======================= */
/* NAVEGACIÓN */
/* ======================= */
header {
    background: rgba(0, 0, 0, 0.95);
    padding: 1rem 2rem;
    display: flex;
    justify-content: left; /* Centra la navegación en el header */
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.05);
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

header nav ul li a {
    text-decoration: none;
    color: #f1f1f1;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
}

header nav ul li a::after {
    content: "";
    width: 0%;
    height: 2px;
    background: #00ffe1;
    position: absolute;
    bottom: -4px;
    left: 0;
    transition: width 0.3s ease;
}

header nav ul li a:hover::after {
    width: 100%;
}

header nav ul li a.active {
    color: #00ffe1;
}

/* ======================= */
/* CONTROLES SUPERIORES */
/* ======================= */
.controles-superiores {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: #121212;
    border-bottom: 1px solid #222;
    flex-wrap: wrap;
}

.buscador input[type="text"] {
    width: 100%;
    max-width: 500px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 30px;
    border: none;
    outline: none;
    background: #222;
    color: #f1f1f1;
    box-shadow: 0 0 8px rgba(0, 255, 225, 0.3);
    transition: box-shadow 0.3s ease;
}

.buscador input[type="text"]:focus {
    box-shadow: 0 0 12px #00ffe1;
}

/* ======================= */
/* DROPDOWN / FILTRO */
/* ======================= */
.dropdown {
    position: relative;
    display: inline-block;
    z-index: 10;
}

.dropbtn {
    background: linear-gradient(145deg, #00ffe1, #008c7e);
    color: #0a0a0a;
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 255, 225, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropbtn:hover {
    background: linear-gradient(145deg, #00fff7, #00ccb3);
    box-shadow: 0 0 16px rgba(0, 255, 225, 0.7);
    transform: scale(1.05);
}

.dropdown-content {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    position: absolute;
    background-color: #1f1f1f;
    min-width: 220px;
    box-shadow: 0px 4px 15px rgba(0, 255, 225, 0.15);
    z-index: 1;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 10px;
}

.dropdown-content a {
    color: #f1f1f1;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    transition: background-color 0.3s;
}

.dropdown-content a:hover {
    background-color: #00ffe120;
}

.dropdown-content a.active-filter { /* Estilo para la categoría activa */
    background-color: #00ffe140; /* Un color ligeramente diferente para indicar que está activa */
    font-weight: bold;
}

.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ======================= */
/* GALERÍA */
/* ======================= */
.galeria {
    display: grid;
    /* Usa auto-fit para un diseño más flexible basado en el tamaño del contenedor */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem;
    background: #121212;
}

.producto {
    background: #1f1f1f;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 255, 225, 0.1);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    text-align: center; /* Centra el texto dentro de cada tarjeta de producto */
}

.producto img {
    width: 100%;
    max-width: 200px; /* Ajusta este valor si tus imágenes son más grandes o pequeñas */
    height: 200px; /* Altura fija para uniformidad */
    object-fit: contain; /* Asegura que la imagen completa sea visible */
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Selectores corregidos para las etiquetas <p> */
.producto p:nth-of-type(1) { /* Nombre del producto */
    font-size: 1.2rem;
    color: #00ffe1;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.producto p:nth-of-type(2) { /* Cantidad */
    font-size: 0.95rem;
    color: #ccc;
    margin-bottom: 0.3rem;
}

.producto p:nth-of-type(3) { /* Precio */
    font-weight: bold;
    color: #00ffc3;
    font-size: 1rem;
    margin-top: 0.5rem;
}

.producto:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 255, 225, 0.25);
}

/* ======================= */
/* PIE DE PÁGINA */
/* ======================= */
footer {
    text-align: center;
    padding: 2rem;
    background: #0a0a0a;
    font-size: 0.9rem;
    color: #888;
    border-top: 1px solid #222;
}

/* ======================= */
/* RESPONSIVE */
/* ======================= */
@media (max-width: 1024px) {
    .galeria {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    header {
        padding: 1rem;
    }
    header nav ul {
        gap: 1rem;
    }
    .controles-superiores {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    .galeria {
        grid-template-columns: 1fr; /* Una columna en móviles */
        padding: 1.5rem;
    }
    .producto img {
        max-width: 150px; /* Ajusta el tamaño de la imagen en móviles si es necesario */
    }
}