/* ============================================================
   ZUVELO.CO — Design System
   styles.css · Fase 1 · Fundación
   
   REGLA: Este archivo controla SOLO el diseño visual.
   No importa lógica. No importa JS.
   Modificar aquí NO afecta el comportamiento de la app.
   ============================================================ */

/* ── 1. TOKENS & VARIABLES ── */
:root {
  /* Paleta principal */
  --color-bg:           #F5F3EE;        /* Crudo cálido — fondo base */
  --color-surface:      #FFFFFF;        /* Blanco limpio — cards, panels */
  --color-surface-alt:  #EDE9E1;        /* Gris arena — fondos secundarios */
  --color-border:       #D8D2C6;        /* Borde suave */
  --color-border-strong:#B5ADA0;        /* Borde énfasis */

  /* Paleta acento */
  --color-primary:      #2A4D3E;        /* Verde bosque — CTA principal */
  --color-primary-hover:#1E3A2E;
  --color-primary-light:#EAF2EE;        /* Fondo suave primary */
  --color-accent:       #D4A843;        /* Ámbar — destacados, boost */
  --color-accent-hover: #B88C30;
  --color-accent-light: #FBF3DC;

  /* Estados semánticos */
  --color-success:      #27AE60;
  --color-success-bg:   #E8F8EF;
  --color-warning:      #E67E22;
  --color-warning-bg:   #FEF3E7;
  --color-danger:       #C0392B;
  --color-danger-bg:    #FDECEB;
  --color-info:         #2980B9;
  --color-info-bg:      #EBF5FB;

  /* Tipografía */
  --color-text-primary:   #1A1814;
  --color-text-secondary: #6B6560;
  --color-text-tertiary:  #9C958E;
  --color-text-inverse:   #FFFFFF;
  --color-text-link:      #2A4D3E;

  /* ── Tipografía ── */
  --font-display:   'Playfair Display', 'Georgia', serif;   /* Titulares */
  --font-body:      'DM Sans', 'Helvetica Neue', sans-serif; /* Cuerpo */
  --font-mono:      'JetBrains Mono', 'Courier New', monospace; /* Precios, códigos */

  --text-xs:    0.6875rem;   /* 11px */
  --text-sm:    0.8125rem;   /* 13px */
  --text-base:  0.9375rem;   /* 15px */
  --text-md:    1.0625rem;   /* 17px */
  --text-lg:    1.25rem;     /* 20px */
  --text-xl:    1.5rem;      /* 24px */
  --text-2xl:   1.875rem;    /* 30px */
  --text-3xl:   2.375rem;    /* 38px */
  --text-4xl:   3rem;        /* 48px */

  --weight-regular: 400;
  --weight-medium:  500;
  --weight-semibold:600;
  --weight-bold:    700;

  --leading-tight:  1.15;
  --leading-snug:   1.35;
  --leading-normal: 1.55;
  --leading-relaxed:1.75;

  /* ── Espaciado ── */
  --space-1:  0.25rem;   /* 4px */
  --space-2:  0.5rem;    /* 8px */
  --space-3:  0.75rem;   /* 12px */
  --space-4:  1rem;      /* 16px */
  --space-5:  1.25rem;   /* 20px */
  --space-6:  1.5rem;    /* 24px */
  --space-8:  2rem;      /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */
  --space-24: 6rem;      /* 96px */

  /* ── Grilla ── */
  --grid-cols: 12;
  --grid-gap:  1.5rem;
  --container-sm:  640px;
  --container-md:  768px;
  --container-lg:  1024px;
  --container-xl:  1280px;
  --container-2xl: 1440px;
  --container-pad: clamp(1rem, 4vw, 2rem);

  /* ── Radios ── */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  24px;
  --radius-full: 9999px;

  /* ── Sombras ── */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.06);
  --shadow-sm:  0 2px 6px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.12);
  --shadow-xl:  0 16px 48px rgba(0,0,0,0.14);
  --shadow-card:0 2px 8px rgba(42,77,62,0.08);

  /* ── Transiciones ── */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;
  --transition-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ── Layout ── */
  --header-height:    64px;
  --nav-height:       48px;
  --sidebar-width:    260px;
  --footer-height:    auto;
  --z-below:    -1;
  --z-base:      0;
  --z-raised:   10;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-overlay:  300;
  --z-modal:    400;
  --z-toast:    500;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover { color: var(--color-primary-hover); }

ul, ol { list-style: none; }

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: var(--font-body);
  font-size: var(--text-base);
}

/* ── 3. SISTEMA DE GRILLA ── */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.container--sm  { max-width: var(--container-sm); }
.container--md  { max-width: var(--container-md); }
.container--lg  { max-width: var(--container-lg); }
.container--2xl { max-width: var(--container-2xl); }

.grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), 1fr);
  gap: var(--grid-gap);
}

/* Columnas semánticas */
.col-1  { grid-column: span 1; }
.col-2  { grid-column: span 2; }
.col-3  { grid-column: span 3; }
.col-4  { grid-column: span 4; }
.col-5  { grid-column: span 5; }
.col-6  { grid-column: span 6; }
.col-7  { grid-column: span 7; }
.col-8  { grid-column: span 8; }
.col-9  { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }

/* Flex helpers */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }

/* ── 4. COMPONENTES UI BASE ── */

/* — Botones — */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
  white-space: nowrap;
  transition: all var(--transition-base);
  cursor: pointer;
  text-decoration: none;
  border: 1.5px solid transparent;
  font-family: var(--font-body);
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}
.btn--primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: var(--color-text-inverse);
}

.btn--accent {
  background: var(--color-accent);
  color: var(--color-text-inverse);
  border-color: var(--color-accent);
}
.btn--accent:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: var(--color-text-inverse);
}

.btn--outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn--outline:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: transparent;
}
.btn--ghost:hover {
  background: var(--color-surface-alt);
  color: var(--color-text-primary);
}

.btn--sm { padding: var(--space-2) var(--space-3); font-size: var(--text-xs); }
.btn--lg { padding: var(--space-4) var(--space-8); font-size: var(--text-md); }
.btn--full { width: 100%; }

/* — Badges — */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 1.4;
  white-space: nowrap;
}
.badge--success  { background: var(--color-success-bg);  color: var(--color-success); }
.badge--warning  { background: var(--color-warning-bg);  color: var(--color-warning); }
.badge--danger   { background: var(--color-danger-bg);   color: var(--color-danger);  }
.badge--info     { background: var(--color-info-bg);     color: var(--color-info);    }
.badge--accent   { background: var(--color-accent-light); color: var(--color-accent); }
.badge--primary  { background: var(--color-primary-light); color: var(--color-primary); }
.badge--neutral  { background: var(--color-surface-alt); color: var(--color-text-secondary); }

/* — Cards — */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card--flat { box-shadow: none; }
.card--flat:hover { box-shadow: var(--shadow-sm); transform: none; }

/* — Inputs — */
.input-group { display: flex; flex-direction: column; gap: var(--space-2); }

.input-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
}

.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: var(--text-base);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}
.input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.input::placeholder { color: var(--color-text-tertiary); }

/* — Dividers — */
.divider {
  height: 1px;
  background: var(--color-border);
  width: 100%;
}

/* ── 5. LAYOUT ESTRUCTURAL ── */

/* — Header — */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  width: 100%;
}

/* — Category Nav — */
.category-nav {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  position: sticky;
  top: var(--header-height);
  z-index: calc(var(--z-sticky) - 1);
  overflow: visible; /* ← permite que el submenú salga hacia abajo */
}

/* — Main Layout — */
.site-main {
  min-height: calc(100vh - var(--header-height) - var(--nav-height));
  padding-block: var(--space-8);
}

/* Layout con sidebar */
.layout-with-sidebar {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: var(--space-8);
  align-items: start;
}

/* — Footer — */
.site-footer {
  background: var(--color-text-primary);
  color: var(--color-text-inverse);
  padding-block: var(--space-12) var(--space-8);
  margin-top: var(--space-16);
}

/* ── 6. TIPOGRAFÍA UTILITARIA ── */
.text-display {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
}
.text-xs      { font-size: var(--text-xs); }
.text-sm      { font-size: var(--text-sm); }
.text-base    { font-size: var(--text-base); }
.text-md      { font-size: var(--text-md); }
.text-lg      { font-size: var(--text-lg); }
.text-xl      { font-size: var(--text-xl); }
.text-2xl     { font-size: var(--text-2xl); }
.text-3xl     { font-size: var(--text-3xl); }
.text-4xl     { font-size: var(--text-4xl); }

