html, body {
    height: 100%;
    margin: 0;
}

/* Container principale */
.page-wrapper {
    display: flex;
    justify-content: space-between;
    height: 100vh;
    overflow: hidden;
}

/* Colonna dei filtri */
.sidebar {
    width: 300px; /* Larghezza fissa per i filtri */
    padding: 20px;
    background-color: #f4f4f4;
}

/* Colonna dei prodotti */
.content-area {
    flex: 1;
    /* display: flex; */
    overflow-y: auto;
    flex-wrap: wrap;
    gap: 20px;
}


/* Scheda prodotto */

.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 20px;
    padding: 0 20px;
}

.product-card {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 16px;
    background-color: #fff;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

.product-card .add-to-favorites {
    margin-top: auto;         /* spinge il bottone in basso */
    width: 100%;              /* largo quanto la card */
    border: none;
    padding: 12px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.product-card .add-to-favorites:focus {
    outline: none;
}

.product-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.product-meta {
    display: flex;
    justify-content: space-around;
    font-size: 1.2rem;
    color: #555;
}

.price-level {
    color: #2e7d32;
}

.delivery-speed {
    color: #1565c0;
}

.add-to-favorites {
    padding: 10px;
    font-size: 1rem;
    width: 100%;
    border: none;
    border-radius: 6px;
    background-color: #f0f0f0;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-to-favorites:hover {
    background-color: #ddd;
}

/* Fine scheda prodotto */



/* Spinner */
.spinner-wrapper {
    width: 100%;
    display: flex;
    justify-content: center; /* centra orizzontalmente */
    align-items: center;
    padding: 20px 0;
  }
  
  .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0,0,0,0.1);
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
  
  @keyframes spin {
    to { transform: rotate(360deg); }
  }

/* Fine Spinner */


.end-message {
    display: flex;
    justify-content: center; /* centra orizzontalmente */
    align-items: center;
    padding: 20px 0;
    width: 100%;
}

.top-bar {
    box-sizing: border-box;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    width: 100%;
    height: 50px;
    background: #f4f4f4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
}

.left-info {
    font-size: 16px;
    font-weight: 500;
}

.right-info {
    position: relative;
}

.quote-icon {
    text-decoration: none;
    font-size: 22px;
    color: #333;
    position: relative;
}

.badge {
    position: absolute;
    top: -6px;
    right: -10px;
    background: red;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: bold;
}

/* Titolo e prezzo */
.product h3 {
    font-size: 1.2rem;
    margin: 10px 0;
}

.product p {
    font-size: 1rem;
    color: #555;
}

.product a {
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
}

/* Modale */
#productModal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    width: 70%;
    max-width: 800px;
    margin: 10% auto;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    cursor: pointer;
}
button.add-to-favorites {
    background-color: #28a745;
    color: white;
    padding: 8px 20px;
    border: none;
    cursor: pointer;
}
button.added {
    background-color: #cd4f39;
    color: white;
    cursor: pointer;
}
a.btn_request_quote {
    display: block;
    position: relative;
    background: #28a745;
}

img.show-detail {
    cursor: pointer;
}


/* Richiesta preventivo */

    .container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        max-width: 1000px;
        margin: 2rem auto;
        padding: 1rem;
    }

    h2 {
        margin-bottom: 1rem;
    }

    ul#selected-products {
        list-style: none;
        padding-left: 0;
    }

    ul#selected-products li {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
        background-color: #f5f5f5;
        border: 1px solid #ddd;
        border-radius: 5px;
    }

    form {
        display: flex;
        flex-direction: column;
    }

    form input,
    form textarea {
        padding: 0.8rem;
        margin-bottom: 1rem;
        border-radius: 5px;
        border: 1px solid #ccc;
    }

    form select {
        padding: 0.8rem;
        margin-bottom: 1rem;
        border-radius: 5px;
        border: 1px solid #ccc;
        height: 40px;
    }

    form button,
    .button {
        background-color: #007bff;
        color: #fff;
        padding: 0.8rem;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        text-decoration: none;
        font-size: 12px;
        display: inline-block;
        text-align: center;
        margin-bottom: 10px;
        font-family: inherit;
    }

    form button:hover {
        background-color: #0056b3;
    }

    .alert-success {
        background-color: #d4edda;
        border: 1px solid #c3e6cb;
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 5px;
        color: #155724;
    }

@media (min-width: 1024px) {
    .product-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .page-wrapper {
        flex-direction: column; /* Le colonne si impilano su dispositivi piccoli */
        height: auto;
        overflow: visible;
    }
    .container {
        grid-template-columns: 1fr;
    }

    .content-area {
        overflow-y: unset;
    }

    .sidebar {
        width: 100%; /* La sidebar diventa a tutta larghezza */
        box-sizing: border-box;
    }

    a.btn_request_quote {
        display: block;
        position: fixed;
        bottom: 0px;
        left: 0px;
        width: 100%;
        border-radius: 0px;
        padding: 20px 0px;
        margin: 0;
    }

}