/* =========================
   VARIABLES
========================= */

:root {
    --border: #e5e7eb;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent: linear-gradient(135deg, #6a11cb, #2575fc);
    --accent-solid: #2575fc;
    --accent-soft: #ede9fe;
    --bg-soft: #f8fafc;
  }
  
  /* =========================
     LAYOUT GENERAL
  ========================= */
  
  .gadgets-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 28px;
    max-width: 1000px;
    margin: 40px auto;
    margin-top: 0;
    padding: 0 16px;
  }
  
 /* Contenedor del formulario */
  /* =========================
     PRODUCT CARD
  ========================= */
  
  /* =========================
   PRODUCT CARD (Grid actualizado)
========================= */
.product-card {
    position: relative;
    display: grid;
    /* 3 Columnas: Imagen (180px), Info (flexible), Acciones (220px) */
    grid-template-columns: auto 2fr 1fr 1fr; 
    gap: 25px;
    background: #fff;
    overflow: hidden;
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: 20px;
    margin-bottom: 24px;
    transition: all .3s ease;
    align-items: center; /* Centra todo verticalmente */
}
  
.product-card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,.08);
    transform: translateY(-3px);
    border-color: #ddd;
}

.product-image-container {
    width: 8rem;
    height: 8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.product-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-left: 1px solid #f1f5f9;
    padding-left: 10px;
}
  
  /* =========================
     RANK
  ========================= */
  
  /* =========================
   RANK (Flotante en esquina)
========================= */

.rank {
    /* Lo sacamos del flujo normal para que no ocupe espacio */
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    display: flex;
    align-items: flex-start;
  }
  
  /* El estilo del cuadradito con el número */
  .rank .number {
    background: #f1f5f9; /* Gris muy suave */
    color: #fff; /* Texto oscuro */
    font-size: 16px;
    font-weight: 800;
    background: var(--accent);
    /* Tamaño fijo cuadrado */
    width: 40px;
    height: 40px;
    
    /* Centrar el texto */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Bordes: Curva solo abajo a la derecha */
    border-bottom-right-radius: 12px;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    
    margin: 0; /* Quitamos margen antiguo */
  }
  /* =========================
     PRODUCT MAIN
  ========================= */
  
  .product-main {
    display: flex;
    align-items: center;
    gap: 18px;
  }
  
  
  .product-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-info h3 {
    font-size: 15px;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
}
  
  .type {
    font-size: 13px;
    margin-top: 0;
    color: var(--text-muted);
  }
  
  /* =========================
     PROS
  ========================= */
.pros {
    margin:0;
    margin-top: -5px;
    display: flex;
    flex-direction: column;
    width: 100%; 
}

.pros li {
    font-size: 0.8125rem;
    color: #374151;
    display: flex;
    align-items: center;
    margin-top: 0;
    
    max-width: 280px; 
    width: 100%;      
    box-sizing: border-box; 
    display: block;           
    white-space: nowrap;    
    overflow: hidden;         
    text-overflow: ellipsis;  
    max-width: 100%;
}

.pros li svg {
    flex-shrink: 0; 
    width: 16px;
    height: 16px;
    filter: drop-shadow(0 1px 2px rgba(34, 197, 94, 0.2));
}

.pros li span {
    flex: 1;                 
    min-width: 0;          
    width: 0;      
    margin-left: 5px;       
    white-space: nowrap;     
    overflow: hidden;        
    text-overflow: ellipsis; 
    display: block;          
}

