:root {
  --brand: #1660b0;
  --brand-dark: #0d3f75;
  --surface: #f4f6f9;
  --border: #dfe3ea;
  --text: #1f2937;
  --text-muted: #6b7280;
  --radius: .6rem;
  --shadow: 0 1px 3px rgba(15, 53, 96, .08);
  --shadow-hover: 0 4px 12px rgba(15, 53, 96, .12);
}

body {
  background-color: var(--surface);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.site-header {
  background: #fff;
}

.site-masthead {
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  min-width: 0;
}

.site-logo {
  height: 68px;
  width: auto;
}

/* "Clasificados" al lado del logo, separado por una regla vertical. */
.site-brand-seccion {
  border-left: 2px solid var(--border);
  padding-left: .75rem;
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 1.65rem;
  letter-spacing: -.01em;
}

.site-navbar {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
}

.nav-grupos {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.25rem;
  padding: .1rem 0;
}

.nav-grupo-link {
  color: #e8eef7;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 500;
  padding: .45rem 0;
  border-bottom: 2px solid transparent;
}

.nav-grupo-link:hover,
.nav-grupo-link.active {
  color: #fff;
  border-bottom-color: #fff;
}

.nav-back {
  color: var(--brand);
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  padding: .4rem .95rem;
  border: 2px solid var(--brand);
  border-radius: 999px;
  transition: background-color .15s ease, color .15s ease;
}

.nav-back:hover {
  background: var(--brand);
  color: #fff;
}

.site-subnav {
  background: var(--brand-dark);
}

.site-subnav a {
  color: #cfe0f5;
  font-size: .92rem;
  text-decoration: none;
  padding: .45rem 0;
}

.site-subnav a:hover {
  color: #fff;
}

.site-footer {
  background: #fff;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .85rem;
}

/* Buscador */
.buscador input[type="search"] {
  max-width: 420px;
}

/* Paneles de grupo (home): cabecera con el total y grilla de rubros adentro */
.grupo-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 1rem;
}

.grupo-panel-head {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem 1rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  text-decoration: none;
}

.grupo-panel-head:hover {
  color: #fff;
  filter: brightness(1.1);
}

.grupo-panel-head i {
  font-size: 1.15rem;
}

.grupo-panel-nombre {
  font-weight: 700;
  font-size: 1.05rem;
}

.grupo-panel-total {
  margin-left: auto;
  background: rgba(255, 255, 255, .18);
  border-radius: 999px;
  padding: .1rem .7rem;
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
}

.grupo-panel-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .4rem;
  padding: .75rem;
}

.grupo-panel-vacio {
  margin: 0;
  padding: .9rem 1rem;
  color: var(--text-muted);
  font-size: .9rem;
}

.rubro-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .45rem .7rem;
  border: 1px solid var(--border);
  border-radius: .4rem;
  text-decoration: none;
  color: var(--text);
  font-size: .9rem;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.rubro-chip:hover {
  border-color: var(--brand);
  background: #eef4fc;
  color: var(--brand-dark);
}

.rubro-chip-cantidad {
  flex-shrink: 0;
  background: var(--surface);
  border-radius: 999px;
  padding: 0 .5rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.rubro-chip:hover .rubro-chip-cantidad {
  background: #fff;
  color: var(--brand);
}

/* Listado de avisos (tarjetas) */
.avisos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}

.aviso-item {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .15s ease, border-color .15s ease;
}

.aviso-item:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-hover);
}

/* Foto de portada, o el icono de la categoria si el aviso no tiene foto */
.aviso-foto {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef2f8;
  border-bottom: 1px solid var(--border);
}

.aviso-foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.aviso-foto i {
  font-size: 2.5rem;
  color: #aebdd2;
}

.aviso-cuerpo {
  padding: .7rem .85rem;
}

.aviso-item .aviso-titulo {
  display: block;
  font-weight: 700;
  color: var(--brand-dark);
}

.aviso-item .aviso-texto {
  color: var(--text);
  font-size: .9rem;
  margin: .25rem 0 0;
}

/* Por defecto el texto del aviso se ve completo; con "Colapsar textos" se
   corta a tres lineas (ver templates/partials/control-texto.php). */