.text-primary   { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-tertiary  { color: var(--color-text-tertiary); }
.text-accent    { color: var(--color-accent); }
.text-success   { color: var(--color-success); }
.text-danger    { color: var(--color-danger); }

.font-regular  { font-weight: var(--weight-regular); }
.font-medium   { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold     { font-weight: var(--weight-bold); }

/* ── 7. SPACERS UTILITARIOS ── */
.mt-2  { margin-top: var(--space-2); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }
.p-4   { padding: var(--space-4); }
.p-6   { padding: var(--space-6); }
.p-8   { padding: var(--space-8); }
.px-4  { padding-inline: var(--space-4); }
.px-6  { padding-inline: var(--space-6); }
.py-4  { padding-block: var(--space-4); }
.py-6  { padding-block: var(--space-6); }

/* ── 8. ESTADOS VACÍOS (SKELETONS) ── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-surface-alt) 0%,
    var(--color-border) 50%,
    var(--color-surface-alt) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── 9. TOAST / NOTIFICACIONES ── */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--color-text-primary);
  color: var(--color-text-inverse);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  animation: toast-in var(--transition-spring) forwards;
  min-width: 240px;
  max-width: 380px;
}

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

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0);    max-height: 80px; margin-bottom: var(--space-2); }
  to   { opacity: 0; transform: translateX(110%); max-height: 0;    margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
}

/* ── 10. RESPONSIVE BREAKPOINTS ── */
/* Mobile first: base = mobile */
/* > 640px  → sm  */
/* > 768px  → md  */
/* > 1024px → lg  */
/* > 1280px → xl  */

@media (max-width: 1023px) {
  :root {
    --sidebar-width: 220px;
    --grid-gap: 1rem;
  }
  .layout-with-sidebar {
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: var(--space-6);
  }
}

@media (max-width: 767px) {
  :root {
    --header-height: 56px;
    --nav-height: 44px;
    --container-pad: 1rem;
  }
  .layout-with-sidebar {
    grid-template-columns: 1fr;
  }
  /* En mobile la sidebar se esconde por defecto — app.js la gestiona */
  .sidebar {
    display: none;
  }
  .sidebar.is-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: var(--z-overlay);
    background: var(--color-surface);
    overflow-y: auto;
    padding: var(--space-6);
  }
  .col-6, .col-4, .col-3 { grid-column: span 12; }
  .col-8, .col-9          { grid-column: span 12; }
}

@media (max-width: 479px) {
  .btn--lg { padding: var(--space-3) var(--space-6); font-size: var(--text-base); }
}

/* ── 11. ACCESIBILIDAD ── */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── 12. SCROLLBAR CUSTOM ── */
::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: var(--color-bg); }
::-webkit-scrollbar-thumb  { background: var(--color-border-strong); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-tertiary); }

/* ── 13. COMPONENTES ESPECÍFICOS FASE 1 ── */

/* — Logo — */
.logo-placeholder {
  display: flex;
  align-items: baseline;
  gap: 1px;
}
.logo-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-2xl);
  color: var(--color-primary);
  line-height: 1;
}
.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  color: var(--color-text-primary);
  line-height: 1;
}
.logo-tld { color: var(--color-text-tertiary); font-size: var(--text-lg); }

/* — Header Search — */
.header-search { flex: 1; max-width: 540px; }
.search-wrapper {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.search-wrapper:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.search-icon {
  flex-shrink: 0;
  margin-left: var(--space-4);
  color: var(--color-text-tertiary);
}
.search-input {
  border: none !important;
  box-shadow: none !important;
  background: transparent;
  flex: 1;
  border-radius: 0;
}
.search-input:focus { box-shadow: none !important; }
.search-btn {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  flex-shrink: 0;
}

/* — Header Actions — */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}
.icon-btn {
  padding: var(--space-2);
  position: relative;
}
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  background: var(--color-danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* — Lang selector — */
.lang-selector { display: flex; align-items: center; gap: var(--space-1); }
.lang-btn {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-tertiary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.lang-btn.is-active { color: var(--color-primary); background: var(--color-primary-light); }
.lang-btn:hover:not(.is-active) { color: var(--color-text-primary); }
.lang-divider { color: var(--color-border-strong); font-size: var(--text-xs); }

/* — Header scrolled state — */
.site-header.is-scrolled {
  box-shadow: var(--shadow-sm);
}

/* — Category Nav — */
.category-nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  overflow-x: auto;
  overflow-y: visible; /* ← evita que corte el submenú hacia abajo */
  scrollbar-width: none;
  padding-block: var(--space-2);
}
.category-nav-list::-webkit-scrollbar { display: none; }

.category-nav-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  white-space: nowrap;
  transition: all var(--transition-fast);
  cursor: pointer;
  background: transparent;
  border: 1.5px solid transparent;
}
.category-nav-item:hover {
  background: var(--color-surface);
  color: var(--color-text-primary);
  border-color: var(--color-border);
}
.category-nav-item.is-active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* — Sidebar — */
.sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  position: sticky;
  top: calc(var(--header-height) + var(--nav-height) + var(--space-4));
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-title {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sidebar-footer { margin-top: var(--space-2); }

/* — Filter Groups — */
.filter-group { display: flex; flex-direction: column; gap: var(--space-3); }
.filter-group__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
}
.price-range-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.filter-quick-prices { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.filter-checklist { display: flex; flex-direction: column; gap: var(--space-2); }
.filter-check-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
}
.filter-check-label:hover { color: var(--color-text-primary); }
.filter-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* — Listings Toolbar — */
.listings-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  gap: var(--space-3);
}
.listings-count { flex: 1; }

/* — Listings Grid — */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-8);
}

/* — Listing Card — estilos en sección Fase 3 más abajo — */

/* — Paginación — */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}
.pagination-info { text-align: center; }

/* — View toggle — */
.view-toggle { display: flex; gap: var(--space-1); }

/* — Mobile Nav — */
.mobile-nav {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding-block: var(--space-4);
}
.mobile-nav.is-open { display: block; }
.mobile-nav-list { display: flex; flex-direction: column; gap: var(--space-1); }
.mobile-nav-link {
  display: block;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-weight: var(--weight-medium);
  color: var(--color-text-primary);
  transition: background var(--transition-fast);
}
.mobile-nav-link:hover { background: var(--color-surface-alt); color: var(--color-text-primary); }
.mobile-nav-link--cta { color: var(--color-primary); font-weight: var(--weight-semibold); }

/* — Sidebar overlay mobile — */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: calc(var(--z-overlay) - 1);
  backdrop-filter: blur(2px);
}
.sidebar-overlay.is-active { display: block; }

/* — Mobile specific — */
.mobile-only { display: none; }
@media (max-width: 767px) {
  .mobile-only { display: inline-flex; }
  .desktop-only { display: none; }
  .listings-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
  .header-search { display: none; } /* Se mueve a segunda línea en Fase 2 */
  .lang-selector  { display: none; }
}
@media (max-width: 479px) {
  .listings-grid { grid-template-columns: 1fr; }
}

/* — Footer — */
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-12);
}
.footer-logo { display: flex; align-items: baseline; gap: 1px; margin-bottom: var(--space-3); }
.footer-tagline { color: var(--color-text-tertiary); font-size: var(--text-sm); max-width: 240px; }
.footer-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-8); }
.footer-nav-col { display: flex; flex-direction: column; gap: var(--space-3); }
.footer-nav-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-1);
}
.footer-nav-link {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  transition: color var(--transition-fast);
  line-height: var(--leading-relaxed);
}
.footer-nav-link:hover { color: white; }

@media (max-width: 767px) {
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-8); }
  .footer-nav  { grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
}
@media (max-width: 479px) {
  .footer-nav  { grid-template-columns: 1fr; }
}

/* ── 14. LOCATION SELECTOR ── */
.location-selector {
  position: relative;
}

.location-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  transition: all var(--transition-fast);
  background: var(--color-surface);
  white-space: nowrap;
  max-width: 160px;
}
.location-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.location-btn.is-active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.location-icon {
  flex-shrink: 0;
  color: var(--color-text-secondary);
}
.location-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100px;
}
.location-chevron {
  flex-shrink: 0;
  transition: transform var(--transition-fast);
  color: var(--color-text-tertiary);
}
.location-btn[aria-expanded="true"] .location-chevron {
  transform: rotate(180deg);
}