.pros li:hover {
    cursor: help;
}
  /* =========================
     RATING + STARS
  ========================= */
  
  .rating {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
  }
  
  .stars {
    --percent: calc(var(--rating) / 5 * 100%);
    font-size: 16px;
    font-family: Times;
  }
  
  .stars::before {
    content: "★★★★★";
    background: linear-gradient(
      90deg,
      #c05621 var(--percent),
      #e5e7eb var(--percent)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  
  /* =========================
     PRICE BOX
  ========================= */
  
  .price-box {
    border: none;
    text-align: center;
    padding: 0;
    background: transparent;
}
  
  .price-box .label {
    font-size: 12px;
    color: var(--text-muted);
  }
  
  .price-box .price {
    font-size: 18px;
    font-weight: 800;
    margin: 10px 0;
  }
  
  .price-box .cta {
    display: block;
    background: #000;
    color: #fff;
    padding: 5px;
    border-radius: 12px;
    font-weight: 800;
    text-decoration: none;
  }
  
/* =========================
   RESPONSIVE & TOGGLE
========================= */

/* Por defecto (Escritorio), el botón toggle está oculto */
.toggle-btn {
    display: none;
  }
  
  /* --- TABLETS Y MÓVILES (Menos de 960px) --- */
  @media (max-width: 790px) {
    
    .filter-group {
        margin-bottom: 0;
    }
    /* Layout principal a una sola columna */
    .gadgets-layout {
      grid-template-columns: 1fr;
      gap: 20px;
    }
  
  
    /* ESTILO DEL BOTÓN TOGGLE */
    .toggle-btn {
      display: flex;
      justify-content: space-between;
      align-items: center;
      width: 100%;
      background: #fff;
      border: 1px solid #ddd;
      padding: 10px;
      font-size: 1rem;
      font-weight: 700;
      color: #333;
      border-radius: 8px;
      cursor: pointer;
      transition: background 0.2s;
    }
  
    .toggle-btn:hover {
      background: #f9f9f9;
    }
    
    /* Cuando está abierto, cambiamos el color un poco */
    .toggle-btn.active {
      background: #f0f4ff;
      border-color: #4f46e5;
      color: #4f46e5;
      border-bottom-left-radius: 0; /* Para pegarlo al formulario */
      border-bottom-right-radius: 0;
      border-bottom: none;
    }
  
    /* EL FORMULARIO (OCULTO POR DEFECTO) */
    
  
    /* EL FORMULARIO (VISIBLE) */
  }
  
  /* --- MÓVILES PEQUEÑOS (Menos de 650px) --- */
  @media (max-width: 700px) {
  
    /* En móvil muy chico, los filtros a 1 sola columna */
    #filterForm.is-open {
      grid-template-columns: 1fr;
    }
  
    
    
    /* Ajustes de tarjeta (los mismos de antes) */
    .product-card {
      display: flex;
      flex-direction: column;
      padding: 18px;
      gap: 5px;
    }
    .product-main { flex-direction: column; gap: 12px; }
    .product-main img { margin: 0 auto; display: block; }
    .product-main .info { text-align: center; }
    
    /* Caja precio móvil */
    .price-box {
      width: 100%;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      align-items: center;
      padding: 12px 16px;
    }
    .price-box .label { display: none; }
    .price-box .price { margin: 0; font-size: 20px; }
   
  }
  
  /* Animación suave al abrir */
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  /* =========================
   ORDER SELECT
========================= */

.order-select {
    display: grid;
    grid-template-columns: auto auto;
    margin-bottom: 18px;
  }
  
  .order-select select {
    appearance: none;
    background:
      var(--bg-soft)
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath d='M5.5 7.5L10 12l4.5-4.5'/%3E%3C/svg%3E")
      no-repeat right 12px center;
    background-size: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 34px 8px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
  }
  
  .order-select select:hover {
    border-color: var(--accent-solid);
  }
  
  .order-select select:focus {
    outline: none;
    border-color: var(--accent-solid);
    box-shadow: 0 0 0 2px rgba(37, 117, 252, 0.15);
  }
  
  .load-more {
    margin: 30px auto 0;
    display: block;
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: #fff;
    border: none;
    padding: 14px 28px;
    font-size: 14px;
    width: fit-content;
    font-weight: 700;
    border-radius: 999px;
    cursor: pointer;
        text-decoration: none; /* Quitar subrayado */
        display: block; /* Comportamiento de bloque/botón */
        text-align: center;
  }
  

  /* Esto hace que el título se estire sobre el sidebar y los productos */
.page-intro {
    grid-column: 1 / -1; /* Ocupa todo el ancho del grid */
    border-bottom: 1px solid #eee;
  }
  
  .page-intro h1 {
    margin: 0 0 10px 0;
    color: #111;
  }
  
  .page-intro p {
    color: #666;
    font-size: 1.1rem;
  }
  
  /* En móvil centramos el texto */
  @media (max-width: 650px) {
    .page-intro {
      text-align: center;
      width: 100%;
      max-width: 100%;
    }
  }

.products{
    max-width: 800px;
}
  
/* Contenedor principal del rango y premio */
.rank-award {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    height: 30px;
    align-items: center;
    background: linear-gradient(135deg, #6a11cb, #2575fc); /* Tu degradado indigo-blue */
    border-bottom-right-radius: 12px;
    border-top-left-radius: 20px; /* Ajusta este valor al radio de tu .product-card */
    overflow: hidden;
    z-index: 10;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.1);
}

/* Estilo para el número */
.rank-award .number {
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    width: 40px;
    height: 40px;
    border-right: 1px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Estilo para el texto que se une al número */
.rank-award .award-text {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 0 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}



/* Small helper (screen-reader only) */
.sr-only { position: absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* Order controls layout */
.order-select { justify-content: space-between; align-items:center; gap:10px; margin-bottom:12px; }
.order-controls { display:flex; align-items:center; gap:8px; }

/* Mobile filter button (hidden desktop) */
.mobile-filter-btn{
  display:none;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  border-radius:8px;
  border:1px solid #ddd;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  cursor:pointer;
}


/* Mobile behavior: show icon + transform filter form into a panel */
@media (max-width: 700px) {
  /* show button */
  
  /* make order-select occupy full width and left-align the select */
  .order-select { grid-template-columns: none; }
  .results-count {grid-area: 2;}

  /* hide the aside filterForm by default (on mobile) */

  /* when is-open (toggle desde JS), mostrar como panel full-height desde la derecha */


  /* evitar que el resto de la página este scrollable (podés activar esto en JS si prefieres) */
}


@media (max-width:1000px) {
  .filter-group h3 {
    margin-top: 10px;
  }
  .gadgets-layout {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    place-items: center;
  }
  body.filters-open::after{
    content:"";
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.45);
    z-index:1100;
    pointer-events:auto;
  }
/* Ocultar completamente el aside en mobile */
.mobile-filter-btn { display:inline-flex; }
#filterForm.is-open {
  display:block !important;
  position:fixed;
  top:0;
  right:0;
  height:100dvh; /* 🔥 viewport real dinámico */
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  width:92%;
  background-color: #fff;
  max-width:300px;
  z-index:1200;
  padding:20px;
  box-shadow: -20px 0 60px rgba(2,6,23,0.6);
  overflow:auto;
  border-left: 1px solid rgba(255,255,255,0.04);
  transform: translateX(0);
  transition: transform .28s cubic-bezier(.2,.9,.3,1);
}
/* añadir un botón de cerrar dentro del panel (si quieres colocarlo vía CSS) */
#filterForm.is-open .close-filter {
  display:inline-flex;
  margin-left:auto;
  background:transparent;
  border:0;
  color:#e2e8f0;
  font-size:1.1rem;
  cursor:pointer;
}
}

/* -------------------------
   Mobile: forzar 1 columna y ocultar aside
   ------------------------- */
   @media (max-width:700px) {
    /* Forzar contenedor a 1 columna */
    
  
    
    aside.filters .apply-btn,
    #filterForm .apply-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      margin-top: 18px;
      padding: 12px 16px;
      border-radius: 10px;
      border: none;
      cursor: pointer;
    
      /* Estilo principal */
      background-color: #000;
      color: #ffffff;
      font-weight: 700;
      font-size: 0.95rem;
      letter-spacing: .3px;
    
      box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
      transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
    }
    /* Asegurar que main ocupa todo el ancho */
    main.products {
      grid-column: 1 / -1 !important;
      width: 100% !important;
    }
  
    /* El panel flotante #filterForm aparece cuando tiene .is-open (ya lo definiste) */
   
  
    /* Opcional overlay cuando están los filtros abiertos */
    
  }
  

  /* Estilos del Slider de Rango Dual */
.price-slider-wrapper {
    width: 100%;
    padding: 10px 0 20px 0;
}
.slider-container {
    position: relative;
    height: 6px;
    background: #e2e8f0;  
    border-radius: 5px;
    margin-top: 15px;
}
.slider-track {
    position: absolute;
    height: 100%; 
    background: #4a5568; /* Color de la barra activa */
    border-radius: 5px;
}
.range-input {
    position: relative;
}
.range-input input {
    position: absolute;
    width: 100%;
    height: 5px;
    top: -7px;
    background: none;
    pointer-events: none; /* Permite clic a través */
    -webkit-appearance: none;
    -moz-appearance: none;
}
/* Estilo del "Thumb" (la bolita) para Chrome/Safari */
.range-input input::-webkit-slider-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #4a5568;
    pointer-events: auto; /* Reactiva eventos en la bolita */
    -webkit-appearance: none;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
