/* --- ESTILOS GENERALES Y VARIABLES --- */
:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --border: #334155;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --radius: 8px;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
}

/* --- ENCABEZADO Y MENÚ --- */
header {
    background-color: #111827;
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    display: flex;
    flex-direction: column; /* Se acomoda en columna para celulares por defecto */
    align-items: center;
    gap: 0.75rem;
}

header .logo {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
}

header nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

header nav a, header nav button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
}

header nav button#cart-btn {
    background-color: var(--primary);
    border: none;
    font-weight: bold;
}

/* --- FILTROS Y BUSCADOR --- */
main {
    padding: 1rem;
}

.filters {
    display: flex;
    flex-direction: column; /* Apila el buscador y el selector en celulares */
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.filters input, .filters select {
    width: 100%;
    padding: 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: var(--radius);
    font-size: 0.95rem;
}

/* --- GRID DE PRODUCTOS --- */
.product-grid {
    display: grid;
    grid-template-columns: 1fr; /* Una sola columna en celulares para que respire bien */
    gap: 1rem;
}

/* --- MODALES --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    box-sizing: border-box;
    z-index: 1000;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 400px;
    color: var(--text-main);
    box-sizing: border-box;
}

/* --- ADAPTACIÓN PARA COMPUTADORAS (Pantallas más grandes) --- */
@media (min-width: 768px) {
    header {
        flex-direction: row;
        justify-content: space-between;
        padding: 1rem 2rem;
    }

    header nav {
        width: auto;
        justify-content: flex-end;
    }

    .filters {
        flex-direction: row;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* Varias columnas en PC */
    }
}