/* ============================================================
   NEXIA AI — styles.css
   Sistema de diseño Neo-Cyber Minimalista
   Estructura: Variables → Reset → Componentes → Responsive
============================================================ */

/* ------------------------------------------------------------
   1. CUSTOM PROPERTIES (TOKENS DE DISEÑO)
   Analogía: Son como los atributos globales del <html>.
   Al cambiar data-theme, todo el sistema cambia en cascada.
------------------------------------------------------------ */
:root {
  /* — Paleta Modo Oscuro — */
  --bg-primary:    #020617;
  --bg-secondary:  #080e1e;
  --bg-tertiary:   #0d1526;
  --bg-card:       rgba(13, 21, 38, 0.72);
  --bg-card-hover: rgba(18, 28, 50, 0.88);

  --text-primary:   #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;

  --accent-cyan:        #00f0ff;
  --accent-purple:      #8a2be2;
  --accent-cyan-dim:    rgba(0, 240, 255, 0.12);
  --accent-purple-dim:  rgba(138, 43, 226, 0.12);
  --accent-cyan-glow:   0 0 24px rgba(0, 240, 255, 0.45);
  --accent-purple-glow: 0 0 24px rgba(138, 43, 226, 0.45);

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-cyan:   rgba(0, 240, 255, 0.3);
  --border-purple: rgba(138, 43, 226, 0.45);

  /* Glassmorphism */
  --glass-bg:     rgba(13, 21, 38, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --blur:         blur(16px);

  /* Espaciado y forma */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Sombras */
  --shadow-card:    0 4px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow-cy: 0 0 40px rgba(0, 240, 255, 0.12);

  /* Transiciones */
  --t-fast: 0.15s ease;
  --t-med:  0.3s ease;
  --t-slow: 0.5s ease;

  /* Layout */
  --header-h:   68px;
  --max-w:      1280px;
  --pad:        24px;
}

/* — Paleta Modo Claro — */
[data-theme="light"] {
  --bg-primary:    #f1f5f9;
  --bg-secondary:  #e2e8f0;
  --bg-tertiary:   #cbd5e1;
  --bg-card:       rgba(255, 255, 255, 0.78);
  --bg-card-hover: rgba(255, 255, 255, 0.98);

  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;

  --border-subtle: rgba(0, 0, 0, 0.07);
  --border-medium: rgba(0, 0, 0, 0.13);

  --glass-bg:     rgba(255, 255, 255, 0.62);
  --glass-border: rgba(0, 0, 0, 0.09);

  --shadow-card:    0 4px 20px rgba(0, 0, 0, 0.10);
  --shadow-glow-cy: 0 0 40px rgba(0, 200, 220, 0.07);

  --accent-cyan-dim:   rgba(0, 200, 220, 0.11);
  --accent-purple-dim: rgba(138, 43, 226, 0.08);
}

/* ------------------------------------------------------------
   2. RESET Y BASE
------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--t-med), color var(--t-med);
}

/* Ocultar cursor nativo solo en desktop con mouse real */
@media (hover: hover) and (pointer: fine) {
  body,
  a, button, input, [role="button"] { cursor: none; }
}

a { color: var(--accent-cyan); text-decoration: none; }
a:hover { opacity: 0.8; }

img { max-width: 100%; display: block; }

button {
  font-family: 'Space Grotesk', sans-serif;
  border: none;
  background: none;
  cursor: pointer;
  transition: all var(--t-fast);
}

/* ------------------------------------------------------------
   3. CONTENEDOR
------------------------------------------------------------ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ------------------------------------------------------------
   4. CURSOR PERSONALIZADO
   Punto neón cian (cursor) + aro elástico (cursorTrail).
   Completamente desactivado en pantallas táctiles vía
   media query (hover:none) y (pointer:coarse).
------------------------------------------------------------ */
@media (hover: hover) and (pointer: fine) {

  /* Punto neón: sigue al mouse al instante */
  .cursor {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--accent-cyan);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--accent-cyan), 0 0 22px rgba(0,240,255,0.5);
    mix-blend-mode: screen;
    transition: width 0.2s ease, height 0.2s ease, background 0.2s ease;
  }

  /* Aro exterior: sigue con lerp (efecto elástico via JS) */
  .cursor-trail {
    position: fixed;
    width: 28px;
    height: 28px;
    border: 1.5px solid rgba(0, 240, 255, 0.45);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    transition: width 0.25s ease, height 0.25s ease;
  }

  /* Estado: sobre elemento interactivo */
  .cursor--hover {
    width: 16px !important;
    height: 16px !important;
    background: transparent !important;
    border: 2px solid var(--accent-cyan);
    box-shadow: var(--accent-cyan-glow);
  }

  /* Estado: clic */
  .cursor--clicking {
    background: var(--accent-purple) !important;
    box-shadow: 0 0 10px var(--accent-purple), 0 0 22px rgba(138,43,226,0.5) !important;
    width: 8px !important;
    height: 8px !important;
  }
}

