/* ============================================================ */
/* BOLSA DE TRABAJO - ESTILOS BASE (SIN PALETA DE COLORES)      */
/* ============================================================ */
/* Este archivo contiene la estructura y los estilos funcionales */
/* Las paletas de colores se definen en archivos separados.      */
/* ============================================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  overflow-x: clip;
  max-width: 100%;
}
body {
  font-family: var(--font);
  line-height: 1.5;
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  overflow-x: clip;
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select {
  font: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  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;
}
.container {
  width: 100%;
  max-width: clamp(320px, 90vw, 1600px);
  margin-inline: auto;
  padding-inline: 1rem;
}
@media (max-width: 640px) {
  .container {
    padding-inline: 1.25rem;
  }
  #colLista,
  .footer-grid,
  .footer-bottom .container {
    padding-inline: 1.25rem !important;
  }
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
:target {
  scroll-margin-top: 88px;
}
#vacantes,
#como-funciona,
#faq {
  scroll-margin-top: 88px;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--brand-deep);
  backdrop-filter: blur(6px);
  color: #fff;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 64px;
}
.logo img {
  height: 36px;
  width: auto;
}
.nav {
  display: none;
  align-items: center;
  gap: .2rem;
}
.nav a {
  padding: .4rem .7rem;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .8);
  transition: .2s;
}
.nav a:hover {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}
.nav-hola-text {
  padding: .4rem .7rem;
  font-size: .8rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}
.btn-login {
  background: var(--accent);
  color: #fff !important;
  border-radius: 999px;
  padding: .4rem 1rem !important;
  font-weight: 700;
}
.btn-login:hover {
  transform: scale(1.03);
}
.burger {
  background: none;
  border: 0;
  color: #fff;
  padding: .5rem;
  cursor: pointer;
}
.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  margin-top: 5px;
}
.burger span:first-child {
  margin-top: 0;
}
.nav-mobile {
  display: none;
  border-top: 1px solid rgba(255, 255, 255, .1);
}
.nav-mobile.open {
  display: block;
}
.nav-mobile ul {
  list-style: none;
  padding: .5rem 0;
}
.nav-mobile a {
  display: block;
  padding: .6rem .5rem;
  font-size: .8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .9);
  border-radius: 8px;
}
.nav-mobile a:hover {
  background: rgba(255, 255, 255, .1);
}
.nav-hola-text-mobile {
  display: block;
  padding: .6rem .5rem;
  font-size: .8rem;
  font-weight: 600;
  color: #fff;
}
@media (min-width: 768px) {
  .nav {
    display: flex;
  }
  .burger {
    display: none;
  }
  .nav-mobile {
    display: none !important;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--brand-deep);
  color: #fff;
  padding: 1.8rem 0;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: url('/imagenes/bg/bg-1.jpg') center/cover no-repeat;
  opacity: .25;
}
.hero-glow {
  position: absolute;
  top: -6rem;
  right: -6rem;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: rgba(220, 53, 69, .25);
  filter: blur(60px);
}
.hero .container {
  position: relative;
}
.breadcrumb {
  font-size: .7rem;
  color: rgba(255, 255, 255, .6);
  margin-bottom: 1rem;
}
.breadcrumb ol {
  display: flex;
  gap: .5rem;
  list-style: none;
}
.hero h1 {
  margin-top: .6rem;
  font-size: 1.6rem;
  line-height: 1.15;
  max-width: 48rem;
}
.hero h2 {
  margin-top: .4rem;
  font-size: .9rem;
  color: rgba(255, 255, 255, .85);
  max-width: 40rem;
}
.hero p {
  margin-top: .4rem;
  font-size: .8rem;
  color: rgba(255, 255, 255, .7);
  max-width: 40rem;
}
.hero-mascot {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(180px);
  height: 105%;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.2));
}
.hero .container {
  position: relative;
  z-index: 2;
}
@media (max-width: 991px) {
  .hero-mascot {
    transform: translateX(-40px);
    opacity: 0.15;
    height: 100%;
  }
}
@media (min-width: 768px) {
  .hero h1 {
    font-size: 2.2rem;
  }
}

/* ---------- Buscador ---------- */
.buscador {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-top: 1rem;
  padding: .6rem;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.buscador .campo {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding-inline: .5rem;
  flex: 1;
}
.buscador input,
.buscador select {
  width: 100%;
  border: 0;
  background: transparent;
  padding: .5rem 0;
  font-size: .85rem;
  color: var(--text);
}
.buscador input:focus,
.buscador select:focus {
  outline: none;
}
.btn-buscar {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: .5rem 1.2rem;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
}
.btn-buscar:hover {
  transform: scale(1.02);
}
@media (min-width: 768px) {
  .buscador {
    flex-direction: row;
    align-items: center;
  }
  .buscador .sep {
    border-left: 1px solid var(--border);
  }
}

/* ========== LAYOUT PRINCIPAL ========== */
.seccion {
  padding: 2.5rem 0;
}

.contenedor-principal {
  display: flex;
  gap: 1.5rem;
  transition: gap 0.3s;
  align-items: stretch;
  position: relative;
}

.col-lista {
  flex: 1;
  min-width: 0;
  transition: flex 0.3s;
  display: flex;
  flex-direction: column;
}

.col-detalle {
  flex: 0 0 0%;
  display: none;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  overflow-y: visible;
  transition: flex 0.3s;
}

.modo-detalle .col-lista {
  flex: 0 0 30%;
  max-height: none;
  overflow-y: visible;
}
.modo-detalle .col-detalle {
  display: block;
  flex: 1;
}
.modo-lista .col-lista {
  flex: 1;
}
.modo-lista .col-detalle {
  display: none;
}

@media (max-width: 1023px) {
  .contenedor-principal {
    flex-direction: column;
  }
  .col-lista {
    flex: 1 !important;
  }
  .col-detalle {
    max-height: none !important;
  }
  .modo-detalle .col-lista {
    display: none;
  }
  .modo-detalle .col-detalle {
    display: block;
    flex: 1;
  }
}

/* ---------- Filtros ---------- */
.filtros-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.filtros-header h2 {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--brand-deep);
  display: flex;
  align-items: center;
  gap: .4rem;
}
.btn-limpiar {
  background: none;
  border: 0;
  color: var(--accent);
  font-size: .7rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-limpiar:disabled {
  opacity: .4;
  cursor: default;
}
.filtros-body {
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
  max-height: 2000px;
  opacity: 1;
}
.filtros-body.collapsed {
  max-height: 0;
  opacity: 0;
  padding: 0;
  margin: 0;
}
.filtros h3 {
  margin-top: 1rem;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: .35rem;
  padding-top: .9rem;
  border-top: 1px dashed var(--border);
}
.filtros h3:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: .2rem;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .5rem;
}
.chip {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--brand-deep);
  border-radius: 999px;
  padding: .3rem .7rem;
  font-size: .7rem;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
  white-space: nowrap;
}
.chip:hover {
  background: var(--bg);
}
.chip[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.chip[aria-pressed="true"]::before {
  content: "\2713";
  margin-right: .25rem;
  font-weight: 700;
}
.filtro-salario-wrap {
  display: flex;
  gap: .5rem;
  margin-top: .5rem;
  flex-wrap: nowrap;
}
.filtro-salario-wrap input {
  flex: 1;
  min-width: 60px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .3rem .5rem;
  font-size: .8rem;
  background: #fff;
  outline: none;
  transition: .2s;
}
.filtro-salario-wrap input:focus {
  border-color: var(--brand);
}
.filtro-select-exp,
.filtro-select-escolaridad,
.filtro-orden-wrap select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .3rem .5rem;
  font-size: .8rem;
  background: #fff;
  outline: none;
  transition: .2s;
  margin-top: .5rem;
}
.filtro-select-exp:focus,
.filtro-select-escolaridad:focus,
.filtro-orden-wrap select:focus {
  border-color: var(--brand);
}
.filtro-orden-wrap {
  margin-top: .5rem;
}
.filtros-activos-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-top: 1rem;
  padding-top: .5rem;
  border-top: 1px solid var(--border);
  font-size: .8rem;
  color: var(--muted);
}
.filtros-activos-wrap strong {
  color: var(--brand-deep);
  margin-right: .3rem;
}
.tag-filtro {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--brand-soft);
  color: var(--brand);
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 500;
}
.tag-quitar {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: .85rem;
  line-height: 1;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: .15s;
}
.tag-quitar:hover {
  background: var(--brand);
  color: #fff;
}
.filtros-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}

