/* ==========================================================================
   Egantica Product Filters v2.0 
   Brand colors: Teal #0a3e4b / Orange #f89f3a / White
   ========================================================================== */

:root {
    --egf-teal: #0a3e4b;
    --egf-teal-light: #0d4f5f;
    --egf-teal-dark: #072d36;
    --egf-orange: #f89f3a;
    --egf-orange-hover: #e8901f;
    --egf-orange-light: #fff4e5;
    --egf-gray-50: #f8f9fa;
    --egf-gray-100: #f1f3f5;
    --egf-gray-200: #e9ecef;
    --egf-gray-300: #dee2e6;
    --egf-gray-400: #ced4da;
    --egf-gray-500: #adb5bd;
    --egf-gray-600: #868e96;
    --egf-gray-700: #495057;
    --egf-gray-800: #343a40;
    --egf-gray-900: #212529;
    --egf-radius: 8px;
    --egf-shadow: 0 4px 24px rgba(10, 62, 75, 0.12);
    --egf-shadow-lg: 0 12px 40px rgba(10, 62, 75, 0.18);
}

/* === LAYOUT OVERRIDES === */
.egf-vehicle-page #primary {
    width: 100%;
    float: none;
}

.egf-vehicle-page #secondary,
.egf-vehicle-page .widget-area {
    display: none !important;
}

.egf-vehicle-page .shoptimizer-sorting {
    display: none !important;
}

/* Hide the default category banner/header — we could build our own later */
.egf-vehicle-page .woocommerce-products-header {
    display: none !important;
}

/* Hide category description that appears in the loop */
.egf-vehicle-page .term-description,
.egf-vehicle-page .woocommerce-products-header__title,
.egf-vehicle-page header.woocommerce-products-header,
.egf-vehicle-page .taxonomy-description,
.egf-vehicle-page .shoptimizer-category-banner {
    display: none !important;
}

/* Hide the page title "Scooters" — our filter section has the count */
.egf-vehicle-page .woocommerce-products-header__title.page-title {
    display: none !important;
}

/* Hide duplicate ordering dropdowns */
.egf-vehicle-page .woocommerce-ordering {
    display: none !important;
}

/* Hide default result count */
.egf-vehicle-page .woocommerce-result-count {
    display: none !important;
}

/* Hide default pagination — todo: add AJAX pagination later */
.egf-vehicle-page .woocommerce-pagination {
    display: none !important;
}

.egf-vehicle-page .site-content .col-full {
    max-width: 1170px;
    margin: 0 auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    box-sizing: border-box;
}

/* === FILTER SECTION === */
.egf-filter-section {
    margin: 0 0 1.5rem;
    width: 100%;
    max-width: 100%;
}

/* Filter Bar */
.egf-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 1rem 0;
    border-bottom: 2px solid var(--egf-gray-200);
    max-width: 100%;
}

/* Filter Button */
.egf-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #fff;
    border: 1.5px solid var(--egf-gray-300);
    border-radius: var(--egf-radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--egf-gray-800);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    white-space: nowrap;
    line-height: 1;
}

.egf-btn:hover {
    border-color: var(--egf-teal);
    color: var(--egf-teal);
    background: var(--egf-gray-50);
}

.egf-btn[aria-expanded="true"] {
    border-color: var(--egf-teal);
    background: var(--egf-teal);
    color: #fff;
}

/* Chevron */
.egf-chev {
    transition: transform 0.2s;
    opacity: 0.5;
}

.egf-btn[aria-expanded="true"] .egf-chev {
    transform: rotate(180deg);
    opacity: 1;
}

/* Badge */
.egf-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--egf-orange);
    color: #fff;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.egf-btn[aria-expanded="true"] .egf-badge {
    background: #fff;
    color: var(--egf-teal);
}

/* === DROPDOWN === */
.egf-filter-group {
    position: relative;
}

.egf-drop {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 240px;
    background: #fff;
    border: 1px solid var(--egf-gray-200);
    border-radius: var(--egf-radius);
    box-shadow: var(--egf-shadow-lg);
    z-index: 200;
    animation: egfFadeIn 0.12s ease;
    overflow: hidden;
}

.egf-filter-group.is-open .egf-drop {
    display: block;
}

.egf-drop-scroll .egf-drop-body {
    max-height: 280px;
    overflow-y: auto;
}

@keyframes egfFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dropdown header */
.egf-drop-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--egf-gray-100);
    font-size: 12px;
    font-weight: 600;
    color: var(--egf-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.egf-drop-clear {
    background: none;
    border: none;
    font-size: 12px;
    color: var(--egf-orange);
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    padding: 0;
}

.egf-drop-clear:hover {
    color: var(--egf-orange-hover);
    text-decoration: underline;
}

/* Dropdown body */
.egf-drop-body {
    padding: 6px;
}

/* Option */
.egf-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s;
    font-size: 14px;
    color: var(--egf-gray-800);
    user-select: none;
}

.egf-opt:hover {
    background: var(--egf-gray-50);
}

.egf-opt input { display: none; }

.egf-opt small {
    margin-left: auto;
    color: var(--egf-gray-500);
    font-size: 12px;
}

