/* ============================================
   VARIABILI CSS
   ============================================ */
:root {
  --verde-scuro: #2c3e50;
  --verde-chiaro: #34495e;
  --verde: #27ae60;
  --bianco: #ffffff;
  --arancione: #e67e22;
  --accent-salmon: #eb635c;

  /* Colori categorie */
  --bevande: #3498db;
  --primi: #e74c3c;
  --secondi: #f39c12;
  --forno-e-snack: #9b59b6;
  --pasticceria: #e91e63;
  --mantenimento: #2ecc71;
  --one-a-day: #1abc9c;
  --barrette: #34495e;
  --integratori: #8e44ad;
  --cofanetti: #d35400;
  --extra: #95a5a6;
  --cofanetti-integratori: #c0392b;
  --novita: #e74c3c;
}

/* ============================================
   STILI BASE SISTEMA FILTRI
   ============================================ */
.product-filters,
[data-component='product-filters'] {
  background: #ffffff;
  padding-bottom: 50px;
}

.filters-title {
  margin: 0 0 20px 0;
  padding-bottom: 10px;
  color: var(--verde-scuro);
  font-size: 24px;
  font-weight: 500;
}

/* ============================================
   SEZIONI INDIVIDUALI DEI FILTRI
   ============================================ */
.filter-section,
[data-component='filter-section'] {
  margin-bottom: 25px;
  border: 1px solid #e1e8ed;
  border-radius: 6px;
  overflow: hidden;
}

.filter-header {
  border-radius: 4px 4px 0px 0px;
  background: var(--verde-scuro);
  display: flex;
  padding: 4px 16px;
  align-items: center;
  gap: 10px;
  align-self: stretch;
}

.filter-title {
  color: var(--bianco);
  height: 20px;
  flex: 1 0 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.28px;
  text-transform: uppercase;
  margin: 0;
}

.filter-toggle,
[data-action='toggle-filter'] {
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s;
  padding: 4px;
}

.filter-toggle:hover,
[data-action='toggle-filter']:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.filter-toggle svg,
[data-action='toggle-filter'] svg {
  color: var(--bianco);
  transition: transform 0.2s ease;
}

.filter-toggle[aria-expanded='true'] svg,
[data-action='toggle-filter'][aria-expanded='true'] svg {
  transform: rotate(180deg);
}

/* ============================================
   CONTENUTO DEI FILTRI
   ============================================ */
.filter-content {
  padding: 8px 16px;
  transition:
    max-height 0.3s ease,
    opacity 0.2s ease;
  overflow: hidden;
  background: white;
  border-bottom-right-radius: 4px;
  border-bottom-left-radius: 4px;
  border-left: 0.5px #d0d2d8 solid;
  border-right: 0.5px #d0d2d8 solid;
  border-bottom: 0.5px #d0d2d8 solid;
}

