/* GM Product Filters - Clean Minimal Design */
:root {
    --gm-primary: #1a4d3e;
    --gm-primary-light: #2d6b5a;
    --gm-text: #1f2937;
    --gm-text-light: #6b7280;
    --gm-text-muted: #9ca3af;
    --gm-border: #e5e7eb;
    --gm-border-light: #f3f4f6;
    --gm-bg: #ffffff;
    --gm-bg-hover: #f9fafb;
    --gm-bg-active: #f3f4f6;
    --gm-radius: 12px;
    --gm-radius-sm: 8px;
    --gm-radius-xs: 6px;
}

/* Base wrapper */
.gm-filters-wrapper {
    background: var(--gm-bg);
    border-radius: var(--gm-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    overflow: hidden;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.gm-filters-wrapper *,
.gm-filters-wrapper *::before,
.gm-filters-wrapper *::after {
    box-sizing: border-box;
}

/* SVG base styles */
.gm-filters-wrapper svg {
    display: block;
    flex-shrink: 0;
}

/* Header */
.gm-filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--gm-primary) 0%, var(--gm-primary-light) 100%);
}

.gm-filters-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.gm-filters-title svg {
    width: 16px;
    height: 16px;
    opacity: 0.9;
}

.gm-filters-clear {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
}

.gm-filters-clear:hover {
    background: rgba(255,255,255,0.2);
}

.gm-filters-clear svg {
    width: 12px;
    height: 12px;
}

/* Active tags */
.gm-filters-active-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gm-filters-active-tags:not(:empty) {
    padding: 10px 16px;
    border-bottom: 1px solid var(--gm-border);
    background: var(--gm-border-light);
}

.gm-active-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px 4px 10px;
    background: var(--gm-primary);
    color: #fff;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 500;
}

.gm-active-tag button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    padding: 0;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    color: inherit;
    cursor: pointer;
    transition: background 0.15s ease;
}

.gm-active-tag button:hover {
    background: rgba(255,255,255,0.35);
}

.gm-active-tag button svg {
    width: 8px;
    height: 8px;
}

/* Filter body */
.gm-filters-body {
    padding: 0;
}

/* Filter sections */
.gm-filter-section {
    border-bottom: 1px solid var(--gm-border);
}

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

/* Filter header - no icons */
.gm-filter-header {
    display: flex;
    align-items: center;
    padding: 13px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
}

.gm-filter-header:hover {
    background: var(--gm-bg-hover);
}

/* Filter label */
.gm-filter-label {
    flex: 1;
    font-weight: 500;
    font-size: 14px;
    color: var(--gm-text);
}

/* Filter count badge */
.gm-filter-count {
    margin-right: 10px;
    padding: 2px 7px;
    background: var(--gm-primary);
    color: #fff;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

/* Chevron */
.gm-filter-chevron {
    width: 18px;
    height: 18px;
    color: var(--gm-text-muted);
    transition: transform 0.2s ease;
}

.gm-filter-section.is-open .gm-filter-chevron {
    transform: rotate(180deg);
}

/* Filter content */
.gm-filter-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.gm-filter-section.is-open .gm-filter-content {
    max-height: 350px;
}

/* Search box */
.gm-filter-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 16px 10px;
    padding: 8px 10px;
    background: var(--gm-border-light);
    border: 1px solid var(--gm-border);
    border-radius: var(--gm-radius-xs);
}

.gm-filter-search svg {
    width: 14px;
    height: 14px;
    color: var(--gm-text-muted);
}

.gm-search-input {
    flex: 1;
    border: none;
    background: none;
    font-size: 12px;
    color: var(--gm-text);
    outline: none;
}

.gm-search-input::placeholder {
    color: var(--gm-text-muted);
}

/* Filter options container */
.gm-filter-options {
    padding: 0 16px 14px;
}

/* Chip style (for small lists) */
.gm-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gm-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: var(--gm-border-light);
    border: 1px solid var(--gm-border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.gm-chip:hover {
    background: var(--gm-bg-active);
    border-color: #d1d5db;
}

.gm-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.gm-chip:has(input:checked) {
    background: rgba(26, 77, 62, 0.06);
    border-color: var(--gm-primary);
}

.gm-chip:has(input:checked) .gm-chip-text {
    color: var(--gm-primary);
    font-weight: 500;
}

.gm-chip-text {
    font-size: 13px;
    color: var(--gm-text);
}

.gm-chip-count {
    margin-left: 6px;
    font-size: 11px;
    color: var(--gm-text-muted);
}

/* List style (for long lists) */
.gm-filter-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 240px;
    overflow-y: auto;
}

