/* STATIC FILTERS DESIGN - assets/css/landing.css */
/* UPDATED: Implementate tutte le modifiche richieste */
/* ALL CARD CONFLICTS REMOVED - Cards handled by tour_cards.css */
/* FIXED: Z-index, titoli bianchi, pulsanti arancioni, gap ridotto */

/* ========================================
   1. LANDING LAYOUT (NO CALENDAR)
   ======================================== */
.landing-ricerca {
    background: transparent;
    padding: 0;
    padding-bottom: 0;
}

.landing-ricerca .archive-content-wrapper {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    position: relative;
    min-height: 100vh;
}

/* ========================================
   2. SIDEBAR FILTERS - FIXED Z-INDEX
   ======================================== */
.landing-ricerca .tour-filters-sidebar {
    width: 340px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 28px;
    height: auto;
    position: relative;
    top: 0;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    border: 1px solid rgba(255,255,255,0.3);
    z-index: 50; /* FIXED: Ridotto z-index per non andare sopra header */
    flex-shrink: 0;
    isolation: isolate;
}

/* Mobile Filter Toggle - Hidden on desktop, visible on mobile */
.mobile-filter-toggle {
    display: none;
    cursor: pointer;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f79448, #e8843f);
    color: white;
    border-radius: 12px;
    margin-bottom: 15px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(247, 148, 72, 0.3);
    transition: all 0.3s ease;
}

.mobile-filter-toggle h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.mobile-filter-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(247, 148, 72, 0.4);
}

#filterToggleIcon {
    font-size: 14px;
    transition: transform 0.3s ease;
}

#filterToggleIcon.rotated {
    transform: rotate(180deg);
}

/* Filter content wrapper */
.mobile-filter-content {
    display: block;
}

/* Filter Sections */
.filter-section {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(224,224,224,0.5);
    position: relative;
    z-index: 1;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--blue-primary) !important;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ========================================
   3. DESTINATION TABS
   ======================================== */
.destination-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.destination-tab {
    flex: 1;
    padding: 14px;
    background: rgba(255,255,255,0.7);
    border: 2px solid rgba(224,224,224,0.5);
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
    color: #64748b;
    text-transform: capitalize;
    position: relative;
}

.destination-tab[data-location="sardegna"]:hover {
    border-color: #f79448;
    color: #f79448;
    background: rgba(247,148,72,0.05);
}

.destination-tab[data-location="como"]:hover {
    border-color: #3068b3;
    color: #3068b3;
    background: rgba(48,104,179,0.05);
}