/* En táctil/móvil: ocultar divs del cursor */
@media (hover: none), (pointer: coarse) {
  .cursor, .cursor-trail { display: none !important; }
}

/* ------------------------------------------------------------
   5. HEADER
   Sticky + glassmorphism + sombra al hacer scroll.
------------------------------------------------------------ */
.header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--glass-bg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--glass-border);
  transition: box-shadow var(--t-med), background var(--t-med);
}

.header--scrolled {
  box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  width: 100%;
}

/* — Logo — */
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.logo__icon {
  font-size: 1.5rem;
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 8px var(--accent-cyan));
  animation: logoPulse 3.5s ease-in-out infinite;
}
@keyframes logoPulse {
  0%,100% { filter: drop-shadow(0 0 6px var(--accent-cyan)); }
  50%      { filter: drop-shadow(0 0 16px var(--accent-cyan)) drop-shadow(0 0 30px rgba(0,240,255,0.35)); }
}
.logo__accent { color: var(--accent-cyan); }

/* — Nav principal — */
.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.nav__link {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--t-fast);
  text-decoration: none;
}
.nav__link:hover { color: var(--text-primary); background: var(--accent-cyan-dim); }
.nav__link--active { color: var(--accent-cyan); background: var(--accent-cyan-dim); }

/* — Controles del header — */
.header__controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Toggle de vista */
.view-toggle {
  display: flex;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.view-toggle__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  border-radius: 5px;
  color: var(--text-muted);
}
.view-toggle__btn--active {
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0,240,255,0.18);
}
.view-toggle__btn:hover:not(.view-toggle__btn--active) {
  color: var(--text-secondary);
  background: var(--border-subtle);
}

/* Toggle de tema */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 1rem;
}
.theme-toggle:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0,240,255,0.18);
}

/* ------------------------------------------------------------
   6. HERO SECTION
------------------------------------------------------------ */
.hero {
  position: relative;
  padding: 80px 0 60px;
  text-align: center;
  overflow: hidden;
}

/* Fondo: glows + grid de puntos */
.hero__bg { position: absolute; inset: 0; pointer-events: none; }

.hero__bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}
.hero__bg-glow--cyan {
  width: 600px; height: 400px;
  background: radial-gradient(ellipse, rgba(0,240,255,0.15) 0%, transparent 70%);
  top: -100px; left: 50%; transform: translateX(-50%);
}
.hero__bg-glow--purple {
  width: 500px; height: 350px;
  background: radial-gradient(ellipse, rgba(138,43,226,0.12) 0%, transparent 70%);
  bottom: -80px; right: 10%;
}
.hero__bg-dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 28px 28px;
}

.hero__content { position: relative; z-index: 1; }

/* Badge animado */
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--accent-cyan-dim);
  border: 1px solid var(--border-cyan);
  border-radius: 100px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 28px;
  animation: fadeSlideDown 0.6s ease both;
}
.hero__badge-dot {
  width: 7px; height: 7px;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 7px var(--accent-cyan);
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.25} }

/* Título */
.hero__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.9rem, 4.5vw, 3.1rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 16px;
  animation: fadeSlideDown 0.6s 0.1s ease both;
}
.hero__title--accent {
  background: linear-gradient(130deg, var(--accent-cyan) 30%, var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  animation: fadeSlideDown 0.6s 0.2s ease both;
}

/* Barra de búsqueda */
.search-wrapper { animation: fadeSlideDown 0.6s 0.3s ease both; }

.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 580px;
  margin: 0 auto;
  background: var(--glass-bg);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 14px 20px;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  transition: border-color var(--t-med), box-shadow var(--t-med);
}
.search-bar:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0,240,255,0.1), var(--shadow-glow-cy);
}
.search-bar__icon {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color var(--t-fast);
}
.search-bar:focus-within .search-bar__icon { color: var(--accent-cyan); }

