/* Tour Filter System - MASONRY GRID LAYOUT */

:root {
    --primary-color: #639f1d;
    --primary-dark: #4d7a16;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #e0e0e0;
}

.ete-tour-filter-wrapper * {
    box-sizing: border-box;
}

.ete-tour-filter-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 0;
    position: relative;
    padding: 0;
}

/* ==================== SIDEBAR ==================== */
.filter-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: white;
    border-right: 1px solid var(--border-color);
    height: fit-content;
    max-height: calc(100vh - 120px);
    position: sticky;
    top: 100px;
    overflow-y: auto;
    padding: 0;
}

.filter-sidebar::-webkit-scrollbar {
    width: 6px;
}

.filter-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.filter-sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.filter-container {
    background: white;
    padding: 0;
    margin: 0;
}

.filter-header {
    padding: 25px 20px;
    border-bottom: 3px solid var(--primary-color);
    background: #f9f9f9;
}

.filter-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-dark);
}

.filter-subtitle {
    font-size: 13px;
    color: var(--text-light);
    margin: 0;
}

.tour-filter-form {
    padding: 0;
}

.filter-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Slider Groups */
.filter-slider-group {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.filter-slider-group h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text-dark);
}

.slider-subtitle {
    font-size: 12px;
    color: var(--text-light);
    margin: 0 0 20px 0;
}

.slider-container {
    padding: 20px 5px 10px 5px;
}

.slider-range {
    height: 6px !important;
    background: #e0e0e0 !important;
    border: none !important;
    border-radius: 3px !important;
}

.ui-slider-range {
    background: var(--primary-color) !important;
    border-radius: 3px !important;
}

.ui-slider-handle {
    width: 20px !important;
    height: 20px !important;
    background: white !important;
    border: 3px solid var(--primary-color) !important;
    border-radius: 50% !important;
    cursor: grab !important;
    outline: none !important;
    top: -7px !important;
    margin-left: -10px !important;
}

.ui-slider-handle:active {
    cursor: grabbing !important;
}

.ui-slider-handle:hover {
    background: var(--primary-color) !important;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    font-size: 12px;
    color: var(--text-light);
}

.slider-values {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Mobile Nav - Hidden on Desktop */
.mobile-filter-nav {
    display: none;
}

.filter-nav-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-dark);
    background: white;
    transition: all 0.2s ease;
}

.filter-nav-item:hover {
    background: #f9f9f9;
}

.filter-nav-item.active {
    background: #f0f9e8;
    color: var(--primary-color);
}

.filter-nav-arrow {
    font-size: 24px;
    color: var(--text-light);
    transition: transform 0.2s ease;
}

.filter-nav-item.active .filter-nav-arrow {
    transform: rotate(90deg);
    color: var(--primary-color);
}

/* Filter Groups */
.filter-group {
    border-bottom: 1px solid var(--border-color);
}

.filter-group h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    padding: 16px 20px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group h4 svg {
    color: var(--primary-color);
    width: 18px;
    height: 18px;
}

