/* Sidebar categorías y subcategorías */
.cat-chevron {
  cursor: pointer;
  margin-left: 8px;
  font-size: 13px;
  transition: transform 0.2s;
  user-select: none;
}
.cat-chevron.open {
  transform: rotate(90deg);
}
.subcat-list {
  display: none;
  padding-left: 18px;
  margin: 6px 0 6px 0;
  list-style: none;
}
.subcat-list.open {
  display: block;
  background: #fff;
  box-shadow: 0 4px 18px 0 rgba(202,0,39,0.10), 0 0px 0 0 #CA0027;
  border-radius: 8px;
  margin-top: 6px;
  margin-bottom: 6px;
  padding: 8px 12px;
  transition: box-shadow 0.2s, background 0.2s;
}

/* Categorías y subcategorías: estilos base */
.cat-link,
.subcat-link {
  text-transform: uppercase !important;
  font-size: 12px !important;
  font-weight: 500;
  color: #444;
  cursor: pointer;
  display: block;
  padding: 2px 0;
  transition: color 0.2s, background 0.2s, font-weight 0.2s;
  border-radius: 5px;
  line-height: 1.8 !important;
}

/* Hover (excepto activo) */
.cat-link:hover:not(.active),
.subcat-link:hover:not(.active) {
  color: #CA0027 !important;
  font-weight: bold !important;
}

/* Activo: fondo, color, padding, etc SOLO en el <a> */
.cat-link.active,
.subcat-link.active {
  color: #fff !important;
  background-color: #CA0027 !important;
  font-weight: bold !important;
  padding: 10px !important;
  border-radius: 5px !important;
  display: block;
}

/* Elimina fondo en el li, solo el <a> activo tiene fondo */
.list-lines li,
.subcat-list li {
  background: none !important;
  padding-inline: 5px !important;
}

/* Subcategoría activa sigue igual */
.subcat-link.active {
  background: #CA0027 !important;
  color: #fff !important;
}

/* Opcional: subcategorías no activas, color más suave */
.subcat-link {
  color: #CA0027;
  background: transparent;
}

/* Opcional: categoría activa, shadow más fuerte */
.cat-link.active {
  box-shadow: 0 2px 2px 0 rgba(202,0,39,0.10);
}

.list-lines li {
  border-bottom: 1px solid #ddd;
  padding: 5px 0 5px 2px;
}

/* =============================
   MEJORAS ESPECÍFICAS PARA MOBILE
   ============================= */

@media (max-width: 991px) {
  /* --- CHEVRON MEJORADO PARA MOBILE --- */
  .cat-chevron {
    margin-left: auto;
    font-size: 12px;
    color: #CA0027;
    opacity: 0.8;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(202, 0, 39, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    min-width: 24px;
    min-height: 24px;
  }
  
  .cat-chevron:hover {
    opacity: 1;
    background: rgba(202, 0, 39, 0.2);
    transform: scale(1.1);
  }
  
  .cat-chevron.open {
    background: #CA0027;
    color: #fff;
    transform: rotate(90deg);
  }
  
  /* --- CATEGORÍAS MEJORADAS PARA MOBILE --- */
  .cat-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    margin: 4px 0;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    font-size: 14px !important;
    font-weight: 600;
    width: 100%;
  }
  
  .cat-link:hover:not(.active) {
    background: rgba(202, 0, 39, 0.05);
    border-color: rgba(202, 0, 39, 0.2);
    transform: translateX(4px);
  }
  
  .cat-link.active {
    background: linear-gradient(135deg, #CA0027 0%, #a8001f 100%);
    border-color: #CA0027;
    box-shadow: 0 4px 12px rgba(202, 0, 39, 0.3);
    transform: translateX(4px);
  }
  
  /* --- SUBCATEGORÍAS MEJORADAS PARA MOBILE --- */
  .subcat-list {
    padding-left: 0;
    margin: 8px 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(-10px);
  }
  
  .subcat-list.open {
    max-height: 500px;
    opacity: 1;
    transform: translateY(0);
    background: rgba(202, 0, 39, 0.03);
    border-left: 3px solid #CA0027;
    padding: 8px 0;
  }
  
  .subcat-link {
    padding: 12px 20px;
    margin: 2px 8px;
    border-radius: 6px;
    font-size: 13px !important;
    font-weight: 500;
    color: #666;
    position: relative;
    overflow: hidden;
  }
  
  .subcat-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, rgba(202, 0, 39, 0.1) 0%, transparent 100%);
    transition: width 0.3s ease;
  }
  
  .subcat-link:hover:not(.active) {
    background: rgba(202, 0, 39, 0.08);
    transform: translateX(8px);
  }
  
  .subcat-link:hover:not(.active)::before {
    width: 100%;
  }
  
  .subcat-link.active {
    background: linear-gradient(135deg, #CA0027 0%, #a8001f 100%);
    box-shadow: 0 2px 8px rgba(202, 0, 39, 0.3);
    transform: translateX(8px);
  }
  
  /* --- ESTRUCTURA DE LISTA PARA MOBILE --- */
  .list-lines li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0;
    margin: 0;
  }
  
  .list-lines li:last-child {
    border-bottom: none;
  }
  
  /* --- ANIMACIONES PARA MOBILE --- */
  @keyframes slideInMobile {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .subcat-list.open {
    animation: slideInMobile 0.3s ease-out;
  }
}