/* =============================================================
   CE Filters Widget — Figma-style pill buttons
   Atelier Mirabel
   ============================================================= */

/* -----------------------------------------------------------
   1. FILTER SECTION TITLES — Teal pill badges
   ----------------------------------------------------------- */
.elementor-widget-listing-filters .ce-filters__tab {
    position: relative;
    background-color: var(--color-secondary) !important;
    color: #fff !important;
    border-radius: 25px !important;
    padding: 20px 25px !important;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.elementor-widget-listing-filters .ce-filters__tab::before {
    content: '';
    inset: 3px;
    border-radius: 25px;
    border: 2px dashed white;
    position: absolute;
    transition: inset 0.3s ease-in-out, border 0.3s ease;
    pointer-events: none;
}

.elementor-widget-listing-filters .ce-filters__tab:hover {
    background-color: var(--color-secondary) !important;
}

.elementor-widget-listing-filters .ce-filters__title {
    color: #fff !important;
}

.elementor-widget-listing-filters .ce-filters__tab-icon {
    color: #fff !important;
}

/* -----------------------------------------------------------
   2. FILTER OPTIONS — Pill button style
   ----------------------------------------------------------- */
.elementor-widget-listing-filters .elementor-field-option {
    display: flex !important;
    align-items: center;
    padding: 10px 16px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 25px !important;
    background: #fff !important;
    color: #1E1E1E !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 400;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-bottom: 0 !important;
}

.elementor-widget-listing-filters .elementor-field-option:hover {
    border-color: var(--color-secondary) !important;
    color: var(--color-secondary) !important;
}

/* Active / checked state — filled teal pill */
.elementor-widget-listing-filters .elementor-field-option:has(input:checked) {
    background-color: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    color: #fff !important;
}

.elementor-widget-listing-filters .elementor-field-option:has(input:checked) .elementor-field-label {
    color: #fff !important;
}

.elementor-widget-listing-filters .elementor-field-option:has(input:checked):hover {
    background-color: #28a0ba !important;
    border-color: #28a0ba !important;
}

/* Hide native checkbox/radio icons — replaced by pill button look */
.elementor-widget-listing-filters .elementor-field-option input[type="checkbox"],
.elementor-widget-listing-filters .elementor-field-option input[type="radio"] {
    display: none !important;
}

.elementor-widget-listing-filters .elementor-field-option .ce-checkbox,
.elementor-widget-listing-filters .elementor-field-option .ce-radio {
    display: none !important;
}

/* Label fill the full button */
.elementor-widget-listing-filters .elementor-field-option .elementor-field-label {
    color: #1E1E1E;
    transition: color 0.2s ease;
    flex: 1;
}

/* Hide magnitude count in pill mode */
.elementor-widget-listing-filters .elementor-field-option .elementor-field-label::after {
    display: none !important;
}

/* -----------------------------------------------------------
   3. HIDDEN OPTIONS — Must beat specificity of .elementor-field-option
      Specificity: 0-3-0 + !important > 0-2-0 + !important
   ----------------------------------------------------------- */
.elementor-widget-listing-filters .elementor-field-option.ce-filters-hidden-option {
    display: none !important;
}

.elementor-widget-listing-filters .elementor-field-option.ce-filters-search-hidden {
    display: none !important;
}

/* -----------------------------------------------------------
   4. FILTER CONTENT AREA — Vertical stack with gap
      Only style the open state; CE handles closed via aria-hidden.
   ----------------------------------------------------------- */
.elementor-widget-listing-filters .elementor-field-subgroup {
    flex-direction: column;
    gap: 6px;
    padding: 4px 0 8px;
}

/* Ensure accordion closed state is never overridden */
.elementor-widget-listing-filters .elementor-field-subgroup[aria-hidden="true"] {
    display: none !important;
}

/* -----------------------------------------------------------
   5. SIZES — 3-column grid layout
   ----------------------------------------------------------- */
.elementor-widget-listing-filters .elementor-field-group:has([data-type="attribute_group:2"]) .elementor-field-subgroup {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
}

/* But still respect closed state */
.elementor-widget-listing-filters .elementor-field-group:has([data-type="attribute_group:2"]) .elementor-field-subgroup[aria-hidden="true"] {
    display: none !important;
}

.elementor-widget-listing-filters .elementor-field-group:has([data-type="attribute_group:2"]) .elementor-field-option {
    justify-content: center;
    text-align: center;
    padding: 8px 6px !important;
    font-size: 13px;
    font-weight: 500;
}

.elementor-widget-listing-filters .elementor-field-group:has([data-type="attribute_group:2"]) .elementor-field-option .elementor-field-label {
    text-align: center;
    flex: unset;
}

/* Search & voir plus inside grid → span full width */
.elementor-widget-listing-filters .elementor-field-group:has([data-type="attribute_group:2"]) .ce-filters-search-wrapper,
.elementor-widget-listing-filters .elementor-field-group:has([data-type="attribute_group:2"]) .ce-filters-voir-plus-btn {
    grid-column: 1 / -1;
}

/* -----------------------------------------------------------
   6. COLORS — Single column, same pill buttons as other filters
      with a color swatch circle before the label
   ----------------------------------------------------------- */

/* For colors: show the swatch circle before the label */
.elementor-widget-listing-filters .elementor-field-type-color .elementor-field-option .ce-checkbox {
    display: inline-block !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    border-radius: 50% !important;
    border: 1px solid #ddd !important;
    margin-right: 8px !important;
    font-size: 0 !important;
    vertical-align: middle;
}

/* Color active state: show check mark on swatch */
.elementor-widget-listing-filters .elementor-field-type-color .elementor-field-option:has(input:checked) .ce-checkbox {
    font-size: 11px !important;
    color: #fff;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-color: #333 !important;
    box-shadow: 0 0 0 2px #2FB5D2;
}

/* Active color pill — teal subtle background */
.elementor-widget-listing-filters .elementor-field-type-color .elementor-field-option:has(input:checked) {
    background-color: rgba(47, 181, 210, 0.1) !important;
    border-color: #2FB5D2 !important;
    color: #1E1E1E !important;
}

.elementor-widget-listing-filters .elementor-field-type-color .elementor-field-option:has(input:checked) .elementor-field-label {
    color: #1E1E1E !important;
}

/* -----------------------------------------------------------
   7. VOIR PLUS / SEARCH — injected by JS
   ----------------------------------------------------------- */
.ce-filters-voir-plus-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--color-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 0 2px;
    transition: color 0.2s ease;
    margin-top: 2px;
}