/* Dropdown */
.location-dropdown {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  width: 220px;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: dropdown-in var(--transition-base) ease;
}
.location-dropdown[hidden] { display: none; }

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.location-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  text-align: left;
  transition: background var(--transition-fast);
  cursor: pointer;
  background: transparent;
}
.location-option:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.location-option.is-selected {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: var(--weight-semibold);
}
.location-option--detect {
  color: var(--color-primary);
  font-weight: var(--weight-medium);
}
.location-option--detect:hover {
  background: var(--color-primary-light);
}

.location-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-1) 0;
}
.location-group-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-tertiary);
  padding: var(--space-2) var(--space-3) var(--space-1);
}

/* Mobile: ocultar label, solo icono */
@media (max-width: 1023px) {
  .location-label { display: none; }
  .location-chevron { display: none; }
  .location-btn { max-width: none; padding: var(--space-2); border-radius: var(--radius-md); }
  .location-dropdown { right: 0; left: auto; }
}
@media (max-width: 767px) {
  .location-selector { display: none; }
}

/* ── 15. CAMBIOS FASE 1 v2 — Iconos, Ads, Logo ── */

/* — Logo con eslogan — */
.logo {
  display: flex;
  flex-direction: column;
  gap: 0;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-row {
  display: flex;
  align-items: baseline;
  gap: 1px;
}
.logo-slogan {
  font-size: 9px;
  font-weight: 500;
  font-style: italic;
  color: var(--color-text-tertiary);
  letter-spacing: .06em;
  line-height: 1;
  margin-top: 2px;
  padding-left: 1px;
}

/* — Iconos header — */
.icon-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 42px;
  height: 42px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
  font-family: var(--font-body);
}
.icon-btn:hover {
  background: var(--color-surface-alt);
  color: var(--color-text-primary);
}
.icon-lang-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--color-text-secondary);
  line-height: 1;
  transition: color var(--transition-fast);
}
.icon-btn:hover .icon-lang-label { color: var(--color-text-primary); }

/* Badge numérico en iconos */
.icon-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--color-primary);
  color: white;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-body);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid var(--color-surface);
}

/* Separador vertical en header */
.icon-sep {
  width: 1px;
  height: 20px;
  background: var(--color-border);
  margin: 0 4px;
  flex-shrink: 0;
}

/* — Dropdown idioma — */
.lang-dropdown-wrap { position: relative; }
.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  min-width: 130px;
  z-index: var(--z-dropdown);
  display: none;
  flex-direction: column;
  gap: 2px;
  animation: dropdown-in var(--transition-base) ease;
}
.lang-dropdown.is-open { display: flex; }
.lang-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  cursor: pointer;
  background: transparent;
  border: none;
  font-family: var(--font-body);
  transition: background var(--transition-fast);
  text-align: left;
  width: 100%;
}
.lang-option:hover { background: var(--color-primary-light); color: var(--color-primary); }
.lang-option.is-active { color: var(--color-primary); font-weight: var(--weight-semibold); }

/* — Cards boost: bordes especiales (imagen ahora es __img-wrap, ver Fase 3) — */
/* Boosted TOP — borde ámbar */
.listing-card.is-top {
  border-color: var(--color-accent);
  border-width: 1.5px;
}
/* Boosted FEATURED — borde verde */
.listing-card.is-featured {
  border-color: var(--color-primary);
  border-width: 1.5px;
}

/* — Banner más suave — */
.featured-banner {
  background: linear-gradient(135deg, #3D6B57 0%, #4A7F68 55%, #5A9478 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  position: relative;
  overflow: hidden;
}
.featured-banner::before {
  content: '';
  position: absolute;
  right: -30px; top: -30px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
}
.banner-cta-soft {
  background: rgba(255,255,255,0.18);
  border: 1.5px solid rgba(255,255,255,0.35);
  color: #fff;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-5);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background var(--transition-fast);
  backdrop-filter: blur(4px);
}
.banner-cta-soft:hover { background: rgba(255,255,255,0.28); }

/* — AD 3: Sidebar sticky block — */
.ad-sidebar {
  background: var(--color-surface-alt);
  border: 1.5px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 200px;
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: var(--text-xs);
}
.ad-sidebar__label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: var(--color-border);
  color: var(--color-text-tertiary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* — AD 2: Card nativa en el grid — */
.listing-card.is-ad {
  border: 1.5px dashed var(--color-border-strong);
  background: var(--color-surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 220px;
  color: var(--color-text-tertiary);
  font-size: var(--text-xs);
  text-align: center;
  box-shadow: none;
  cursor: default;
}
.listing-card.is-ad:hover { transform: none; box-shadow: none; }
.listing-card.is-ad .ad-native-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: var(--color-border);
  color: var(--color-text-tertiary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* ══════════════════════════════════════════════
   FASE 2 — Header & Navegación
   styles.css · Solo diseño, sin lógica
══════════════════════════════════════════════ */

/* ── BUSCADOR MEJORADO CON SELECTOR DE CATEGORÍA ── */
.header-search { flex: 1; max-width: 560px; }

.search-wrapper {
  display: flex;
  align-items: center;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  height: 42px;
}
.search-wrapper:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* Selector de categoría dentro del buscador */
.search-cat-select {
  border: none;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  padding: 0 var(--space-3);
  height: 100%;
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
  min-width: 100px;
  max-width: 130px;
}
.search-cat-select:focus { color: var(--color-primary); }

.search-icon {
  flex-shrink: 0;
  margin-left: var(--space-3);
  color: var(--color-text-tertiary);
}
.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  outline: none;
  padding: 0 var(--space-2);
  min-width: 0;
}
.search-input::placeholder { color: var(--color-text-tertiary); }
.search-btn {
  border-radius: 0;
  height: 100%;
  padding: 0 var(--space-5);
  flex-shrink: 0;
  font-size: var(--text-sm);
  border: none;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.search-btn:hover { background: var(--color-primary-hover); }

/* ── CATEGORÍAS CON SUBCATEGORÍAS ── */
.cat-nav-item { position: relative; }

.cat-chevron {
  font-size: 10px;
  opacity: 0.6;
  margin-left: 1px;
  transition: transform var(--transition-fast);
  display: inline-block;
}
.category-nav-item[aria-expanded="true"] .cat-chevron {
  transform: rotate(90deg);
}

/* Categoría "Gratis" — color especial */
.cat-gratis { color: var(--color-success) !important; }
.cat-gratis:hover { background: var(--color-success-bg) !important; }
.cat-gratis.is-active {
  background: var(--color-success) !important;
  color: white !important;
}

/* Submenu dropdown */
.cat-submenu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 9999; /* por encima de todo — header, nav, sidebar */
  padding: var(--space-3);
  min-width: 280px;
  animation: dropdown-in var(--transition-base) ease;
}
.cat-submenu[hidden] { display: none; }

.cat-submenu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
.cat-submenu-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}
.cat-submenu-link:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* ── MOBILE NAV COMPLETO ── */
.mobile-nav {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding-block: var(--space-4);
  display: none;
}
.mobile-nav.is-open { display: block; }

.mobile-nav-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-bottom: var(--space-4);
}

/* Buscador mobile */
.mobile-search {
  margin-bottom: var(--space-4);
}
.mobile-search .search-wrapper {
  height: 44px;
  border-radius: var(--radius-lg);
}

/* Categorías mobile */
.mobile-cat-group { border-bottom: 1px solid var(--color-border); }
.mobile-cat-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: none;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--color-text-primary);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
}
.mobile-cat-btn:hover { background: var(--color-surface-alt); }
.mobile-cat-chevron {
  font-size: 12px;
  color: var(--color-text-tertiary);
  transition: transform var(--transition-fast);
}
.mobile-cat-btn[aria-expanded="true"] .mobile-cat-chevron {
  transform: rotate(90deg);
}

.mobile-subcats {
  display: none;
  padding: 0 var(--space-4) var(--space-3) var(--space-8);
  flex-direction: column;
  gap: 2px;
}
.mobile-subcats.is-open { display: flex; }
.mobile-subcat-link {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.mobile-subcat-link:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* Mobile bottom CTAs */
.mobile-nav-ctas {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4) 0;
}
.mobile-nav-ctas .btn { flex: 1; justify-content: center; }