.btn-filtros-flotante {
  position: relative;
  overflow: visible;
}
.btn-filtros-flotante::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--brand-deep);
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  padding: .25rem .55rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.btn-filtros-flotante:hover::after,
.btn-filtros-flotante:focus-visible::after {
  opacity: 1;
}

/* ---------- Barra de resultados ---------- */
.barra-resultados {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  padding: 0.5rem 0;
  background: var(--bg);
  flex-shrink: 0;
  position: relative;
  top: auto;
  z-index: auto;
  margin-bottom: .4rem;
}
.barra-resultados strong {
  font-size: 1.1rem;
  color: var(--brand-deep);
}

.barra-resultados .btn-filtros-flotante {
  flex-shrink: 0;
  order: -1;
}

/* ---------- Tarjeta de vacante ---------- */
.vacante {
  position: relative;
  padding: 1rem 1.2rem;
  transition: .2s;
  cursor: pointer;
  border-left: 3px solid transparent;
  outline-offset: 2px;
}
.vacante:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.vacante.seleccionada {
  border-left-color: var(--brand);
  background: var(--brand-soft);
}
.vacante:focus-visible {
  outline: 2px solid var(--brand);
}
.vacante-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.badge-nuevo {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: .1rem .5rem;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.badge-area {
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 999px;
  padding: .1rem .5rem;
  font-size: 10px;
  font-weight: 600;
}
.vacante h3 {
  margin-top: .3rem;
  font-size: 1rem;
  color: var(--brand-deep);
}
.vacante h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.estado {
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid;
  padding: .2rem .6rem;
  font-size: .7rem;
  font-weight: 700;
}
.estado.verde {
  background: rgba(40, 167, 69, .12);
  color: var(--success);
  border-color: rgba(40, 167, 69, .3);
}
.estado.amarillo {
  background: rgba(255, 193, 7, .2);
  color: #8a6100;
  border-color: rgba(255, 193, 7, .45);
}
.estado.rojo {
  background: rgba(220, 53, 69, .1);
  color: var(--accent);
  border-color: rgba(220, 53, 69, .3);
}
.meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1rem;
  margin-top: .5rem;
  font-size: .8rem;
  color: var(--muted);
}
.meta li {
  display: flex;
  align-items: center;
  gap: .3rem;
}
.meta i {
  color: var(--brand);
}
.reqs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .6rem;
  padding-top: .6rem;
  border-top: 1px solid var(--border);
}
.req {
  background: var(--bg);
  border-radius: 4px;
  padding: .15rem .5rem;
  font-size: .7rem;
  font-weight: 500;
  color: var(--muted);
}
.req-licencia-obligatoria {
  background: #fff9d7;
  color: #757575;
  border-radius: 4px;
  padding: .15rem .5rem;
  font-size: .7rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.vacante-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: .6rem;
}
.vacante.seleccionada .vacante-bottom span {
  color: var(--brand);
  font-weight: 600;
}
.btn-solid {
  border: 0;
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  padding: .4rem .9rem;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
}
.btn-solid:hover {
  transform: scale(1.03);
}
.btn-outline {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--brand-deep);
  border-radius: 999px;
  padding: .4rem .9rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
}
.btn-outline:hover {
  background: var(--bg);
}

