@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

.material-icons {
    font-family: 'Material Icons' !important;
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    /* Preferred icon size */
    display: inline-block;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'liga';
}

/* CSS for Ecom Search Overlay (Glassmorphism & Animation) */

/* Mobile & Desktop Trigger: Icon Only (Requested) */
.ecom-search-input-mockup {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

.ecom-search-input-mockup .search-placeholder {
    display: none !important;
}

.ecom-search-input-mockup .search-icon {
    font-size: 24px;
    color: #333;
}

/* Mobile Trigger Fix: Hide Text on Mobile (Redundant but kept for safety/legacy overrides if needed, though above covers it) */
@media (max-width: 768px) {
    /* .search-placeholder rule removed as it is now global */
}

/* Overlay Container */
.ecom-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    z-index: 99999;
    display: none;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
}

.ecom-search-header {
    margin-top: 50px !important;
}

.ecom-search-overlay.is-visible {
    opacity: 1;
}

/* Close Button */
.ecom-search-close {
    position: absolute;
    top: 1%;
    right: 6%;
    font-size: 30px;
    cursor: pointer;
    color: #333;
    z-index: 100000;
    transition: transform 0.2s;
}

.ecom-search-close:hover {
    transform: rotate(90deg);
}

/* Main Search Container */
.ecom-search-container {
    width: 100%;
    max-width: 1400px;
    margin-top: 50px;
    padding: 0 20px;
    position: relative;
    box-sizing: border-box;
}

/* Search Input Wrapper - Box Style */
.ecom-input-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 10px auto;
    background-color: #f3f3f3;
    /* Light grey background */
    border-radius: 8px;
    /* Rounded corners */
    display: flex;
    align-items: center;
    padding: 0 15px;
    /* Padding for the container */
    height: 60px;
    /* Fixed height for consistency */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

#ecom-search-input-main {
    flex-grow: 1;
    /* Take available space */
    width: auto;
    font-size: 18px;
    /* Slightly smaller for box fit */
    padding: 0 15px;
    /* spacing text from icons */
    border: none;
    border-bottom: none;
    /* Remove line style */
    background: transparent;
    outline: none;
    font-family: inherit;
    font-weight: 400;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none;
    height: 100%;
}

#ecom-search-input-main:focus {
    border-bottom-color: transparent;
    /* Override */
}

/* Clear Icon */
.search-clear-icon {
    position: relative;
    /* Relative within flex */
    right: auto;
    top: auto;
    transform: none;
    cursor: pointer;
    color: #999;
    padding: 5px;
    margin-left: 10px;
    display: none;
    /* JS toggles this */
}

/* Share Icon */
.ecom-search-share-icon {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    transform: none;
    cursor: pointer;
    color: #777;
    transition: color 0.2s;
    z-index: 10;
    padding: 5px;
    font-size: 22px;
    margin-right: 5px;
}

/* New: Search Icon Large */
.search-icon-large {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    color: #555;
    font-size: 24px;
    margin-right: 5px;
}

.ecom-search-share-icon:hover {
    color: #000;
}

/* Initial Content (History, Trends) */
#ecom-search-initial-content {
    margin-top: 40px;
    width: 100%;
    max-width: 800px;
    margin: 40px auto;
}

/* History & Trending Sections */
.ecom-search-section h4,
.ecom-search-section h3 {
    font-size: 14px;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 1px;
    margin-bottom: 15px;
    font-weight: 600;
}

.ecom-search-list-inline,
.ecom-tag-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.ecom-search-list-inline li,
.ecom-tag-list li {
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    font-weight: 500;
    transition: all 0.25s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.ecom-search-list-inline li:hover,
.ecom-tag-list li:hover {
    background: #000;
    color: #fff;
    border-color: #000;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15);
}

/* Loading Spinner */
#ecom-search-loading {
    display: none;
    margin: 40px auto;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #000;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Results Container (Flex: Sidebar + Grid) */
#ecom-search-results {
    display: none;
    width: 100%;
    margin-top: 30px;
    gap: 30px;
    align-items: flex-start;
}

/* Sidebar (Filters) */
.ecom-filters-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: #fff;
    padding: 0;
    /* Reset padding for accordion look */
    border-radius: 8px;
    /* Removed sticky to avoid complex overflow issues with accordion, 
       can re-add if container height is managed */
}

/* Filter Group / Accordion Item */
.ecom-filter-group {
    border-bottom: 1px solid #eee;
    margin-bottom: 0;
    /* Flush */
}

/* Accordion Header */
.ecom-accordion-header {
    width: 100%;
    padding: 15px;
    background: transparent;
    border: none;
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
    outline: none;
}

.ecom-accordion-header:hover {
    background: #f9f9f9;
}

.ecom-accordion-header::after {
    content: '+';
    font-size: 18px;
    font-weight: 400;
}

.ecom-accordion-header.active::after {
    content: '-';
}

/* Accordion Content */
.ecom-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0 15px;
    background: #fff;
}

.ecom-accordion-content.open {
    max-height: 500px;
    /* Max height for transition */
    padding-bottom: 20px;
    overflow-y: auto;
    transition: max-height 0.5s ease-in;
}