/* ── HEADER SCROLLED ── */
.site-header.is-scrolled { box-shadow: var(--shadow-sm); }

/* ── RESPONSIVE FASE 2 ── */
@media (max-width: 1023px) {
  .search-cat-select { display: none; }
  .header-search { max-width: 400px; }
}

@media (max-width: 767px) {
  .header-search { display: none; } /* se mueve al mobile nav */
  .cat-submenu   { display: none !important; } /* se usa mobile nav */
  .category-nav  { display: none; } /* reemplazado por mobile nav */
}


/* ══════════════════════════════════════════════
   PRICE RANGE SLIDER DOBLE
══════════════════════════════════════════════ */

/* Valores mostrados encima */
.price-range-display {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.price-range-display__val {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-primary);
  min-width: 56px;
}
.price-range-display__val:last-child { text-align: right; flex: 1; }
.price-range-display__sep {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}

/* Contenedor del track + thumbs */
.price-range-track-wrap {
  position: relative;
  height: 36px;
  display: flex;
  align-items: center;
  margin-bottom: var(--space-3);
}

/* Track visual */
.price-range-track {
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  pointer-events: none;
}

/* Relleno entre los dos thumbs */
.price-range-fill {
  position: absolute;
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  left: 0%;
  right: 0%;
}

/* Los dos inputs range — superpuestos */
.price-range-input {
  position: absolute;
  left: 0; right: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  border: none;
  outline: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

/* Thumb */
.price-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2.5px solid var(--color-primary);
  cursor: pointer;
  pointer-events: all;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.price-range-input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2.5px solid var(--color-primary);
  cursor: pointer;
  pointer-events: all;
  box-shadow: var(--shadow-sm);
}
.price-range-input::-webkit-slider-thumb:hover,
.price-range-input:active::-webkit-slider-thumb {
  transform: scale(1.2);
  box-shadow: 0 0 0 4px var(--color-primary-light);
}
.price-range-input::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 4px var(--color-primary-light);
}

/* El thumb de min encima cuando colisionan */
.price-range-input--min { z-index: 3; }
.price-range-input--max { z-index: 4; }

   Solo diseño. La lógica vive en app.js
══════════════════════════════════════════════ */

/* — Card base — */
.listing-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
}

/* — Imagen — */
.listing-card__img-wrap {
  position: relative;
  width: 100%;
  padding-top: 68%; /* ratio 3:2 aprox */
  overflow: hidden;
  background: var(--color-surface-alt);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.listing-card__img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.listing-card:hover .listing-card__img-wrap img {
  transform: scale(1.04);
}

/* — Botón favorito — */
.listing-card__fav {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.92);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  transition: all var(--transition-fast);
  backdrop-filter: blur(4px);
  z-index: 2;
}
.listing-card__fav:hover {
  background: white;
  color: var(--color-danger);
  transform: scale(1.1);
}
.listing-card__fav.is-favorited {
  color: var(--color-danger);
  background: white;
}
.listing-card__fav.is-favorited svg {
  fill: var(--color-danger);
}

/* — Badges sobre la imagen — */
.listing-card__badges {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  z-index: 2;
}
.listing-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 1.4;
  white-space: nowrap;
}
.listing-badge--free {
  background: var(--color-success);
  color: white;
}
.listing-badge--top {
  background: var(--color-accent);
  color: white;
}
.listing-badge--featured {
  background: var(--color-primary);
  color: white;
}
.listing-badge--new {
  background: var(--color-info-bg);
  color: var(--color-info);
}

/* — Cuerpo — */
.listing-card__body {
  padding: var(--space-3) var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}

/* — Categoría pill — */
.listing-card__cat {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* — Título — */
.listing-card__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.listing-card:hover .listing-card__title {
  color: var(--color-primary);
}

/* — Precio — */
.listing-card__price {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  line-height: 1;
}
.listing-card__price--free {
  color: var(--color-success);
}

/* — Meta: ciudad + días — */
.listing-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: auto;
}
.listing-card__city {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  display: flex;
  align-items: center;
  gap: 3px;
}
.listing-card__days {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}
.listing-card__days--expiring {
  color: var(--color-warning);
  font-weight: var(--weight-semibold);
}

/* — Condición pill — */
.listing-card__condition {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: var(--weight-semibold);
  background: var(--color-surface-alt);
  color: var(--color-text-secondary);
  width: fit-content;
}

/* — Estado vacío (sin resultados) — */
.listings-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-8);
  text-align: center;
  gap: var(--space-4);
}
.listings-empty__icon {
  font-size: 3rem;
  opacity: .4;
}
.listings-empty__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
}
.listings-empty__sub {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}

   Solo diseño. La lógica vive en app.js
══════════════════════════════════════════════ */

/* Wrapper necesita position:relative para el dropdown */
.header-search { position: relative; }

/* Dropdown de sugerencias */
.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  overflow: hidden;
  animation: dropdown-in var(--transition-base) ease;
  max-height: 420px;
  overflow-y: auto;
}
.search-suggestions[hidden] { display: none; }

/* Grupo: título de sección */
.suggestion-group-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--color-text-tertiary);
  padding: var(--space-3) var(--space-4) var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

/* Item individual */
.suggestion-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--color-border);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover,
.suggestion-item.is-focused {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* Icono del item */
.suggestion-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-alt);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}
.suggestion-item:hover .suggestion-icon,
.suggestion-item.is-focused .suggestion-icon {
  background: var(--color-primary-light);
}

/* Texto con match resaltado */
.suggestion-text { flex: 1; min-width: 0; }
.suggestion-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggestion-item:hover .suggestion-title,
.suggestion-item.is-focused .suggestion-title { color: var(--color-primary); }

.suggestion-title mark {
  background: transparent;
  color: var(--color-primary);
  font-weight: var(--weight-bold);
}
.suggestion-meta {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  margin-top: 1px;
}
.suggestion-price {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-primary);
  flex-shrink: 0;
}
.suggestion-price.free { color: var(--color-success); }

/* Footer del dropdown */
.suggestion-footer {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  text-align: center;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}
.suggestion-footer strong { color: var(--color-primary); cursor: pointer; }
.suggestion-footer strong:hover { text-decoration: underline; }

/* Estado vacío */
.suggestion-empty {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: var(--text-sm);
}

/* Categoría pill en la meta */
.suggestion-cat-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--color-surface-alt);
  color: var(--color-text-tertiary);
  font-size: 10px;
  font-weight: var(--weight-medium);
  margin-right: var(--space-1);
}

/* ══════════════════════════════════════════════
   FASE 4 — Auth Panel
   Panel lateral deslizante · login · registro · perfil
══════════════════════════════════════════════ */

/* — Overlay — */
.auth-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: calc(var(--z-modal) - 1);
  backdrop-filter: blur(2px);
  animation: fade-in 200ms ease;
}
.auth-overlay.is-open { display: block; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* — Panel — */
.auth-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100vw;
  height: 100vh;
  background: var(--color-surface);
  z-index: var(--z-modal);
  box-shadow: var(--shadow-xl);
  transform: translateX(100%);
  transition: transform 350ms cubic-bezier(0.32, 0.72, 0, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.auth-panel[hidden] { display: flex; } /* override hidden para animación */
.auth-panel.is-open { transform: translateX(0); }

.auth-panel__inner {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  flex: 1;
}

/* — Header — */
.auth-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.auth-panel__logo {
  display: flex;
  align-items: baseline;
  gap: 2px;
  color: var(--color-primary);
}
.auth-panel__close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.auth-panel__close:hover {
  background: var(--color-surface-alt);
  color: var(--color-text-primary);
}

/* — Tabs — */
.auth-tabs {
  display: flex;
  background: var(--color-surface-alt);
  border-radius: var(--radius-lg);
  padding: 3px;
  gap: 3px;
}
.auth-tab {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  border-radius: calc(var(--radius-lg) - 2px);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-body);
}
.auth-tab.is-active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

/* — Subtítulo — */
.auth-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

/* — Botón Google — */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-google:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* — Divider — */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-tertiary);
  font-size: var(--text-xs);
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

/* — Formulario — */
.auth-form { display: flex; flex-direction: column; gap: var(--space-4); }
.auth-field { display: flex; flex-direction: column; gap: var(--space-2); }
.auth-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.auth-input { background: var(--color-bg); }
.auth-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.auth-input.is-error { border-color: var(--color-danger); }
.auth-input.is-error:focus { box-shadow: 0 0 0 3px var(--color-danger-bg); }