/* Custom checkbox */
.egf-ck {
    width: 18px;
    height: 18px;
    border: 2px solid var(--egf-gray-400);
    border-radius: 4px;
    flex-shrink: 0;
    transition: all 0.12s;
    position: relative;
}

.egf-opt input:checked + .egf-ck {
    background: var(--egf-teal);
    border-color: var(--egf-teal);
}

.egf-opt input:checked + .egf-ck::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* === PRICE FILTER === */
.egf-drop-price {
    min-width: 300px;
}

.egf-drop-price .egf-drop-body {
    padding: 14px;
}

.egf-price-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.egf-price-row em {
    color: var(--egf-gray-500);
    font-style: normal;
    font-size: 13px;
}

.egf-price-field {
    flex: 1;
    display: flex;
    align-items: center;
    border: 1.5px solid var(--egf-gray-300);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.15s;
}

.egf-price-field:focus-within {
    border-color: var(--egf-teal);
}

.egf-price-field span {
    padding: 8px 0 8px 10px;
    color: var(--egf-gray-500);
    font-size: 14px;
    font-weight: 500;
}

.egf-price-field input {
    width: 100%;
    border: none;
    padding: 8px 10px 8px 4px;
    font-size: 14px;
    font-family: inherit;
    color: var(--egf-gray-800);
    background: transparent;
    outline: none;
    -moz-appearance: textfield;
}

.egf-price-field input::-webkit-outer-spin-button,
.egf-price-field input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

/* Range slider */
.egf-slider {
    position: relative;
    height: 28px;
    display: flex;
    align-items: center;
}

.egf-slider input[type="range"] {
    position: absolute;
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: none;
    pointer-events: none;
    z-index: 2;
    margin: 0;
    padding: 0;
}

.egf-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--egf-teal);
    border: 3px solid #fff;
    box-shadow: 0 1px 6px rgba(0,0,0,0.2);
    pointer-events: all;
    cursor: grab;
}

.egf-slider input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--egf-teal);
    border: 3px solid #fff;
    box-shadow: 0 1px 6px rgba(0,0,0,0.2);
    pointer-events: all;
    cursor: grab;
}

.egf-track {
    position: absolute;
    width: 100%;
    height: 4px;
    background: var(--egf-gray-200);
    border-radius: 2px;
    z-index: 1;
}

.egf-track::after {
    content: '';
    position: absolute;
    height: 100%;
    background: var(--egf-teal);
    border-radius: 2px;
    left: var(--track-left, 0%);
    right: var(--track-right, 0%);
}

/* === ACTIVE FILTERS === */
.egf-active {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    flex-wrap: wrap;
}

.egf-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.egf-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--egf-orange-light);
    border: 1px solid var(--egf-orange);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--egf-teal-dark);
    cursor: pointer;
    transition: all 0.12s;
}

.egf-tag:hover {
    background: var(--egf-orange);
    color: #fff;
}

.egf-tag svg {
    opacity: 0.6;
}

.egf-tag:hover svg {
    opacity: 1;
}

.egf-wis {
    margin-left: auto;
    background: none;
    border: 1px solid var(--egf-gray-300);
    border-radius: 100px;
    padding: 5px 14px;
    font-size: 13px;
    color: var(--egf-gray-600);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.12s;
    white-space: nowrap;
}

.egf-wis:hover {
    border-color: #dc3545;
    color: #dc3545;
}

/* === RESULTS BAR === */
.egf-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin-bottom: 8px;
}

.egf-count {
    font-size: 14px;
    color: var(--egf-gray-600);
    font-weight: 500;
    white-space: nowrap;
}

.egf-sort {
    padding: 6px 28px 6px 10px;
    border: 1.5px solid var(--egf-gray-300);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: var(--egf-gray-700);
    background: #fff url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23868e96' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") right 8px center no-repeat;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    width: auto;
    min-width: 0;
    max-width: 200px;
}

.egf-sort:focus {
    outline: none;
    border-color: var(--egf-teal);
}

/* === PRODUCT GRID OVERRIDES === */
.egf-vehicle-page ul.products {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
}

.egf-vehicle-page ul.products li.product {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
    border: 1px solid var(--egf-gray-200);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.25s ease;
    background: #fff;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
}

.egf-vehicle-page ul.products li.product:hover {
    border-color: var(--egf-teal);
    box-shadow: 0 8px 30px rgba(10, 62, 75, 0.12);
    transform: translateY(-3px);
}

/* Image area */
.egf-vehicle-page ul.products li.product .woocommerce-image__wrapper,
.egf-vehicle-page ul.products li.product .shoptimizer-plp-carousel-container {
    background: var(--egf-gray-50);
}

.egf-vehicle-page ul.products li.product .woocommerce-image__wrapper img,
.egf-vehicle-page ul.products li.product .shoptimizer-plp-image-wrapper img {
    border-radius: 0 !important;
    width: 100% !important;
    aspect-ratio: 4/3;
    object-fit: contain;
    padding: 1rem;
    mix-blend-mode: multiply;
}

