/* ============================================
   GG Shop Filters — Sidebar + Mobile Modal
   Styled to match funpromotion.gr
   ============================================ */

/* --- Desktop: sidebar visible, mobile filter row hidden --- */
@media (min-width: 768px) {
    .gg-mobile-filter-row {
        display: none !important;
    }

    .gg-shop-sidebar {
        position: sticky;
        top: 20px;
        align-self: flex-start;
    }

    /* --- Section headings (CATEGORIES, COLOR, PRICE) --- */
    .gg-shop-sidebar .elementor-heading-title {
        font-size: 14px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--gg-dark, #1E1E1C);
        padding-bottom: 0;
        border-bottom: none;
        margin-bottom: 12px;
    }

    /* Thin separator line after each filter section */
    .gg-shop-sidebar .elementor-widget-wp-widget-woocommerce_product_categories,
    .gg-shop-sidebar .elementor-widget-wp-widget-woocommerce_price_filter,
    .gg-shop-sidebar .elementor-widget-shortcode {
        padding-bottom: 15px;
        margin-bottom: 5px;
        border-bottom: 1px solid #e8e8e8;
    }

    /* Sidebar widget spacing */
    .gg-shop-sidebar .elementor-widget {
        margin-bottom: 5px;
    }

    /* Hide WC widget title (we use our own headings) */
    .gg-shop-sidebar .widget_product_categories > h5,
    .gg-shop-sidebar .widget_product_categories .widgettitle,
    .gg-shop-sidebar .widget_price_filter > h5,
    .gg-shop-sidebar .widget_price_filter .widgettitle {
        display: none;
    }

    /* --- Category list --- */
    .gg-shop-sidebar .product-categories {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .gg-shop-sidebar .product-categories > li {
        padding: 0;
        margin-bottom: 6px;
    }

    .gg-shop-sidebar .product-categories > li > a {
        color: #555;
        text-decoration: none;
        font-size: 14px;
        font-weight: 400;
        transition: color 0.2s ease;
        display: block;
        padding: 2px 0;
    }

    .gg-shop-sidebar .product-categories > li > a:hover {
        color: var(--gg-primary, #00A1E1);
    }

    /* Subcategories */
    .gg-shop-sidebar .product-categories .children {
        list-style: none;
        padding: 0;
        margin: 2px 0 0 0;
    }

    .gg-shop-sidebar .product-categories .children li {
        padding: 0;
        margin-bottom: 4px;
    }

    .gg-shop-sidebar .product-categories .children a {
        color: #888;
        text-decoration: none;
        font-size: 13px;
        padding: 2px 0 2px 12px;
        display: block;
        transition: color 0.2s ease;
        position: relative;
    }

    .gg-shop-sidebar .product-categories .children a::before {
        content: '›';
        position: absolute;
        left: 0;
        color: #bbb;
    }

    .gg-shop-sidebar .product-categories .children a:hover {
        color: var(--gg-primary, #00A1E1);
    }

    .gg-shop-sidebar .product-categories .count {
        display: none; /* hide counts like funpromotion */
    }

    /* --- Price filter --- */
    .gg-shop-sidebar .widget_price_filter .price_slider_wrapper {
        padding: 5px 0;
    }

    .gg-shop-sidebar .widget_price_filter .price_slider {
        margin-bottom: 15px;
    }

    .gg-shop-sidebar .widget_price_filter .price_label {
        font-size: 13px;
        color: #888;
    }

    .gg-shop-sidebar .widget_price_filter .button {
        background: var(--gg-dark, #1E1E1C);
        color: #fff;
        border: none;
        padding: 6px 18px;
        border-radius: 2px;
        font-size: 12px;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        cursor: pointer;
        transition: background 0.2s ease;
    }

    .gg-shop-sidebar .widget_price_filter .button:hover {
        background: var(--gg-primary, #00A1E1);
    }

    /* Hide mobile filter panel on desktop */
    #gg-filter-overlay,
    #gg-filter-panel {
        display: none !important;
    }
}

/* --- Injected sidebar section (COLOR) --- */
.gg-sidebar-color-section {
    padding-bottom: 15px;
    margin-bottom: 5px;
    border-bottom: 1px solid #e8e8e8;
}

.gg-sidebar-section-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gg-dark, #1E1E1C);
    margin: 0 0 12px 0;
    padding: 0;
}

/* --- Print technique filter --- */
.gg-sidebar-print-section {
    padding-bottom: 15px;
    margin-bottom: 5px;
    border-bottom: 1px solid #e8e8e8;
}

.gg-print-filter {
    margin: 0;
    padding: 0;
}

.gg-print-filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    transition: color 0.2s ease;
    color: #555;
    font-size: 14px;
}

.gg-print-filter-item:hover {
    color: var(--gg-primary, #00A1E1);
}

.gg-print-filter-item.active {
    color: var(--gg-primary, #00A1E1);
    font-weight: 600;
}

.gg-print-filter-label {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.gg-print-filter-name {
    font-size: 14px;
}

.gg-print-filter-sub {
    font-size: 11px;
    color: #aaa;
    font-weight: 400;
}

.gg-print-filter-count {
    background: #f0f0f0;
    color: #888;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.gg-print-filter-item.active .gg-print-filter-count {
    background: var(--gg-primary, #00A1E1);
    color: #fff;
}

/* Print technique icons */
.gg-print-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f0f0f5;
    flex-shrink: 0;
    gap: 2px;
    flex-wrap: wrap;
    padding: 4px;
}

.gg-pdot {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Single dot — center it */
.gg-print-icon .gg-pdot:only-child {
    width: 14px;
    height: 14px;
}

/* Full color icon — rainbow gradient */
.gg-print-icon-full {
    background: conic-gradient(#00bcd4, #e91e63, #ffc107, #4caf50, #2196f3, #00bcd4);
    border-radius: 50% !important;
    width: 28px;
    height: 28px;
    padding: 0;
}

/* Embroidery icon */
.gg-print-icon-emb {
    background: #333;
    border-radius: 8px;
    position: relative;
}

.gg-print-icon-emb::after {
    content: none;
}

.gg-print-icon-emb .gg-print-emb-svg {
    display: block;
}

/* --- Color filter squares --- */
.gg-color-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
}

.gg-color-filter-swatch {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.gg-color-filter-swatch:hover {
    border-color: #999;
    transform: scale(1.15);
}

.gg-color-filter-swatch.active {
    border-color: var(--gg-primary, #00A1E1);
    box-shadow: 0 0 0 2px var(--gg-primary, #00A1E1);
}

/* White swatch needs visible border */
.gg-color-filter-swatch[data-color="white"],
.gg-color-filter-swatch[data-color="ivory"] {
    border-color: #ccc;
}

/* --- Mobile: sidebar hidden, filter button + slide-out panel --- */
@media (max-width: 767px) {
    .gg-shop-sidebar {
        display: none !important;
    }

    .gg-mobile-filter-row {
        display: block;
    }
}

/* --- Loading state for AJAX --- */
.post-inner-loop[style*="opacity"] {
    transition: opacity 0.2s ease;
}

/* --- Mobile Filter Overlay --- */
#gg-filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#gg-filter-overlay.active {
    display: block;
    opacity: 1;
}

/* --- Mobile Filter Panel (slides from left) --- */
#gg-filter-panel {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 380px;
    height: 100%;
    background: #ffffff;
    z-index: 99999;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15);
}

#gg-filter-panel.active {
    left: 0;
}

/* --- Panel Header --- */
.gg-filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
}

.gg-filter-panel-title {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gg-dark, #1E1E1C);
}

.gg-filter-panel-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.gg-filter-panel-close:hover {
    color: var(--gg-dark, #1E1E1C);
}

/* --- Panel Body (scrollable) --- */
.gg-filter-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

.gg-filter-panel-body .elementor-widget {
    margin-bottom: 15px;
}

/* Panel headings */
.gg-filter-panel-body .elementor-heading-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gg-dark, #1E1E1C);
    margin-bottom: 12px;
}

/* Hide WC widget titles in panel */
.gg-filter-panel-body .widget_product_categories > h5,
.gg-filter-panel-body .widget_product_categories .widgettitle,
.gg-filter-panel-body .widget_price_filter > h5,
.gg-filter-panel-body .widget_price_filter .widgettitle {
    display: none;
}

/* Category list styling inside modal */
.gg-filter-panel-body .product-categories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gg-filter-panel-body .product-categories li {
    padding: 4px 0;
}

.gg-filter-panel-body .product-categories a {
    color: #555;
    text-decoration: none;
    font-size: 14px;
}

.gg-filter-panel-body .product-categories a:hover {
    color: var(--gg-primary, #00A1E1);
}

.gg-filter-panel-body .product-categories .children {
    list-style: none;
    padding-left: 12px;
    margin: 0;
}

.gg-filter-panel-body .product-categories .children a {
    color: #888;
    font-size: 13px;
}

.gg-filter-panel-body .product-categories .count {
    display: none;
}

/* Price filter in panel */
.gg-filter-panel-body .widget_price_filter .button {
    background: var(--gg-dark, #1E1E1C);
    color: #fff;
    border: none;
    padding: 6px 18px;
    border-radius: 2px;
    font-size: 12px;
    cursor: pointer;
}

/* --- Apply Button --- */
.gg-filter-apply-btn {
    display: block;
    width: calc(100% - 40px);
    margin: 0 20px 20px;
    padding: 14px;
    background: var(--gg-primary, #00A1E1);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.gg-filter-apply-btn:hover {
    background: #0081b8;
}

/* --- Material filter pills --- */
.gg-material-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
}

.gg-material-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: #f3f3f3;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    color: #555;
    transition: all 0.2s ease;
    user-select: none;
}

.gg-material-pill:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

.gg-material-pill.active {
    background: var(--gg-primary, #00A1E1);
    color: #fff;
    border-color: var(--gg-primary, #00A1E1);
}

.gg-material-pill.active:hover {
    background: #0090c8;
}

.gg-material-pill small {
    font-size: 10px;
    opacity: 0.7;
}

.gg-material-pill.active small {
    opacity: 0.9;
}

/* --- Prevent body scroll when modal is open --- */
body.gg-filters-open {
    overflow: hidden;
}
