/* Filtro de productos Electromillonaria (sidebar + AJAX). */
#emf-clear-filters-button {
  width: 100%;
  margin: 30px 0;
}

#emf-filter-container {
  margin-bottom: 2em;
}

#emf-mobile-filter-button {
  display: none;
  background-color: var(--em-red, #DB0303);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  font-size: 16px;
  margin-bottom: 1em;
}

.emf-filter-section {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--em-gray-200, #E1E1E1);
}

.emf-filter-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.emf-filter-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 0;
  padding: 10px 0;
  cursor: pointer;
  position: relative;
  color: #333;
}

.emf-filter-title::after {
  content: '+';
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: bold;
  color: #888;
}

.emf-filter-title.active::after {
  content: '−';
}

.emf-filter-options {
  display: none;
  padding-top: 15px;
}

.emf-filter-options ul {
  list-style: none;
  padding: 0;
  margin: 10px 0 0 40px;
}

.emf-filter-options li {
  margin-bottom: 12px;
}

.emf-category-label {
  display: flex;
  align-items: center;
}

.emf-subcategory-toggle {
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  margin-right: 8px;
  color: #888;
  width: 20px;
  text-align: center;
}

.emf-subcategory-list {
  display: none;
  padding-left: 25px;
  list-style: none;
  margin-top: 8px;
}

.emf-filter-options label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 15px;
  color: #555;
}

.emf-filter-options input[type="checkbox"] {
  margin-right: 12px;
  width: 18px;
  height: 18px;
  accent-color: #333;
  border-radius: 4px;
}

.emf-price-inputs {
  display: flex;
  gap: 10px;
  align-items: end;
  margin-top: 15px;
  font-size: 15px;
  color: #444;
}

.emf-price-inputs label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.emf-price-inputs input[type="number"] {
  width: 100%;
  padding: 8px;
}

.emf-price-apply {
  padding: 8px 14px;
  cursor: pointer;
}

.emf-term-hidden {
  display: none;
}

.emf-term-count {
  font-size: 0.9em;
  color: #888;
  margin-left: 5px;
}

/* Estado de carga AJAX */
ul.products.emf-loading {
  opacity: 0.5;
  position: relative;
  transition: opacity 0.3s;
}

ul.products.emf-loading::before {
  content: 'Cargando...';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.9);
  padding: 15px 30px;
  border-radius: 8px;
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  color: #333;
  font-weight: 500;
}

@media (max-width: 768px) {
  #emf-mobile-filter-button {
    display: block;
  }

  #emf-filter-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 320px;
    max-width: 90%;
    height: 100%;
    background-color: #ffffff;
    z-index: 9999;
    transition: left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
    box-shadow: 2px 0 15px rgba(0,0,0,0.15);
    border-radius: 0;
  }

  #emf-filter-sidebar.emf-open {
    left: 0;
  }

  .emf-close-filter {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: #555;
  }

  .emf-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    display: none;
  }
}