/* Estilo del "Thumb" para Firefox */
.range-input input::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border: 2px solid #4a5568;
    border-radius: 50%;
    background: #fff;
    pointer-events: auto;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.price-inputs {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-top: 20px;
    gap: 10px;
}

.price-field {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    color: #4a5568;
    background: #f8fafc;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    padding: 8px 12px;
    width: fit-content;
    transition: border-color 0.2s;
}

.price-field:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.price-field span {
    font-weight: 600;
    color: #64748b;
    font-size: 12px;
    margin-right: 6px;
    white-space: nowrap;
}

.price-field input[type="text"] {
    width: 80px;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    outline: none;
}

.btn-primary {
    background: black;
    color: white;
    /* tus estilos actuales */
  }

  .btn-secondary {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #555; /* Gris oscuro, no negro */
    text-decoration: underline;
    cursor: pointer;
  }
  
  .btn-secondary:hover {
    color: #000;
  }

  .icon-options {
    display: flex;
    gap: 15px; /* Espacio entre botones */
}

/* Estilo Base del Botón */
.icon-btn {
    width: 60px;  /* Ancho fijo */
    height: 60px; /* Alto fijo para que sea cuadrado */
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px; /* Bordes redondeados modernos */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.5rem; /* Tamaño del icono */
    color: #9ca3af; /* Color gris apagado por defecto */
}

.icon-btn input {
    display: none; /* Ocultamos el radio real */
}

/* Efecto Hover */
.icon-btn:hover {
    border-color: #d1d5db;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Efecto Click */
.icon-btn:active {
    transform: scale(0.95);
}

/* --- ESTADOS ACTIVOS --- */

/* Cuando activas el SÍ (Azul Agua) */
.yes-btn:has(input:checked) {
    background-color: #eff6ff;
    border-color: #3b82f6;
    color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* Cuando activas el NO (Rojo/Gris oscuro) */
.no-btn:has(input:checked) {
    background-color: #fef2f2;
    border-color: #ef4444;
    color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}



.bandera {
  position: relative;
  width: 100px;
  background: #000;
  text-align: center;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.bandera .titulo {
  font-size: 12px;
  padding: 4px 0 2px;
  position: relative;
  color: #fff;
}

.bandera .puntaje {
  padding: 6px 0;
  font-size: 22px;
  color: #fff;
}

.bandera .texto {
  font-size: 13px;
  padding: 4px 0 6px;
  font-weight: bold;
  color: #fff;
}

.bandera .puntaje span {
  font-size: 14px;
  color: #fff;
}
/* =========================================
   1. TABLET LAYOUT (701px - 1100px)
   Diseño horizontal ancho: Imagen | Info+Pros | Precio+Score
   ========================================= */
   @media (max-width: 1100px) {
    .bandera {
      width: 80px;
    }
    .gadgets-layout {
      padding: 0 10px;
    }
    .product-card {
        display: grid;
        /* 3 Columnas: Imagen - Info - Acciones */
        grid-template-areas: "image info actions";
        align-items: center;
        text-align: left;
    }

    /* Imagen */
    .product-image-container {
        grid-area: image;
        display: flex;
        width: 6rem;
        height: 6rem;
        align-items: center;
        justify-content: center;
    }

    /* Info Central (Mantenemos los Pros aquí porque caben) */
   
    .product-info h3 { font-size: 15px; margin: 0; }
    .type { display: none; } /* Ocultamos el tipo para limpiar */

    /* Acciones Derecha (Score + Precio + Botón apilados) */
    .product-actions {
        border-left: 1px solid #f1f5f9;
        padding-left: 15px;
        border-top: none;
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 12px;
    }

    .price-box {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        padding: 0;
    }
    .price-box .cta {
      padding: 5px;
    }
}

@media (max-width:600px) {
  .product-info {
    grid-area: 2;
    grid-column: 1/5;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.product-card {
  grid-template-columns: 3fr;
}

.product-actions {
  grid-area: actions;

}
}
@media (max-width: 400px) {
  .price-box {
    flex-direction: column;
  }
}

/* Por defecto oculto en escritorio */
.close-filter-btn {
  display: none;
}

/* Solo visible en Mobile (ajusta el pixelaje a tu breakpoint, ej: 1000px o 700px) */
@media (max-width: 1000px) {
  .close-filter-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      position: absolute;
      top: 15px;
      right: 15px;
      background: transparent;
      border: none;
      cursor: pointer;
      padding: 5px;
      z-index: 20;
      color: #4a5568; /* Color gris oscuro */
      border-radius: 50%;
      transition: background 0.2s;
  }

  .close-filter-btn:hover {
      background-color: #f1f5f9;
      color: #000;
  }

  .close-filter-btn svg {
      width: 24px;
      height: 24px;
  }
  
 #filterForm{
    position: static; /* vive normal en el aside */
  }

  #filterForm.is-open{
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    bottom: 0;
    height: 100dvh;
    width: 92%;
    max-width: 420px;
    z-index: 1200;
    padding: 20px;
    background: #fff;
    box-shadow: -20px 0 60px rgba(2,6,23,0.6);
    overflow: auto;
  }
}




/* Estilos para estado vacío */
.no-results-wrapper {
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border-radius: 12px;
  grid-column: 1 / -1; /* Esto asegura que ocupe todo el ancho si usas grid */
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  border: 1px dashed #cbd5e0;
  margin-top: 20px;
}

.no-results-icon {
  margin-bottom: 20px;
  opacity: 0.7;
}

.no-results-wrapper h3 {
  font-size: 1.5rem;
  color: #2d3748;
  margin-bottom: 10px;
  margin-top: 0;
}

.no-results-wrapper p {
  color: #718096;
  margin-bottom: 25px;
  font-size: 1rem;
}

.reset-filters-btn {
  background-color: #4a5568;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.reset-filters-btn:hover {
  background-color: #2d3748;
}

/* --- GRID SPECS --- */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.spec-grid span {
  background: #f1f5f9;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.95rem;
}



@media (max-width: 480px) {


  /* --- GRID SPECS → UNA COLUMNA --- */
  .spec-grid {
      grid-template-columns: 1fr;
      gap: 8px;
  }

  .spec-grid span {
      font-size: 0.9rem;
      padding: 8px 10px;
  }
}
@media (max-width:360px) {

  .price-box .cta {
    font-size: .875rem;
  }
  .price-box .price {
    font-size: 1rem;
  }
  .product-image-container {
    width: 4rem;
    height:4rem;
  }
}









:root{
  --spec-border: rgba(17,17,17,0.06);
  --spec-bg: #ffffff;
  --spec-accent: #111827; /* título */
  --spec-text: #374151;
  --spec-muted: #6b7280;
  }
  
  
  .specs-card{
  border-radius: 10px;
  padding: 18px;
  color: var(--spec-text);
  max-width: 520px; /* adapta a la caja donde lo pongas */
  }
  
  
  .specs-title{
  margin: 0 0 10px 0;
  font-size: 15px;
  color: var(--spec-accent);
  letter-spacing: -0.2px;
  font-weight: 600;
  }
  
  
  .product-specs{
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
  }
  
  
  .product-specs th,
  .product-specs td{
  padding: 10px 8px;
  vertical-align: top;
  }
  
  
  .product-specs th{
  width: 38%;
  text-align: left;
  color: var(--spec-muted);
  font-weight: 600;
  font-size: 13px;
  padding-right: 14px;
  }
  
  
  .product-specs td{
  color: var(--spec-text);
  font-weight: 500;
  word-wrap: break-word;
  }
  
  
  /* Líneas separadoras sutiles */
  .product-specs tbody tr + tr td{
  border-top: 1px solid var(--spec-border);
  }
  
  
  /* Responsive: en pantallas muy pequeñas, convertir a diseño vertical */
  table {
    min-width: auto!important;
  }


  .results-count {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0;
    margin-top: 0;
  }



  /*--------------------------------- Battery widget -----------------------------------------------*/
  .battery-widget {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-top: 10px;
    padding: 20px;
    max-width: 420px;
    background: #fff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
  }
  
  .battery-display {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
  }
  
  .battery {
    width: 120px;
    height: 40px;
    border: 2px solid #333;
    border-radius: 6px;
    position: relative;
  }
  
  .battery::after {
    content: "";
    position: absolute;
    right: -8px;
    top: 12px;
    width: 6px;
    height: 16px;
    background: #333;
    border-radius: 2px;
  }
  
  .battery-level {
    height: 100%;
    width: 50%;
    background: #22c55e;
    border-radius: 4px;
    transition: width 0.3s ease, background 0.3s ease;
  }
  
  .battery-level.low {
    background: #dc2626; /* rojo */
  }
  
  .battery-level.medium {
    background: #f59e0b; /* amarillo */
  }
  
  .battery-level.high {
    background: #16a34a; /* verde */
  }
  
  .battery-results p {
    margin: 4px 0;
    font-size: 0.9rem;
  }
  
  .battery-ideal {
    margin-top: 10px;
    font-size: 0.9rem;
    background: #f9fafb;
    padding: 8px 12px;
    border-radius: 8px;
  }
  /* =========================
   BATTERY RANGE SLIDER
========================= */

.battery-range {
  width: 100%;
  margin: 14px 0;
}

/* RESET */
#batteryRange {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
  cursor: pointer;
}