.search-bar__input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  color: var(--text-primary);
  min-width: 0;
}
.search-bar__input::placeholder { color: var(--text-muted); }
/* Ocultar controles nativos del input[type=search] */
.search-bar__input::-webkit-search-decoration,
.search-bar__input::-webkit-search-cancel-button { display: none; }

.search-bar__kbd {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  padding: 3px 9px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
}

/* ------------------------------------------------------------
   7. FILTROS
------------------------------------------------------------ */
.filters-section {
  padding: 8px 0 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.filters-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.filters-group__label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  white-space: nowrap;
  min-width: 80px;
}
.filters-group__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Botones de categoría */
.filter-btn {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  padding: 6px 16px;
  backdrop-filter: var(--blur);
  white-space: nowrap;
  transition: all var(--t-fast);
}
.filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
}
.filter-btn--active {
  color: var(--accent-cyan) !important;
  background: var(--accent-cyan-dim) !important;
  border-color: var(--border-cyan) !important;
  box-shadow: 0 0 14px rgba(0,240,255,0.14);
}

/* Micro-tags (borde punteado, acento púrpura) */
.tag-btn {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px dashed var(--border-medium);
  border-radius: 100px;
  padding: 4px 12px;
  white-space: nowrap;
  transition: all var(--t-fast);
}
.tag-btn:hover {
  color: var(--accent-purple);
  border-color: rgba(138,43,226,0.45);
  border-style: solid;
  background: var(--accent-purple-dim);
}
.tag-btn--active {
  color: var(--accent-purple) !important;
  border-color: var(--border-purple) !important;
  border-style: solid !important;
  background: var(--accent-purple-dim) !important;
  box-shadow: 0 0 14px rgba(138,43,226,0.14);
}

/* ------------------------------------------------------------
   8. BARRA DE RESULTADOS
------------------------------------------------------------ */
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 26px;
}
.results-bar__count {
  font-size: 0.875rem;
  color: var(--text-muted);
}
.results-bar__count strong {
  color: var(--accent-cyan);
  font-weight: 700;
}
.results-bar__sort {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ------------------------------------------------------------
   9. TOOLS GRID (CSS Grid)
   Vista lista usa .tools-grid--list (Flexbox).
   Razón del cambio: Flexbox column es más predecible
   para ítems de altura variable en una sola dimensión.
------------------------------------------------------------ */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(296px, 1fr));
  gap: 20px;
  padding-bottom: 64px;
}

/* Vista lista: Flexbox column */
.tools-grid--list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ------------------------------------------------------------
   10. TARJETA BASE
   isolation: isolate → crea contexto de apilamiento propio
   para que el spotlight ::before no filtre al padre.
------------------------------------------------------------ */
.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow-card);
  transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med);
  isolation: isolate;
  animation: cardReveal 0.4s ease both;
}
.card:hover {
  transform: translateY(-5px);
  border-color: var(--border-cyan);
  box-shadow: var(--shadow-card), var(--shadow-glow-cy);
}

/* Stagger de entrada para las tarjetas */
.card:nth-child(1)  { animation-delay: 0.04s; }
.card:nth-child(2)  { animation-delay: 0.09s; }
.card:nth-child(3)  { animation-delay: 0.14s; }
.card:nth-child(4)  { animation-delay: 0.19s; }
.card:nth-child(5)  { animation-delay: 0.24s; }
.card:nth-child(6)  { animation-delay: 0.29s; }
.card:nth-child(7)  { animation-delay: 0.34s; }
.card:nth-child(8)  { animation-delay: 0.38s; }
.card:nth-child(9)  { animation-delay: 0.42s; }
.card:nth-child(10) { animation-delay: 0.46s; }
.card:nth-child(11) { animation-delay: 0.50s; }
.card:nth-child(12) { animation-delay: 0.54s; }
.card:nth-child(13) { animation-delay: 0.58s; }
.card:nth-child(14) { animation-delay: 0.62s; }

/* Pseudo-elemento para el efecto Spotlight.
   El gradiente se actualiza via CSS custom property --spotlight
   inyectada por JS en cada mousemove. */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--spotlight, transparent);
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.card:hover::before { opacity: 1; }