.filter-content.collapse {
  max-height: 0;
  padding: 0 16px;
  opacity: 0;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ============================================
   SINGOLI ELEMENTI FILTRO
   ============================================ */
.filter-item,
[data-component='filter-option'] {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.filter-item:last-child,
[data-component='filter-option']:last-child {
  border-bottom: none;
}

.filter-item:hover,
[data-component='filter-option']:hover {
  background-color: transparent;
}

/* Nasconde il checkbox reale */
.filter-item input[type='checkbox'],
[data-input='filter-checkbox'] {
  position: absolute;
  opacity: 0;
  visibility: hidden;
  height: 0;
  width: 0;
  overflow: hidden;
}

/* Checkbox personalizzato */
.filter-item::before,
[data-component='filter-option']::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 1px solid #d0d2d8;
  border-radius: 2px;
  background: white;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

[data-component='filter-option'].active {
  background-color: transparent;
}

/* Checkbox checked */
.filter-item.selected::before,
[data-component='filter-option'][data-selected='true']::before,
.filter-item:has(input:checked)::before,
[data-component='filter-option']:has(
    [data-input='filter-checkbox']:checked
  )::before {
  background: #68abad;
  border-color: #d0d2d8;
}

.filter-content-wrapper,
[data-element='filter-content'] {
  display: flex;
  align-items: center;
  flex: 1;
}

.filter-icon,
[data-element='filter-icon'] {
  width: 24px;
  height: 24px;
  margin-right: 10px;
  object-fit: contain;
}

.filter-label,
[data-element='filter-label'] {
  flex: 1;
  color: #063f46;
  font-size: 14px;
  font-weight: 400;
  line-height: 18px;
  letter-spacing: 0.28px;
}

.filter-count,
[data-element='filter-count'] {
  font-size: 0.85rem;
  color: #6c757d;
  margin-left: 8px;
}

label[data-term-slug='altro'] {
  display: none;
}

/* ============================================
   ALLERGENI
   ============================================ */
.allergen-filters .filter-help-text {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 15px;
  font-style: italic;
}

/* ============================================
   BADGE E ELEMENTI SPECIALI
   ============================================ */
.filter-badge {
  padding: 0 8px;
  background: #eb635c;
  border-radius: 4px;
  color: white;
  font-size: 14px;
  font-weight: 400;
  line-height: 18px;
  letter-spacing: 0.28px;
}

.filter-badge + .filter-label,
.filter-badge + [data-element='filter-label'] {
  display: none;
}

/* ============================================
   RANGE SLIDERS
   ============================================ */
[data-component='range-filter'],
.range-filter-container {
  padding: 20px 0;
}

[data-element='range-display'],
.range-display {
  text-align: center;
}

[data-element='range-values'],
.range-values {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 500;
  color: var(--verde-scuro);
}

[data-element='range-min-display'],
[data-element='range-max-display'],
.range-min-display,
.range-max-display {
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  min-width: 80px;
}

[data-element='range-separator'],
.range-separator {
  font-weight: 300;
  color: #6c757d;
}

/* Dual Range Container */
[data-element='dual-range-container'],
.dual-range-container {
  position: relative;
  height: 40px;
}

[data-element='dual-range-track'],
.dual-range-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  transform: translateY(-50%);
}

[data-element='dual-range-fill'],
.dual-range-fill {
  position: absolute;
  top: 50%;
  height: 6px;
  background: var(--verde-scuro);
  border-radius: 3px;
  transform: translateY(-50%);
  transition: all 0.2s ease;
}

/* Range Slider Input Styles */
[data-input='range-slider'],
.range-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
  outline: none;
}

[data-input='range-slider']::-webkit-slider-thumb,
.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--verde-scuro);
  border: 2px solid white;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: all;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

[data-input='range-slider']::-webkit-slider-thumb:hover,
.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

[data-input='range-slider']::-webkit-slider-thumb:active,
.range-slider::-webkit-slider-thumb:active {
  transform: scale(1.15);
}

/* Firefox */
[data-input='range-slider']::-moz-range-thumb,
.range-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--verde-scuro);
  border: 2px solid white;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: all;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

[data-input='range-slider']::-moz-range-thumb:hover,
.range-slider::-moz-range-thumb:hover {
  transform: scale(1.1);
}

[data-input='range-slider']::-moz-range-track,
.range-slider::-moz-range-track {
  background: transparent;
}

/* ============================================
   AZIONI FILTRI
   ============================================ */
.filter-actions,
[data-element='filter-actions'],
[data-element='range-actions'] {
  text-align: center;
}

.reset-filters-btn,
[data-action='reset-filters'],
[data-action='reset-range'],
.range-reset-btn {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.reset-filters-btn:hover,
[data-action='reset-filters']:hover,
[data-action='reset-range']:hover,
.range-reset-btn:hover {
  background: #c0392b;
  transform: translateY(-1px);
}

/* ============================================
   STATI INTERATTIVI
   ============================================ */
.filter-item.selected,
[data-component='filter-option'][data-selected='true'] {
  background-color: #d1ecf1;
}

.filter-item.selected .filter-label,
[data-component='filter-option'][data-selected='true']
  [data-element='filter-label'] {
  color: #2980b9;
  font-weight: 500;
}

.filter-item.preselected {
  background-color: #e8f4f8;
  border: 1px solid #b8e0ec;
}

.filter-item.preselected .filter-label {
  font-weight: 600;
}

/* ============================================
   MESSAGGI DI STATO
   ============================================ */
.no-filter-options {
  color: #6c757d;
  font-style: italic;
  text-align: center;
  padding: 20px;
  margin: 0;
}

.no-products-found,
[data-component='no-products'] {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
}

.no-products-found p,
[data-component='no-products'] p {
  font-size: 1.1rem;
  margin: 0;
}

/* ============================================
   LAYOUT DEL SISTEMA COMPLETO
   ============================================ */
.product-filters-system {
  width: 95%;
  max-width: 1440px;
  margin: 0 auto;
}

@media screen and (max-width: 1200px) {
  .product-filters-system {
    width: 90%;
  }
}

/* Layout Sidebar */
.filters-sidebar-layout {
  display: grid;
  grid-template-columns: 245px 1fr;
  gap: 90px;
  align-items: start;
  padding: 60px 0;
}

.filters-sidebar {
  position: sticky;
  top: 20px;
}

.products-main-area {
  min-height: 400px;
}

/* ============================================
   SEZIONE RISULTATI
   ============================================ */
.products-results-section,
[data-element='products-results'] {
  width: 100%;
}

.results-header,
.results-header-mobile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  /* border-bottom: 1px solid #e1e8ed; */
}