.ce-filters-voir-plus-btn:hover {
    color: #1a8fa8;
}

.ce-filters-voir-plus-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    transition: transform 0.2s ease;
}

.ce-filters-voir-plus-btn.expanded svg {
    transform: rotate(180deg);
}

/* Search input inside CE filters */
.ce-filters-search-wrapper {
    position: relative;
    margin-bottom: 8px;
}

.ce-filters-search-input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    font-size: 12px;
    outline: none;
    background: #fafafa;
    transition: border-color 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
}

.ce-filters-search-input:focus {
    border-color: #2FB5D2;
    background: #fff;
}

.ce-filters-search-input::placeholder {
    color: #aaa;
}

.ce-filters-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: #999;
    pointer-events: none;
}

/* -----------------------------------------------------------
   8. FILTER GROUP SPACING
   ----------------------------------------------------------- */
.elementor-widget-listing-filters .elementor-field-group {
    margin-bottom: 4px;
}

/* -----------------------------------------------------------
   9. ACTIVE FILTERS BAR (top bar with X tags)
   ----------------------------------------------------------- */
.elementor-widget-listing-active-filters .elementor-field-option {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 6px 14px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 25px !important;
    background: #fff !important;
    font-size: 12px;
    text-decoration: none !important;
    color: #1E1E1E !important;
    transition: all 0.2s ease;
}

.elementor-widget-listing-active-filters .elementor-field-option:hover {
    border-color: #e74c3c !important;
    color: #e74c3c !important;
}

.elementor-widget-listing-active-filters .elementor-field-option .ceicon-close {
    font-size: 10px;
    color: #999;
    transition: color 0.2s ease;
}

.elementor-widget-listing-active-filters .elementor-field-option:hover .ceicon-close {
    color: #e74c3c;
}

/* -----------------------------------------------------------
   10. SCROLLBAR STYLING
   ----------------------------------------------------------- */
.elementor-widget-listing-filters .ce-scrollbar-y--auto::-webkit-scrollbar {
    width: 4px;
}