/* Input con botón ojo */
.auth-input-wrap { position: relative; }
.auth-input-wrap .auth-input { padding-right: 2.5rem; }
.auth-toggle-pw {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-tertiary);
  padding: 0;
  display: flex;
  align-items: center;
  transition: color var(--transition-fast);
}
.auth-toggle-pw:hover { color: var(--color-text-primary); }

/* Error field */
.auth-field-error {
  font-size: var(--text-xs);
  color: var(--color-danger);
  min-height: 16px;
  display: block;
}

/* Forgot password */
.auth-forgot {
  font-size: var(--text-xs);
  color: var(--color-primary);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: var(--weight-medium);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-forgot:hover { color: var(--color-primary-hover); }

/* Password strength */
.pw-strength {
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--color-border);
  margin-top: 4px;
  overflow: hidden;
  position: relative;
}
.pw-strength::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: var(--radius-full);
  transition: width 300ms ease, background 300ms ease;
  width: var(--pw-width, 0%);
  background: var(--pw-color, var(--color-danger));
}

/* Submit */
.auth-submit { margin-top: var(--space-2); }

/* Terms checkbox */
.auth-check-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  line-height: var(--leading-relaxed);
}
.auth-link {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Switch tab link */
.auth-switch {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-align: center;
}
.auth-switch-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* — Perfil logueado — */
.auth-profile {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-primary-light);
  border-radius: var(--radius-lg);
}
.auth-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: white;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.auth-profile__name {
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  color: var(--color-primary);
}
.auth-profile__email {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: 2px;
}
.auth-profile-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.auth-profile-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-primary);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  width: 100%;
  text-align: left;
}
.auth-profile-link:hover {
  background: var(--color-surface-alt);
  color: var(--color-primary);
}
.auth-profile-link--danger { color: var(--color-danger); }
.auth-profile-link--danger:hover {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

/* — Header: icono perfil logueado — */
.icon-btn.is-logged .auth-avatar-mini {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* — Mobile — */
@media (max-width: 767px) {
  .auth-panel { width: 100vw; }
}

.auth-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   DASHBOARD — Estilos extendidos
   Lifecycle de anuncios · Boost states · Stats · Notificaciones
   Solo diseño. Lógica en app.js / inline scripts.
══════════════════════════════════════════════ */

/* ── Tarjeta de anuncio con barra de progreso de ciclo de vida ── */
.dash-listing-card {
  position: relative;
}
.dash-listing-lifecycle {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
  background: var(--color-border);
}
.dash-lifecycle-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}
.dash-lifecycle-bar--active   { background: var(--color-success); }
.dash-lifecycle-bar--warning  { background: var(--color-warning); }
.dash-lifecycle-bar--danger   { background: var(--color-danger); }

/* ── Badge de boost en la tarjeta ── */
.dash-boost-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.dash-boost-badge--top {
  background: var(--color-accent-light);
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}
.dash-boost-badge--featured {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

/* ── Panel de boost en el modal/sidebar ── */
.dash-boost-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.dash-boost-panel__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
}
.dash-boost-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
.dash-boost-option {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--color-surface);
  text-align: left;
  font-family: var(--font-body);
}
.dash-boost-option:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}
.dash-boost-option.is-selected {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}
.dash-boost-option--featured {
  border-color: var(--color-accent);
  position: relative;
}
.dash-boost-option--featured::before {
  content: 'Popular';
  position: absolute;
  top: -10px;
  right: var(--space-3);
  background: var(--color-accent);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
}
.dash-boost-option__name {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
}
.dash-boost-option__price {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
}
.dash-boost-option__desc {
  font-size: 10px;
  color: var(--color-text-tertiary);
  line-height: 1.4;
}

/* ── Stats mejoradas: mini-lista debajo del número ── */
.dash-stat-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: var(--space-1);
}
.dash-stat-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}
.dash-stat-list-val {
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
}

/* ── Sección de notificaciones de email ── */
.dash-email-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}
.dash-email-timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 20px;
  bottom: 20px;
  width: 2px;
  background: var(--color-border);
}
.dash-email-step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  position: relative;
}
.dash-email-step__dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  z-index: 1;
  border: 2px solid var(--color-surface);
}
.dash-email-step__dot--sent     { background: var(--color-success-bg);  color: var(--color-success); }
.dash-email-step__dot--pending  { background: var(--color-surface-alt); color: var(--color-text-tertiary); }
.dash-email-step__dot--warning  { background: var(--color-warning-bg);  color: var(--color-warning); }
.dash-email-step__dot--danger   { background: var(--color-danger-bg);   color: var(--color-danger); }
.dash-email-step__content { flex: 1; }
.dash-email-step__day {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.dash-email-step__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
  margin-top: 1px;
}
.dash-email-step__desc {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  margin-top: 1px;
}

/* ── Acción de Reactivar (anuncio expirado) ── */
.dash-listing-card--expired {
  opacity: 0.7;
  background: var(--color-surface-alt);
}
.dash-listing-card--expired .dash-listing-title {
  color: var(--color-text-tertiary);
  text-decoration: line-through;
}
.dash-reactivate-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-primary);
  background: var(--color-primary-light);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-full);
  padding: 2px var(--space-3);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-body);
}
.dash-reactivate-btn:hover {
  background: var(--color-primary);
  color: white;
}

/* ── Summary bar arriba del dashboard ── */
.dash-summary-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.dash-summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}
.dash-summary-num {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1;
}
.dash-summary-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.dash-summary-item--warning .dash-summary-num { color: var(--color-warning); }
.dash-summary-item--danger  .dash-summary-num { color: var(--color-danger); }
.dash-summary-item--success .dash-summary-num { color: var(--color-success); }

@media (max-width: 500px) {
  .dash-summary-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
  }
  .dash-boost-options { grid-template-columns: 1fr; }
}

/* ── Anuncio relacionado en mensaje: estado cerrado ── */
.msg-listing-ref--closed {
  background: var(--color-surface-alt);
  opacity: 0.85;
}
.msg-listing-ref__closed-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

/* ══════════════════════════════════════════════
   GDPR COOKIE BANNER
   RGPD conforme · ePrivacy Directive · Alemania
   Solo diseño. Lógica en inline script de index.html.
══════════════════════════════════════════════ */

/* ── Backdrop cuando el panel de preferencias está abierto ── */
.cookie-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 498;
  background: rgba(26,24,20,.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: cookie-fade-in .2s ease;
}
.cookie-backdrop.is-open { display: block; }

/* ── Banner principal (bottom bar) ── */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 499;
  padding: var(--space-4) var(--space-6);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 24px rgba(26,24,20,.10);
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.cookie-banner.is-visible { transform: translateY(0); }

.cookie-banner__inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center;
  gap: var(--space-6); flex-wrap: wrap;
}

.cookie-banner__icon {
  font-size: 1.5rem; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  background: var(--color-primary-light);
  border-radius: var(--radius-full);
}

.cookie-banner__text { flex: 1; min-width: 240px; }
.cookie-banner__title {
  font-size: var(--text-sm); font-weight: var(--weight-bold);
  color: var(--color-text-primary); margin-bottom: 3px;
}
.cookie-banner__desc {
  font-size: var(--text-xs); color: var(--color-text-secondary);
  line-height: 1.55;
}
.cookie-banner__desc a {
  color: var(--color-primary); font-weight: var(--weight-semibold);
  text-decoration: underline; text-underline-offset: 2px;
}

.cookie-banner__actions {
  display: flex; align-items: center; gap: var(--space-3);
  flex-shrink: 0; flex-wrap: wrap;
}

.cookie-btn {
  padding: 9px 18px; border-radius: var(--radius-md);
  font-family: var(--font-body); font-size: var(--text-sm);
  font-weight: var(--weight-semibold); cursor: pointer;
  transition: all var(--transition-fast); white-space: nowrap;
  border: 1.5px solid transparent;
}
.cookie-btn--accept {
  background: var(--color-primary); color: white;
  border-color: var(--color-primary);
}
.cookie-btn--accept:hover { background: var(--color-primary-hover); transform: translateY(-1px); }
.cookie-btn--necessary {
  background: var(--color-surface); color: var(--color-text-primary);
  border-color: var(--color-border);
}
.cookie-btn--necessary:hover { border-color: var(--color-border-strong); background: var(--color-surface-alt); }
.cookie-btn--manage {
  background: transparent; color: var(--color-text-secondary);
  border-color: transparent; padding-inline: var(--space-2);
  font-size: var(--text-xs); text-decoration: underline; text-underline-offset: 2px;
}
.cookie-btn--manage:hover { color: var(--color-primary); }