.results-header-mobile {
  border: none;
}

.results-header p,
.results-header-mobile p {
  color: var(--verde-scuro);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.4;
}

.results-header p strong,
.results-header-mobile p strong {
  font-weight: 500;
}

.results-header a,
.results-header-mobile a {
  margin-top: 8px;
  color: #82858c;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.4;
  text-decoration-line: underline;
  text-decoration-style: solid;
  text-decoration-skip-ink: none;
  text-decoration-thickness: auto;
  text-underline-offset: auto;
  text-underline-position: from-font;
}

/* ============================================
   GRIGLIA PRODOTTI
   ============================================ */
.products-container,
[data-element='products-container'] {
  position: relative;
  min-height: 200px;
}

.products-grid,
[data-element='products-grid'] {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 9px;
  margin: -10px;
  transition: opacity 0.3s ease;
}

/* ============================================
   PRODUCT CARDS
   ============================================ */
.product-card,
[data-component='product-card'] {
  width: calc(33% - 6px);
  padding: 10px;
}

@media screen and (max-width: 1300px) {
  .product-card,
  [data-component='product-card'] {
    width: calc(50% - 9px);
  }
}

@media screen and (max-width: 1020px) {
  .product-card,
  [data-component='product-card'] {
    width: calc(100% - 9px);
  }
}

@media screen and (max-width: 768px) {
  .product-card,
  [data-component='product-card'] {
    width: calc(50% - 9px);
  }
}

@media screen and (max-width: 660px) {
  .product-card,
  [data-component='product-card'] {
    width: calc(100% - 9px) !important;
  }
}

.product-card .card,
[data-component='product-card'] {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: normal;
  justify-content: space-between;
  gap: 16px;
  border-radius: 12px;
  border: 0.5px solid #d0d2d8;
  background: var(--bianco);
  /* height: 100%; */
  box-sizing: border-box;
}

.product-card img,
[data-component='product-card'] img {
  height: 24px;
  width: 24px;
  object-fit: cover;
}

.product-card .card-product-body,
[data-element='product-content'] {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  height: 100%;
  max-height: 220px;
  position: relative;
}

/* Badge categorie */
.product-card .card-categories .badge-category,
[data-element='product-categories'] .badge-category,
[data-element='product-categories'] a[data-category] {
  display: inline-flex;
  padding: 2px 8px;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border-radius: 4px;
  color: #fff;
  font-family: Graphik, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 18px;
  letter-spacing: 0.28px;
  text-transform: uppercase;
  text-decoration: none;
  margin-right: 5px;
  margin-bottom: 5px;
}