.avisos-colapsados .aviso-item .aviso-texto {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.aviso-item.destacado {
  background: #fff8e6;
  border-color: #e8c766;
  border-left: 4px solid #e8a33d;
}

.badge-destacado {
  display: inline-block;
  background: #e8a33d;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: .2rem .6rem;
  border-radius: .25rem;
  margin-bottom: .35rem;
}

.aviso-item.negrillas .aviso-texto {
  font-weight: 700;
}

.aviso-item.marco-1 {
  border: 2px solid var(--brand);
}

.aviso-item.marco-2 {
  border: 2px solid #888;
}

.aviso-item.marco-3 {
  border: 2px dotted #888;
}

.aviso-cabecera {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: .75rem;
  padding: .1rem .5rem;
  border-radius: .25rem;
  margin-bottom: .25rem;
}

.rubro-heading {
  margin-top: 1.5rem;
  padding-bottom: .25rem;
  border-bottom: 2px solid var(--brand);
  color: var(--brand-dark);
}

.grupo-icono {
  color: var(--brand);
}

.nav-grupo-link i {
  font-size: 1rem;
}

/* Navegacion entre ediciones */
.ediciones {
  margin-top: 1.75rem;
  padding: .9rem 1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.ediciones-titulo {
  display: block;
  margin-bottom: .6rem;
  color: var(--brand-dark);
  font-weight: 700;
  font-size: .9rem;
}

.ediciones-lista {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.edicion-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.edicion-chip:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* La edicion que se esta viendo queda marcada y sin invitar al clic. */
.edicion-chip.activa {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
  cursor: default;
}

.edicion-hoy {
  background: rgba(255, 255, 255, .22);
  border-radius: 999px;
  padding: 0 .4rem;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.edicion-chip:not(.activa) .edicion-hoy {
  background: var(--brand);
  color: #fff;
}

/* Cartel de "estas viendo una edicion pasada" */
.edicion-navegada {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: 1rem;
  padding: .6rem .9rem;
  background: #fff8e6;
  border: 1px solid #e8c766;
  border-left: 4px solid #e8a33d;
  border-radius: var(--radius);
  font-size: .9rem;
}

.edicion-navegada-volver {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.edicion-navegada-volver:hover {
  text-decoration: underline;
}

/* Detalle de aviso */
.aviso-detalle-foto img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.aviso-galeria {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .5rem;
}

.aviso-galeria img {
  height: 70px;
  border-radius: .25rem;
  border: 1px solid var(--border);
  cursor: pointer;
}

/* Google AdSense */
.ad-slot {
  text-align: center;
  overflow: hidden;
}

/* Aviso sin foto: no tiene sentido reservarle el 4:3 completo, alcanza una
   banda con el icono de la categoria. */
.aviso-foto-vacia {
  aspect-ratio: auto;
  height: 58px;
}

.aviso-foto-vacia i {
  font-size: 1.5rem;
}

/* Compartir aviso */
.compartir {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.compartir-titulo {
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 600;
  margin-right: .25rem;
}

.compartir-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: .82rem;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.compartir-btn:hover {
  color: #fff;
}

.compartir-whatsapp:hover  { background: #25d366; border-color: #25d366; }
.compartir-facebook:hover  { background: #1877f2; border-color: #1877f2; }
.compartir-x:hover         { background: #000;    border-color: #000; }
.compartir-telegram:hover  { background: #29a9eb; border-color: #29a9eb; }
.compartir-mail:hover      { background: var(--brand); border-color: var(--brand); }
.compartir-copiar:hover    { background: var(--brand-dark); border-color: var(--brand-dark); }

.compartir-copiar.copiado {
  background: #1f9d55;
  border-color: #1f9d55;
  color: #fff;
}

/* En movil el listado pasa a cuadricula de dos columnas tipo Pinterest, con la
   foto en su proporcion real en vez de recortada al 4:3, asi las tarjetas
   quedan de alto variable (align-items: start evita que se estiren).
   Se usa grid y no "columns: 2": el balanceo de multi-columna apila las dos
   tarjetas en la izquierda cuando el rubro tiene exactamente 2 avisos, que es
   un caso muy comun en estos listados. */
@media (max-width: 575.98px) {
  .avisos-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: .5rem;
  }

  .aviso-foto {
    aspect-ratio: auto;
  }

  .aviso-foto img {
    height: auto;
    object-fit: contain;
  }

  .aviso-foto-vacia {
    height: 46px;
  }

  .aviso-foto-vacia i {
    font-size: 1.25rem;
  }

  .aviso-cuerpo {
    padding: .55rem .6rem;
  }

  .aviso-item .aviso-texto {
    font-size: .82rem;
  }

  .avisos-colapsados .aviso-item .aviso-texto {
    -webkit-line-clamp: 4;
  }
}

/* Avisos especiales: son pocos (1-2 por edicion) y no llevan foto, asi que en
   vez de la grilla de tarjetas van como piezas de ancho completo, con una
   franja azul a la izquierda que los distingue de los clasificados. */
.especiales-lista {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-bottom: 1rem;
}

.especial-item {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .9rem 1.1rem;
}

.especial-titulo {
  margin: 0;
  color: var(--brand-dark);
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .01em;
}

.especial-texto {
  margin: .3rem 0 0;
  color: var(--text);
  font-size: .95rem;
}

@media (max-width: 575.98px) {
  .especial-item {
    padding: .75rem .85rem;
  }

  .especial-titulo {
    font-size: .98rem;
  }
}

/* Cabecera mas grande en escritorio; en movil se modera para no comerse la
   pantalla. */
@media (max-width: 575.98px) {
  .site-logo {
    height: 50px;
  }

  .site-brand-seccion {
    font-size: 1.25rem;
  }

  .nav-back {
    font-size: .95rem;
    padding: .3rem .8rem;
  }

  .nav-grupo-link {
    font-size: 1rem;
    padding: .35rem 0;
  }

  .site-subnav a {
    font-size: .88rem;
  }
}
/* Seccion de adultos: enlace del menu y aviso de mayoria de edad */
.badge-18 {
  display: inline-block;
  min-width: 1.9rem;
  padding: .05rem .35rem;
  border-radius: 999px;
  background: #d93a3a;
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
  vertical-align: .1em;
}

/* Mientras no se confirma la edad, el contenido de la pagina no se muestra. */
html.edad-pendiente main {
  visibility: hidden;
}

html.edad-modal-abierto {
  overflow: hidden;
}

.edad-modal {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(8, 24, 48, .72);
  backdrop-filter: blur(4px);
}

.edad-modal[hidden] {
  display: none;
}

.edad-dialogo {
  width: 100%;
  max-width: 420px;
  padding: 1.75rem 1.5rem 1.5rem;
  background: #fff;
  border-top: 5px solid #d93a3a;
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
  text-align: center;
}

.edad-icono {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  margin: 0 auto .9rem;
  border: 3px solid #d93a3a;
  border-radius: 50%;
  color: #d93a3a;
  font-size: 1.35rem;
  font-weight: 800;
}

.edad-titulo {
  margin: 0 0 .5rem;
  color: var(--brand-dark);
  font-size: 1.3rem;
  font-weight: 700;
}

.edad-texto {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: .95rem;
}

.edad-acciones {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.edad-btn {
  padding: .65rem 1rem;
  border: 2px solid var(--brand);
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.edad-aceptar {
  background: var(--brand);
  color: #fff;
}

.edad-aceptar:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.edad-volver {
  background: #fff;
  color: var(--brand);
}

.edad-volver:hover {
  background: var(--surface);
}
/* Boton para colapsar o abrir el texto de los avisos */
.control-texto {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 .75rem;
}

.control-texto-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--brand);
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
}

.control-texto-btn:hover {
  border-color: var(--brand);
  background: #eef4fc;
}

/* Publicite aqui (pie de pagina) */
.publicite {
  padding: 2rem 0 1.5rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  text-align: left;
}

.publicite-cabecera {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.publicite-titulo {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 800;
}

.publicite-bajada {
  margin: .25rem 0 0;
  color: #d6e4f5;
}

.publicite-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.publicite-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .6rem 1.05rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.publicite-whatsapp {
  background: #25d366;
  color: #fff;
}

.publicite-whatsapp:hover {
  background: #1ebe5a;
  color: #fff;
}

.publicite-claro {
  background: #fff;
  color: var(--brand-dark);
}

.publicite-claro:hover {
  background: #e8f0fb;
  color: var(--brand-dark);
}

.publicite-oficinas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, .2);
}

.publicite-region {
  margin: 0 0 .6rem;
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.publicite-lista {
  display: grid;
  gap: .55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.publicite-lista li {
  display: flex;
  flex-wrap: wrap;
  gap: .1rem .6rem;
  color: #d6e4f5;
  font-size: .88rem;
  line-height: 1.35;
}

.publicite-lista strong {
  flex-basis: 100%;
  color: #fff;
}

.publicite-tel {
  color: #fff;
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  .publicite-titulo {
    font-size: 1.4rem;
  }

  .publicite-acciones,
  .publicite-btn {
    width: 100%;
  }

  .publicite-btn {
    justify-content: center;
  }
}
/* Foco visible con el azul de la marca en los botones del aviso de edad: al
   abrirse el aviso el foco va a "Aceptar", y el anillo por defecto del
   navegador se veia como un contorno negro grueso. */
.edad-btn:focus-visible {
  outline: 3px solid rgba(22, 96, 176, .4);
  outline-offset: 2px;
}

/* Cabecera: WhatsApp de publicidad junto al enlace al portal, con la misma
   medida que ese boton para que queden parejos. */
.masthead-acciones {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}

.masthead-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .95rem;
  border: 2px solid #25d366;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease;
}

.masthead-whatsapp:hover {
  border-color: #1ebe5a;
  background: #1ebe5a;
  color: #fff;
}

.masthead-whatsapp i {
  font-size: 1.15rem;
}

@media (max-width: 575.98px) {
  .masthead-whatsapp {
    padding: .3rem .8rem;
    font-size: .95rem;
  }
}