body {
    font-family: Arial, sans-serif;
    margin: 0;
    background: #f5f5f5;
}


.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 280px));
    justify-content: center;
    gap: 20px;
    padding: 20px;
}


.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #eee; /* importante para que no sea transparente */
}

.card {
    background: white;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}


.card {
    transition: all 0.3s ease;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 10px;
    background: #fff;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border-color: #aaa;
}

/* Tablet */
@media (max-width: 990px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Celular */
@media (max-width: 600px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

/* CARDS OCULTAS EN DESKTOP */
.carrito-cards {
    display: none;
}

/* MOBILE */
@media (max-width: 768px) {

    /* ocultar tabla */
    table {
        display: none;
    }

    /* mostrar cards */
    .carrito-cards {
        display: block;
        padding: 15px;
    }

    .carrito-card {
        background: #fff;
        border-radius: 10px;
        padding: 15px;
        margin-bottom: 15px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }

    .carrito-card h4 {
        margin-top: 0;
    }

    .carrito-card input {
        width: 70px;
        margin-right: 5px;
    }

    .carrito-card form {
        margin-top: 10px;
    }

    .btn-eliminar {
        background: red;
        color: #fff;
        border: none;
        padding: 5px 10px;
        cursor: pointer;
    }

        .btn-actualizar {
        background: rgb(29, 54, 139);
        color: #fff;
        border: none;
        padding: 5px 10px;
        cursor: pointer;
    }


}

.producto-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

.producto-titulo {
    margin-bottom: 20px;
}

/* GRID DESKTOP */
.producto-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: center;
}

/* IMAGEN */
.producto-imagen img {
    width: 100%;
    max-width: 350px;
    border-radius: 10px;
}

/* INFO */
.producto-info {
    text-align: left;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .producto-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

.producto-info {
    background: #fff;
    padding: 15px;
    border-radius: 10px;
}
}

/* HEADER BASE (desktop igual que ahora) */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #222;
    padding: 10px;
    flex-wrap: wrap;
}

/* fila inferior */
.header-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* MOBILE */
@media (max-width: 768px) {

    .header {
        flex-direction: column;
        align-items: stretch;
    }

    /* buscador arriba */
    .search-box {
        width: 100%;
        display: flex;
        margin-bottom: 10px;
    }

    .search-box input {
        flex: 1;
    }

    /* fila inferior */
    .header-row {
        display: flex;
        justify-content: space-between;
        width: 100%;
    }

    /* ocultar texto del carrito (más limpio) */
    .carrito-texto {
        display: none;
    }
}