.filter-options {
    padding: 10px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-options.scrollable {
    max-height: 250px;
    overflow-y: auto;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    padding: 6px 0;
    cursor: pointer;
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.filter-checkbox span {
    font-size: 14px;
    color: #555;
}

.filter-empty-note {
    font-size: 13px;
    color: var(--text-light);
    font-style: italic;
    padding: 10px 0;
    margin: 0;
}

.filter-actions {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: #f9f9f9;
}

.btn-reset {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-reset:hover {
    background: var(--primary-dark);
}

.btn-reset svg {
    width: 16px;
    height: 16px;
}

.tour-count {
    display: block;
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
    margin-top: 12px;
}

.tour-count strong {
    color: var(--primary-color);
}

/* ==================== CONTENT AREA ==================== */
.tours-content-area {
    flex: 1;
    padding: 30px;
    background: #fafafa;
}

/* ==================== MASONRY GRID LAYOUT ==================== */
.tours-grid,
.tours-simple-grid {
    position: relative;
    width: 100%;
    clear: both;
}

/* FORCE GRID LAYOUT - Override everything */
.tours-grid,
#tours-results {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    width: 100%;
    clear: both;
}

/* Tour cards must be block elements within grid */
.tours-grid .tour-card,
#tours-results .tour-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    float: none !important;
    position: static !important;
    clear: none !important;
}

/* Simple Grid Display */
.tours-simple-grid {
    display: grid !important;
    gap: 20px !important;
    clear: both;
}

.tours-simple-grid.tours-masonry-1 {
    grid-template-columns: 1fr !important;
    max-width: 100%;
}

.tours-simple-grid.tours-masonry-2 {
    grid-template-columns: repeat(2, 1fr) !important;
}

.tours-simple-grid.tours-masonry-3 {
    grid-template-columns: repeat(3, 1fr) !important;
}

.tours-simple-grid.tours-masonry-4 {
    grid-template-columns: repeat(4, 1fr) !important;
}

.tours-simple-grid .tour-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    float: none !important;
}

/* ==================== UNIFORM TOUR CARDS ==================== */
.tour-card {
    background: white;
    border: 1px solid #e0e0e0;
    display: flex !important;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow: hidden;
    width: 100% !important;
    box-sizing: border-box;
}

.tour-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.tour-image {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: #f5f5f5;
}

.tour-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.tour-card:hover .tour-image img {
    transform: scale(1.05);
}

.tour-content {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ==================== UNIFIED PRICE DISPLAY: from $X to $Y ==================== */
.tour-price-display {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
    line-height: 1.3;
}

.price-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    font-weight: 600;
    display: inline-block;
    margin-right: 4px;
}

.price-from {
    font-size: 19px;
    font-weight: 700;
    color: var(--primary-color);
    display: inline-block;
}

.price-separator {
    font-size: 12px;
    font-weight: 500;
    color: #888;
    margin: 0 4px;
    display: inline-block;
}

.price-to {
    font-size: 19px;
    font-weight: 700;
    color: var(--primary-color);
    display: inline-block;
}

.price-unit {
    font-size: 11px;
    color: #666;
    font-weight: 500;
    margin-left: 3px;
    display: inline-block;
}

/* TITLE */
.tour-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.3;
    min-height: auto;
}

.tour-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s ease;
}

.tour-title a:hover {
    color: var(--primary-color);
}