/* ---------- Detalle de vacante ---------- */
.detalle-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  color: var(--muted);
  text-align: center;
}
.detalle-placeholder i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}
.detalle-placeholder h3 {
  font-size: 1.2rem;
  color: var(--brand-deep);
  margin-bottom: 0.5rem;
}
.detalle-vacante {
  padding: 0.2rem 0;
}
.detalle-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e9ecef;
}
.detalle-header .info h3 {
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 1.2rem;
}
.detalle-header .info .sub {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: #6c757d;
}
.detalle-header .info .sub span i {
  color: var(--brand);
}
.detalle-header .acciones {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.detalle-header .acciones .estado-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 12px;
  color: #fff;
}
.detalle-header .acciones .btn-cerrar-detalle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: .2s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.detalle-header .acciones .btn-cerrar-detalle:hover {
  background: var(--bg);
  border-color: var(--accent);
  color: var(--accent);
}
.detalle-vacante .job-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.detalle-vacante .job-detail-card {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}
.detalle-vacante .job-detail-card .label {
  font-size: 11px;
  color: #6c757d;
  text-transform: uppercase;
  font-weight: 600;
}
.detalle-vacante .job-detail-card .value {
  font-size: 17px;
  font-weight: 700;
  color: var(--brand);
}
.detalle-vacante .beneficio-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #b8d4d4;
  font-size: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s;
}
.detalle-vacante img,
#detalleContainer img {
  max-width: 100%;
  height: auto;
  display: block;
}
.detalle-vacante .beneficio-tag:hover {
  transform: translateY(-2px);
}
.detalle-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e9ecef;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}
.detalle-footer .izquierda {
  display: flex;
  gap: 10px;
}
.detalle-footer .derecha {
  display: flex;
  gap: 10px;
}