.gm-filter-list::-webkit-scrollbar {
    width: 4px;
}

.gm-filter-list::-webkit-scrollbar-track {
    background: transparent;
}

.gm-filter-list::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

/* Checkbox style */
.gm-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--gm-radius-xs);
    cursor: pointer;
    transition: background 0.15s ease;
    position: relative;
}

.gm-checkbox:hover {
    background: var(--gm-bg-hover);
}

.gm-checkbox input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.gm-checkbox-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #fff;
    border: 1.5px solid var(--gm-border);
    border-radius: 4px;
    transition: all 0.15s ease;
}

.gm-checkbox-box svg {
    width: 11px;
    height: 11px;
    color: #fff;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.15s ease;
}

.gm-checkbox:hover .gm-checkbox-box {
    border-color: #d1d5db;
}

.gm-checkbox input:checked ~ .gm-checkbox-box {
    background: var(--gm-primary);
    border-color: var(--gm-primary);
}

.gm-checkbox input:checked ~ .gm-checkbox-box svg {
    opacity: 1;
    transform: scale(1);
}

.gm-checkbox-text {
    font-size: 13px;
    color: var(--gm-text);
}

.gm-checkbox:has(input:checked) .gm-checkbox-text {
    font-weight: 500;
    color: var(--gm-primary);
}

/* Price filter - joined inputs */
.gm-price-joined {
    display: flex;
    border-top: 1px solid #e5e5e5;
    overflow: hidden;
    background: #fff;
}

.gm-price-joined:focus-within {
    border-color: var(--gm-primary);
}

.gm-price-input {
    flex: 1;
    width: 50%;
    height: 44px;
    padding: 0;
    border: none;
    font-size: 14px;
    color: var(--gm-text);
    outline: none;
    background: transparent;
    -moz-appearance: textfield;
    text-align: center;
}

.gm-price-input::-webkit-outer-spin-button,
.gm-price-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.gm-price-input::placeholder {
    color: #c0c0c0;
}

.gm-price-min {
    border-right: 1px solid #e5e5e5;
}

/* Loading state */
.gm-filters-loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.9);
    z-index: 10;
}

.gm-filters-wrapper.is-loading .gm-filters-loading {
    display: flex;
}

.gm-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--gm-border);
    border-top-color: var(--gm-primary);
    border-radius: 50%;
    animation: gmSpin 0.6s linear infinite;
}

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

/* No products */
.gm-no-products {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 20px;
    text-align: center;
}

.gm-no-products svg {
    width: 40px;
    height: 40px;
    color: var(--gm-text-muted);
    margin-bottom: 12px;
    opacity: 0.5;
}

.gm-no-products p {
    font-size: 15px;
    font-weight: 600;
    color: var(--gm-text);
    margin: 0 0 4px;
}

.gm-no-products span {
    font-size: 13px;
    color: var(--gm-text-light);
}

/* Pagination */
.gm-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
    padding: 16px 0;
}

.gm-pagination a,
.gm-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    background: #fff;
    border: 1px solid var(--gm-border);
    border-radius: var(--gm-radius-xs);
    font-size: 13px;
    font-weight: 500;
    color: var(--gm-text);
    text-decoration: none;
    transition: all 0.15s ease;
}

.gm-pagination a:hover {
    border-color: var(--gm-primary);
    color: var(--gm-primary);
}

.gm-pagination .current {
    background: var(--gm-primary);
    border-color: var(--gm-primary);
    color: #fff;
}

/* Hidden state */
.gm-checkbox.is-hidden,
.gm-chip.is-hidden {
    display: none;
}

/* Products loading */
.gm-products-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Mobile */
@media (max-width: 768px) {
    .gm-filters-header {
        padding: 12px 14px;
    }

    .gm-filter-header {
        padding: 12px 14px;
    }

    .gm-filter-options {
        padding: 0 14px 12px;
    }
}