/* INFO LINE */
.tour-info-line {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tour-duration {
    font-weight: 600;
    color: var(--text-dark);
}

.tour-type {
    color: #888;
}

/* DESTINATIONS */
.tour-destinations-list {
    font-size: 12px;
    color: #666;
    padding: 8px 0;
    border-top: 1px solid #f0f0f0;
    margin-bottom: 10px;
    line-height: 1.4;
}

.tour-destinations-list strong {
    color: var(--text-dark);
    font-weight: 600;
}

/* VIEW DETAILS BUTTON */
.tour-view-button {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: white;
    border: 2px solid #2c3e50;
    border-radius: 4px;
    color: #2c3e50;
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    margin-top: auto;
}

.tour-view-button:hover {
    background: #66a321;
    border-color: #66a321;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 163, 33, 0.3);
}

/* Loading */
.loading-spinner {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-tours-found {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border: 2px dashed #ddd;
    grid-column: 1 / -1;
}

.no-tours-found h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

/* Mobile Filter Toggle - Sticky Button */
.mobile-filter-toggle {
    display: none;
}

.filter-overlay {
    display: none;
}

/* ==================== SIMPLE TOUR DISPLAY WRAPPER ==================== */
.tours-simple-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Compact layout for single column (sidebar widgets) */
.tours-simple-grid.tours-masonry-1 .tour-card {
    margin-bottom: 15px;
}

.tours-simple-grid.tours-masonry-1 .tour-image {
    height: 160px;
}

.tours-simple-grid.tours-masonry-1 .tour-content {
    padding: 12px;
}

.tours-simple-grid.tours-masonry-1 .tour-title {
    font-size: 15px;
    line-height: 1.3;
    margin-bottom: 8px;
}

.tours-simple-grid.tours-masonry-1 .tour-price-display {
    margin-bottom: 8px;
    padding-bottom: 6px;
}

.tours-simple-grid.tours-masonry-1 .price-from,
.tours-simple-grid.tours-masonry-1 .price-to {
    font-size: 17px;
}

.tours-simple-grid.tours-masonry-1 .tour-destinations-list {
    font-size: 11px;
    padding: 6px 0;
    margin-bottom: 8px;
}

.tours-simple-grid.tours-masonry-1 .tour-view-button {
    padding: 8px 12px;
    font-size: 12px;
}

/* Widget-specific styling for sidebars */
.tours-widget-layout {
    max-width: 100%;
    padding: 0;
}

.widget .tours-simple-wrapper,
.sidebar .tours-simple-wrapper,
aside .tours-simple-wrapper {
    max-width: 100%;
    padding: 0;
}

.widget .tours-simple-grid,
.sidebar .tours-simple-grid,
aside .tours-simple-grid {
    gap: 15px !important;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .tours-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .tours-simple-grid.tours-masonry-3,
    .tours-simple-grid.tours-masonry-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .ete-tour-filter-wrapper {
        flex-direction: column;
    }
    
    /* Sticky Mobile Filter Button */
    .mobile-filter-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 999;
        background: var(--primary-color);
        color: white;
        border: none;
        padding: 15px 30px;
        border-radius: 50px;
        font-size: 16px;
        font-weight: 600;
        box-shadow: 0 4px 15px rgba(99, 159, 29, 0.4);
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .mobile-filter-toggle:hover {
        background: var(--primary-dark);
        box-shadow: 0 6px 20px rgba(99, 159, 29, 0.5);
    }
    
    .mobile-filter-toggle svg {
        width: 20px;
        height: 20px;
    }
    
    /* Show Mobile Navigation */
    .mobile-filter-nav {
        display: block;
        background: white;
        border-bottom: 2px solid var(--border-color);
    }
    
    /* Hide filter groups by default on mobile */
    .filter-slider-group,
    .filter-group {
        display: none !important;
    }
    
    /* Show when active */
    .filter-slider-group.mobile-active,
    .filter-group.mobile-active {
        display: block !important;
    }
    
    /* Slide-in Sidebar */
    .filter-sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        max-height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    
    .filter-sidebar.active {
        left: 0;
    }
    
    /* Overlay */
    .filter-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    
    .filter-overlay.active {
        display: block;
        opacity: 1;
        pointer-events: all;
    }
    
    /* Content Area */
    .tours-content-area {
        padding: 20px 15px 80px 15px;
    }
    
    /* Single column on mobile for ALL grids */
    .tours-grid {
        grid-template-columns: 1fr !important;
    }
    
    .tours-grid.tours-masonry .tour-card,
    .tours-masonry-2 .tour-card,
    .tours-masonry-3 .tour-card,
    .tours-masonry-4 .tour-card {
        width: 100% !important;
        margin-bottom: 20px;
        display: block;
    }
    
    .tours-simple-grid,
    .tours-simple-grid.tours-masonry-2,
    .tours-simple-grid.tours-masonry-3,
    .tours-simple-grid.tours-masonry-4 {
        grid-template-columns: 1fr !important;
    }
    
    /* Adjust card elements for mobile */
    .tour-image {
        height: 200px;
    }
    
    .price-from,
    .price-to {
        font-size: 20px;
    }
    
    .tour-title {
        font-size: 17px;
        min-height: auto;
    }
    
    .tours-simple-wrapper {
        padding: 20px 15px;
    }
}