/* Colori specifici per categoria */
.product-card .card-categories .cat-bevande,
[data-category='bevande'] {
  background: var(--bevande);
}
.product-card .card-categories .cat-primi,
[data-category='primi'] {
  background: var(--primi);
}
.product-card .card-categories .cat-secondi,
[data-category='secondi'] {
  background: var(--secondi);
}
.product-card .card-categories .cat-forno-e-snack,
[data-category='forno-e-snack'] {
  background: var(--forno-e-snack);
}
.product-card .card-categories .cat-pasticceria,
[data-category='pasticceria'] {
  background: var(--pasticceria);
}
.product-card .card-categories .cat-mantenimento,
[data-category='mantenimento'] {
  background: var(--mantenimento);
}
.product-card .card-categories .cat-one-a-day,
[data-category='one-a-day'] {
  background: var(--one-a-day);
}
.product-card .card-categories .cat-barrette,
[data-category='barrette'] {
  background: var(--barrette);
}
.product-card .card-categories .cat-integratori,
[data-category='integratori'] {
  background: var(--integratori);
}
.product-card .card-categories .cat-cofanetti,
[data-category='cofanetti'] {
  background: var(--cofanetti);
}
.product-card .card-categories .cat-extra,
[data-category='extra'] {
  background: var(--extra);
}
.product-card .card-categories .cat-cofanetti-integratori,
[data-category='cofanetti-integratori'] {
  background: var(--cofanetti-integratori);
}
.product-card .card-categories .cat-novita,
[data-category='novita'] {
  background: var(--novita);
}
.product-card .card-categories .cat-proteinmax,
[data-category='proteinmax'] {
  background: var(--proteinmax);
}
.product-card .card-categories .cat-cofanetti-mixa-gusta,
[data-category='cofanetti-mixa-gusta'] {
  background: var(--mixa-gusta);
}

.product-card .card-product-image img,
[data-element='product-image'] img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.product-card .product-unavailable,
[data-element='product-image'] .product-unavailable {
  padding: 4px 16px;
  width: 80%;
  background: var(--grigio);
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
}

.product-card .product-unavailable img,
[data-element='product-image'] .product-unavailable img {
  width: 16px;
  height: 16px;
}

.product-card .product-unavailable span,
[data-element='product-image'] .product-unavailable span {
  flex: 1;
  text-align: center;
  color: #fff;
  font-size: 14px;
  font-weight: 400;
  line-height: 18px;
  letter-spacing: 0.28px;
}