.destination-tab[data-location="sardegna"].active {
    background: linear-gradient(135deg, #f79448 0%, #e8843f 100%);
    color: white;
    border-color: #f79448;
    box-shadow: 0 4px 15px rgba(247,148,72,0.3);
}

.destination-tab[data-location="como"].active {
    background: linear-gradient(135deg, #3068b3 0%, #2a5ba1 100%);
    color: white;
    border-color: #3068b3;
    box-shadow: 0 4px 15px rgba(48,104,179,0.3);
}

/* ========================================
   4. GUESTS SELECTOR - DESKTOP GRID
   ======================================== */
.guests-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.guest-option {
    padding: 12px 8px;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(221,221,221,0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    position: relative;
}

.guest-option:hover {
    border-color: #f79448;
    color: #f79448;
    background: rgba(247,148,72,0.1);
    transform: scale(1.05);
}

.guest-option.selected {
    background: linear-gradient(135deg, #f79448 0%, #e8843f 100%);
    color: white;
    border-color: #f79448;
    box-shadow: 0 4px 12px rgba(247,148,72,0.3);
}

/* ========================================
   4.1. PEOPLE COUNTER - MOBILE SPECIFIC
   ======================================== */
.people-counter {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255,255,255,0.7);
    border-radius: 12px;
    border: 2px solid rgba(224,224,224,0.5);
    position: relative;
    z-index: 2;
}

.counter-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #f79448 0%, #e8843f 100%);
    color: white;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(247,148,72,0.3);
    position: relative;
}

.counter-btn:hover {
    background: linear-gradient(135deg, #e8843f 0%, #d7743a 100%);
    transform: scale(1.1);
    box-shadow: 0 6px 18px rgba(247,148,72,0.4);
}

.counter-btn:active {
    transform: scale(0.95);
}

.counter-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.counter-display {
    min-width: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: #333;
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid rgba(224,224,224,0.5);
}

/* ========================================
   5. DURATION TABS (ALWAYS VISIBLE)
   ======================================== */
.duration-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.duration-tab {
    padding: 14px 12px;
    background: rgba(255,255,255,0.7);
    border: 2px solid rgba(224,224,224,0.5);
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
    color: #64748b;
    text-transform: capitalize;
    position: relative;
}

.duration-tab:hover {
    border-color: #3068b3;
    color: #3068b3;
    background: rgba(48,104,179,0.05);
}

.duration-tab.active {
    background: linear-gradient(135deg, #3068b3 0%, #2a5ba1 100%);
    color: white;
    border-color: #3068b3;
    box-shadow: 0 4px 15px rgba(48,104,179,0.3);
}

/* ========================================
   6. TOUR TYPE TOGGLE - SIMPLIFIED MOBILE
   ======================================== */
.tour-type-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.tour-type-option {
    flex: 1;
    padding: 14px;
    background: rgba(255,255,255,0.7);
    border: 2px solid rgba(224,224,224,0.5);
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
    color: #64748b;
    text-transform: capitalize;
    position: relative;
}

.tour-type-option:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: rgba(99,102,241,0.05);
}

.tour-type-option.active {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border-color: #6366f1;
    box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}

.tour-type-option .type-icon,
.tour-type-option .type-desc {
    display: none;
}

.tour-type-option .type-label {
    font-size: 14px;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.5px;
}

/* ========================================
   7. SEARCH AND RESET BUTTONS - SAME SIZE
   ======================================== */
.search-availability-btn,
.reset-filters-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

.search-availability-btn {
    background: linear-gradient(135deg, #f79448 0%, #e8843f 100%);
    color: white;
}

.search-availability-btn:hover {
    background: linear-gradient(135deg, #e8843f 0%, #d7743a 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(247,148,72,0.4);
}

.reset-filters-btn {
    background: transparent;
    color: #666;
    border: 2px solid #e0e0e0;
}

.reset-filters-btn:hover {
    border-color: #999;
    color: #333;
    background: rgba(153,153,153,0.05);
}

/* ========================================
   8. DYNAMIC HERO CONTENT - UPDATED WITH DESCRIPTION
   ======================================== */
.dynamic-hero-content {
    text-align: center;
    padding: 0;
    margin-bottom: 40px; /* INCREASED: Più spazio per il testo descrittivo */
    background: transparent;
    border-radius: 20px;
    border: none;
    position: relative;
    z-index: 1;
}

.dynamic-hero-content .page-title {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px; /* INCREASED: Più spazio prima della descrizione */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1.2;
}

/* NEW: Hero description styling */
.hero-description {
    margin-bottom: 25px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero-description p {
    font-size: 18px;
    color: white !important; /* FIXED: Testo bianco come richiesto */
    line-height: 1.6;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    font-weight: 400;
}

.dynamic-hero-content .page-subtitle {
    font-size: 18px;
    color: white;
    margin: 0;
}

.dynamic-hero-content #tourCount {
    font-weight: 700;
    color: white;
}

/* ========================================
   9. ACTIVE FILTERS DISPLAY
   ======================================== */
.active-filters-display {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(224, 224, 224, 0.5);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    position: relative;
    z-index: 1;
}

.active-filters-display h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

#active-filters-list {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* ========================================
   10. TOURS GRID - UPDATED GAP
   ======================================== */
.landing-ricerca .tour-archive-content {
    flex: 1;
    min-width: 0;
    position: relative;
    padding-bottom: 100px;
    z-index: 1;
    width: 100%;
    isolation: isolate;
}

#tour-results {
    position: relative;
    z-index: 1;
    overflow: visible;
}

.tour-card {
    position: relative;
    z-index: 1;
    max-width: 100%;
    overflow: hidden;
}

/* ========================================
   11. LOADING AND ERROR STATES
   ======================================== */
.tour-loading {
    text-align: center;
    padding: 60px 40px;
    background: white;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    position: relative;
    z-index: 1;
}

.tour-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid #f1f5f9;
    border-top: 4px solid #f79448;
    border-radius: 50%;
    animation: tour-spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes tour-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-tours-found {
    text-align: center;
    padding: 80px 40px;
    background: white;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    position: relative;
    z-index: 1;
}

/* ========================================
   12. LAYOUT SPACING
   ======================================== */
.landing-ricerca .container {
    max-width: 1400px;
    padding: 0 30px;
    min-height: calc(100vh - 200px);
    width: 100%;
    position: relative;
}

/* ========================================
   13. MOBILE STYLES - ALL FILTERS VISIBLE
   ======================================== */
@media (max-width: 1024px) {
    .landing-ricerca .archive-content-wrapper {
        flex-direction: column;
    }
    
    .landing-ricerca .tour-filters-sidebar {
        width: 100%;
        position: static;
        margin-bottom: 30px;
        z-index: auto;
    }
    
    .landing-ricerca .tour-archive-content {
        z-index: auto;
    }
}

@media (max-width: 768px) {
    /* MOBILE SPECIFIC - COLLAPSIBLE FILTERS */

    .mobile-filter-toggle {
        display: flex !important; /* Show toggle button on mobile */
    }

    .mobile-filter-content {
        display: none; /* Hidden by default */
        overflow: hidden;
        transition: all 0.3s ease;
    }

    .mobile-filter-content.active {
        display: block !important;
    }
    
    .landing-ricerca .tour-filters-sidebar {
        padding: 20px;
        border-radius: 15px;
        margin-bottom: 20px;
        z-index: auto;
    }
    
    .people-counter {
        display: flex !important;
    }
    
    .guests-grid {
        display: none !important;
    }
    
    .filter-section {
        margin-bottom: 20px;
        padding-bottom: 20px;
    }
    
    .filter-title {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .destination-tabs {
        gap: 10px;
    }
    
    .destination-tab {
        padding: 16px;
        font-size: 15px;
        font-weight: 700;
    }
    
    .duration-tabs {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .duration-tab {
        padding: 16px 12px;
        font-size: 14px;
    }
    
    .tour-type-toggle {
        gap: 10px;
    }
    
    .tour-type-option {
        padding: 16px;
        font-size: 15px;
        font-weight: 700;
    }
    
    .tour-type-option .type-icon,
    .tour-type-option .type-desc {
        display: none !important;
    }
    
    .tour-type-option .type-label {
        font-size: 16px;
        font-weight: 700;
    }
    
    .search-availability-btn,
    .reset-filters-btn {
        padding: 18px;
        font-size: 17px;
        font-weight: 800;
        margin-bottom: 8px;
    }
    
    .search-availability-btn {
        box-shadow: 0 4px 15px rgba(247,148,72,0.3);
    }
    
    .dynamic-hero-content {
        margin-bottom: 20px; /* Adjusted for mobile */
    }
    
    .dynamic-hero-content .page-title {
        font-size: 28px;
        background: linear-gradient(135deg, #ffffff, #f8f9fa);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        line-height: 1.2;
        margin-bottom: 15px;
    }
    
    .hero-description p {
        font-size: 16px; /* Slightly smaller on mobile */
    }
    
    .dynamic-hero-content .page-subtitle {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .landing-ricerca .container {
        padding: 0 15px;
    }
    
    .filter-section {
        margin-bottom: 15px;
        padding-bottom: 15px;
    }
    
    .destination-tab {
        padding: 14px 10px;
        font-size: 14px;
    }
    
    .tour-type-option {
        padding: 14px;
    }
    
    .search-availability-btn,
    .reset-filters-btn {
        padding: 16px;
        font-size: 16px;
    }
    
    .people-counter {
        gap: 10px;
    }
    
    .counter-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .counter-display {
        min-width: 50px;
        font-size: 20px;
        padding: 10px 12px;
    }
    
    .hero-description p {
        font-size: 15px;
    }
}

/* ========================================
   14. ACCESSIBILITY ENHANCEMENTS
   ======================================== */
.guest-option:focus,
.duration-tab:focus,
.tour-type-option:focus,
.destination-tab:focus,
.counter-btn:focus {
    outline: 2px solid #3068b3;
    outline-offset: 2px;
}

.search-availability-btn:focus,
.reset-filters-btn:focus {
    outline: 2px solid #f79448;
    outline-offset: 2px;
}

/* ========================================
   15. ANIMATIONS
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   16. FILTER VALIDATION STATES
   ======================================== */
.filter-section.has-selection .filter-title::after {
    content: ' ✓';
    color: #10b981;
    margin-left: 5px;
}

.guest-option.selected,
.duration-tab.active,
.tour-type-option.active {
    animation: selectPulse 0.3s ease;
}

@keyframes selectPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ========================================
   17. Z-INDEX HIERARCHY (FIXED)
   ======================================== */
.site-header { z-index: 100; } /* Header always on top */
.tour-filters-sidebar { z-index: 50; } /* FIXED: Sidebar below header */
.tour-archive-content { z-index: 10; }
.tour-card { z-index: 1; }

.tour-card * {
    max-width: 100%;
    position: relative;
}

/* ========================================
   LOCATION SECTIONS - UPDATED WITH WHITE TITLES & ORANGE BUTTONS
   ======================================== */

.tours-grid.location-sections-active {
    display: block !important;
    grid-template-columns: none !important;
}

.location-section {
    display: block !important;
    width: 100% !important;
    margin-bottom: 80px !important;
    clear: both !important;
}

.location-section:last-child {
    margin-bottom: 40px !important;
}

/* UPDATED: Titoli in bianco come richiesto */
.location-title {
    font-size: 42px !important;
    font-weight: 800 !important;
    text-align: center !important;
    margin-bottom: 50px !important;
    line-height: 1.2 !important;
    width: 100% !important;
    display: block !important;
    clear: both !important;
    color: white !important; /* FIXED: Titoli in bianco */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

/* Rimuovo i colori specifici e lascio solo bianco */
.como-title,
.sardegna-title {
    color: white !important;
    background: none !important;
    -webkit-background-clip: none !important;
    -webkit-text-fill-color: white !important;
    background-clip: none !important;
}

.location-tours-fullwidth {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) !important;
    gap: 20px !important; /* FIXED: Ridotto gap a 20px come richiesto */
    justify-items: stretch !important;
    width: 100% !important;
    margin-bottom: 40px !important;
    clear: both !important;
}

.location-section .tour-card {
    width: 100% !important;
    max-width: none !important; /* REMOVED: Rimosso max-width per espansione completa */
    justify-self: stretch !important;
}

.view-all-container {
    text-align: center !important;
    margin-top: 40px !important;
    width: 100% !important;
    clear: both !important;
}

.view-all-location-btn {
    padding: 16px 32px !important;
    border: none !important;
    border-radius: 25px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
}

/* FIXED: Entrambi i pulsanti arancioni come richiesto */
.como-section .view-all-location-btn,
.sardegna-section .view-all-location-btn {
    background: linear-gradient(135deg, #f79448, #e8843f) !important; /* ARANCIONE */
    color: white !important;
}

.como-section .view-all-location-btn:hover,
.sardegna-section .view-all-location-btn:hover {
    background: linear-gradient(135deg, #e8843f, #d7743a) !important; /* ARANCIONE SCURO */
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(247, 148, 72, 0.4) !important;
}

.tours-grid:not(.location-sections-active) {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) !important;
    gap: 20px !important; /* FIXED: Gap ridotto anche per layout normale */
    justify-items: stretch !important;
    width: 100% !important;
}

.active-filters-display,
#active-filters {
    display: none !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .location-section {
        margin-bottom: 50px !important;
    }
    
    .location-title {
        font-size: 32px !important;
        margin-bottom: 30px !important;
    }
    
    .location-tours-fullwidth {
        grid-template-columns: 1fr !important;
        gap: 20px !important; /* FIXED: Anche su mobile gap 20px */
        margin-bottom: 30px !important;
    }
    
    .view-all-container {
        margin-top: 25px !important;
    }
    
    .view-all-location-btn {
        padding: 14px 28px !important;
        font-size: 14px !important;
        width: 100% !important;
        max-width: 300px !important;
    }
    
    .tours-grid:not(.location-sections-active) {
        grid-template-columns: 1fr !important;
        gap: 30px !important; /* INCREASED: Gap mobile 30px */
    }
}

@media (max-width: 480px) {
    .location-title {
        font-size: 28px !important;
        margin-bottom: 25px !important;
    }
    
    .location-tours-fullwidth {
        gap: 20px !important; /* FIXED: Gap mobile small 20px */
    }
}

/* ============================================================================
   NO FILTERS LAYOUT - FULL WIDTH
   ============================================================================ */

.archive-content-wrapper.no-filters {
    display: block;
}

.archive-content-wrapper.no-filters .tour-archive-content.full-width {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Hide filter sidebar when filters are removed */
.archive-content-wrapper.no-filters .tour-filters-sidebar {
    display: none !important;
}

/* Center content in full width mode */
.archive-content-wrapper.no-filters .dynamic-hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px;
    padding: 20px;
}

/* Tours grid takes full width */
.archive-content-wrapper.no-filters .tours-grid {
    width: 100%;
    max-width: 100%;
}

@media (max-width: 768px) {
    .archive-content-wrapper.no-filters .dynamic-hero-content {
        padding: 15px;
        margin-bottom: 30px;
    }
}