/* ===== TRACK ===== */
#batteryRange::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--range-color, #22c55e) var(--percent, 50%),
    #e5e7eb var(--percent, 50%)
  );
}

#batteryRange::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
}

#batteryRange::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--range-color, #22c55e);
}

/* ===== THUMB ===== */
#batteryRange::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--range-color, #22c55e);
  margin-top: -7px;
  box-shadow: 0 4px 10px rgba(0,0,0,.15);
  transition: transform .15s ease, border-color .15s ease;
}

#batteryRange:active::-webkit-slider-thumb {
  transform: scale(1.15);
}

#batteryRange::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--range-color, #22c55e);
  box-shadow: 0 4px 10px rgba(0,0,0,.15);
}


.common-mistakes {
  max-width: 800px;
  margin-top: 20px;
  border-radius: 16px;
}

.common-mistakes h2 {
  margin-top: 0;
}

.mistake-item {
  border-top: 1px solid #e5e7eb;
  padding: 10px 0;
}

.mistake-toggle {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  font-size: 16px;
  font-weight: 700;
  padding: 10px 0;
}


.mistake-content {
  padding: 0px 0 0px 15px;
  color: #374151;
}

.mistake-item.active .mistake-content {
  display: block;
}
.footer { margin-top: 0 !important; }
      
/* --- ESTILOS DEL MODAL (ESTRUCTURA) --- */
body.modal-open { overflow: hidden; } /* Evita scroll de fondo */