.product-card .product-bg-container,
[data-element='product-image'] {
  width: 100%;
  /* height: 230px; */
  aspect-ratio: 1.3 / 1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.product-card .card-categories,
[data-element='product-categories'] {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
}

.product-card .card-title,
[data-element='product-title'] {
  color: var(--verde-scuro);
  font-size: 24px;
  font-weight: 400;
  margin: 0 0 8px 0;
}

.product-card .card-details,
[data-element='product-details'] {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.product-card .card-details .card-potions,
[data-detail='portions'] {
  color: var(--verde-scuro);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.28px;
}

.product-card .card-price,
[data-element='product-price'] {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: Graphik, sans-serif;
}

.product-card .card-price del,
[data-element='product-price'] del {
  color: var(--arancione);
  font-size: 16px;
  font-weight: 400;
  text-decoration: line-through;
  opacity: 1;
}

.product-card .card-price ins,
[data-element='product-price'] ins {
  color: var(--verde-scuro);
  font-size: 24px;
  font-weight: 500;
  text-decoration: none;
}

.product-card .card-price del,
.product-card .card-price ins,
[data-element='product-price'] del,
[data-element='product-price'] ins {
  display: inline-block;
}

.product-card .card-price .woocommerce-Price-amount,
[data-element='product-price'] .woocommerce-Price-amount {
  white-space: nowrap;
  color: var(--verde-scuro);
  text-align: right;
  font-family: Graphik;
  font-size: 24px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
}

.product-card .card-price .woocommerce-Price-currencySymbol,
[data-element='product-price'] .woocommerce-Price-currencySymbol {
  font-size: inherit;
}

.product-card .card-description .product-short-description,
[data-element='product-description'] {
  height: 40px;
}

.product-card .card-description .product-short-description,
[data-element='product-description'] p {
  color: var(--verde-scuro);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.4;
  margin: 0;
}

.product-card .card-ctas,
[data-element='product-actions'] {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-top: auto;
}

.product-card .card-ctas img,
[data-element='product-actions'] img {
  height: 42px;
  width: 42px;
  object-fit: cover;
}

.product-card .card-ctas .card-go-to-product,
[data-action='view-product'] {
  display: flex;
  height: 40px;
  padding: 16px 20px;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex: 1 0 0;
  border-radius: 50px;
  background: var(--verde);
  border: 1px solid var(--verde);
  color: var(--bianco);
  font-size: 16px;
  font-weight: 300;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.3s ease-in-out;
}

.product-card .card-ctas .card-go-to-product:hover,
[data-action='view-product']:hover {
  background: var(--bianco);
  color: var(--verde);
}

[data-action='add-to-cart'] {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

[data-action='add-to-cart']:hover {
  background: #f1f3f4;
}

.button-card-product-unavaiable {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.button-card-product-unavaiable:hover {
  background: #f1f3f4;
}

[data-action='add-to-cart'][data-state='loading'] {
  opacity: 0.7;
  cursor: not-allowed;
}

[data-action='add-to-cart'][data-state='success'] {
  background: var(--verde);
  border-radius: 50%;
}

[data-action='add-to-cart'][data-state='error'] {
  background: #e74c3c;
  border-radius: 50%;
}

/* ============================================
   BOTTONE CARICA ALTRI
   ============================================ */
.products-pagination,
[data-element='load-more-container'] {
  text-align: center;
  padding: 40px 0;
}

.load-more-button,
[data-action='load-more'] {
  background: var(--verde-scuro);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.load-more-button:hover:not(:disabled),
[data-action='load-more']:hover:not(:disabled) {
  background: var(--verde-chiaro);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.load-more-button:disabled,
[data-action='load-more']:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.load-more-button[data-state='loading'] .button-text,
[data-action='load-more'][data-state='loading'] [data-element='button-text'] {
  display: none;
}

.load-more-button[data-state='loading'] .loading-spinner,
[data-action='load-more'][data-state='loading']
  [data-element='loading-spinner'] {
  display: inline-block !important;
}

.load-more-button[data-state='hidden'],
[data-action='load-more'][data-state='hidden'] {
  display: none;
}

/* Spinner per il caricamento */
.loading-spinner,
[data-element='loading-spinner'] {
  display: none;
  vertical-align: middle;
}

.spinner {
  animation: rotate 1s linear infinite;
}

.spinner .path {
  stroke: white;
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }
  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

/* ============================================
   STATI DI CARICAMENTO
   ============================================ */
.loading-filters,
[data-state='loading'] {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.loading-filters::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 1000;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ============================================
   MESSAGGI DI ERRORE
   ============================================ */
.filter-error-message,
[data-component='error-message'] {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 20px;
  position: relative;
}

.error-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.dismiss-error,
[data-action='close-notification'] {
  background: none;
  border: none;
  color: #721c24;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0;
  margin-left: 10px;
}

.dismiss-error:hover,
[data-action='close-notification']:hover {
  opacity: 0.7;
}

/* ============================================
   NOTIFICAZIONI CARRELLO
   ============================================ */
[data-component='cart-notification'] {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--verde);
  color: var(--bianco);
  padding: 15px 20px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  animation: slideIn 0.3s ease;
}

[data-element='notification-content'] {
  display: flex;
  align-items: center;
  gap: 15px;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ============================================
   FILTRI GERARCHICI E PARENT
   ============================================ */
.hierarchical-filters .filter-group {
  margin-bottom: 8px;
  border-radius: 8px;
  overflow: hidden;
}

.filter-parent-wrapper {
  display: flex;
  align-items: center;
  position: relative;
}

.filter-parent-wrapper .filter-item,
.filter-parent-wrapper [data-component='filter-option'] {
  flex: 1;
  margin: 0;
}

.filter-children {
  padding-left: 6px;
  max-height: 1000px;
  overflow: hidden;
  transition:
    max-height 0.3s ease,
    opacity 0.2s ease;
  opacity: 1;
}

.filter-children.collapsed {
  max-height: 0;
  opacity: 0;
}

.filter-child {
  padding: 4px 0;
  font-size: 0.9em;
}

.filter-child .filter-content-wrapper,
.filter-child [data-element='filter-content'] {
  padding-left: 16px;
  position: relative;
}

.filter-parent.non-clickable {
  cursor: pointer;
  user-select: none;
  padding: 6px 0px;
}

.filter-parent.non-clickable:hover {
  background-color: #f8f9fa;
}

.filter-parent.non-clickable .filter-label,
.filter-parent.non-clickable [data-element='filter-label'] {
  font-weight: 600;
  color: var(--verde-scuro);
}

.filter-parent.non-clickable .filter-content-wrapper,
.filter-parent.non-clickable [data-element='filter-content'] {
  display: flex;
  align-items: center;
  flex: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .filters-sidebar-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px 0;
  }

  .filters-sidebar {
    position: static;
  }

  .product-filters,
  [data-component='product-filters'] {
    padding: 15px;
    margin-bottom: 20px;
  }

  .filter-item,
  [data-component='filter-option'] {
    padding: 12px 8px;
  }

  .filter-icon,
  [data-element='filter-icon'] {
    width: 20px;
    height: 20px;
  }

  .products-grid,
  [data-element='products-grid'] {
    margin: -5px;
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .d-md-none {
    display: block !important;
  }

  .d-none.d-md-flex {
    display: none !important;
  }

  .range-filter-container,
  [data-component='range-filter'] {
    padding: 15px 0;
  }

  [data-element='range-values'],
  .range-values {
    flex-direction: column;
    gap: 8px;
  }

  [data-element='range-separator'],
  .range-separator {
    transform: rotate(90deg);
  }

  [data-element='range-min-display'],
  [data-element='range-max-display'],
  .range-min-display,
  .range-max-display {
    min-width: 100px;
  }
}

@media (max-width: 480px) {
  [data-component='product-card'] {
    flex: 0 0 calc(100% - 10px);
    /* border: none; */
  }

  .product-filters-system {
    width: 100%;
    padding: 0 10px;
  }

  [data-element='product-title'] {
    font-size: 20px;
  }

  [data-element='product-actions'] {
    gap: 10px;
  }

  [data-action='view-product'] {
    width: 100%;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.d-none {
  display: none !important;
}
.d-block {
  display: block !important;
}
.d-flex {
  display: flex !important;
}
.flex-column {
  flex-direction: column !important;
}
.flex-wrap {
  flex-wrap: wrap !important;
}
.justify-content-start {
  justify-content: flex-start !important;
}
.justify-content-between {
  justify-content: space-between !important;
}
.align-items-start {
  align-items: flex-start !important;
}
.align-items-center {
  align-items: center !important;
}
.gap-2 {
  gap: 0.5rem !important;
}

@media (min-width: 768px) {
  .d-md-none {
    display: none !important;
  }
  .d-md-block {
    display: block !important;
  }
  .d-md-flex {
    display: flex !important;
  }
}

/* ============================================
   DISABILITATI E TRANSIZIONI
   ============================================ */
.filter-checkbox:disabled,
.reset-filters-btn:disabled,
[data-input='filter-checkbox']:disabled,
[data-action='reset-filters']:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.products-grid,
[data-element='products-grid'] {
  transition: opacity 0.3s ease;
}

.filter-item.active .filter-label,
[data-component='filter-option'].active [data-element='filter-label'] {
  font-weight: 500;
}

.filter-item.active .filter-count,
[data-component='filter-option'].active [data-element='filter-count'] {
  background-color: var(--accent-salmon);
  color: white;
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 0.8rem;
}

.filter-item.active .filter-count,
[data-component='filter-option'].active [data-element='filter-count'] {
  background-color: var(--accent-salmon);
  color: white;
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 0.8rem;
}

.filter-item.active input[type='checkbox']:checked {
  accent-color: var(--accent-salmon);
}

/* ============================================
   MOBILE FILTERS TOGGLE
   ============================================ */

/* Bottone toggle mobile - nascosto di default */
.mobile-filters-toggle {
  display: none;
  background: #ffffff;
  border: 1px solid #e1e8ed;
  border-radius: 6px;
  padding: 12px 20px;
  width: 100%;
  cursor: pointer;
  margin-bottom: 20px;
  transition: all 0.2s ease;
}

.mobile-filters-toggle:hover {
  background: #f8f9fa;
  border-color: #68abad;
}

.mobile-filters-toggle:focus {
  outline: 2px solid #68abad;
  outline-offset: 2px;
}

.mobile-filters-toggle-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mobile-filters-toggle-text {
  color: var(--verde-scuro);
  font-size: 16px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mobile-filters-toggle svg {
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.mobile-filters-toggle.active {
  background: #f8f9fa;
  border-color: var(--verde);
}

.mobile-filters-toggle.active svg path {
  fill: var(--verde);
}

/* Wrapper per i filtri */
.mobile-filters-wrapper {
  display: block;
  transition: all 0.3s ease;
}

/* ============================================
   RESPONSIVE MOBILE
   ============================================ */
@media (max-width: 768px) {
  /* Mostra il toggle su mobile */
  .mobile-filters-toggle {
    display: block;
  }

  /* Nascondi i filtri di default su mobile */
  .mobile-filters-wrapper {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition:
      max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
      opacity 0.3s ease;
    margin-bottom: 0;
  }

  /* Mostra i filtri quando active */
  .mobile-filters-wrapper.active {
    max-height: 3000px; /* Valore alto per contenere tutti i filtri */
    opacity: 1;
    margin-bottom: 20px;
  }

  /* Stili aggiuntivi per i filtri su mobile quando aperti */
  .mobile-filters-wrapper.active .product-filters {
    padding: 20px 15px;
    background: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    animation: slideDown 0.3s ease;
  }

  /* Animazione slide down */
  @keyframes slideDown {
    from {
      transform: translateY(-10px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  /* Riduci padding del titolo su mobile */
  .mobile-filters-wrapper .filters-title {
    font-size: 20px;
    margin-bottom: 15px;
  }

  /* Ottimizza spazio tra sezioni su mobile */
  .mobile-filters-wrapper .filter-section {
    margin-bottom: 15px;
  }
}

/* Per schermi molto piccoli */
@media (max-width: 480px) {
  .mobile-filters-toggle {
    padding: 10px 15px;
  }

  .mobile-filters-toggle-text {
    font-size: 14px;
  }

  .mobile-filters-toggle svg {
    width: 20px;
    height: 20px;
  }
}

/* ============================================
   FILTRI GERARCHICI (PARENT/CHILD)
   ============================================ */

.filter-parent-group {
  overflow: hidden;
  border-bottom: 1px solid #d0d2d8;
}

/* Toggle parent (non è un filtro, solo un pulsante) */
.filter-parent-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  background: #f8f9fa;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  border-radius: 6px;
}

.filter-parent-toggle .filter-children-toggle-icon {
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 10px;
}

.filter-parent-toggle[aria-expanded='true'] .filter-children-toggle-icon {
  transform: rotate(180deg);
}

.filter-children.collapsed {
  max-height: 0;
  opacity: 0;
}

/* Stile per i figli */
.filter-child {
  padding-left: 0px;
}

.filter-child[data-component='filter-option'] {
  border-bottom: 1px solid #f0f0f0;
}

.filter-child[data-component='filter-option']:last-child {
  border-bottom: none;
}

/* Quando parent è selezionato */
.filter-parent-wrapper
  [data-input='filter-checkbox']:checked
  ~ [data-element='filter-content']
  .parent-label {
  color: var(--verde);
}

/* Mobile ottimizzazioni */
@media (max-width: 768px) {
  .filter-children {
    margin-left: 15px;
  }

  .filter-child {
    padding-left: 15px;
  }

  .filter-children-toggle {
    padding: 6px 10px;
  }
}

/* ============================================
   RECIPE CARD STYLES
   ============================================ */

/* Recipe Card Base */
[data-component='recipe-card'] {
  background: #ffffff;
  border-radius: 12px;
  border: 0.5px solid #d0d2d8;
  overflow: hidden;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

[data-component='recipe-card']:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Recipe Image Container */
[data-element='recipe-image'] {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

[data-element='recipe-image'] img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

[data-component='recipe-card']:hover [data-element='recipe-image'] img {
  transform: scale(1.05);
}

/* Placeholder quando manca immagine */
.recipe-placeholder-image {
  width: 100%;
  height: 100%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 24px;
  font-weight: 300;
}

/* Badge Difficoltà */
[data-element='recipe-difficulty'] {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

[data-element='recipe-difficulty'][data-level='facile'] {
  background: #2ecc71;
  color: white;
}

[data-element='recipe-difficulty'][data-level='media'] {
  background: #f39c12;
  color: white;
}

[data-element='recipe-difficulty'][data-level='difficile'] {
  background: #e74c3c;
  color: white;
}

/* Recipe Content */
[data-element='recipe-content'] {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Recipe Title */
[data-element='recipe-title'] {
  color: var(--verde-scuro);
  font-size: 20px;
  font-weight: 500;
  margin: 0;
  line-height: 1.3;
}

/* Recipe Time */
[data-element='recipe-time'] {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6c757d;
  font-size: 14px;
}

[data-element='recipe-time'] svg {
  stroke: currentColor;
  flex-shrink: 0;
}

/* Recipe Description */
[data-element='recipe-description'] {
  flex: 1;
}

[data-element='recipe-description'] p {
  color: #6c757d;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

/* Recipe Actions */
[data-element='recipe-actions'] {
  margin-top: auto;
  padding-top: 12px;
}

[data-action='view-recipe'] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--verde);
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  width: 100%;
}

[data-action='view-recipe']:hover {
  background: var(--verde-scuro);
  transform: translateY(-1px);
}

/* ============================================
   FILTRI SPECIFICI RICETTE
   ============================================ */

/* Range slider per tempo preparazione */
[data-filter='tempo_preparazione'] [data-element='range-values'] {
  font-size: 14px;
}

[data-filter='tempo_preparazione'] [data-element='range-min-display']:after,
[data-filter='tempo_preparazione'] [data-element='range-max-display']:after {
  content: ' min';
  font-size: 12px;
  color: #6c757d;
}

/* Filtri difficoltà con colori */
[data-filter='difficolta_ricetta']
  [data-value='facile']
  [data-element='filter-label'] {
  position: relative;
  padding-left: 20px;
}

[data-filter='difficolta_ricetta']
  [data-value='facile']
  [data-element='filter-label']:before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2ecc71;
}

[data-filter='difficolta_ricetta']
  [data-value='media']
  [data-element='filter-label'] {
  position: relative;
  padding-left: 20px;
}

[data-filter='difficolta_ricetta']
  [data-value='media']
  [data-element='filter-label']:before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f39c12;
}

[data-filter='difficolta_ricetta']
  [data-value='difficile']
  [data-element='filter-label'] {
  position: relative;
  padding-left: 20px;
}

[data-filter='difficolta_ricetta']
  [data-value='difficile']
  [data-element='filter-label']:before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

/* ============================================
   RESPONSIVE RICETTE
   ============================================ */
@media (max-width: 768px) {
  [data-element='recipe-image'] {
    height: 150px;
  }

  [data-element='recipe-title'] {
    font-size: 18px;
  }

  [data-element='recipe-content'] {
    padding: 15px;
  }

  [data-action='view-recipe'] {
    padding: 8px 16px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  [data-component='recipe-card'] {
    margin-bottom: 15px;
  }

  [data-element='recipe-difficulty'] {
    font-size: 11px;
    padding: 4px 10px;
  }
}
/* ============================================
   FILTRI ATTIVI E ORDINAMENTO
   ============================================ */
.active-filters-bar {
  margin-bottom: 20px;
}

.active-filters-container {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.active-filters-container.has-filters::before {
  content: 'Filtri selezionati:';
  color: #82858c;
  font-size: 14px;
  font-weight: 400;
  line-height: 18px;
  letter-spacing: 0.28px;
}

.active-filters-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.active-filter-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  border-radius: 50px;
  outline: 1px #68abad solid;
  outline-offset: -1px;
  transition: all 0.2s ease;
}

.active-filter-tag span:first-child {
  color: #063f46;
  font-size: 14px;
  font-weight: 400;
  line-height: 18px;
  letter-spacing: 0.28px;
}

.active-filter-remove {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
  position: relative;
}

.active-filter-remove::before {
  content: '×';
  color: #063f46;
  font-size: 18px;
  line-height: 1;
  font-weight: 400;
}

.active-filter-remove:hover {
  opacity: 0.7;
}

/* Ordinamento prodotti */
.product-sorting {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.sort-label {
  color: var(--verde-scuro);
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}

.sort-select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: var(--bianco);
  color: var(--verde-scuro);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 200px;
}

.sort-select:hover {
  border-color: var(--verde);
}

.sort-select:focus {
  outline: none;
  border-color: var(--verde);
  box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

/* Responsive filtri attivi */
@media (max-width: 768px) {
  .active-filters-container {
    flex-direction: column;
    align-items: stretch;
  }

  .product-sorting {
    justify-content: space-between;
    width: 100%;
  }

  .sort-select {
    flex: 1;
    min-width: auto;
  }
}
