/* 1. Variabili Colori e Font */
:root {
    --primary-green: #4CAF50;
    --accent-orange: #FF9800;
    --dark-text: #424242;
    --light-grey-bg: #f5f5f5;
    --white: #ffffff;
    --title-font: 'Quicksand', sans-serif;
}

/* 2. Stili Globali */
html {
    overscroll-behavior: none;
    height: 100%;
}

body {
    background-color: var(--light-grey-bg);
    color: var(--dark-text);
    min-height: 100vh;
    overscroll-behavior: none; /* per evitare il rimbalzo */
    display: flex;
    flex-direction: column;
}

#product-list {
    flex: 1 0 auto;
}

/* 3. Override di Bootstrap */
.bg-primary {
    background-color: var(--primary-green) !important;
}

.btn-primary {
    background-color: var(--accent-orange);
    border-color: var(--accent-orange);
}

.btn-primary:hover {
    background-color: #e68900; /* Un po' più scuro al hover */
    border-color: #e68900;
}

.text-primary {
    color: var(--primary-green) !important;
}

a {
    color: var(--accent-orange);
}

a:hover {
    color: #e68900;
}

.navbar-light .navbar-nav .nav-link.active {
    color: var(--primary-green);
    font-weight: bold;
}

/* 4. Header */
header h1 {
    font-family: var(--title-font);
    font-weight: 700;
}

/* 5. Card Prodotti */
.product-card {
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* 6. Bottone Carrello Flottante */
#cart-button {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
}

#cart-button:hover {
    background-color: #45a049; /* Verde più scuro per hover */
    border-color: #45a049;
}


/* Stili per 5 colonne su schermi XL e XXL */
@media (min-width: 1200px) {
    #product-list .col-xl {
        flex: 0 0 auto;
        width: 20%;
    }
}

@media (min-width: 1400px) {
    #product-list .col-xxl {
        flex: 0 0 auto;
        width: 20%;
    }
}

/* Stili per la visualizzazione compatta su mobile */
@media (max-width: 575.98px) {
    .product-card {
        flex-direction: row;
        align-items: stretch; /* Allunga gli elementi figli all'altezza della card */
    }

    .product-card .card-img-top {
        width: 100px;
        height: 100%;
        object-fit: cover;
        border-radius: var(--bs-card-border-radius) 0 0 var(--bs-card-border-radius);
    }

    .product-card .card-body {
        padding: 0.75rem;
        flex: 1 1 auto;
        flex-direction: row !important; /* Corregge l'override di Bootstrap */
        justify-content: space-between;
        align-items: center; /* Allinea verticalmente gli elementi */
    }

    .product-card .product-info {
        flex: 1 1 auto;
        margin-right: 0.5rem; /* Aggiunge spazio tra info e controlli */
    }

    .product-card .product-controls {
        flex: 0 0 140px; /* Larghezza fissa per i controlli, aumentata per il testo del bottone */
        margin-top: 0 !important; /* Sovrascrive mt-auto */
        display: flex;
        flex-direction: column;
        justify-content: center;
        height: 100%;
    }

    .product-card .card-title {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }

    .product-card .card-text {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .product-card .btn {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Stili per la tabella del carrello su mobile */
@media (max-width: 575.98px) {
    #cart-items .table {
        font-size: 0.8rem; /* Riduci la dimensione del font per la tabella */
    }

    #cart-items .table th,
    #cart-items .table td {
        padding: 0.5rem 0.25rem; /* Riduci il padding per guadagnare spazio */
    }
}