.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 9999; justify-content: center; align-items: flex-start; overflow-y: auto; padding: 20px 0; }
.modal-container { background: white; width: 95%; max-width: 600px; border-radius: 8px; position: relative; margin: 20px auto; box-shadow: 0 20px 50px rgba(0,0,0,0.3); font-family: 'Arial', sans-serif; animation: slideUp 0.3s ease-out; }
@keyframes slideUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header { padding: 15px 20px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center;  border-radius: 8px 8px 0 0; }
.modal-title h2 { margin: 0; font-size: 1.4rem; font-weight: 700; color: #111; display: inline-block; }
.modal-title span { font-weight: 400; color: #555; font-size: 1rem;  }
.close-modal { font-size: 30px; border: none; background: none; cursor: pointer; color: #999; padding: 0; line-height: 0.8; }
.modal-body { padding: 20px; }

/* LAYOUT DE 2 COLUMNAS (Desktop) */
.top-layout {  margin-bottom: 20px; }
@media (max-width:600px) {
  .top-layout {
      display: block;
  }
}
.left-col { flex: 1.2; position: relative; } /* Columna Fotos */
.right-col { flex: 0.8;  } /* Columna Info/Precio */

/* --- 1. BANDERA (SCORE) FLOTANTE --- */
.absolute-badge { position: absolute; right: 0; top: 0; padding: 10px; z-index: 5; pointer-events: none; }

 
  .bandera .puntaje #mScoreVal {
      padding: 4px 0;
      font-size: 20px;
      color: #fff;
      font-weight: 800;
  }
  .bandera .texto {
      font-size: 12px;
      padding: 2px 0 6px;
      font-weight: bold;
      color: #fff;
  }

/* --- 2. SLIDER TÁCTIL (Touch Action Fix) --- */
.modal-slider-viewport { 
    position: relative; overflow: hidden; border-radius: 8px; border:1px solid #eee; height: 350px; 
    display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
    touch-action: pan-y; /* CRÍTICO: Permite scroll vertical nativo, pero JS detecta horizontal */
    background: #fff;
}
.modal-slider-track { display: flex; transition: transform 0.3s ease-out; height: 100%; width: 100%; }
.slide-image { min-width: 100%; height: 100%; object-fit: contain; display: block; padding: 20px; box-sizing: border-box; }

.modal-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.9); border: 1px solid #ddd; border-radius: 50%; width: 40px; height: 40px; cursor: pointer; font-size: 18px; color: #333; z-index: 4; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.slider-prev { left: 10px; }
.slider-next { right: 10px; }

.thumbnails { display: flex; gap: 8px; justify-content: center; overflow-x: auto; padding-bottom: 5px; }
.thumb { width: 50px; height: 50px; border: 1px solid #ddd; padding: 2px; cursor: pointer; object-fit: contain; border-radius: 4px; }
.thumb.active { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }

/* --- 3. SECCIÓN OPINIONES (Estilo Amazon) --- */
.review-summary { border-top: 1px solid #eee; border-bottom: 1px solid #eee; padding: 10px 0; margin-bottom: 15px; font-size: 14px; color: #333; display: flex; align-items: center; gap: 8px; }
.stars-static { color: #F7CA00; letter-spacing: -1px; font-size: 16px; text-shadow: 0 0 1px #e47911; }
.review-bold { font-weight: 700; color: #333; }

/* --- 4. PRECIOS (Caja Amazon) --- */
.price-section { margin-bottom: 20px; }
.price-header { font-size: 16px; font-weight: 700; margin-bottom: 10px; color: #333; }
.price-box-container { border: 1px solid #d5d9d9; border-radius: 8px; padding: 15px; position: relative; background: #fff; display: flex; flex-direction: column; gap: 8px; }


.price-row { display: flex; align-items: baseline; gap: 5px; }
.price-symbol { font-size: 14px; vertical-align: top; }
.price-val { font-size: 28px; color: #0F1111; font-weight: 500; line-height: 1; }
.shipping-txt { font-size: 13px; color: #565959; }

.btn-offer { background: #000;color: #fff;width: fit-content; padding: 10px 40px; border-radius: 20px; text-decoration: none; font-size: 14px; font-weight: 600; text-align: center; box-shadow: 0 2px 5px rgba(213,217,217,.5);  box-sizing: border-box; }
.disclaimer { font-size: 11px; color: #565959; margin-top: 5px; font-style: italic; }

/* --- 5. DESCRIPCIÓN & ACORDEONES --- */
.desc-text { font-size: 14px; line-height: 1.5; color: #333; margin-bottom: 20px; }

.accordion { border-top: 1px solid #e7e7e7; }
.accordion-item { border-bottom: 1px solid #e7e7e7; }
.accordion-header { width: 100%; text-align: left; background: none; border: none;border-bottom: 1px solid #ddd; padding: 15px 0; font-size: 15px; font-weight: 700; color: #333; display: flex; justify-content: space-between; align-items: center; outline: none; }
.icon-chevron { transition: transform 0.3s; font-size: 12px; }
.accordion-header.active .icon-chevron { transform: rotate(180deg); }

.spec-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.spec-row:last-child { border: none; }
.spec-label { font-weight: 700; color: #555; width: 45%; }
.spec-val { width: 50%; text-align: right; }

.product-card { cursor: pointer; transition: transform 0.2s; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.product-card a { position: relative; z-index: 5; }

/* Mobile Responsive */
@media(max-width: 768px) {
    .modal-header { padding: 10px 15px; }
    .modal-body { padding: 0 15px 15px; }
    .modal-slider-viewport { height: 280px; }
    .absolute-badge { padding: 10px; }
    .bandera { width: 75px; }
    .bandera .puntaje { font-size: 18px; }
}

/* --- ESTRELLAS AUTOMÁTICAS --- */
.star-rating-dynamic {
display: inline-block;
font-size: 18px;
font-family: Times, serif; /* Times tiene estrellas unicode bonitas */
line-height: 1;
background: linear-gradient(90deg, #c05621 var(--percent), #ddd var(--percent));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
letter-spacing: 1px;
}
.star-rating-dynamic::before {
content: '★★★★★'; /* 5 estrellas unicode */
}

/* --- PRECIO ESTILO AMAZON MEJORADO --- */
.price-display {
display: flex;
align-items: flex-start; /* Alinea arriba */
color: #B12704;
line-height: 1;
}
.price-symbol {
font-size: 14px;
margin-top: 4px; /* Ajuste fino */
}
.price-whole {
font-size: 28px;
font-weight: 700;
}
.price-fraction {
font-size: 14px;
margin-top: 4px;
}

/* SPEC SECTIONS */
.spec-sections { display: flex; flex-direction: column; gap: 12px; padding: 12px 0; }
.spec-section {
border-radius: 10px;
background: linear-gradient(180deg, #ffffff, #fafafa);
border: 1px solid #e8e8ef;
box-shadow: 0 6px 20px rgba(12,12,20,0.04);
overflow: hidden;
}
.spec-header {
display:flex;border-bottom: 1px solid #e5e5e5; align-items:center; justify-content:space-between;
gap:12px; padding:12px 16px; cursor: pointer;
}
.spec-header h4 { margin:0; font-size:14px; font-weight:700; color:#1f2937; }
.spec-meta { font-size:13px; color:#6b7280; }
.spec-toggle {
display:inline-flex; align-items:center; justify-content:center;
width:34px; height:34px; border-radius:8px; background:#f3f4f6; border:1px solid #e6e7ee;
transition: transform .18s ease;
}
.spec-toggle[aria-expanded="true"] { transform: rotate(180deg); background:#eef2ff; border-color:#c7d2fe; }

.spec-grid {
display:grid;
grid-template-columns: repeat(2, minmax(0,1fr));
gap: 10px 20px;
padding: 12px 16px 18px;
}
@media (max-width:600px) { .spec-grid { grid-template-columns: 1fr; } }

.spec-item {
display:flex; align-items:center; gap:10px; padding:8px 10px;
background: linear-gradient(90deg, rgba(99,102,241,0.1), transparent);
border-radius:8px; border:1px solid rgba(99,102,241,0.04);
}
.spec-key { font-weight:700; color:#374151; font-size:13px; width:45%; }
.spec-val { color:#374151; font-size:13px; text-align:right; width:55%; }

.spec-chip { display:inline-block; padding:4px 8px; border-radius:999px; font-size:12px; font-weight:600; color:#065f46; background:#ecfdf5; border:1px solid #bbf7d0; }

/* Small utilities */
.spec-empty { padding:12px 16px; color:#6b7280; font-style:italic; }


.good-price-sticker {

background-color: #cf2c27;
color: #fff;
display: inline-flex;
font-size: .75rem;
height: 22px;
line-height: 22px;
margin-left: 10px;
left: 0;
padding: 0 8px 0 5px;
position: relative;
white-space: nowrap;
z-index: 10;
top: -10px;
position: absolute;
}

.good-price-sticker:before {
background-color: #cf2c27;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 1px;
border-top-left-radius: 1px;
content: "";
height: 16px;
left: -8px;
position: absolute;
top: 3px;
transform: rotate(45deg);
width: 16px;
z-index: -1;
}

.good-price-sticker:after {

background-color: #fff;
border-radius: 5px;
content: "";
height: 5px;
left: -6px;
position: absolute;
top: 8px;
width: 5px;
}

.details {
display: block;
text-align: center;
margin-top: 10px;
font-size: 0.9rem;
color: #555;
text-decoration: underline;
cursor: pointer;
}
/* TABLA RESPONSIVE CON STICKY */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; position: relative; min-height: 300px;margin: 1rem -1rem;border: 1px solid #ddd; }
table { border-collapse: separate; border-spacing: 0; width: 100%}
th, td { border-bottom: 1px solid #eee; border-right: 1px solid #f9f9f9; background: #fff; }
  /* Columna Izquierda Fija */
  .sticky-col { 
      width: 100px;
       padding: 12px 15px; font-weight: 600; font-size: 14px; color: #555; text-align: left;
      border-right: 2px solid #ddd;
  }

  .prod-col { min-width: 200px;width: 300px; font-size: 14px; padding: 5px; text-align: center; vertical-align: middle; position: relative; }
  /* Headers Sección */
  .section-header td { background: #fff; border-bottom: 2px solid #cbd5e0; padding: 0; position: sticky; left: 0; z-index: 20; }
  .section-title { padding: 10px 20px; font-weight: 700; color: #333; display: flex; align-items: center; cursor: pointer; user-select: none; }
  .arrow { margin-right: 10px; transition: 0.3s; font-size: 12px; }
  .collapsed tr:not(.section-header) { display: none; }
  .collapsed .arrow { transform: rotate(-90deg); }

  /* UI Productos */
  .prod-img { width: 130px; height: 130px; object-fit: contain; margin-bottom: 10px; }
  .prod-name { color: var(--primary); font-weight: 700; font-size: 15px; display: block; margin-bottom: 5px; }
  .price { font-weight: 800; font-size: 1.3em; color: #222; }
  .score { color: white; padding: 4px 8px; border-radius: 4px; font-weight: 700; font-size: 0.9em; }
  .bg-green { background: var(--green); } .bg-orange { background: var(--orange); }

  /* Botones */
  .btn-remove { position: absolute; top: 5px; right: 5px; background: white; border: 1px solid #ddd; border-radius: 50%; width: 28px; height: 28px; cursor: pointer; color: #999; font-size: 16px; transition: 0.2s; z-index: 5;}
  .btn-remove:hover { color: red; border-color: red; transform: scale(1.1); }
  
  .add-col {min-width: 140px; background: #fff; }
  .btn-add { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 70px; height: 70px; border-radius: 50%; border: 2px dashed #ccc; cursor: pointer; background: transparent; margin: 0 auto; margin-top: 30px;transition: 0.2s; }
  .btn-add:hover { border-color: var(--primary); color: var(--primary); background: #f0f8ff; }

  /* Loading Spinner */
  #loadingOverlay { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(255,255,255,0.9); z-index: 9999; justify-content: center; align-items: center; }
  .spinner { border: 4px solid #f3f3f3; border-top: 4px solid var(--primary); border-radius: 50%; width: 40px; height: 40px; animation: spin 0.8s linear infinite; }
  @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

  /* Modal */
  .modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 2000; justify-content: center; align-items: flex-start; padding-top: 60px; backdrop-filter: blur(2px); }
  .modal-box { background: white; width: 500px; max-width: 90%; max-height: 80vh; border-radius: 12px; display: flex; flex-direction: column; box-shadow: 0 20px 40px rgba(0,0,0,0.3); overflow: hidden; }
  .modal-head { padding: 20px; border-bottom: 1px solid #eee; display: flex; gap: 10px; background: #fff; }
  .modal-body { overflow-y: auto;}
  .search-input { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 16px; outline: none; }
  .search-item { display: flex; align-items: center; padding: 15px 20px; cursor: pointer; border-bottom: 1px solid #f9f9f9; transition: 0.2s; }
  .search-item:hover { background: #f0f8ff; }

  @media(max-width: 768px) {
      .sticky-col { font-size: 12px; padding: 10px; }
      .prod-col { min-width: 140px;width: 200px; padding: 10px 5px; }
  }
  .compare-modal {
display: none;
position: fixed;
inset: 0;
background: rgba(0,0,0,0.6);
z-index: 3000;
justify-content: center;
align-items: flex-start;
padding-top: 60px;
}
.compare-modal .modal-box {
background:#fff;
width:500px;
max-width:90%;
border-radius:12px;
overflow:hidden;
}
/* --- Variables para fácil edición --- */
:root {
  --nav-bg: #ffffff;
  --nav-border: #e2e8f0;
  --primary-color: #2563eb; /* Azul moderno, cámbialo por tu color de marca */
  --text-main: #334155;
  --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

/* --- Contenedor General --- */
/* --- Estilos Generales (Desktop First) --- */
:root {
  --nav-blue: #2563eb;
  --nav-dark: #1e293b;
}

.jump-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 20px 0;
  padding: 6px 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 50px; /* Pill shape en desktop */
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.jump-label {
  font-weight: 700;
  font-size: 13px;
  color: #64748b;
  padding: 0 10px;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

/* Enlaces Desktop */
.jump-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 50px;
  color: var(--nav-dark);
  text-decoration: none;
  transition: all 0.2s ease;
}

.jump-nav a svg {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  transition: transform 0.2s;
}

/* Hover Desktop */
.jump-nav a:hover {
  background-color: #eff6ff;
  color: var(--nav-blue);
}
.jump-nav a:hover svg {
  opacity: 1;
  transform: scale(1.1);
  stroke: var(--nav-blue);
}

/* Estado Activo (JS) */
.jump-nav a.active {
  background-color: var(--nav-blue);
  color: #fff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}
.jump-nav a.active svg {
  opacity: 1;
  stroke: #fff;
}

/* --- MOBILE: DISEÑO SIN SCROLL (APP BAR) --- */
@media (max-width: 768px) {
  .jump-nav {
      position: fixed;
      bottom: 0;
      left: 0;
      width: 100%; /* Ocupar todo el ancho */
      margin: 0;
      border-radius: 0; /* Quitar bordes redondos */
      border: none;
      border-top: 1px solid #eee;
      
      /* Layout Flex para distribuir espacio */
      justify-content: space-evenly; /* Espacio igual entre items */
      padding: 8px 0;
      padding-bottom: max(8px, env(safe-area-inset-bottom)); /* Soporte iPhone Notch */
      
      background: rgba(255, 255, 255, 0.98);
      backdrop-filter: blur(10px);
      z-index: 997;
      box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  }

  /* Ocultar etiqueta "Jump to" */
  .jump-label {
      display: none;
  }

  /* Estilo botón móvil (Stack Vertical) */
  .jump-nav a {
      flex-direction: column; /* Ícono arriba, texto abajo */
      gap: 4px;
      padding: 4px 0;
      border-radius: 8px;
      font-size: 10px; /* Texto pequeño */
      flex: 1; /* Forzar ancho igual para todos */
      text-align: center;
      background: transparent !important; /* Quitar fondo azul en móvil si prefieres */
      box-shadow: none !important;
      color: #64748b; /* Color gris por defecto */
  }

  /* Ajuste de íconos en móvil */
  .jump-nav a svg {
      width: 22px;
      height: 22px;
      opacity: 1;
  }

  /* Estado activo en móvil (Solo colorear ícono y texto, sin fondo) */
  .jump-nav a.active {
      color: var(--nav-blue);
      background: transparent;
  }
  
  .jump-nav a.active svg {
      stroke: var(--nav-blue);
      filter: drop-shadow(0 2px 4px rgba(37, 99, 235, 0.3));
  }
}
/* --- CSS MEJORADO PARA MODAL COMPARAR --- */
.compare-modal .modal-head {
display: flex; 
justify-content: space-between; /* Separa título y botón a los extremos */
align-items: center;
padding: 15px 20px; 
border-bottom: 1px solid #eee;
}

.compare-modal strong {
font-size: 1.1rem;
color: #333;
}

/* Diseño del botón X */
.btn-close-compare {
background: transparent;
border: none;
font-size: 28px;
line-height: 1;
color: #999;
cursor: pointer;
padding: 0;
transition: color 0.2s;
}

.btn-close-compare:hover {
color: #333; /* Se oscurece al pasar el mouse */
}

#backToTop.show {
  transform: translateY(-60px) !important;
}

 /* --- WIDGET SIDEBAR --- */
 .sidebar-widget {
  background: #fff;
  border: 1px solid #e5e7eb; /* Gris suave */
  border-radius: 12px;
  height: fit-content;
  margin-left: 10px;
  padding: 20px;
  margin-top: 20px; /* Separación del filtro */
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.sidebar-widget h3 {
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
  margin-top: 0;
  margin-bottom: 15px;
  border-bottom: 2px solid #f3f4f6;
  padding-bottom: 10px;
}

.related-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.related-list li {
  margin-bottom: 15px;
}
.related-list li:last-child {
  margin-bottom: 0;
}

.related-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  group: pointer; /* Para efectos hover */
  transition: transform 0.2s ease;
}

.related-item:hover {
  transform: translateX(4px); /* Pequeña animación al pasar el mouse */
}

/* Imagen en miniatura */
.related-thumb {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f9fafb;
  border: 1px solid #eee;
}

.related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* O cover, según tus imágenes */
}

/* Textos */
.related-info {
  display: flex;
  flex-direction: column;
}

.related-info .tag {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  color: #6366f1; /* Color acento (puedes usar tu naranja/verde) */
  margin-bottom: 2px;
}

.related-info h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  line-height: 1.4;
  transition: color 0.2s;
}

.related-item:hover a {
  color: #6366f1; /* Color al pasar el mouse */
}

/* Ocultar en móvil si ya ocultas los filtros, 
 o dejar visible según preferencia */
@media (max-width: 820px) {
  .container{
    flex-direction: column;
  }
  .sidebar-widget {
      margin-left: 0;
  }
}






















/* =====================================================
   CSS MEJORADO PARA FILTROS
   ===================================================== */

/* --- CONTENEDOR PRINCIPAL --- */
.filters {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); 
    border: 1px solid #eee;
    margin-top: 40px;
    height: fit-content;
    max-height: calc(100vh - 100px); /* Evita que sea muy alto */
    overflow-y: auto; /* Scroll si tiene muchos filtros */
}

/* Scroll suave */
.filters::-webkit-scrollbar {
    width: 8px;
}

.filters::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.filters::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

.filters::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* --- GRUPOS DE FILTROS --- */
.filter-group {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f3f4f6;
}

.filter-group:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-group h3 {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #374151;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
}

/* --- BOTONES DE FILTRO MEJORADOS --- */
.filter-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 11px 14px;
    
    background: #fafafa;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    
    font-size: 0.9rem;
    color: #4b5563;
    font-weight: 500;
}

/* Hover */
.filter-btn:hover {
    border-color: #9ca3af;
    background: #f9fafb;
    transform: translateY(-1px);
}

/* Input oculto */
.filter-btn input {
    display: none; 
}

/* Estado seleccionado */
.filter-btn:has(input:checked) {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #3b82f6;
    color: #1e40af;
    font-weight: 600;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.1);
}

/* Icono check al seleccionar */
.filter-btn:has(input:checked)::after {
    content: '✓';
    font-size: 14px;
    font-weight: bold;
    color: #3b82f6;
}

/* --- TOOLTIP --- */
.tooltip-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    text-align: center;
    font-size: 11px;
    font-weight: bold;
    color: #6b7280;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: help;
    margin-left: 6px;
    line-height: 18px;
    transition: all 0.2s;
}

.tooltip-icon:hover {
    background: #3b82f6;
    color: #fff;
    transform: scale(1.1);
}

/* --- BOTONES DE ACCIÓN --- */

/* Botón Aplicar (Principal) */
.filters button[type="submit"],
.apply-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.filters button[type="submit"]:hover,
.apply-btn:hover {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.filters button[type="submit"]:active,
.apply-btn:active {
    transform: translateY(0);
}

/* Botón Limpiar (Secundario) */
.reset-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: #6b7280;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.reset-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

/* --- RESPONSIVE --- */
@media (max-width: 1000px) {
    .filter-group {
        margin-bottom: 18px;
        padding-bottom: 16px;
    }
    
    .filter-group h3 {
        font-size: 0.85rem;
    }
    
    .filter-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}

/* --- MEJORAS VISUALES --- */

/* Emojis en los filtros */
.filter-btn span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Animación sutil al cargar */
.filter-group {
    animation: fadeInUp 0.3s ease-out backwards;
}

.filter-group:nth-child(1) { animation-delay: 0.05s; }
.filter-group:nth-child(2) { animation-delay: 0.1s; }
.filter-group:nth-child(3) { animation-delay: 0.15s; }
.filter-group:nth-child(4) { animation-delay: 0.2s; }
.filter-group:nth-child(5) { animation-delay: 0.25s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- CONTADOR DE FILTROS ACTIVOS (Opcional) --- */
.filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #3b82f6;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    margin-left: auto;
}

/* --- INDICADOR DE RESULTADOS (Opcional) --- */
.filter-results {
    text-align: center;
    padding: 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: #0369a1;
    font-weight: 600;
}

/* Soporte real para barras de navegación Android / Samsung */
@supports (height: 100dvh) {
  #filterForm.is-open{
    height:100dvh;
  }
}

body.filters-open{
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
}
/* ======================================
   Mobile filters - forced behavior (end of CSS)
   ====================================== */
@media (max-width:1000px) {
  /* por defecto el form está oculto en mobile */
  #filterForm {
    display: none !important;
    position: static !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }

  /* SOLO cuando tiene la clase is-open se muestra como panel fijo */
  #filterForm.is-open {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: 92% !important;
    max-width: 300px !important;
    height: 100dvh !important;
    z-index: 2000 !important;
    padding: 20px !important;
    background: #fff !important;
    box-shadow: -20px 0 60px rgba(0,0,0,.45) !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;
    transform: translateX(0) !important;
  }

  /* aside nunca debe ocupar área visual en mobile */
  aside.filters {
    padding: 0 !important;
    margin: 0 !important;
    height: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  /* botón cerrar visible dentro del panel */
  #filterForm .close-filter-btn { display:inline-flex !important; z-index:2100; }
}

/* Fuerza comportamiento correcto en desktop (evita que estilos mobile queden pegados) */
@media (min-width:1001px) {
  aside.filters { display: block !important; position: relative !important; padding: 20px; background: transparent; box-shadow: none; height: auto; }
  #filterForm { display: block !important; position: static !important; width: auto !important; max-width: none !important; height: auto !important; padding: 0 !important; background: transparent !important; box-shadow: none !important; overflow: visible !important; }
  #filterForm.mobile-hidden { display: block !important; } /* en desktop no ocultamos por mobile-hidden */
  /* Si querés que en desktop el form mantenga tus estilos originales, elimina / adapta las líneas anteriores */
}

@media (max-width: 1000px) {
    
    /* ========== BOTÓN DE FILTROS MÓVIL ========== */
    .mobile-filter-btn {
        /* Tamaño generoso - fácil de tocar */
        min-width: 120px;
        min-height: 52px;
        padding: 12px 20px;
        
        /* Colores de alto contraste */
        background: linear-gradient(to bottom, #ffffff, #f5f5f5);
        border: 1px solid #ddd;
        border-radius: 10px;
        
        /* Texto grande y legible */
        font-size: 1rem;          /* 16px mínimo */
        font-weight: 600;
        color: #1a1a1a;
        letter-spacing: 0.3px;
        
        /* Flexbox para icono + texto */
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 10px;
        
        /* Cursor y transición */
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    /* Icono del filtro más grande */
    .mobile-filter-btn svg {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
    }
    
    /* Añadir texto "Filtros" después del icono */
    .mobile-filter-btn::after {
        content: "Filters";
        font-size: 1rem;
        font-weight: 600;
    }
    
    /* Estado hover/active - feedback visual claro */
    .mobile-filter-btn:hover,
    .mobile-filter-btn:focus {
        background: linear-gradient(to bottom, #f0f0f0, #e5e5e5);
        border-color: #ddd;
        transform: scale(1.02);
    }
    
    .mobile-filter-btn:active {
        background: #e0e0e0;
        transform: scale(0.98);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }
    
    /* Focus visible para accesibilidad */
    .mobile-filter-btn:focus-visible {
        outline: 3px solid #0066cc;
        outline-offset: 3px;
    }
    
    /* ========== INDICADOR DE FILTROS ACTIVOS ========== */
    .mobile-filter-btn.has-filters {
        background: linear-gradient(to bottom, #e8f4e8, #d4edda);
        border-color: #28a745;
        color: #155724;
    }
    
    .mobile-filter-btn.has-filters::before {
        content: "";
        width: 10px;
        height: 10px;
        background: #28a745;
        border-radius: 50%;
        position: absolute;
        top: -4px;
        right: -4px;
        border: 2px solid white;
    }
    
    /* ========== CONTENEDOR DE CONTROLES ========== */
    .order-controls {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
    }
    
    /* Select de orden también más accesible */
    #order-select {
        min-height: 48px;
        padding: 10px 40px 10px 16px;
        font-size: 1rem;
        font-weight: 500;
        border: 1px solid #ddd;
        border-radius: 8px;
        background-color: #fff;
        color: #1a1a1a;
    }
    
}

/* ========== VERSIÓN AÚN MÁS GRANDE (opcional) ========== */
/* Para pantallas pequeñas o usuarios que necesitan más ayuda */

@media (max-width: 1000px) {
    
    .mobile-filter-btn {
        /* Botón aún más prominente en pantallas pequeñas */
        min-width: 140px;
        min-height: 56px;
        padding: 14px 24px;
        font-size: 1.0625rem;  /* 17px */
        border-width: 2.5px;
        border-radius: 12px;
        gap: 12px;
    }
    
    .mobile-filter-btn svg {
        width: 24px;
        height: 24px;
    }
    
    .mobile-filter-btn::after {
        font-size: 1.0625rem;
    }
    
    /* Controles en columna si no caben */
    .order-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    #order-select {
        flex: 1;
        min-height: 52px;
        font-size: 1.0625rem;
    }
}