.btn-volver-lista {
  display: none;
  align-items: center;
  gap: .4rem;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--brand-deep);
  border-radius: 999px;
  padding: .4rem .9rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: .8rem;
}
.btn-volver-lista:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
}
@media (max-width: 1023px) {
  .modo-detalle .btn-volver-lista {
    display: inline-flex;
  }
}
@media (max-width: 768px) {
  .detalle-vacante .job-detail-grid {
    grid-template-columns: 1fr;
  }
  .detalle-header .acciones {
    width: 100%;
    justify-content: flex-end;
  }
  .detalle-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .detalle-footer .izquierda,
  .detalle-footer .derecha {
    justify-content: center;
  }
}
/*btn de filtrado*/
.btn-filtros-flotante {
  z-index: 1030;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.btn-filtros-flotante:hover {
  background: var(--brand-deep);
}
@media (max-width: 1023px) {
  .btn-filtros-flotante::after {
    display: none;
  }
}

.filtros-flotante {
  position: fixed;
  top: 0;
  left: 0;
  width: 340px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg);
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 1050;
  transform: translateX(-110%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 1.5rem 1rem;
  overflow-y: auto;
  display: none;
}
.filtros-flotante.abierto {
  transform: translateX(0);
  display: block;
}
.filtros-flotante .filtros-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  position: sticky;
  top: 0;
  background: var(--bg);
  padding-bottom: .6rem;
  z-index: 2;
  border-bottom: 1px solid var(--border);
}
.filtros-flotante .btn-cerrar-flotante {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--brand-deep);
}
.filtros-flotante-footer {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 1rem -1rem -1.5rem;
  padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: block;
}
.btn-aplicar-filtros {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .7rem 1rem;
  font-size: .85rem;
}
.overlay-filtros {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1040;
  display: none;
}
.overlay-filtros.show {
  display: block;
}
@media (max-width: 1023px) {
  .filtros-flotante {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 85vh;
    max-height: 85vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
  }
  .filtros-flotante.abierto {
    transform: translateY(0);
  }
  .filtros-flotante::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 999px;
    margin: 0 auto .75rem;
  }
}

/* ---------- Scroll to Top ---------- */
#scrollTopBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  transition: opacity 0.3s, transform 0.3s, background 0.3s;
}
#scrollTopBtn:hover {
  background: var(--brand-deep);
  transform: scale(1.05);
}
#scrollTopBtn.show {
  display: flex;
}

#detalleContainer {
    position: sticky;
    top: 80px;
    align-self: start;
    height: max-content;
}