/* Filter Checkboxes */
.ecom-cat-item,
.ecom-attr-item,
.ecom-feat-item {
    margin-bottom: 8px;
}

.ecom-cat-item label,
.ecom-attr-item label,
.ecom-feat-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

.ecom-cat-item label:hover {
    color: #000;
}

.ecom-cat-filter,
.ecom-attr-filter,
.ecom-feat-filter {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    accent-color: #000;
}

/* Results Grid */
#ecom-results-container {
    flex-grow: 1;
    display: grid;
    gap: 20px;
}

/* Active Filter Badges */
.ecom-active-filters-row {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.ecom-active-filter-badge {
    background: #f0f0f0;
    border: 1px solid #ddd;
    color: #333;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ecom-active-filter-badge .material-icons {
    font-size: 16px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.ecom-active-filter-badge .material-icons:hover {
    color: #f44336;
}

.ecom-clear-all-filters {
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
    color: #999;
}

.ecom-clear-all-filters:hover {
    color: #333;
}


/* Categories Row */
.ecom-search-categories-row {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.ecom-cat-chip {
    background: #fff;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    color: #333;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    white-space: nowrap;
    transition: all 0.2s;
}

.ecom-cat-chip:hover {
    background: #000;
    color: #fff;
    border-color: #000;
}

.ecom-cat-chip i {
    font-size: 16px;
}

/* Product Item */
.ecom-result-item {
    background: #fff;
    border-radius: 8px;
    padding: 10px;
    /* Reduced from 15px */
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.ecom-result-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.ecom-result-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    margin-bottom: 8px;
    border-radius: 4px;
}

.ecom-result-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
    line-height: 1.3;
    flex-grow: 1;
}

.ecom-result-reference {
    font-size: 12px;
    color: #777;
    margin-bottom: 4px;
    font-weight: 500;
}

.ecom-result-price {
    font-size: 15px;
    font-weight: 700;
    color: #000;
}

/* Highlight */
.ecom-highlight {
    background-color: #fff3cd;
    color: #856404;
    padding: 0 2px;
    border-radius: 2px;
}

/* --- CSS Range Slider (Modern, clean) --- */
.ecom-slider-container {
    position: relative;
    width: 100%;
    height: 40px;
    margin-top: 15px;
}

.ecom-slider-track {
    position: absolute;
    top: 5px;
    left: 0;
    right: 0;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
}

.ecom-slider-range {
    position: absolute;
    top: 5px;
    height: 4px;
    background: #000;
    border-radius: 2px;
}

.ecom-range-input {
    position: absolute;
    top: -5px;
    left: 0;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    /* Lint fix */
    background: transparent;
    pointer-events: none;
    z-index: 2;
    margin: 0;
}

.ecom-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #000;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    margin-top: -7px;
}

.ecom-range-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #000;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.ecom-price-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.ecom-price-apply-btn {
    width: 100%;
    margin-top: 15px;
    padding: 8px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.3s;
}

.ecom-price-apply-btn:hover {
    background: #333;
}

/* Default Desktop: Hide Mobile Toggle */
.ecom-mobile-filter-bar {
    display: none;
}

/* --- Mobile Adaptations --- */
@media (max-width: 768px) {
    #ecom-search-results {
        flex-direction: column;
    }

    /* Mobile Filter Toggle (Main) */
    .ecom-mobile-filter-bar {
        width: 100%;
        margin-bottom: 20px;
        display: block !important;
        /* Force Visible */
    }

    .ecom-mobile-filter-btn {
        width: 100%;
        padding: 12px;
        background: #f5f5f5;
        border: 1px solid #ddd;
        text-align: left;
        font-weight: 600;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-radius: 4px;
    }

    .ecom-filters-sidebar {
        width: 100%;
        position: relative;
        top: 0;
        margin-bottom: 20px;
        border: none;
        padding: 0;
        display: block !important;
        /* Ensure parent is visible */
    }

    /* Hide Inner Content on Mobile Default */
    .ecom-filters-inner {
        display: none;
        animation: none;
    }

    .ecom-filters-inner.is-mobile-open {
        display: block;
        animation: slideDown 0.3s;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .ecom-search-container {
        padding: 0 15px;
        margin-top: 70px;
        /* Increased to avoid overlap with Close button */
    }

    /* Mobile Close Button Adjustment */
    .ecom-search-close {
        top: 1% !important;

        right: 15px;
        font-size: 30px;
        /* Smaller on mobile */
    }

    #ecom-search-input-main {
        font-size: 16px;
        padding: 10px 10px 10px 0;
    }

    /* Ensure input wrapper doesn't overlap if close button is low */
    /* Ensure input wrapper doesn't overlap if close button is low */
    .ecom-input-wrapper {
        margin-right: 0;
        height: 50px;
        /* Slightly smaller height on mobile */
    }
}

/* --- Initial Content Grid (Layout with Banner) --- */
.ecom-initial-grid {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* .ecom-initial-grid.has-banner .ecom-banner-area {
    display: block; 
} */



.ecom-initial-main {
    flex-grow: 1;
    width: 100%;
    /* Fallback */
}

/* Mobile: Stack Banner */
@media (max-width: 768px) {
    .ecom-initial-grid {
        flex-direction: column;
    }


}