/* Imagen de la tarjeta */
.card__img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  z-index: 1;
}
.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}
.card:hover .card__img { transform: scale(1.06); }

/* Badge de categoría sobre la imagen */
.card__category-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 3px 10px;
  border-radius: 100px;
  backdrop-filter: blur(8px);
}
/* Colores por categoría */
.badge--imagen { background: var(--accent-cyan);   color: var(--bg-primary); }
.badge--video  { background: #ff4757;              color: #fff; }
.badge--musica { background: #2ed573;              color: var(--bg-primary); }
.badge--texto  { background: #ffa502;              color: var(--bg-primary); }
.badge--codigo { background: var(--accent-purple); color: #fff; }

/* Cuerpo de la tarjeta */
.card__body {
  padding: 18px 20px 20px;
  position: relative;
  z-index: 1;
}
.card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.card__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.card__free-badge {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #2ed573;
  background: rgba(46,213,115,0.12);
  border: 1px solid rgba(46,213,115,0.3);
  border-radius: 100px;
  padding: 2px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.card__description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 16px;
}
.card__tag {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.67rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 2px 8px;
}
.card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
.card__price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.card__price-premium { color: var(--accent-purple); font-weight: 700; }
.card__cta {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: var(--accent-cyan-dim);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  white-space: nowrap;
}
.card__cta:hover {
  background: var(--accent-cyan);
  color: var(--bg-primary);
  box-shadow: var(--accent-cyan-glow);
}

/* ------------------------------------------------------------
   11. TARJETA PATROCINADA (BENTO BOX)
   En vista grid: span 2 columnas, layout horizontal (imagen|contenido).
   En vista lista: 1 columna, layout vertical (imagen arriba, contenido abajo).
   En móvil: siempre vertical.
------------------------------------------------------------ */
.card--sponsored {
  grid-column: span 2;
  border-color: var(--border-purple);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(138,43,226,0.08) 100%);
  box-shadow: var(--shadow-card), 0 0 30px rgba(138,43,226,0.12);
}
.card--sponsored:hover {
  border-color: var(--accent-purple);
  box-shadow: var(--shadow-card), var(--accent-purple-glow);
}

/* Wrapper bento: flex row en desktop, column en tablet/móvil */
.card__bento {
  display: flex;
  flex-direction: row;
  height: 100%;
}
.card--sponsored .card__img-wrapper {
  width: 42%;
  flex-shrink: 0;
  aspect-ratio: unset;
  min-height: 230px;
}
.card--sponsored .card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px 28px;
}
.card--sponsored .card__title { font-size: 1.25rem; }
.card--sponsored .card__description { -webkit-line-clamp: 3; }

/* Badge "Patrocinado" */
.card__sponsored-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.63rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-purple);
  background: var(--accent-purple-dim);
  border: 1px solid var(--border-purple);
  border-radius: 100px;
  padding: 3px 10px;
  margin-bottom: 10px;
}

/* ------------------------------------------------------------
   12. VISTA DE LISTA
   Las tarjetas se convierten en filas horizontales.
   La patrocinada recupera layout vertical (100% ancho).
------------------------------------------------------------ */
.tools-grid--list .card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  max-height: 150px;
}
.tools-grid--list .card__img-wrapper {
  width: 210px;
  min-width: 210px;
  flex-shrink: 0;
  aspect-ratio: unset;
}
.tools-grid--list .card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 18px;
}
.tools-grid--list .card__description {
  margin-bottom: 0;
  -webkit-line-clamp: 1;
}
.tools-grid--list .card__tags { margin-bottom: 0; }

/* La patrocinada en lista: vuelve a layout vertical normal */
.tools-grid--list .card--sponsored {
  max-height: none;
  flex-direction: column;
}
.tools-grid--list .card--sponsored .card__bento {
  flex-direction: column;
}
.tools-grid--list .card--sponsored .card__img-wrapper {
  width: 100%;
  min-width: unset;
  aspect-ratio: 21 / 6;
  max-height: 180px;
}
.tools-grid--list .card--sponsored .card__body {
  padding: 20px 24px;
}