/* ============================================================ */
/* SECCIÓN MODIFICADA: ESTILOS PARA LA VISTA MÓVIL DEL DETALLE  */
/* ============================================================ */
@media (max-width: 1023px) {
  
  /* 1. CORRECCIÓN DEL FONDO GRIS: 
        Sacamos la capa oscura fuera del contenedor principal para que no 
        se mezcle y ensucie el fondo blanco. */
  .contenedor-principal.modo-detalle::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 890;
  }
  
  /* Apagamos el overlay viejo que causaba el bug */
  .modo-detalle #detalleContainer::before {
    display: none !important; 
  }
  
  #detalleContainer {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    height: 90vh;
    max-height: 90vh;
    margin: 0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
    z-index: 900;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    background: #ffffff !important; 
  }
  
  /* Cabecera sin barra gris superior */
  #detalleContainer .detalle-header {
    position: sticky; /* Cambiamos relative por sticky */
    top: -1.5rem; /* Compensa el margen negativo para pegarse justo al borde */
    z-index: 10; /* Asegura que el texto que sube pase por debajo y no por encima */
    
    background: #ffffff;
    margin: -1.5rem -1.5rem 1rem;
    padding: 1.1rem 1.5rem .75rem;
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 4px;
    border-bottom: 1px solid var(--border);
  }
  
  #detalleContainer .detalle-header::before {
    display: none;
  }
  
  /* Título y fecha (Se colocan debajo) */
  #detalleContainer .detalle-header .info {
    width: 100%;
    flex: none;
    order: 2; 
  }
  
  #detalleContainer .detalle-header .info h3 {
    font-size: 1.1rem;
    margin: 0 0 4px 0;
    word-break: break-word;
  }
  
  #detalleContainer .detalle-header .info .sub {
    font-size: 12px;
    flex-wrap: wrap;
    gap: 6px;
  }
  
  /* 2. CORRECCIÓN BOTÓN DE CERRAR: 
        Botones y estado (Se colocan arriba y se separan a los extremos) */
  #detalleContainer .detalle-header .acciones {
    display: flex;
    align-items: center;
    justify-content: space-between; /* <-- Esto empuja el botón "Cerrar" a la derecha */
    width: 100%;
    order: 1;
    margin-top: 0; 
    margin-bottom: 12px;
  }
  
  #detalleContainer .detalle-header .acciones .estado-badge {
    order: 0; 
    font-size: 11px;
    padding: 2px 10px;
  }
  
  #detalleContainer .detalle-header .acciones .btn-cerrar-detalle {
    order: 1; 
    font-size: 14px;
    padding: 5px 14px;
  }
  
  /* Footer horizontal: compartir a la izquierda, aplicar a la derecha */
  #detalleContainer .detalle-footer {
    display: flex;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 1rem -1.5rem -1.5rem;
    padding: .8rem 1.5rem calc(.8rem + env(safe-area-inset-bottom, 0px));
    background: #ffffff;
    border-top: 1px solid var(--border);
    border-radius: 0 0 16px 16px;
  }
  
  #detalleContainer .detalle-footer .izquierda {
    justify-content: flex-start;
    flex: 0 0 auto;
  }
  
  #detalleContainer .detalle-footer .derecha {
    justify-content: flex-end;
    flex: 0 0 auto;
    margin-left: auto;
  }
  
  #detalleContainer .detalle-footer .btn-dev,
  #detalleContainer .detalle-footer .btn-solid {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
}
/* ============================================================ */