/* ── Panel de preferencias (modal) ── */
.cookie-panel {
  display: none;
  position: fixed; inset: 0; z-index: 500;
  align-items: center; justify-content: center;
  padding: var(--space-4);
}
.cookie-panel.is-open { display: flex; }

.cookie-panel__card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  display: flex; flex-direction: column;
  animation: cookie-slide-up .25s cubic-bezier(.4,0,.2,1);
}

.cookie-panel__head {
  padding: var(--space-6) var(--space-6) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4);
}
.cookie-panel__title {
  font-family: var(--font-display); font-size: var(--text-lg);
  font-weight: var(--weight-bold); color: var(--color-text-primary);
}
.cookie-panel__sub {
  font-size: var(--text-xs); color: var(--color-text-secondary);
  margin-top: 4px; line-height: 1.55;
}
.cookie-panel__close {
  width: 32px; height: 32px; border-radius: var(--radius-full);
  background: var(--color-surface-alt); border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--color-text-secondary);
  flex-shrink: 0; transition: all var(--transition-fast);
}
.cookie-panel__close:hover { background: var(--color-border); color: var(--color-text-primary); }

.cookie-panel__body { padding: var(--space-4) var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); }

/* Categoría individual */
.cookie-cat {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.cookie-cat__head {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--color-bg); cursor: pointer;
  transition: background var(--transition-fast);
}
.cookie-cat__head:hover { background: var(--color-surface-alt); }
.cookie-cat__info { flex: 1; min-width: 0; }
.cookie-cat__name {
  font-size: var(--text-sm); font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
}
.cookie-cat__hint { font-size: var(--text-xs); color: var(--color-text-tertiary); margin-top: 2px; }
.cookie-cat__chevron {
  color: var(--color-text-tertiary); flex-shrink: 0;
  transition: transform var(--transition-fast);
}
.cookie-cat.is-expanded .cookie-cat__chevron { transform: rotate(180deg); }

.cookie-cat__detail {
  display: none; padding: var(--space-3) var(--space-5) var(--space-4);
  background: var(--color-surface);
  font-size: var(--text-xs); color: var(--color-text-secondary);
  line-height: 1.65; border-top: 1px solid var(--color-border);
}
.cookie-cat.is-expanded .cookie-cat__detail { display: block; }

/* Toggle switch */
.cookie-toggle {
  position: relative; width: 40px; height: 22px; flex-shrink: 0;
}
.cookie-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.cookie-toggle__track {
  position: absolute; inset: 0; border-radius: 99px;
  background: var(--color-border); transition: background .2s ease; cursor: pointer;
}
.cookie-toggle input:checked + .cookie-toggle__track { background: var(--color-primary); }
.cookie-toggle input:disabled + .cookie-toggle__track { opacity: .5; cursor: not-allowed; }
.cookie-toggle__thumb {
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: white; transition: transform .2s ease;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.cookie-toggle input:checked ~ .cookie-toggle__thumb { transform: translateX(18px); }

/* Footer del panel */
.cookie-panel__foot {
  padding: var(--space-4) var(--space-6) var(--space-5);
  border-top: 1px solid var(--color-border);
  display: flex; gap: var(--space-3); justify-content: flex-end; flex-wrap: wrap;
}

/* ── Floating re-open button (bottom-right tras aceptar) ── */
.cookie-reopen {
  display: none;
  position: fixed; bottom: var(--space-5); left: var(--space-5);
  z-index: 490;
  width: 44px; height: 44px; border-radius: var(--radius-full);
  background: var(--color-surface); border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  align-items: center; justify-content: center;
  cursor: pointer; color: var(--color-text-secondary);
  transition: all var(--transition-fast); font-size: 18px;
}
.cookie-reopen.is-visible { display: flex; }
.cookie-reopen:hover { border-color: var(--color-primary); color: var(--color-primary); transform: scale(1.08); }

/* ── Animaciones ── */
@keyframes cookie-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes cookie-slide-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ── Mobile ── */
@media (max-width: 640px) {
  .cookie-banner { padding: var(--space-4); }
  .cookie-banner__inner { gap: var(--space-3); }
  .cookie-banner__icon { display: none; }
  .cookie-banner__actions { width: 100%; }
  .cookie-btn--accept, .cookie-btn--necessary { flex: 1; text-align: center; justify-content: center; }
  .cookie-panel__head, .cookie-panel__body, .cookie-panel__foot { padding-inline: var(--space-4); }
}


/* ============================================================
   DASHBOARD & MENSAJES — Estilos movidos desde index.html
   (antes vivían en un <style> inline — ahora centralizados)
   ============================================================ */

/* ── DASHBOARD OVERLAY ── */
.dash-overlay{position:fixed;inset:0;background:rgba(26,24,20,.55);backdrop-filter:blur(4px);z-index:var(--z-modal);display:flex;align-items:center;justify-content:center;padding:var(--space-4);animation:dash-fade-in 220ms ease}
.dash-overlay[hidden]{display:none}
@keyframes dash-fade-in{from{opacity:0}to{opacity:1}}
.dash-panel{background:var(--color-surface);border-radius:var(--radius-2xl);width:100%;max-width:780px;height:90vh;max-height:90vh;display:flex;flex-direction:column;overflow:hidden;box-shadow:var(--shadow-xl);animation:dash-slide-up 280ms cubic-bezier(0.34,1.2,0.64,1)}
@keyframes dash-slide-up{from{transform:translateY(24px);opacity:0}to{transform:translateY(0);opacity:1}}

/* Header */
.dash-header{display:flex;align-items:center;justify-content:space-between;padding:var(--space-5) var(--space-6);border-bottom:1px solid var(--color-border);flex-shrink:0;background:var(--color-primary)}
.dash-header__left{display:flex;align-items:center;gap:var(--space-4)}
.dash-avatar{width:44px;height:44px;border-radius:50%;background:rgba(255,255,255,.2);color:white;display:flex;align-items:center;justify-content:center;font-family:var(--font-display);font-size:var(--text-lg);font-weight:700;flex-shrink:0;border:2px solid rgba(255,255,255,.3)}
.dash-user-name{font-size:var(--text-base);font-weight:700;color:white;line-height:1.2}
.dash-user-email{font-size:var(--text-xs);color:rgba(255,255,255,.65);margin-top:2px}
.dash-close{width:36px;height:36px;border-radius:50%;border:none;background:rgba(255,255,255,.15);color:white;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background var(--transition-fast);flex-shrink:0}
.dash-close:hover{background:rgba(255,255,255,.25)}

/* Tabs */
.dash-tabs{display:flex;border-bottom:1px solid var(--color-border);flex-shrink:0;overflow-x:auto;scrollbar-width:none;background:var(--color-surface)}
.dash-tabs::-webkit-scrollbar{display:none}
.dash-tab{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-4) var(--space-5);font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--color-text-secondary);border:none;background:transparent;cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px;white-space:nowrap;transition:all var(--transition-fast)}
.dash-tab:hover{color:var(--color-primary)}
.dash-tab.is-active{color:var(--color-primary);font-weight:var(--weight-semibold);border-bottom-color:var(--color-primary)}
.dash-tab__badge{font-size:10px;font-weight:700;background:var(--color-danger);color:white;border-radius:var(--radius-full);padding:1px 6px;min-width:18px;text-align:center}

/* Body */
.dash-body{flex:1;overflow-y:auto;background:var(--color-bg)}
.dash-pane{padding:var(--space-6);display:flex;flex-direction:column;gap:var(--space-5)}
.dash-pane[hidden]{display:none}
.dash-pane-header{display:flex;align-items:center;justify-content:space-between}
.dash-pane-title{font-family:var(--font-display);font-size:var(--text-xl);font-weight:700;color:var(--color-text-primary)}
.dash-period{font-size:var(--text-xs);color:var(--color-text-tertiary);font-weight:500}