.elementor-widget-listing-filters .ce-scrollbar-y--auto::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 2px;
}

.elementor-widget-listing-filters .ce-scrollbar-y--auto::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.elementor-widget-listing-filters .ce-scrollbar-y--auto::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.elementor-widget-listing-active-filters a {
    background: var(--color-primary)!important;
    border-radius: 30px!important;
}

.elementor-widget-listing-active-filters a:hover {
    opacity: 0.8;
}

/* -----------------------------------------------------------
   PRIX À PARTIR DE — label dans les miniatures produit
----------------------------------------------------------- */
.prix-a-partir-de {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #888;
    text-transform: normal;
    letter-spacing: 0.05em;
    line-height: 1.2;
    margin-bottom: 2px;
}

.prix-a-partir-de strong {
    font-size: 15px;
    font-weight: 700;
    color: #232323;
    letter-spacing: 0;
    text-transform: none;
}

/* Quand placé dans un widget CE (product listing) */
.elementor-widget .prix-a-partir-de {
    margin-top: 4px;
}


/* GLOBAL */ 

.ce-filters-search-wrapper {
    width: 100%;
  }
  
  
  button.ce-filters-voir-plus-btn {
    width: 100%;
    margin-left: 10px;
    cursor: pointer;
  }
  
  /* Type Catégorie */
  .ce-filter-categorie .ce-filters-search-wrapper,
  .ce-filter-categorie a.elementor-field-option.js-search-link {
    width: 100%;
  }
  
  
  .ce-filter-categorie button.ce-filters-voir-plus-btn {
    margin-left: 10px;
  }
  
  /* GENRES */
  .ce-filter-feature-3 .elementor-field-option.js-search-link {
    width: 100%;
  }
  
  
  /* COULEURS */ 
  .ce-filter-couleur .elementor-field-subgroup {
    flex-direction: row!important;
    flex-wrap: wrap;
  } 
  
  .ce-filter-couleur a.elementor-field-option.js-search-link {
    width: calc(50% - 8px)
  }
  
  
  /* Matieres */ 
  .ce-filter-feature-2 a.elementor-field-option.js-search-link {
    width: 100%;
  }
  
  /* Marques */ 
  .ce-filter-marque a.elementor-field-option.js-search-link {
    width: 100%;
  }

  /* Engagements (Bio / Made in France) */
  .ce-filter-engagements a.elementor-field-option.js-search-link {
    width: 100%;
  }

  /* -----------------------------------------------------------
     PRIX — Range slider
  ----------------------------------------------------------- */
  .elementor-widget-listing-filters .ce-filter-prix .elementor-field-subgroup {
    flex-direction: column;
    gap: 12px;
    padding: 8px 4px 4px;
  }

  .elementor-widget-listing-filters .ce-filter-prix .ce-dual-range {
    --ce-range-height: 4px;
    --ce-range-active-color: var(--color-primary);
    --ce-range-thumb-color: #fff;
    --ce-range-thumb-size: 18px;
    --ce-range-thumb-border-width: 2px;
    --ce-range-thumb-border-color: var(--color-primary);
    --ce-range-thumb-border-radius: 50%;
    --ce-range-thumb-cursor: pointer;
    background-color: #e0e0e0;
    border-radius: 4px;
    margin: 10px 4px;
  }

  .elementor-widget-listing-filters .ce-filter-prix .ce-dual-range input::-webkit-slider-thumb {
    box-shadow: 0 2px 6px rgba(47, 181, 210, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .elementor-widget-listing-filters .ce-filter-prix .ce-dual-range input::-webkit-slider-thumb:hover,
  .elementor-widget-listing-filters .ce-filter-prix .ce-dual-range input::-webkit-slider-thumb:active {
    transform: scale(1.2);
    box-shadow: 0 3px 10px rgba(47, 181, 210, 0.5);
  }

  .elementor-widget-listing-filters .ce-filter-prix .ce-dual-range input::-moz-range-thumb {
    box-shadow: 0 2px 6px rgba(47, 181, 210, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  /* Label prix min - max */
  .elementor-widget-listing-filters .ce-filter-prix .elementor-field-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-secondary);
    padding: 0 2px;
    margin-top: 4px;
  }

  .elementor-widget-listing-filters .ce-filter-prix .elementor-field-label::after {
    display: none !important;
  }