/* ---------- Paginación ---------- */
.paginacion-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
  gap: .4rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.paginacion-wrap button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  padding: .3rem .7rem;
  font-size: .8rem;
  cursor: pointer;
  transition: .2s;
}
.paginacion-wrap button:hover {
  background: var(--bg);
}
.paginacion-wrap button.activo {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* ---------- Skeleton ---------- */
.skeleton-card {
  padding: 1rem 1.2rem;
}
.sk {
  background: linear-gradient(90deg, #eef2f2 25%, #f7fafa 37%, #eef2f2 63%);
  background-size: 400% 100%;
  animation: sk 1.2s ease-in-out infinite;
  border-radius: 6px;
  height: 12px;
  margin-top: .55rem;
}
.sk.t {
  height: 18px;
  width: 60%;
}
.sk.s {
  width: 35%;
}
.sk.m {
  width: 80%;
}
@keyframes sk {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

/* ---------- Cómo funciona ---------- */
.como {
  background: var(--brand-soft);
  padding: 2.5rem 0;
}
.como h2,
.faq h2 {
  font-size: 1.3rem;
  color: var(--brand-deep);
}
.pasos {
  list-style: none;
  display: grid;
  gap: .8rem;
  margin-top: 1.5rem;
}
@media (min-width: 640px) {
  .pasos {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .pasos {
    grid-template-columns: repeat(4, 1fr);
  }
}
.paso {
  padding: 1rem;
}
.paso .num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: .8rem;
}
.paso h3 {
  margin-top: .5rem;
  color: var(--brand-deep);
  font-size: 1rem;
}
.paso p {
  margin-top: .2rem;
  font-size: .8rem;
  color: var(--muted);
}

/* ---------- FAQ ---------- */
.faq {
  background: var(--brand-soft);
  padding: 2.5rem 0;
}
.faq-grid {
  display: grid;
  gap: .6rem;
  margin-top: 1.2rem;
}
@media (min-width: 768px) {
  .faq-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.faq details {
  padding: 1rem;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--brand-deep);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: .9rem;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary .mas {
  color: var(--accent);
  transition: .2s;
}
.faq details[open] summary .mas {
  transform: rotate(45deg);
}
.faq details p {
  margin-top: .5rem;
  font-size: .8rem;
  color: var(--muted);
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 3rem;
  background: var(--brand-deep);
  color: #fff;
}
.footer-grid {
  display: grid;
  gap: 2rem;
  padding: 2.5rem 0;
}
@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .footer-col-ancha {
    grid-column: span 2;
  }
}
.footer img {
  height: 48px;
  width: auto;
}
.footer p,
.footer li,
.footer a {
  color: rgba(255, 255, 255, .75);
}
.footer .texto {
  margin-top: .8rem;
  font-size: .8rem;
  max-width: 20rem;
}
.redes {
  list-style: none;
  display: flex;
  gap: .6rem;
  margin-top: 1rem;
}
.redes a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  transition: .2s;
}
.redes a:hover {
  background: var(--accent);
}
.footer h2 {
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #fff;
}
.footer h3 {
  margin-top: 1.2rem;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: rgba(255, 255, 255, .9);
}
.footer .bloque {
  margin-top: .8rem;
  font-size: .8rem;
  display: grid;
  gap: .6rem;
}
.enlaces {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .4rem;
  margin-top: .6rem;
  font-size: .8rem;
}
.enlaces a:hover {
  color: #fff;
}
.enlaces .flecha {
  color: var(--accent);
  margin-right: .3rem;
}
.newsletter {
  display: flex;
  margin-top: .8rem;
  background: rgba(255, 255, 255, .1);
  border-radius: 999px;
  padding: .2rem;
}
.newsletter input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: .4rem .8rem;
  font-size: .8rem;
  color: #fff;
}
.newsletter input::placeholder {
  color: rgba(255, 255, 255, .5);
}
.newsletter input:focus {
  outline: none;
}
.newsletter button {
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: .4rem .8rem;
  font-weight: 700;
  cursor: pointer;
}
.aviso {
  margin-top: .6rem;
  font-size: .7rem;
  color: rgba(255, 255, 255, .55);
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .1);
}
.footer-bottom .container {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  font-size: .7rem;
  color: rgba(255, 255, 255, .65);
  text-align: center;
}
.footer-bottom ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  justify-content: center;
}
@media (min-width: 640px) {
  .footer-bottom .container {
    flex-direction: row;
    text-align: left;
  }
}

/* ---------- Modal ---------- */
.custom-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, .6);
  z-index: 1100;
  align-items: center;
  justify-content: center;
}
.custom-modal.show {
  display: flex;
}
.custom-modal-dialog {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  max-width: 900px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.custom-modal-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 90vh;
  overflow: hidden;
}
.custom-modal-header {
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  flex-shrink: 0;
}
.custom-modal-header h5 {
  color: #fff;
  margin: 0;
  font-size: 1.1rem;
}
.custom-modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}
.custom-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.custom-modal-footer {
  padding: 12px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f8f9fa;
  border-top: 1px solid #dee2e6;
  flex-shrink: 0;
}

/* ---------- Badge Dev ---------- */
.badge-dev {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  background: #fff4d6;
  color: #8a6100;
  border: 1px dashed #e0b03c;
  border-radius: 999px;
  padding: .05rem .45rem;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
  vertical-align: middle;
}
.dev-wrap {
  opacity: .92;
}
.btn-dev {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: #fff;
  border: 1px dashed #e0b03c;
  color: #8a6100;
  border-radius: 8px;
  padding: .35rem .7rem;
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
}
.btn-dev:hover {
  background: #fff8e8;
}

/* ---------- Scrollbar ---------- */
.col-detalle::-webkit-scrollbar {
  width: 8px;
}
.col-detalle::-webkit-scrollbar-thumb {
  background: #d6dede;
  border-radius: 8px;
}