/* Listings */
.dash-listings{display:flex;flex-direction:column;gap:var(--space-3)}
.dash-listing-card{display:flex;align-items:center;gap:var(--space-4);background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:var(--space-4);transition:box-shadow var(--transition-fast)}
.dash-listing-card:hover{box-shadow:var(--shadow-sm)}
.dash-listing-img{width:56px;height:56px;border-radius:var(--radius-md);flex-shrink:0;display:flex;align-items:center;justify-content:center}
.dash-listing-info{flex:1;min-width:0}
.dash-listing-title{font-size:var(--text-sm);font-weight:var(--weight-semibold);color:var(--color-text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dash-listing-meta{font-size:var(--text-xs);color:var(--color-text-secondary);margin-top:2px}
.dash-listing-price{font-family:var(--font-mono);font-weight:700;color:var(--color-primary)}
.dash-listing-status{display:flex;align-items:center;gap:var(--space-2);margin-top:var(--space-2)}
.dash-listing-days{font-size:var(--text-xs);color:var(--color-text-tertiary)}
.dash-badge{font-size:10px;font-weight:700;padding:2px 8px;border-radius:var(--radius-full);text-transform:uppercase;letter-spacing:.04em}
.dash-badge--active{background:var(--color-success-bg);color:var(--color-success)}
.dash-badge--paused{background:var(--color-warning-bg);color:var(--color-warning)}
.dash-badge--expired{background:var(--color-danger-bg);color:var(--color-danger)}
.dash-listing-actions{display:flex;gap:var(--space-2);flex-shrink:0}
.dash-icon-btn{width:32px;height:32px;border-radius:var(--radius-md);border:1px solid var(--color-border);background:var(--color-surface);color:var(--color-text-secondary);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all var(--transition-fast)}
.dash-icon-btn:hover{border-color:var(--color-primary);color:var(--color-primary)}
.dash-icon-btn--danger:hover{border-color:var(--color-danger);color:var(--color-danger)}

/* Stats */
.dash-stats-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:var(--space-4)}
@media(max-width:500px){.dash-stats-grid{grid-template-columns:1fr}}
.dash-stat-card{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:var(--space-5);display:flex;flex-direction:column;gap:var(--space-2)}
.dash-stat-label{font-size:var(--text-xs);font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--color-text-tertiary)}
.dash-stat-value{font-family:var(--font-mono);font-size:var(--text-3xl);font-weight:700;color:var(--color-text-primary);line-height:1}
.dash-stat-trend{font-size:var(--text-xs);color:var(--color-text-secondary)}
.dash-stat-trend--up{color:var(--color-success)}
.dash-chart-area{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:var(--space-5)}
.dash-chart-label{font-size:var(--text-xs);font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--color-text-tertiary);margin-bottom:var(--space-4)}
.dash-chart-bars{display:flex;align-items:flex-end;gap:4px;height:80px}
.dash-bar{flex:1;background:var(--color-primary-light);border-radius:3px 3px 0 0;transition:background var(--transition-fast);cursor:default;position:relative}
.dash-bar:hover{background:var(--color-primary)}