/* Card content area */
.egf-vehicle-page ul.products li.product .woocommerce-card__header {
    padding: 1rem 1.25rem 1.25rem !important;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Category labels */
.egf-vehicle-page ul.products li.product .product__categories {
    font-size: 11px !important;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--egf-gray-500) !important;
    margin-bottom: 4px !important;
    padding: 0 !important;
}

.egf-vehicle-page ul.products li.product .product__categories a {
    color: var(--egf-gray-500) !important;
    text-decoration: none !important;
}

/* Product title */
.egf-vehicle-page ul.products li.product .woocommerce-loop-product__title {
    padding: 0 !important;
    margin: 0 0 8px 0 !important;
}

.egf-vehicle-page ul.products li.product .woocommerce-loop-product__title a {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: var(--egf-gray-900) !important;
    text-decoration: none !important;
    line-height: 1.3;
}

.egf-vehicle-page ul.products li.product:hover .woocommerce-loop-product__title a {
    color: var(--egf-teal) !important;
}

/* Price — add "Vanaf" prefix */
.egf-vehicle-page ul.products li.product .price {
    padding: 0 !important;
    margin: 0 0 12px 0 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: var(--egf-teal) !important;
}

.egf-vehicle-page ul.products li.product.product-type-variable .price::before {
    content: 'Vanaf ';
    font-size: 13px;
    font-weight: 500;
    color: var(--egf-gray-500);
}

/* Force button always visible and properly positioned */
.egf-vehicle-page ul.products li.product .woocommerce-card__header > a.button,
.egf-vehicle-page ul.products li.product .woocommerce-card__header > a.add_to_cart_button,
.egf-vehicle-page ul.products li.product .woocommerce-card__header > a.product_type_simple,
.egf-vehicle-page ul.products li.product .woocommerce-card__header > a.product_type_variable,
.egf-vehicle-page ul.products li.product .woocommerce-card__header > a.product_type_external,
.egf-vehicle-page ul.products li.product .woocommerce-card__header > a.ajax_add_to_cart {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    transform: none !important;
    margin-top: auto !important;
    padding: 10px 16px !important;
    text-align: center !important;
    background: var(--egf-teal) !important;
    color: #fff !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px;
    transition: background 0.15s !important;
    border: none !important;
    text-decoration: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
    line-height: 1.4 !important;
    height: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
}

.egf-vehicle-page ul.products li.product .woocommerce-card__header > a.button:hover,
.egf-vehicle-page ul.products li.product .woocommerce-card__header > a.add_to_cart_button:hover,
.egf-vehicle-page ul.products li.product .woocommerce-card__header > a.product_type_variable:hover,
.egf-vehicle-page ul.products li.product .woocommerce-card__header > a.ajax_add_to_cart:hover {
    background: var(--egf-orange) !important;
    color: #fff !important;
}

/* Override any Shoptimizer hover effects that move/show the button */
.egf-vehicle-page ul.products li.product:hover .woocommerce-card__header > a.button,
.egf-vehicle-page ul.products li.product:hover .woocommerce-card__header > a.add_to_cart_button,
.egf-vehicle-page ul.products li.product:hover .woocommerce-card__header > a.ajax_add_to_cart {
    display: block !important;
    position: static !important;
    transform: none !important;
}

/* Make the whole card clickable feel */
.egf-vehicle-page ul.products li.product .woocommerce-LoopProduct-link {
    text-decoration: none !important;
}

/* === EMPTY STATE === */
.egf-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--egf-gray-600);
}

.egf-empty h3 {
    margin: 1rem 0 0.5rem;
    color: var(--egf-gray-800);
}

.egf-empty-clear {
    margin-top: 1rem;
    padding: 10px 24px;
    background: var(--egf-teal);
    color: #fff;
    border: none;
    border-radius: var(--egf-radius);
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.egf-empty-clear:hover {
    background: var(--egf-teal-light);
}

/* === LOADING === */
body.egf-loading .egf-products-wrap ul.products,
body.egf-loading ul.products {
    opacity: 0.35;
    pointer-events: none;
    transition: opacity 0.15s;
}

body.egf-loading .egf-filter-section::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid var(--egf-gray-200);
    border-top-color: var(--egf-teal);
    border-radius: 50%;
    animation: egfSpin 0.5s linear infinite;
    z-index: 9999;
}

@keyframes egfSpin { to { transform: rotate(360deg); } }

/* === MOBILE === */
@media (max-width: 991px) {
    .egf-vehicle-page ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
}

@media (max-width: 768px) {
    .egf-filter-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        gap: 6px;
        padding: 12px 0;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .egf-filter-bar::-webkit-scrollbar { display: none; }

    .egf-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .egf-drop {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
        max-height: 70vh;
        animation: egfSlideUp 0.2s ease;
        min-width: auto;
    }

    .egf-filter-group.is-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(10, 62, 75, 0.4);
        z-index: 199;
    }

    @keyframes egfSlideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .egf-vehicle-page ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .egf-bar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .egf-sort {
        max-width: 180px;
    }
}

@media (max-width: 480px) {
    .egf-vehicle-page ul.products {
        grid-template-columns: 1fr !important;
    }
}
