/* ============================ */
/* Banner della categoria       */
/* ============================ */
.category-banner {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 60px 20px;
    color: #fff;
    text-align: center;
    position: relative;
}

.category-banner .banner-content {
    background: #dedacf;
    display: inline-block;
    padding: 20px;
    border-radius: 8px;
}

.category-banner h1 {
    font-size: 36px;
    font-weight: bold;
    margin: 0 0 10px;
    color: #333;
}

.category-banner p {
    font-size: 16px;
    margin: 0;
    color:#333;
}

/* ============================ */
/* Layout con sidebar e prodotti*/
/* ============================ */
.category-layout {
    display: grid;
    grid-template-columns: 80% 20%; /* 80% per i prodotti, 20% per la sidebar */
    gap: 85px;
    width: 100%;
    max-width: 1600px; /* Larghezza massima per tutto il contenuto */
    margin: 0 auto; /* Centra il contenuto */
    padding: 0 0px; /* Padding laterale */
    padding-top: 50px; /* Spaziatura superiore */
    padding-bottom: 120px; /* Spaziatura inferiore */
    box-sizing: border-box;
}

.category-products {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Forza 4 colonne per riga */
    gap: 1em; /* Spaziatura tra le card */
    row-gap: 30px;
    column-gap: 20px;
}

.category-products .product-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1em;
    background: #fff;
    border-radius: 8px;
    box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
    position: relative;
}

.category-products .product-item:hover {
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.15);
}

.category-products .product-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 1em;
}

.category-products .product-item h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0.5em 0;
    color: #333;
    min-height: 1em;
}

.category-products .product-item .desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 1em;
}

.description {
    font-size: 14px;
}

.category-title {
    font-size: 24px;
    font-weight: 600;
    margin: 80px 0 55px;
}

/* ============================ */
/* Menù sidebar                 */
/* ============================ */
.category-sidebar {
    border-bottom: 1px solid #ddd;
    min-width: 300px;
    height: fit-content;
    position: sticky;
    top: 20px; /* Sidebar fissa durante lo scroll */
}

.category-sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-sidebar-menu li {
    padding: 10px;
}

.category-sidebar-menu li a {
    text-decoration: none;
    color: #333;
    text-transform: uppercase;
    font-weight: 600;
}
/* ============================ */
/* Casella di ricerca           */
/* ============================ */

.search-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 20px;
}

.search-box {
    width: 100%;
    max-width: 800px;
    background-color: #f1f1f1;
    padding: 60px 0px 0px 0px;
    border-radius: 5px;
    text-align: center;
    border-radius: 0px 0px 5px 5px;
}

.search-box form {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.search-box input {
    width: 70%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: KohinoorLatin;
}

.search-box button {
    padding: 10px 20px;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: KohinoorLatin;
    text-transform: uppercase;
}

.search-box .search-button {
    display: inline-block;
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    margin-left: 5px;
    transition: background 0.3s ease;
}

.search-box .search-button:hover {
    background-color: #555;
}
.search-box p {
    margin-top: 40px;
    font-size: 14px;
}

/* ============================ */
/* Bottoni                      */
/* ============================ */
.card-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.card-buttons .variant-button,
.card-buttons .product-button {
    padding: 10px 20px;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 35px; /* Altezza uniforme per entrambi i bottoni */
    box-sizing: border-box;
}

.card-buttons .variant-button {
    font-family: 'KohinoorLatin', sans-serif;
    background: #dedacf;
    color: #000000;
    position: relative;
}

.card-buttons .variant-button svg {
    fill: #000000; /* Colore dell'icona */
    margin-right: 8px;
}


.card-buttons .product-button {
    background: #000000;
    color: #fff;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

/* ============================ */
/* Popup Varianti               */
/* ============================ */
.variant-info {
    display: none;
    position: absolute;
    bottom: calc(14% + 8px); /* Fa comparire il popup sopra il bottone */
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 10px;
    font-size: 14px;
    z-index: 10;
    white-space: nowrap;
    font-weight: 600;
    width: 300px;
}

/* Mostra il popup quando si clicca sul pulsante */
.variant-button:focus + .variant-info,
.variant-button:active + .variant-info {
    display: block;
}

/* ============================ */
/* Responsive Design            */
/* ============================ */
@media (max-width: 768px) {
    .category-layout {
        grid-template-columns: 1fr; /* Layout a una colonna */
    }

    .category-products {
        grid-template-columns: repeat(2, 1fr); /* Due colonne per i prodotti */
    }
}

@media (max-width: 480px) {
    .category-products {
        grid-template-columns: 1fr; /* Una colonna per i prodotti */
    }
}