/* Mensajes */
.dash-messages-list{display:flex;flex-direction:column;gap:var(--space-2)}
.dash-message-item{display:flex;align-items:flex-start;gap:var(--space-4);background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:var(--space-4);cursor:pointer;transition:all var(--transition-fast);position:relative}
.dash-message-item:hover{box-shadow:var(--shadow-sm);border-color:var(--color-border-strong)}
.dash-message-item--unread{background:var(--color-primary-light);border-color:var(--color-primary)}
.dash-msg-avatar{width:38px;height:38px;border-radius:50%;background:var(--color-primary);color:white;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:var(--text-sm);flex-shrink:0}
.dash-message-item--unread .dash-msg-avatar{background:var(--color-primary)}
.dash-msg-body{flex:1;min-width:0}
.dash-msg-meta{display:flex;align-items:center;justify-content:space-between;margin-bottom:2px}
.dash-msg-name{font-size:var(--text-sm);font-weight:700;color:var(--color-text-primary)}
.dash-msg-time{font-size:var(--text-xs);color:var(--color-text-tertiary)}
.dash-msg-subject{font-size:var(--text-xs);font-weight:600;color:var(--color-primary);margin-bottom:2px}
.dash-msg-preview{font-size:var(--text-xs);color:var(--color-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dash-unread-dot{width:8px;height:8px;border-radius:50%;background:var(--color-primary);flex-shrink:0;margin-top:4px}
.dash-messages-notice{font-size:var(--text-xs);color:var(--color-text-tertiary);text-align:center;padding:var(--space-4);border:1px dashed var(--color-border);border-radius:var(--radius-lg);background:var(--color-surface)}

/* Favoritos */
.dash-favorites-grid{display:flex;flex-direction:column;gap:var(--space-3)}
.dash-fav-card{display:flex;align-items:center;gap:var(--space-4);background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);padding:var(--space-4);transition:box-shadow var(--transition-fast)}
.dash-fav-card:hover{box-shadow:var(--shadow-sm)}
.dash-fav-img{width:52px;height:52px;border-radius:var(--radius-md);flex-shrink:0;display:flex;align-items:center;justify-content:center}
.dash-fav-info{flex:1;min-width:0}
.dash-fav-title{font-size:var(--text-sm);font-weight:var(--weight-semibold);color:var(--color-text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dash-fav-price{font-family:var(--font-mono);font-size:var(--text-base);font-weight:700;color:var(--color-primary);margin-top:2px}
.dash-fav-meta{font-size:var(--text-xs);color:var(--color-text-secondary);margin-top:2px}
.dash-fav-remove{width:30px;height:30px;border-radius:50%;border:1px solid var(--color-border);background:transparent;color:var(--color-danger);cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:all var(--transition-fast)}
.dash-fav-remove:hover{background:var(--color-danger-bg);border-color:var(--color-danger)}

/* Empty state */
.dash-empty{display:flex;flex-direction:column;align-items:center;gap:var(--space-4);padding:var(--space-10) var(--space-6);text-align:center;color:var(--color-text-tertiary);font-size:var(--text-sm)}

/* ── MENSAJES: layout dos columnas ── */
.dash-pane--messages{padding:0;gap:0}
.msg-layout{display:flex;height:100%;min-height:420px;overflow:hidden}

/* Lista */
.msg-list-col{width:100%;flex-shrink:0;display:flex;flex-direction:column;border-right:1px solid var(--color-border);overflow-y:auto;transition:width var(--transition-base)}
.msg-layout.has-detail .msg-list-col{width:300px;min-width:300px}
@media(max-width:640px){
  .msg-layout.has-detail .msg-list-col{display:none}
  .msg-layout.has-detail .msg-detail-col{display:flex}
}
.dash-messages-list{display:flex;flex-direction:column}
.dash-message-item{display:flex;align-items:flex-start;gap:var(--space-3);padding:var(--space-4) var(--space-5);cursor:pointer;transition:background var(--transition-fast);border-bottom:1px solid var(--color-border);position:relative}
.dash-message-item:hover{background:var(--color-surface-alt)}
.dash-message-item.is-active{background:var(--color-primary-light);border-left:3px solid var(--color-primary)}
.dash-message-item--unread{background:var(--color-primary-light)}
.dash-message-item--unread.is-active{background:var(--color-primary-light)}
.dash-msg-avatar{width:36px;height:36px;border-radius:50%;background:var(--color-primary);color:white;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:var(--text-sm);flex-shrink:0}
.dash-msg-body{flex:1;min-width:0}
.dash-msg-meta{display:flex;align-items:center;justify-content:space-between;margin-bottom:2px}
.dash-msg-name{font-size:var(--text-sm);font-weight:700;color:var(--color-text-primary)}
.dash-msg-time{font-size:10px;color:var(--color-text-tertiary);white-space:nowrap}
.dash-msg-subject{font-size:var(--text-xs);font-weight:600;color:var(--color-text-secondary);margin-bottom:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dash-msg-preview{font-size:var(--text-xs);color:var(--color-text-tertiary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dash-unread-dot{width:8px;height:8px;border-radius:50%;background:var(--color-primary);flex-shrink:0;margin-top:4px}

/* Detalle */
.msg-detail-col{flex:1;display:none;flex-direction:column;background:var(--color-bg);overflow:hidden}
.msg-detail-col[hidden]{display:none!important}
.msg-layout.has-detail .msg-detail-col{display:flex}
.msg-detail-header{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-4) var(--space-5);background:var(--color-surface);border-bottom:1px solid var(--color-border);flex-shrink:0}
.msg-back-btn{width:32px;height:32px;border-radius:var(--radius-md);border:1px solid var(--color-border);background:transparent;color:var(--color-text-secondary);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all var(--transition-fast);flex-shrink:0}
.msg-back-btn:hover{border-color:var(--color-primary);color:var(--color-primary)}
@media(min-width:641px){.msg-back-btn{display:none}}
.msg-detail-avatar{width:36px;height:36px;border-radius:50%;background:var(--color-primary);color:white;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:var(--text-sm);flex-shrink:0}
.msg-detail-meta{flex:1;min-width:0}
.msg-detail-name{font-size:var(--text-sm);font-weight:700;color:var(--color-text-primary)}
.msg-detail-status{font-size:10px;color:var(--color-success)}

/* Anuncio relacionado */
.msg-listing-ref{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-3) var(--space-5);background:var(--color-surface);border-bottom:1px solid var(--color-border);flex-shrink:0}
.msg-listing-ref__img{width:36px;height:36px;border-radius:var(--radius-md);background:var(--color-primary-light);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.msg-listing-ref__info{flex:1;min-width:0}
.msg-listing-ref__label{font-size:9px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--color-text-tertiary)}
.msg-listing-ref__title{font-size:var(--text-xs);font-weight:600;color:var(--color-text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.msg-listing-ref__price{font-size:var(--text-xs);color:var(--color-primary);font-family:var(--font-mono);font-weight:600}
.msg-listing-ref__link{width:28px;height:28px;display:flex;align-items:center;justify-content:center;color:var(--color-text-tertiary);border-radius:var(--radius-md);transition:all var(--transition-fast);flex-shrink:0}
.msg-listing-ref__link:hover{color:var(--color-primary);background:var(--color-primary-light)}

/* Hilo de conversación */
.msg-thread{flex:1;overflow-y:auto;padding:var(--space-5);display:flex;flex-direction:column;gap:var(--space-4)}
.msg-bubble-row{display:flex;gap:var(--space-3);align-items:flex-end}
.msg-bubble-row--mine{flex-direction:row-reverse}
.msg-bubble-av{width:28px;height:28px;border-radius:50%;background:var(--color-surface-alt);display:flex;align-items:center;justify-content:center;font-size:var(--text-xs);font-weight:700;color:var(--color-text-secondary);flex-shrink:0}
.msg-bubble-row--mine .msg-bubble-av{background:var(--color-primary);color:white}
.msg-bubble{max-width:75%;padding:var(--space-3) var(--space-4);border-radius:var(--radius-lg);font-size:var(--text-sm);line-height:var(--leading-relaxed)}
.msg-bubble--them{background:var(--color-surface);border:1px solid var(--color-border);color:var(--color-text-primary);border-radius:4px var(--radius-lg) var(--radius-lg) var(--radius-lg)}
.msg-bubble--mine{background:var(--color-primary);color:white;border-radius:var(--radius-lg) 4px var(--radius-lg) var(--radius-lg)}
.msg-bubble-time{font-size:10px;color:var(--color-text-tertiary);text-align:center;margin:var(--space-2) 0}

/* Caja de respuesta */
.msg-reply-box{display:flex;align-items:flex-end;gap:var(--space-3);padding:var(--space-4) var(--space-5);background:var(--color-surface);border-top:1px solid var(--color-border);flex-shrink:0}
.msg-reply-input{flex:1;border:1.5px solid var(--color-border);border-radius:var(--radius-lg);padding:var(--space-3) var(--space-4);font-family:var(--font-body);font-size:var(--text-sm);background:var(--color-bg);outline:none;resize:none;min-height:40px;max-height:120px;overflow-y:auto;transition:border-color var(--transition-fast);line-height:var(--leading-relaxed)}
.msg-reply-input:focus{border-color:var(--color-primary)}
.msg-reply-send{width:40px;height:40px;border-radius:50%;border:none;background:var(--color-primary);color:white;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:all var(--transition-fast)}
.msg-reply-send:hover{background:var(--color-primary-hover);transform:scale(1.05)}
.msg-reply-send:disabled{background:var(--color-border);cursor:not-allowed;transform:none}

/* ============================================================
   LOCATION SEARCH — buscador dentro del dropdown
   ============================================================ */
.location-search-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
}
.location-search-wrap svg { flex-shrink: 0; color: var(--color-text-tertiary); }
.location-search-input {
  flex: 1; border: none; outline: none;
  font-family: var(--font-body); font-size: var(--text-sm);
  background: transparent; color: var(--color-text-primary);
}
.location-search-input::placeholder { color: var(--color-text-tertiary); }
.location-search-clear {
  border: none; background: none; cursor: pointer;
  color: var(--color-text-tertiary); font-size: 12px; padding: 0 2px;
  flex-shrink: 0; line-height: 1;
}
.location-search-clear:hover { color: var(--color-text-primary); }
#location-suggestions { max-height: 220px; overflow-y: auto; }
.location-no-results {
  padding: 12px 14px;
  font-size: var(--text-sm); color: var(--color-text-tertiary);
  text-align: center;
}

/* ============================================================
   LISTING DRAWER — panel lateral de detalle
   ============================================================ */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(26,24,20,.5);
  backdrop-filter: blur(3px);
  z-index: 1100;
  opacity: 0; pointer-events: none;
  transition: opacity 280ms ease;
}
.drawer-overlay.is-open {
  opacity: 1; pointer-events: all;
}
.listing-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(780px, 100vw);
  background: var(--color-bg);
  z-index: 1101;
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: -8px 0 40px rgba(0,0,0,.15);
  display: flex; flex-direction: column;
}
.listing-drawer.is-open {
  transform: translateX(0);
}
.listing-drawer__close {
  position: absolute; top: 16px; left: -48px;
  width: 40px; height: 40px;
  border-radius: 50%; border: none;
  background: white; color: var(--color-text-primary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  transition: all 150ms ease;
  z-index: 10;
}
.listing-drawer__close:hover {
  background: var(--color-primary); color: white;
}
@media (max-width: 640px) {
  .listing-drawer__close { left: auto; right: 12px; top: 12px; }
}
.listing-drawer__iframe {
  flex: 1; border: none; width: 100%; height: 100%;
}

/* ============================================================
   LOCATION SEARCH
   ============================================================ */
.location-search-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
}
.location-search-wrap svg { flex-shrink: 0; color: var(--color-text-tertiary); }
.location-search-input {
  flex: 1; border: none; outline: none;
  font-family: var(--font-body); font-size: var(--text-sm);
  background: transparent; color: var(--color-text-primary);
}
.location-search-input::placeholder { color: var(--color-text-tertiary); }
.location-search-clear {
  border: none; background: none; cursor: pointer;
  color: var(--color-text-tertiary); font-size: 12px; padding: 0 2px;
  flex-shrink: 0; line-height: 1;
}
.location-search-clear:hover { color: var(--color-text-primary); }
#location-suggestions { max-height: 220px; overflow-y: auto; }
.location-no-results {
  padding: 12px 14px;
  font-size: var(--text-sm); color: var(--color-text-tertiary);
  text-align: center;
}

/* ============================================================
   AD SLOTS — espacios publicitarios en el grid
   ============================================================ */
.ad-slot {
  cursor: default;
}
.ad-slot__inner {
  height: 100%;
  min-height: 200px;
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  justify-content: center;
}
.ad-slot__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.6);
}
.ad-slot__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: white;
  line-height: 1.3;
  margin: 0;
}
.ad-slot__sub {
  font-size: var(--text-sm);
  color: rgba(255,255,255,.75);
  line-height: 1.5;
  margin: 0;
}
.ad-slot__cta {
  display: inline-block;
  margin-top: var(--space-2);
  background: rgba(255,255,255,.15);
  color: white;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: background var(--transition-fast);
  align-self: flex-start;
}
.ad-slot__cta:hover {
  background: rgba(255,255,255,.25);
}

/* Ocultar menú hamburguesa en desktop */
#btn-mobile-menu { display: none !important; }
@media (max-width: 767px) {
  #btn-mobile-menu { display: inline-flex !important; }
}

/* ── Location postal input ── */
.location-postal {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
}
.location-postal-input {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  outline: none;
}
.location-postal-input:focus {
  border-color: var(--color-primary);
}
.location-postal-btn {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
}
.location-postal-btn:hover {
  background: var(--color-primary-dark, #1f4d38);
}