/* ------------------------------------------------------------
   13. ESTADO VACÍO
------------------------------------------------------------ */
.empty-state {
  text-align: center;
  padding: 80px 20px 100px;
}
.empty-state__icon { font-size: 3rem; margin-bottom: 18px; opacity: 0.45; }
.empty-state__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.empty-state__text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 26px;
}

/* ------------------------------------------------------------
   14. BOTONES GENÉRICOS
------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 11px 26px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.btn--primary {
  background: var(--accent-cyan);
  color: var(--bg-primary);
  border-color: var(--accent-cyan);
}
.btn--primary:hover {
  box-shadow: var(--accent-cyan-glow);
  transform: translateY(-2px);
}
.btn--premium {
  background: linear-gradient(135deg, var(--accent-purple), #b44af0);
  color: #fff;
  border-color: var(--accent-purple);
}
.btn--premium:hover {
  box-shadow: var(--accent-purple-glow);
  transform: translateY(-2px);
}
.btn--secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border-color: var(--border-medium);
  backdrop-filter: var(--blur);
}
.btn--secondary:hover {
  color: var(--text-primary);
  border-color: var(--border-cyan);
}

/* ------------------------------------------------------------
   15. MODAL
------------------------------------------------------------ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  opacity: 0;
  transition: opacity var(--t-med);
}
.modal-overlay[hidden] { display: none; }
.modal-overlay--visible { opacity: 1; }

.modal {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 28px 70px rgba(0,0,0,0.55), 0 0 0 1px var(--border-subtle);
  transform: translateY(24px) scale(0.97);
  transition: transform var(--t-med);
  scrollbar-width: thin;
  scrollbar-color: var(--border-medium) transparent;
}
.modal-overlay--visible .modal { transform: translateY(0) scale(1); }

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}
.modal__close:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* Hero del modal */
.modal__hero {
  width: 100%;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.modal__hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Body del modal */
.modal__body { padding: 28px 32px 32px; }
.modal__category-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-cyan);
  margin-bottom: 6px;
}
.modal__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 12px;
}
.modal__desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}
.modal__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 26px;
}
.modal__tag {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 4px 11px;
}

/* Grid de precios */
.modal__pricing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 26px;
}
.pricing-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}
.pricing-card--premium {
  border-color: var(--border-purple);
  background: linear-gradient(135deg, var(--bg-tertiary), rgba(138,43,226,0.08));
}
.pricing-card__plan {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.pricing-card--premium .pricing-card__plan { color: var(--accent-purple); }
.pricing-card__price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.pricing-card__detail {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Acciones del modal */
.modal__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.modal__actions .btn { flex: 1; min-width: 140px; }

/* ------------------------------------------------------------
   16. FOOTER
------------------------------------------------------------ */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 32px 0;
  margin-top: 12px;
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}
.footer__copy {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  flex: 1;
}
.footer__links { display: flex; gap: 20px; }
.footer__links a {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--t-fast);
}
.footer__links a:hover { color: var(--accent-cyan); }

/* ------------------------------------------------------------
   17. ANIMACIONES
------------------------------------------------------------ */
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Scrollbar personalizado */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 3px; }

/* ------------------------------------------------------------
   18. RESPONSIVE
------------------------------------------------------------ */

/* Tablet: la tarjeta patrocinada pierde el span 2 y el bento horizontal */
@media (max-width: 860px) {
  .card--sponsored { grid-column: span 1; }
  .card__bento { flex-direction: column; }
  .card--sponsored .card__img-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: unset;
  }
  .nav { display: none; }
}

/* Móvil */
@media (max-width: 620px) {
  :root { --pad: 16px; }

  .hero { padding: 52px 0 44px; }

  .tools-grid { grid-template-columns: 1fr; }

  /* En lista móvil, las tarjetas vuelven a ser verticales */
  .tools-grid--list .card {
    flex-direction: column;
    max-height: none;
  }
  .tools-grid--list .card__img-wrapper {
    width: 100%;
    min-width: unset;
    aspect-ratio: 16 / 9;
  }
  .tools-grid--list .card__body { padding: 14px 16px; }

  .modal__body { padding: 20px; }
  .modal__pricing { grid-template-columns: 1fr; }
  .modal__actions { flex-direction: column; }
  .modal__actions .btn { min-width: unset; }

  .footer__inner { flex-direction: column; text-align: center; }
  .footer__links { justify-content: center; }

  .search-bar__kbd { display: none; }
  .results-bar { flex-direction: column; align-items: flex-start; gap: 4px; }
  .filters-group__label { min-width: unset; width: 100%; }
  .header__inner { gap: 14px; }
}

