/* tienda/static/tienda/css/tienda.css */
html {
    overflow-x: hidden; /* Oculta todo lo que intente salirse por los lados */

}

body {
    background-color: #000; /* Fondo negro como la imagen */
    zoom: 0.8;
    overflow-x: hidden; /* Oculta todo lo que intente salirse por los lados */
}
/* Contenedor principal */
.productos-grid {
    display: grid;
    /* Cambiamos a auto-fill para que se ajuste al tamaño de la pantalla */
    grid-template-columns: repeat(4, 1fr);
    gap: 50px; 
    /* Bajamos el padding: 150px era demasiado y empujaba todo al centro */
    padding: 50px 50px 50px 140px; 
    background-color: #000;
    justify-items: center; /* Centra las tarjetas en su celda */
}

/* Tarjeta individual */
.producto-card {
    /* Quitamos el width fijo de 310px para que el grid lo controle */
    width: 100%; 
    max-width: 310px; 
    height: auto; /* Dejamos que crezca según contenido */
    text-align: center;
    margin-bottom: 20px; 
}

/* El cuadro gris de la imagen (Más alto y angosto) */
.img-container {
    background-color: #fff;
    border-radius: 15px;
    height: 350px;
    /*Unpocomásbajoparaquenoocupetodalapantalla*/display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 15px;
    width: 100%;
    /*Queusetodoelanchodelatarjeta*/
    -webkit-border-radius: 15px;
    -moz-border-radius: 15px;
    -ms-border-radius: 15px;
    -o-border-radius: 15px;
}

/* Ajuste de la imagen interna */
.img-container img {
    width: 90%;
    height: 90%;
    object-fit: contain;
}

.producto-card h3 {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 5px 0;
    height: 2.4em; /* Mantiene alineados los títulos */
    overflow: hidden;
    color: #fff;
}

.precio {
    color: #ff1a1a;
    font-size: 1.7rem;
    font-weight: bold;
    margin: 5px 0 15px 0;
}

/* Botones */
.btn-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-agregar {
     width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: white;
    color: black;
    border: none;
    border-radius: 20px;
    padding: 8px;
    font-weight: bold;
    cursor: pointer;
     font-size: 1.2rem;
     width: 310px;
    height: 40px;

}

.btn-ver {
    background: #2a2d34;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    height: 40px;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 6px;
    font-size: 1.2rem;
    cursor: pointer;
    font-weight: bold;
}

/* Paginación */
.pagination {
    display: flex;
    text-align: center;
    padding: 30px;
    margin-top: 20px;
    color: #fff;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-pagi-negro {
    color: white;
    text-decoration: none;
    background: #2a2d34;
    padding: 10px 20px;
    border-radius: 20px;
}

.btn-pagi-blanco {
    color: black;
    text-decoration: none;
    background: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
}


.btn-containere {
    display: flex;
    flex-direction: row;
    gap: 15px;
}

/* =========================================
   OPTIMIZACIÓN MÓVIL (Responsividad)
   ========================================= */

/* Dispositivos móviles estándar (Tablets y Teléfonos hasta 768px) */
@media screen and (max-width: 768px) {
    
    /* 1. OCULTAR ELEMENTOS ESPECÍFICOS */
    /* Oculta el menú del dashboard (ajusta esta clase según tu base.html) */
    .menu-dashboard,
    .dashboard-sidebar,
    .dashboard-nav {
        display: none !important;
    }

    /* Ocultar el texto de paginación largo en móviles para evitar desbordes */
    .pagination .PON_TUS_CLASES_AQUI {
        display: none !important;
    }

    /* 2. ADAPTAR LA GRILLA DE PRODUCTOS */
    /* Cambiamos a 2 columnas para aprovechar el espacio en pantalla */
    .productos-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px;
    }

    /* Reducimos un poco el padding y tipografías en las tarjetas */
    .producto-card {
        padding: 10px;
    }
    
    .producto-card h3 {
        font-size: 24px;
        margin-bottom: 5px;
    }
    
    .producto-card .precio {
        font-size: 20px;
    }

    /* 3. OPTIMIZAR BOTONES DE PRODUCTO */
    /* Apilamos los botones verticalmente para que sean fáciles de tocar */
    .btn-container {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .btn-container a, 
    .btn-container button {
        width: 100%;
        font-size: 20px;
        padding: 8px 5px;
        text-align: center;
        box-sizing: border-box;
    }

    /* 4. MEJORAR EL SCROLL DE CATEGORÍAS */
    /* Aseguramos que el scroll horizontal sea fluido y táctil */
    .categories-scroll {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
        scroll-snap-type: x mandatory;
        padding-bottom: 15px;
    }

    .cat-card {
        min-width: 130px; /* Evita que las tarjetas se aplasten */
        flex: 0 0 auto;
        scroll-snap-align: start;
    }


    /* Rompemos las columnas de los filtros para que se apilen */
    .filter-row {
        display: flex;
        flex-direction: column;
    }

    .half-width {
        width: 100%;
        margin-bottom: 15px;
    }
}


/* Teléfonos muy estrechos (hasta 480px) */
@media screen and (max-width: 480px) {
    /* Si la pantalla es muy pequeña, pasamos a 1 sola columna de productos */
    .productos-grid {
        grid-template-columns: 1fr;
    }
}

