/* ============================================================================
   FILTER CHIPS - Modern Category Style
   ============================================================================ */

.filter-chips {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 20px 0 8px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px 10px 10px;
    background: linear-gradient(135deg, rgb(241 227 211) 0%, rgba(250, 250, 250, 0.7) 100%);
    backdrop-filter: blur(20px) saturate(190%);
    -webkit-backdrop-filter: blur(20px) saturate(190%);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #495057;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06), inset 0 1px 2px rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.filter-chip::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.5px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.filter-chip:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1),
                inset 0 1px 2px rgba(255, 255, 255, 0.9);
}

.filter-chip:hover::before {
    opacity: 1;
}

.filter-chip.active {
    background: linear-gradient(135deg, #d4a574 0%, #e0b895 100%);
    color: white;
    border-color: #d4a574;
    box-shadow: 0 8px 28px rgba(212, 165, 116, 0.35),
                0 4px 12px rgba(212, 165, 116, 0.2),
                inset 0 1px 2px rgba(255, 255, 255, 0.3);
    transform: translateY(-4px) scale(1.02);
}

.filter-chip.active::before {
    opacity: 0;
}

.filter-chip.active .filter-chip-icon {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.filter-chip-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(212, 165, 116, 0.15), rgba(212, 165, 116, 0.08));
    color: #d4a574;
    font-size: 16px;
    flex-shrink: 0;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-weight: 700;
    line-height: 1;
}

.filter-chip.active .filter-chip-icon {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    transform: scale(1.1);
}

/* ============================================================================
   SECTION HEADERS
   ============================================================================ */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    flex-wrap: wrap;
    gap: 16px;
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    border-radius: 10px;
    margin: 0 16px 24px 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(212, 165, 116, 0.1);
    transition: all 0.3s ease;
}

.section-header:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.06);
}

.section-header::after {
    display: none;
}

.section-title {
    font-size: 24px;
    font-weight: 800;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.3px;
    flex: 1;
    min-width: 0;
    position: relative;
}

.section-title::before,
.section-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(212, 165, 116, 0.40) 50%,
        transparent 100%);
}

.section-title::before {
    margin-right: 12px;
}

.section-title::after {
    margin-left: 12px;
}

.section-title span {
    font-size: 28px;
    opacity: 0.95;
    white-space: nowrap;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* View Toggle */
.view-toggle {
    display: flex;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

.view-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #6c757d;
}

.view-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

.view-btn.active {
    background: white;
    color: #d4a574;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.view-btn:hover:not(.active) {
    color: #495057;
}

.see-all-btn {
    color: #d4a574;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.see-all-btn:hover {
    color: #c4956f;
    transform: translateX(3px);
}

/* ============================================================================
   #menu-popolare — two-row layout: title+toggle on top, chips below
   ============================================================================ */

#menu-popolare {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding-bottom: 16px;
    gap: 0;
    row-gap: 0;
}

/* Row 1 — title */
#menu-popolare .section-title {
    order: 1;
    flex: 1;
    min-width: 0;
    padding: 20px 0 16px 0;
    font-size: 20px;
    letter-spacing: -0.2px;
}

/* Hide the decorative gradient lines on this instance */
#menu-popolare .section-title::before,
#menu-popolare .section-title::after {
    display: none;
}

/* Row 1 — view toggle (right side) */
#menu-popolare .section-actions {
    order: 2;
    flex-shrink: 0;
    padding: 20px 0 16px 12px;
}

/* Row 2 — filter chips strip, full width */
#menu-popolare .filter-chips {
    order: 3;
    width: 100%;
    padding: 12px 0 4px 0;
    margin-top: 0;
    border-top: 1px solid rgba(212, 165, 116, 0.12);
}

/* ============================================================================
   Responsive adjustments */
@media (max-width: 768px) {
    .filter-chip {
        padding: 8px 14px 8px 8px;
        font-size: 13px;
        gap: 8px;
    }

    .filter-chip-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .filter-chips {
        gap: 10px;
        padding: 16px 0 6px 0;
    }

    .filter-chip {
        padding: 6px 12px 6px 6px;
        font-size: 12px;
        gap: 6px;
    }

    .filter-chip-icon {
        width: 26px;
        height: 26px;
        font-size: 13px;
    }
}

@media (max-width: 380px) {
    .section-header {
        gap: 12px;
    }

    .section-title {
        font-size: 21px;
    }

    .see-all-btn {
        font-size: 14px;
    }

    .filter-chips {
        gap: 8px;
    }

    .filter-chip {
        padding: 5px 10px 5px 5px;
        font-size: 11px;
    }

    .filter-chip-icon {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
}