/* ============================================================
   NUEVAS FEATURES v2.0
   Rating ★ · Favoritos ❤ · URL Share · Toast
============================================================ */

/* ------------------------------------------------------------
   RATING DE ESTRELLAS
   Color cálido dorado para llenas, gris para vacías.
   La media estrella usa un gradiente left-to-right.
------------------------------------------------------------ */
.card__rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.stars {
  display: flex;
  align-items: center;
  gap: 1px;
  line-height: 1;
}

.star {
  font-size: 0.82rem;
  line-height: 1;
}
.star--full  { color: #f59e0b; }
.star--half  {
  color: transparent;
  background: linear-gradient(to right, #f59e0b 50%, var(--text-muted) 50%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.star--empty { color: var(--text-muted); opacity: 0.5; }

.stars__value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: #f59e0b;
  margin-left: 2px;
}

.stars__reviews {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Rating en modal (más grande) */
.modal__rating {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.modal__rating .stars { gap: 2px; }
.modal__rating .star  { font-size: 1rem; }
.modal__rating .stars__value {
  font-size: 0.9rem;
  margin-left: 4px;
}
.modal__reviews {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ------------------------------------------------------------
   BOTÓN FAVORITO EN TARJETA
   Absoluto sobre la imagen, top-right.
   Corazón SVG: contorno inactivo, relleno activo.
------------------------------------------------------------ */
.card__fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  color: var(--text-muted);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all var(--t-fast);
  cursor: pointer;
}

.card__fav-btn:hover {
  color: #ff4b7c;
  border-color: rgba(255, 75, 124, 0.5);
  background: rgba(255, 75, 124, 0.12);
  transform: scale(1.12);
}

/* Estado activo: corazón lleno */
.card__fav-btn--active {
  color: #ff4b7c !important;
  border-color: rgba(255, 75, 124, 0.5) !important;
  background: rgba(255, 75, 124, 0.15) !important;
  box-shadow: 0 0 12px rgba(255, 75, 124, 0.35);
}

[data-theme="light"] .card__fav-btn {
  background: rgba(255, 255, 255, 0.75);
  border-color: var(--border-medium);
}

/* ------------------------------------------------------------
   BOTÓN FAVORITO EN MODAL
------------------------------------------------------------ */
.modal__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modal__fav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  cursor: pointer;
  transition: all var(--t-fast);
}
.modal__fav-btn:hover {
  color: #ff4b7c;
  border-color: rgba(255, 75, 124, 0.45);
  background: rgba(255, 75, 124, 0.1);
}
.modal__fav-btn--active {
  color: #ff4b7c !important;
  border-color: rgba(255, 75, 124, 0.5) !important;
  background: rgba(255, 75, 124, 0.12) !important;
}

/* ------------------------------------------------------------
   BOTÓN "FAVORITOS" EN FILTROS
------------------------------------------------------------ */
.filter-btn--favs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted) !important;
  border-color: var(--border-subtle) !important;
}
.filter-btn--favs svg { flex-shrink: 0; }

.filter-btn--favs-active {
  color: #ff4b7c !important;
  background: rgba(255, 75, 124, 0.1) !important;
  border-color: rgba(255, 75, 124, 0.45) !important;
  box-shadow: 0 0 14px rgba(255, 75, 124, 0.15) !important;
}
.filter-btn--favs-active svg {
  fill: currentColor;
}

/* Badge contador de favoritos */
.favs-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  background: #ff4b7c;
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: 100px;
  padding: 0 5px;
  line-height: 1;
}

/* ------------------------------------------------------------
   BOTÓN COMPARTIR URL (results bar)
------------------------------------------------------------ */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  transition: all var(--t-fast);
  cursor: pointer;
  flex-shrink: 0;
}
.share-btn:hover {
  color: var(--accent-cyan);
  border-color: var(--border-cyan);
  background: var(--accent-cyan-dim);
}

/* ------------------------------------------------------------
   TOAST DE NOTIFICACIÓN
   Aparece desde abajo con clase --visible.
------------------------------------------------------------ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 11px 22px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}
.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
