/* ═══════════════════════════════════════════════════════════════════
   COLEGIOS DEL PERÚ — main.css
   Paleta: Rojo Peruano, Azul Marino, Dorado, Blanco
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@400;600;700;800&display=swap');

/* ── Variables ─────────────────────────────────────────────────── */
:root {
  /* Rojo Peruano elegante */
  --red: #b91c2e;
  --red-light: #dc2626;
  --red-dark: #7f1d1d;
  /* Azul marino colegio (sobrio, profundo) */
  --navy: #1e3a5f;
  --navy-light: #2d5282;
  --navy-dark: #112240;
  /* Complementario oscuro para fondos */
  --dark: #0d1b2a;
  --dark-2: #172233;
  /* Dorado sobrio */
  --gold: #c9922a;
  --gold-light: #e8b84b;
  /* Neutros cálidos (no frio teal) */
  --white: #ffffff;
  --off-white: #f8f6f3;
  --gray-50: #f5f3f0;
  --gray-100: #ede9e4;
  --gray-200: #d8d2c9;
  --gray-300: #b8b0a4;
  --gray-400: #928880;
  --gray-500: #6e6460;
  --gray-600: #4f4744;
  --gray-700: #342e2b;
  --gray-800: #1f1a18;
  --gray-900: #0f0c0b;
  /* Sombras */
  --shadow-sm: 0 1px 4px rgba(30, 58, 95, .07);
  --shadow-md: 0 4px 16px rgba(30, 58, 95, .12);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .13);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, .18);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 40px;
  --transition: .25s cubic-bezier(.4, 0, .2, 1);
  --footer-bg: #112240;
  --nav-h: 68px;
}

/* ── Reset ─────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--off-white);
  color: var(--gray-800);
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

html {
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input,
select,
textarea {
  font-family: inherit;
}

/* ── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--red), var(--navy));
  border-radius: 3px;
}

/* ── Container ─────────────────────────────────────────────────── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════
   NAVBAR
═══════════════════════════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  height: var(--nav-h);
  background: rgba(17, 34, 64, .97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  transition: all var(--transition);
}

.navbar.scrolled,
.navbar.scrolled-always {
  background: rgba(17, 34, 64, .97);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 4px 24px rgba(17, 34, 64, .4);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-around;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}

.nav-logo img {
  border-radius: 50%;
  border: 2px solid var(--gold);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-main {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.125rem;
  color: #fff;
}

.logo-sub {
  font-size: .65rem;
  color: rgba(255, 255, 255, .6);
  font-weight: 400;
  letter-spacing: .03em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-left: 1rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .85rem;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, .85);
  font-size: .875rem;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.nav-link.active {
  color: var(--gold);
  background: rgba(249, 168, 37, .12);
}

.nav-arrow {
  font-size: .65rem;
  opacity: .7;
  transition: transform var(--transition);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown:hover .nav-arrow {
  transform: rotate(180deg);
}

/* Dropdown menu */
.dropdown-menu {
  position: absolute;
  top: calc(100% + .2rem);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-200);
  min-width: 220px;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition);
  z-index: 100;
}

.dropdown-menu::before {
  content: "";
  position: absolute;
  top: -1rem;
  left: 0;
  right: 0;
  height: 1rem;
  background: transparent;
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.dropdown-header {
  padding: .875rem 1rem .5rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--navy);
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* Grid departamentos */
.dropdown-departamentos {
  min-width: 680px;
}

.dropdown-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .25rem;
  padding: .75rem;
}

.dropdown-grid .dropdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  padding: .6rem .4rem;
  border-radius: var(--radius-sm);
  font-size: .72rem;
  font-weight: 500;
  color: var(--gray-700);
  text-align: center;
  transition: all var(--transition);
  border-left: 2px solid transparent;
}

.dropdown-grid .dropdown-item:hover {
  background: var(--gray-50);
  border-left-color: var(--dept-color, var(--red));
  color: var(--dept-color, var(--red));
}

.dept-emoji {
  font-size: 1.25rem;
}

.dept-name {
  line-height: 1.2;
}

/* Tools dropdown */
.dropdown-tools {
  min-width: 280px;
}

.dropdown-item-tool {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .875rem 1rem;
  transition: background var(--transition);
}

.dropdown-item-tool:hover {
  background: var(--gray-50);
}

.tool-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .875rem;
  flex-shrink: 0;
}

.tool-name {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--gray-800);
}

.tool-desc {
  display: block;
  font-size: .75rem;
  color: var(--gray-500);
}

/* Nav search */
.nav-search {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: var(--radius-xl);
  overflow: hidden;
  flex-shrink: 0;
  transition: all var(--transition);
}

.nav-search:focus-within {
  background: rgba(255, 255, 255, .2);
  border-color: var(--gold);
}

.nav-search input {
  background: none;
  border: none;
  outline: none;
  padding: .45rem .875rem;
  color: #fff;
  font-size: .825rem;
  width: 180px;
}

.nav-search input::placeholder {
  color: rgba(255, 255, 255, .5);
}

.nav-search button {
  padding: .45rem .875rem;
  color: #fff;
  opacity: .7;
  transition: opacity var(--transition);
}

.nav-search button:hover {
  opacity: 1;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: .5rem;
  margin-left: auto;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all var(--transition);
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ═══════════════════════════════════════════════════════════════
   HERO — Página de inicio
═══════════════════════════════════════════════════════════════ */
/* El espaciador del hero inicial ya no es necesario con sticky si quieres que el hero inicie debajo de la nav. */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  padding: 4rem 0;
  color: #fff;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('../images/alumnos-en-colegios.webp');
  background-size: cover;
  background-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
      rgba(8, 89, 96, .92) 0%,
      rgba(198, 40, 40, .55) 60%,
      rgba(13, 23, 24, .7) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 1.5rem;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(249, 168, 37, .2);
  border: 1px solid rgba(249, 168, 37, .5);
  border-radius: var(--radius-xl);
  padding: .35rem 1rem;
  color: var(--gold-light);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  animation: fadeInDown .6s ease both;
}

.hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 1.25rem;
  animation: fadeInUp .7s ease .1s both;
}

.hero h1 .highlight {
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, .8);
  max-width: 600px;
  margin-bottom: 2.5rem;
  animation: fadeInUp .7s ease .2s both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
  animation: fadeInUp .7s ease .3s both;
}

.btn-primary,
.btn-secondary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .875rem 1.75rem;
  border-radius: var(--radius-xl);
  font-weight: 600;
  font-size: .95rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--red), var(--red-light));
  color: #fff;
  box-shadow: 0 4px 20px rgba(198, 40, 40, .4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(198, 40, 40, .5);
}

.btn-secondary {
  background: rgba(255, 255, 255, .15);
  backdrop-filter: blur(8px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .3);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, .25);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, .5);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, .1);
  border-color: #fff;
}

/* Hero stats strip */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 3rem;
  animation: fadeInUp .7s ease .4s both;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, .1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: var(--radius-md);
  padding: .875rem 1.25rem;
  min-width: 120px;
  text-align: center;
}

.hero-stat .num {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--gold);
}

.hero-stat .lbl {
  font-size: .75rem;
  color: rgba(255, 255, 255, .7);
}

/* Hero search box */
.hero-search-box {
  position: relative;
  margin-top: 2rem;
  max-width: 700px;
  animation: fadeInUp .7s ease .35s both;
  z-index: 10;
}

.hero-search-box #searchResults {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 1rem;
  background: var(--off-white);
  border-radius: var(--radius-xl);
  max-height: 60vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  padding: 1.5rem;
  display: none;
  z-index: 20;
}

.hero-search-box #searchResults:not(:empty) {
  display: block;
}

.hero-search-form {
  display: flex;
  background: rgba(255, 255, 255, .95);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.hero-search-form input {
  flex: 1;
  padding: 1rem 1.5rem;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--gray-800);
}

.hero-search-form select {
  padding: 0 1rem;
  border: none;
  border-left: 1px solid var(--gray-200);
  outline: none;
  color: var(--gray-600);
  font-size: .875rem;
  background: transparent;
}

.hero-search-form button {
  padding: 1rem 1.75rem;
  background: linear-gradient(135deg, var(--red), var(--red-light));
  color: #fff;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 600;
  transition: all var(--transition);
}

.hero-search-form button:hover {
  background: linear-gradient(135deg, var(--red-dark), var(--red));
}

/* Peru flag decoration */
.hero-flag-deco {
  position: absolute;
  right: 5%;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 8px;
  height: 150px;
  border-radius: 4px;
  overflow: hidden;
}

.flag-stripe {
  flex: 1;
}

.flag-stripe.red {
  background: var(--red);
}

.flag-stripe.white {
  background: rgba(255, 255, 255, .8);
}

/* ═══════════════════════════════════════════════════════════════
   SECCIÓN GENÉRICA
═══════════════════════════════════════════════════════════════ */
.section {
  padding: 5rem 0;
}

.section-sm {
  padding: 3rem 0;
}

.section-dark {
  background: var(--dark);
  color: #fff;
}

.section-navy {
  background: linear-gradient(160deg, var(--navy-dark) 0%, var(--navy) 60%, rgba(30, 58, 95, .85) 100%);
  color: #fff;
}

.section-red {
  background: linear-gradient(135deg, var(--red-dark), var(--red));
  color: #fff;
}

.section-light {
  background: var(--gray-50);
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(198, 40, 40, .1);
  color: var(--red);
  border: 1px solid rgba(198, 40, 40, .2);
  border-radius: var(--radius-xl);
  padding: .3rem .9rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .875rem;
}

.section-navy .section-tag,
.section-dark .section-tag {
  background: rgba(249, 168, 37, .15);
  color: var(--gold-light);
  border-color: rgba(249, 168, 37, .3);
}

.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: .75rem;
}

.section-sub {
  font-size: 1.05rem;
  color: var(--gray-500);
  max-width: 600px;
  margin: 0 auto;
}

.section-dark .section-sub,
.section-navy .section-sub {
  color: rgba(255, 255, 255, .7);
}

/* ═══════════════════════════════════════════════════════════════
   CARDS — Departamentos
═══════════════════════════════════════════════════════════════ */
.dept-cluster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.dept-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border-top: 3px solid var(--dept-color, var(--red));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dept-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--dept-color, var(--red));
  opacity: 0;
  transition: opacity var(--transition);
}

.dept-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.dept-card:hover::before {
  opacity: .04;
}

.dept-card-emoji {
  font-size: 2.25rem;
  display: block;
  margin-bottom: .5rem;
}

.dept-card-name {
  font-weight: 700;
  font-size: .875rem;
  color: var(--gray-800);
  display: block;
  margin-bottom: .25rem;
}

.dept-card-capital {
  font-size: .7rem;
  color: var(--gray-500);
  display: block;
  width: 100%;
  text-align: center;
}

.dept-card-shield {
  width: 48px;
  height: auto;
  margin: 0 auto 0.5rem;
  object-fit: contain;
}

.dept-card-count {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  margin-top: .5rem;
  font-size: .7rem;
  font-weight: 600;
  color: var(--dept-color, var(--red));
  background: rgba(0, 0, 0, .04);
  border-radius: var(--radius-xl);
  padding: .15rem .6rem;
}

/* ═══════════════════════════════════════════════════════════════
   CARDS — Colegios
═══════════════════════════════════════════════════════════════ */
.school-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.school-card {
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.school-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.school-card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--gray-100);
}

.school-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.school-card-nivel {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: .375rem;
  display: flex;
  align-items: center;
  gap: .35rem;
}

.school-card-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: .375rem;
  line-height: 1.3;
}

.school-card-loc {
  font-size: .8rem;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: .3rem;
  margin-bottom: .75rem;
}

.school-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .6rem;
  border-radius: var(--radius-xl);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.badge-publica {
  background: rgba(12, 119, 129, .1);
  color: var(--navy-dark);
}

.badge-privada {
  background: rgba(198, 40, 40, .1);
  color: var(--red-dark);
}

.badge-convenio {
  background: rgba(249, 168, 37, .15);
  color: #a07000;
}

.badge-activo {
  background: rgba(22, 163, 74, .12);
  color: #166534;
}

.badge-inactivo {
  background: rgba(239, 68, 68, .1);
  color: #b91c1c;
}

.badge-urbana {
  background: rgba(12, 119, 129, .08);
  color: var(--navy);
}

.badge-rural {
  background: rgba(22, 163, 74, .1);
  color: #166534;
}

.badge-otra {
  background: var(--gray-100);
  color: var(--gray-600);
}

/* ═══════════════════════════════════════════════════════════════
   PÁGINA DE COLEGIO — Profile
═══════════════════════════════════════════════════════════════ */
.school-hero {
  position: relative;
  padding-top: var(--nav-h);
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, rgba(185, 28, 46, .3) 100%);
  overflow: hidden;
  min-height: 360px;
  display: flex;
  align-items: flex-end;
}

.school-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: .15;
  filter: blur(2px);
}

.school-hero-content {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem 1.5rem 2.5rem;
  display: flex;
  align-items: flex-end;
  gap: 2rem;
}

.school-hero-img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 4px solid rgba(255, 255, 255, .2);
  flex-shrink: 0;
}

.school-hero-info {
  flex: 1;
}

.school-hero-nivel {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.school-hero-name {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 900;
  color: #fff;
  margin-bottom: .75rem;
  line-height: 1.2;
}

.school-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  font-size: .85rem;
  color: rgba(255, 255, 255, .7);
}

.school-hero-meta span {
  display: flex;
  align-items: center;
  gap: .35rem;
}

/* Breadcrumbs —— modo general (fondo claro) */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .375rem;
  font-size: .8rem;
  color: var(--gray-500);
  padding: 1rem 0;
  margin-bottom: .5rem;
}

.breadcrumb a {
  color: var(--navy);
  font-weight: 500;
}

.breadcrumb a:hover {
  color: var(--red);
  text-decoration: underline;
}

.breadcrumb .sep {
  color: var(--gray-300);
}

/* Breadcrumbs dentro del hero (fondo oscuro) */
.school-hero .breadcrumb {
  color: rgba(255, 255, 255, .65);
}

.school-hero .breadcrumb a {
  color: rgba(255, 255, 255, .85);
  font-weight: 600;
}

.school-hero .breadcrumb a:hover {
  color: var(--gold-light);
  text-decoration: underline;
}

.school-hero .breadcrumb .sep {
  color: rgba(255, 255, 255, .35);
}

/* Botones de exportación */
.export-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.5rem;
}

.btn-export {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  font-weight: 600;
  transition: all var(--transition);
}

.btn-export-pdf {
  background: rgba(239, 68, 68, .1);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, .2);
}

.btn-export-word {
  background: rgba(59, 130, 246, .1);
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, .2);
}

.btn-export-png {
  background: rgba(99, 102, 241, .1);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, .2);
}

.btn-export-print {
  background: rgba(107, 114, 128, .1);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

.btn-export:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* School layout */
.school-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
  padding: 2.5rem 0;
}

@media (max-width: 900px) {
  .school-layout {
    display: block;
  }

  .school-layout>div {
    margin-bottom: 2rem;
  }
}

/* Mapa mini sidebar del colegio */
.school-map-mini {
  height: 220px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
}

#schoolMapSidebar {
  width: 100%;
  height: 220px;
  z-index: 10;
}

.leaflet-popup-content-wrapper {
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
}

.leaflet-popup-content {
  margin: 14px 18px !important;
  text-align: center;
}

.leaflet-popup-content a {
  justify-content: center;
}

.info-card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.info-card-header {
  padding: .875rem 1.25rem;
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy-light) 100%);
  color: #fff;
  font-weight: 700;
  font-size: .875rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  letter-spacing: .01em;
}

.info-card-body {
  padding: 1.25rem;
}

/* Info list */
.info-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.info-row {
  display: flex;
  align-items: flex-start;
  gap: .875rem;
  padding: .625rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.info-row:last-child {
  border-bottom: none;
}

.info-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  flex-shrink: 0;
  margin-top: .1rem;
}

.info-label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-400);
  display: block;
  margin-bottom: .1rem;
}

.info-val {
  font-size: .9rem;
  color: var(--gray-800);
  font-weight: 500;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.faq-item {
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.faq-q {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: background var(--transition);
  color: var(--gray-800);
}

.faq-q:hover {
  background: var(--gray-100);
}

.faq-q .faq-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.faq-item.open .faq-q .faq-icon {
  transform: rotate(45deg);
}

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease, padding .35s ease;
  font-size: .875rem;
  color: var(--gray-600);
  line-height: 1.7;
  padding: 0 1.25rem;
}

.faq-item.open .faq-a {
  max-height: 200px;
  padding: 0 1.25rem 1rem;
}

/* Cita motivadora */
.motivation-block {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, rgba(185, 28, 46, .25) 100%);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.motivation-block strong {
  color: var(--gold) !important;
}

.motivation-block::before {
  content: '"';
  position: absolute;
  font-size: 10rem;
  opacity: .05;
  font-family: Georgia, serif;
  top: -2rem;
  left: .5rem;
  line-height: 1;
}

.motivation-text {
  font-size: 1rem;
  line-height: 1.7;
  font-style: italic;
  position: relative;
}

.motivation-author {
  font-size: .75rem;
  opacity: .7;
  margin-top: .75rem;
  position: relative;
}

/* Utilidades para Contenidos del Blog */
.blog-motivation {
  margin: 2.5rem 0;
}

.action-btn-wrap {
  text-align: center;
  margin-top: 2rem;
}

/* ═══════════════════════════════════════════════════════════════
   BÚSQUEDA
═══════════════════════════════════════════════════════════════*/
/* ── Content Wrapper ──────────────────────── */
.main-wrapper {
  min-height: calc(100vh - var(--nav-h));
}

/* ── Hero Buscar ────────────────────────────── */
.buscar-hero {
  background: linear-gradient(155deg, var(--dark) 0%, var(--navy-dark) 55%, var(--navy) 100%);
  padding: 3rem 1.5rem 2.5rem;
  color: #fff;
  text-align: center;
}

.search-hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: .75rem;
}

.search-hero p {
  color: rgba(255, 255, 255, .7);
  margin-bottom: 1.5rem;
}

.search-form-box {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
}

.search-filters {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.search-filters-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .875rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.form-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.form-input,
.form-select {
  padding: .75rem 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--gray-50);
  color: var(--gray-800);
}

.form-input:focus,
.form-select:focus {
  border-color: var(--navy);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 35, 126, .1);
}

.btn-search {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .875rem 2rem;
  background: linear-gradient(135deg, var(--red), var(--red-light));
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 700;
  transition: all var(--transition);
  white-space: nowrap;
  height: fit-content;
  align-self: flex-end;
}

.btn-search:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(198, 40, 40, .4);
}

/* Results */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: .75rem;
}

.results-count {
  font-size: .9rem;
  color: var(--gray-600);
}

.results-count strong {
  color: var(--gray-900);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}

.page-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  border: 1.5px solid var(--gray-200);
  color: var(--gray-700);
  background: #fff;
  transition: all var(--transition);
  cursor: pointer;
}

.page-item:hover,
.page-item.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.page-item.active {
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════
   MAPA
═══════════════════════════════════════════════════════════════ */
.map-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.map-filters-bar {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  padding-top: calc(var(--nav-h) + 1rem);
}

#mapContainer {
  flex: 1;
  min-height: 500px;
}

.leaflet-popup-content-wrapper {
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
}

.map-popup-name {
  font-weight: 700;
  font-size: .9rem;
  color: var(--navy);
  margin-bottom: .25rem;
}

.map-popup-nivel {
  font-size: .75rem;
  color: var(--gray-500);
}

.map-popup-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin-top: .5rem;
  color: var(--red);
  font-size: .8rem;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   CHARTS
═══════════════════════════════════════════════════════════════ */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.chart-card {
  background: rgba(255, 255, 255, .05);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(8px);
}

.chart-card.light {
  background: #fff;
  border-color: var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.chart-title {
  font-size: .875rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.chart-card.light .chart-title {
  color: var(--gray-700);
}

.chart-title i {
  color: var(--gold);
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════════════ */

.sidebar-card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

.sidebar-card-header {
  padding: .875rem 1.25rem;
  background: linear-gradient(90deg, var(--navy-dark), var(--navy));
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}

.sidebar-card-body {
  padding: 1.25rem;
}

/* Authority links */
.auth-links {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.auth-link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem;
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  transition: all var(--transition);
}

.auth-link-item:hover {
  background: #fff;
  border-color: var(--navy);
  transform: translateX(2px);
}

.auth-link-info {
  flex: 1;
}

.auth-link-name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--gray-800);
  display: block;
}

.auth-link-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .75rem;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--red), var(--red-light));
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Nearby schools */
.nearby-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.nearby-item {
  display: flex;
  gap: .875rem;
  align-items: flex-start;
  padding: .75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
  transition: all var(--transition);
  cursor: pointer;
}

.nearby-item:hover {
  background: #fff;
  border-color: var(--navy-light);
  transform: translateX(2px);
}

.nearby-img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.nearby-name {
  font-size: .8rem;
  font-weight: 700;
  color: var(--gray-800);
  display: block;
  margin-bottom: .1rem;
}

.nearby-nivel {
  font-size: .7rem;
  color: var(--gray-500);
}

.nearby-dist {
  font-size: .7rem;
  color: var(--red);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .2rem;
}

/* ═══════════════════════════════════════════════════════════════
   ESTADÍSTICAS HOME
═══════════════════════════════════════════════════════════════ */
.stats-band {
  background: linear-gradient(135deg, var(--dark) 0%, var(--navy-dark) 50%, var(--navy) 100%);
  padding: 2.5rem 0;
  color: #fff;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
}

.stat-num {
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}

.stat-lbl {
  font-size: .82rem;
  color: rgba(255, 255, 255, .75);
}

/* Counter animation */
.counter {
  display: inline-block;
}

/* ── Mobile stats-band ─────────────────────── */
@media (max-width: 900px) {
  .stats-band {
    padding: 1.75rem 0;
  }

  .stat-item {
    background: rgba(255, 255, 255, .06);
    border-radius: 12px;
    padding: 1rem .75rem;
    border: 1px solid rgba(255, 255, 255, .1);
  }

  .stat-num {
    font-size: 2rem;
  }

  .stat-lbl {
    font-size: .78rem;
  }
}

@media (max-width: 500px) {
  .stats-band {
    padding: 1.25rem 0;
  }

  .stats-band .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: .875rem;
  }

  .stats-band .stat-num {
    font-size: 1.65rem;
  }

  .stats-band .stat-lbl {
    font-size: .72rem;
  }
}

/* ═══════════════════════════════════════════════════════════════
   ABOUT / LEGAL PAGES
═══════════════════════════════════════════════════════════════*/
/* ── Hero Comparador ─────────────────────────── */
.compare-hero {
  background: linear-gradient(155deg, var(--navy-dark) 0%, var(--navy) 100%);
  padding: 4rem 1.5rem 3rem;
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  padding: 3rem 1.5rem 3rem;
  /* Removed calc(var(--nav-h) + 3rem) */
  color: #fff;
  text-align: center;
}

.page-hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: .75rem;
}

.page-hero p {
  color: rgba(255, 255, 255, .75);
  max-width: 600px;
  margin: 0 auto;
}

.legal-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.legal-content h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy);
  margin: 2.5rem 0 .875rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p {
  color: var(--gray-600);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.legal-content ul {
  padding-left: 1.25rem;
  color: var(--gray-600);
  line-height: 2;
  margin-bottom: 1rem;
}

.legal-content ul li::marker {
  color: var(--red);
}

/* About images */
.about-img-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 2rem 0;
}

.about-img-grid img {
  border-radius: var(--radius-md);
  height: 260px;
  object-fit: cover;
  width: 100%;
  box-shadow: var(--shadow-md);
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════════ */
.site-footer {
  background: var(--footer-bg);
  color: rgba(255, 255, 255, .8);
}

.footer-wave {
  line-height: 0;
  margin-bottom: -2px;
}

.footer-wave svg {
  width: 100%;
  height: 60px;
  display: block;
}

.footer-top {
  padding: 4rem 0 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: .875rem;
  margin-bottom: 1rem;
}

.footer-logo img {
  border-radius: 50%;
  border: 2px solid var(--gold);
}

.footer-logo-name {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 1.125rem;
  font-weight: 800;
  color: #fff;
}

.footer-logo-tagline {
  display: block;
  font-size: .65rem;
  color: rgba(255, 255, 255, .5);
}

.footer-brand p {
  font-size: .875rem;
  color: rgba(255, 255, 255, .6);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.footer-stats-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.footer-stat {
  text-align: center;
}

.fstat-num {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gold);
}

.fstat-lbl {
  font-size: .7rem;
  color: rgba(255, 255, 255, .5);
}

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.footer-badge {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius-xl);
  padding: .25rem .75rem;
  font-size: .75rem;
}

.footer-links-group h4 {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.footer-links-group ul {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.footer-links-group li a {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  color: rgba(255, 255, 255, .6);
  transition: all var(--transition);
}

.footer-links-group li a:hover {
  color: var(--gold-light);
  padding-left: .25rem;
}

.footer-links-group li a i {
  font-size: .65rem;
  color: var(--red-light);
}

.footer-search {
  display: flex;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1rem;
}

.footer-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  padding: .6rem .875rem;
  color: #fff;
  font-size: .85rem;
}

.footer-search input::placeholder {
  color: rgba(255, 255, 255, .4);
}

.footer-search button {
  padding: .6rem .875rem;
  color: rgba(255, 255, 255, .6);
  transition: color var(--transition);
}

.footer-search button:hover {
  color: var(--gold-light);
}

.footer-nivel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: 1.5rem;
}

.footer-nivel-tags a {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--radius-xl);
  padding: .2rem .7rem;
  font-size: .75rem;
  color: rgba(255, 255, 255, .6);
  transition: all var(--transition);
}

.footer-nivel-tags a:hover {
  background: rgba(198, 40, 40, .3);
  color: #fff;
  border-color: var(--red);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding: 1.25rem 0;
  display: flex;
  align-items: center;
}

.footer-bottom .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  width: 100%;
}

.footer-bottom p {
  font-size: .8rem;
  color: rgba(255, 255, 255, .4);
}

.footer-bottom-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-bottom-links a {
  font-size: .8rem;
  color: rgba(255, 255, 255, .5);
  transition: color var(--transition);
}

.footer-bottom-links a:hover {
  color: var(--gold-light);
}

/* ═══════════════════════════════════════════════════════════════
   GUÍA EDUCATIVA chunks
═══════════════════════════════════════════════════════════════ */
.guia-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.guia-card {
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.guia-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.guia-card-header {
  padding: 2rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.guia-card-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: .75rem;
  position: relative;
  z-index: 1;
}

.guia-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  position: relative;
  z-index: 1;
}

.guia-card-body {
  padding: 1.25rem;
}

.guia-card-body p {
  font-size: .875rem;
  color: var(--gray-600);
  line-height: 1.7;
}

.guia-tag {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: var(--radius-xl);
  font-size: .7rem;
  font-weight: 600;
  margin-top: .75rem;
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════════════════════ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(.9);
    box-shadow: 0 0 0 0 rgba(198, 40, 40, .7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 12px rgba(198, 40, 40, 0);
  }

  100% {
    transform: scale(.9);
    box-shadow: 0 0 0 0 rgba(198, 40, 40, 0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }

  100% {
    background-position: 1000px 0;
  }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .6s ease, transform .6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-delay-1 {
  transition-delay: .1s;
}

.animate-delay-2 {
  transition-delay: .2s;
}

.animate-delay-3 {
  transition-delay: .3s;
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 1000px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .nav-search {
    display: none;
  }

  .dropdown-departamentos {
    min-width: 480px;
  }

  .dropdown-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .hide-on-mobile {
    display: none !important;
  }

  .hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    width: 100%;
    margin: 0;
    display: flex;
    visibility: visible;
    height: calc(100vh - var(--nav-h));
    height: calc(100dvh - var(--nav-h));
    flex-direction: column;
    align-items: flex-start;
    background: rgba(17, 34, 64, .98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.5rem 1.5rem 4rem;
    gap: 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.4, 0, .2, 1);
    z-index: 1500;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-link {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
  }

  .nav-dropdown {
    width: 100%;
  }

  .dropdown-menu {
    position: static;
    transform: none !important;
    box-shadow: none;
    border: none;
    background: rgba(255, 255, 255, .06);
    border-radius: var(--radius-sm);
    padding: .5rem;
    margin-top: .25rem;
    opacity: 1;
    pointer-events: all;
    display: none;
  }

  .nav-dropdown.mobile-open .dropdown-menu {
    display: block;
  }

  .dropdown-departamentos {
    min-width: unset;
  }

  .dropdown-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .dept-cluster {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-flag-deco {
    display: none;
  }

  /* .school-layout {
    grid-template-columns: 1fr;
  } */

  .about-img-grid {
    grid-template-columns: 1fr;
  }

  .school-hero-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    text-align: left;
  }

  .school-hero-img {
    width: 80px;
    height: 80px;
  }

  .hero-search-form {
    flex-direction: column;
    border-radius: var(--radius-md);
  }

  .hero-search-form input,
  .hero-search-form select {
    border-left: none;
    border-bottom: 1px solid var(--gray-200);
    width: 100%;
  }

  .hero-search-form select {
    padding: 1rem;
  }

  .hero-search-form button {
    justify-content: center;
  }

  /* Arreglo de contraste para los sub-menús en oscuro */
  .dropdown-header {
    color: rgba(255, 255, 255, .9);
    border-bottom-color: rgba(255, 255, 255, .1);
    padding: 0.5rem 0.25rem;
    font-size: 0.8rem;
  }

  .dropdown-grid .dropdown-item {
    color: rgba(255, 255, 255, .75);
  }

  .dropdown-grid .dropdown-item:hover {
    background: rgba(255, 255, 255, .1);
    color: #fff;
  }

  .dropdown-item-tool:hover {
    background: rgba(255, 255, 255, .1);
  }

  .tool-name {
    color: rgba(255, 255, 255, .95);
  }

  .tool-desc {
    color: rgba(255, 255, 255, .6);
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero-stats {
    gap: .75rem;
  }

  .hero-stat {
    padding: .625rem .875rem;
  }

  .hero-stat .num {
    font-size: 1.35rem;
  }

  .search-filters {
    grid-template-columns: 1fr;
  }

  .dropdown-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dept-cluster {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ═══════════════════════════════════════════════════════════════
   ESTADÍSTICAS COLEGIO — 2 columnas (stats izq | gráfico der)
═══════════════════════════════════════════════════════════════ */
.stats-section {
  display: grid;
  grid-template-columns: 1fr minmax(160px, 200px);
  gap: 1.25rem;
  align-items: center;
}

.stats-section .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: .65rem;
}

.stat-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: .85rem .65rem;
  text-align: center;
  transition: box-shadow var(--transition), transform var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.stat-card .stat-icon {
  font-size: 1.25rem;
  margin-bottom: .3rem;
}

.stat-card .stat-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  display: block;
}

.stat-card .stat-lbl {
  font-size: .65rem;
  color: var(--gray-500);
  margin-top: .2rem;
  display: block;
}

.stats-chart-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stats-chart-wrap canvas {
  max-width: 190px;
  max-height: 190px;
}

@media (max-width: 640px) {
  .stats-section {
    grid-template-columns: 1fr;
  }

  .stats-chart-wrap {
    order: -1;
  }
}

/* ═══════════════════════════════════════════════════════════════
   COLEGIOS CERCANOS — icono circular por nivel (sin foto)
═══════════════════════════════════════════════════════════════ */
.nearby-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .9rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: 1px solid var(--gray-200);
  margin-bottom: .45rem;
  transition: background var(--transition), box-shadow var(--transition);
  background: var(--white);
}

.nearby-item:hover {
  background: var(--gray-50);
  box-shadow: var(--shadow-sm);
}

.nearby-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: .95rem;
  color: #fff;
}

.nearby-name {
  font-weight: 600;
  font-size: .8rem;
  color: var(--navy);
  display: block;
  line-height: 1.3;
}

.nearby-nivel {
  font-size: .7rem;
  color: var(--gray-500);
  display: block;
  margin-top: 1px;
}

.nearby-dist {
  font-size: .68rem;
  color: var(--gray-400);
  display: block;
  margin-top: 1px;
}

/* Icono sidebar mapa — reducir tamaño */
.sidebar-card-header .fa-map-marked-alt,
.sidebar-card-header .fa-map-marker-alt {
  font-size: .85rem;
}

/* ── Print ────────────────────────────────────────────── */
@media print {

  .navbar,
  .site-footer,
  .export-buttons,
  .sidebar {
    display: none !important;
  }

  .school-layout {
    grid-template-columns: 1fr !important;
  }

  .stats-section {
    grid-template-columns: 1fr !important;
  }
}

/* ── Dropdown AJAX Resultados Hero de Inicio ─────── */
.hero-search-box #searchResults {
  position: absolute;
  /* Changed to absolute to float exactly below the form */
  width: 100%;
  left: 0;
  top: 100%;
  margin-top: 0.5rem;
  z-index: 9999;
}

.hero-search-results-wrapper {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  text-align: center;
  position: relative;
  /* the wrapper #searchResults is absolute now */
  z-index: 1000;
}

.hero-search-results-wrapper.loading,
.hero-search-results-wrapper.error,
.hero-search-results-wrapper.empty {
  padding: 1.5rem;
  color: var(--gray-500);
}

.hero-search-results-wrapper.error {
  color: #b91c1c;
}

.hero-search-results-list {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  text-align: left;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  position: relative;
  /* the wrapper #searchResults is absolute now */
  z-index: 1000;
}

.hero-search-result-item {
  display: flex;
  flex-direction: column;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}

.hero-search-result-item:last-child {
  border-bottom: none;
}

.hero-search-result-item:hover {
  background: #f8fafc;
}

.hero-search-result-name {
  font-weight: 700;
  color: var(--navy);
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.hero-search-result-meta {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.hero-search-result-meta i {
  color: var(--red);
}

.hero-search-result-all {
  display: block;
  margin: 0;
  padding: 0.8rem;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  font-weight: 600;
  color: var(--navy);
  text-align: center;
  text-decoration: none;
  transition: background 0.2s;
}

.hero-search-result-all:hover {
  background: #f1f5f9;
}

.hero-search-result-all i {
  margin-left: 0.25rem;
  font-size: 0.8rem;
}

/* ══════════════════════════════════════════════
   BLOG STYLES
══════════════════════════════════════════════ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  padding: 0;
  max-width: 1280px;
  margin: 0 auto;
}

.blog-card {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  animation: fadeInUp 0.8s ease;
  animation-fill-mode: both;
}

.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--navy-light);
}

.blog-card-img-wrap {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: var(--gray-100);
}

.blog-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-img {
  transform: scale(1.05);
}

.blog-card-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: linear-gradient(135deg, var(--red), var(--red-light));
  color: #fff;
  padding: .3rem .8rem;
  border-radius: var(--radius-xl);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .2);
}

.blog-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .8rem;
  color: var(--gray-500);
  margin-bottom: .75rem;
}

.blog-card-meta span {
  display: flex;
  align-items: center;
  gap: .35rem;
}

.blog-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: .75rem;
  line-height: 1.3;
}

.blog-card-excerpt {
  font-size: .95rem;
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex: 1;
}

.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--gray-100);
  padding-top: 1.25rem;
  margin-top: auto;
}

.blog-card-readmore {
  font-size: .875rem;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: .5rem;
  transition: color var(--transition);
}

.blog-card:hover .blog-card-readmore {
  color: var(--red);
}

.blog-card-readmore i {
  transition: transform 0.3s;
}

.blog-card:hover .blog-card-readmore i {
  transform: translateX(4px);
}

.blog-card-stats {
  display: flex;
  gap: .75rem;
  font-size: .8rem;
  color: var(--gray-400);
}

/* ══════════════════════════════════════════════
   EXPORT & PRINT STYLES
══════════════════════════════════════════════ */
.export-only-header {
  display: none;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--gray-200);
}

.export-only-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--navy);
  margin-bottom: .75rem;
  line-height: 1.2;
}

.export-only-header .export-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.95rem;
  color: var(--gray-600);
  font-weight: 500;
}

.export-only-header .export-meta span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

body.exporting-mode .export-only-header {
  display: block !important;
}

body.exporting-mode .no-export {
  display: none !important;
}

body.exporting-mode .school-main {
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 100% !important;
}

body.exporting-mode .school-layout {
  grid-template-columns: 1fr !important;
}

body.exporting-mode .school-export-area {
  padding: 20px !important;
  background: #fff !important;
}

@media print {
  .export-only-header {
    display: block !important;
  }

  .no-export {
    display: none !important;
  }

  .school-layout {
    display: block !important;
    grid-template-columns: 1fr !important;
  }

  .school-main {
    width: 100% !important;
    display: block !important;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body {
    background: #fff !important;
  }

  .navbar,
  #backToTop,
  .site-footer,
  .hero,
  .school-hero,
  .breadcrumb,
  #cmpDrawerOverlay,
  #cmpDrawer {
    display: none !important;
  }

  .school-export-area {
    padding: 0 !important;
    margin: 0 !important;
  }

  .school-layout {
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
  }

  .info-card {
    margin-bottom: 2rem !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }

  .info-list,
  .stats-section,
  .stats-grid {
    display: block !important;
  }

  .stats-section canvas {
    margin: 1rem auto !important;
    max-width: 250px !important;
  }

  .stat-card {
    margin-bottom: 0.5rem !important;
    display: flex !important;
    align-items: center !important;
  }

  .info-row,
  .faq-item,
  .stat-card,
  .nearby-item {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* ═══════════════════════════════════════════════════════════════
   CHATBOT WIDGET — Colegios del Perú
   Diseño premium navy/gold con glassmorphism
═══════════════════════════════════════════════════════════════ */
#cdp-chatbot {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}

#cdp-chatbot.cdp-visible {
  opacity: 1;
  pointer-events: all;
}

/* ── Botón flotante CTA ────────────────────────────────────── */
#cdp-chat-cta {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  background: linear-gradient(135deg, #0f2744 0%, #1e3a72 60%, #b91c2e 100%);
  border: none;
  border-radius: 50px;
  padding: .75rem 1.25rem .75rem .85rem;
  cursor: pointer;
  color: #fff;
  box-shadow: 0 8px 32px rgba(15, 39, 68, .45), 0 2px 8px rgba(185, 28, 46, .25);
  transition: transform .25s ease, box-shadow .25s ease, opacity .3s ease;
  overflow: hidden;
}

#cdp-chat-cta:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 14px 40px rgba(15, 39, 68, .5), 0 4px 14px rgba(185, 28, 46, .3);
}

.cdp-cta-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(249, 168, 37, .25) 0%, transparent 65%);
  pointer-events: none;
}

.cdp-cta-inner {
  display: flex;
  align-items: center;
  gap: .75rem;
  position: relative;
  z-index: 1;
}

.cdp-cta-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, .15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, .2);
  flex-shrink: 0;
}

.cdp-cta-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.cdp-cta-l1 {
  font-size: .75rem;
  color: rgba(255, 255, 255, .75);
  font-weight: 500;
  line-height: 1;
}

.cdp-cta-l2 {
  font-size: .9rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  line-height: 1.3;
}

.cdp-notif-dot {
  position: absolute;
  top: 5px;
  left: 50px;
  width: 10px;
  height: 10px;
  background: #2e7d32;
  border-radius: 50%;
  border: 2px solid #0f2744;
  animation: cdp-notif-pulse 2s ease-in-out infinite;
}

@keyframes cdp-notif-pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.35);
    opacity: .7;
  }
}

#cdp-chat-cta.cdp-pulse {
  animation: cdp-cta-attention 3s ease-in-out 1;
}

@keyframes cdp-cta-attention {

  0%,
  100% {
    transform: translateY(0);
  }

  20%,
  60% {
    transform: translateY(-6px) scale(1.04);
  }

  40%,
  80% {
    transform: translateY(-3px) scale(1.02);
  }
}

#cdp-chat-cta.cdp-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(.85);
}

/* ── Ventana del chat ──────────────────────────────────────── */
#cdp-chat-window {
  position: absolute;
  bottom: calc(100% + 1rem);
  right: 0;
  width: 380px;
  max-height: 600px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(15, 39, 68, .25), 0 4px 20px rgba(0, 0, 0, .12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(15, 39, 68, .1);
  transform-origin: bottom right;
  transform: scale(.85) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: none;
}

#cdp-chat-window.cdp-open {
  animation: cdp-open .35s cubic-bezier(.34, 1.56, .64, 1) forwards;
  pointer-events: all;
}

#cdp-chat-window.cdp-closing {
  animation: cdp-close .25s ease forwards;
  pointer-events: none;
}

@keyframes cdp-open {
  from {
    transform: scale(.85) translateY(20px);
    opacity: 0;
  }

  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

@keyframes cdp-close {
  from {
    transform: scale(1) translateY(0);
    opacity: 1;
  }

  to {
    transform: scale(.85) translateY(15px);
    opacity: 0;
  }
}

/* ── Header del chat ───────────────────────────────────────── */
.cdp-chat-header {
  position: relative;
  padding: 1.1rem 1.25rem;
  overflow: hidden;
  flex-shrink: 0;
}

.cdp-chat-header-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0a1f3d 0%, #1e3a72 55%, #b91c2e 100%);
}

.cdp-chat-header-body {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: .875rem;
}

.cdp-chat-avatar {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #f9a825, #f57f17);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  position: relative;
  box-shadow: 0 4px 12px rgba(249, 168, 37, .4);
  flex-shrink: 0;
}

.cdp-status-ring {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 11px;
  height: 11px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: cdp-blink 2.5s ease-in-out infinite;
}

@keyframes cdp-blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: .5;
  }
}

.cdp-chat-title-wrap {
  flex: 1;
  min-width: 0;
}

.cdp-chat-title {
  font-family: 'Outfit', sans-serif;
  font-size: .95rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cdp-chat-status {
  font-size: .7rem;
  color: rgba(255, 255, 255, .7);
  display: flex;
  align-items: center;
  gap: .35rem;
}

.cdp-dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  display: inline-block;
}

.cdp-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 3;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, .9);
  cursor: pointer;
  font-size: .8rem;
  transition: background .2s, transform .2s;
  flex-shrink: 0;
}

.cdp-close-btn:hover {
  background: rgba(255, 255, 255, .25);
  transform: rotate(90deg);
}

/* ── Área de mensajes ──────────────────────────────────────── */
#cdp-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .625rem;
  scroll-behavior: smooth;
  background: #f8fafc;
}

#cdp-messages::-webkit-scrollbar {
  width: 4px;
}

#cdp-messages::-webkit-scrollbar-track {
  background: transparent;
}

#cdp-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.cdp-msg {
  display: flex;
  align-items: flex-end;
  gap: .5rem;
  max-width: 88%;
}

.cdp-msg.cdp-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.cdp-msg.cdp-bot {
  align-self: flex-start;
}

.cdp-msg-in {
  animation: cdp-msg-pop .3s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes cdp-msg-pop {
  from {
    transform: scale(.85) translateY(10px);
    opacity: 0;
  }

  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.cdp-msg-avatar {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #f9a825, #e65100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  color: #fff;
  flex-shrink: 0;
}

.cdp-msg-bubble {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px 16px 16px 4px;
  padding: .625rem .875rem;
  font-size: .845rem;
  line-height: 1.55;
  color: #1e293b;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
  word-break: break-word;
}

.cdp-user-bubble {
  background: linear-gradient(135deg, #1e3a72, #0f2744);
  color: #fff;
  border-radius: 16px 16px 4px 16px;
  border: none;
  box-shadow: 0 2px 8px rgba(15, 39, 68, .25);
}

.cdp-chat-link {
  color: #1e3a72;
  font-weight: 600;
  text-decoration: underline;
}

.cdp-user-bubble .cdp-chat-link {
  color: #fde68a;
}

/* ── Typing indicator ──────────────────────────────────────── */
.cdp-typing {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1rem;
}

.cdp-typing-dots {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px 16px 16px 4px;
  padding: .5rem .875rem;
  display: flex;
  gap: .3rem;
  align-items: center;
}

.cdp-typing-dots span {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: cdp-dots 1.2s ease-in-out infinite;
}

.cdp-typing-dots span:nth-child(2) {
  animation-delay: .18s;
}

.cdp-typing-dots span:nth-child(3) {
  animation-delay: .36s;
}

@keyframes cdp-dots {

  0%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-6px);
  }
}

/* ── Sugerencias ───────────────────────────────────────────── */
.cdp-suggestions {
  padding: .625rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  border-top: 1px solid #f1f5f9;
  background: #fff;
}

.cdp-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: #f0f4ff;
  border: 1.5px solid #c7d2fe;
  border-radius: 999px;
  padding: .3rem .7rem;
  font-size: .72rem;
  font-weight: 600;
  color: #1e3a72;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
}

.cdp-chip:hover {
  background: #1e3a72;
  color: #fff;
  border-color: #1e3a72;
  transform: translateY(-1px);
}

/* ── Input area ────────────────────────────────────────────── */
.cdp-chat-input-area {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

#cdp-input {
  flex: 1;
  border: 1.5px solid #e2e8f0;
  border-radius: 999px;
  padding: .6rem 1rem;
  font-size: .85rem;
  outline: none;
  font-family: inherit;
  background: #f8fafc;
  transition: border-color .2s;
}

#cdp-input:focus {
  border-color: #1e3a72;
  background: #fff;
}

#cdp-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a72, #b91c2e);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: .85rem;
  transition: transform .2s, box-shadow .2s;
  flex-shrink: 0;
}

#cdp-send:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(185, 28, 46, .4);
}

/* ── Footer del chat ───────────────────────────────────────── */
.cdp-chat-footer-bar {
  padding: .45rem 1rem;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  font-size: .65rem;
  color: #94a3b8;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
}

/* ── Mobile ────────────────────────────────────────────────── */
@media (max-width: 480px) {
  #cdp-chatbot {
    bottom: 1rem;
    right: 1rem;
  }

  #cdp-chat-window {
    width: calc(100vw - 2rem);
    max-height: 75vh;
    bottom: calc(100% + .75rem);
    right: 0;
    border-radius: 16px;
  }

  #cdp-chat-cta {
    padding: .65rem 1rem .65rem .75rem;
  }

  .cdp-cta-text {
    display: none;
  }

  #cdp-chat-cta {
    border-radius: 50%;
    padding: 0;
    width: 54px;
    height: 54px;
    justify-content: center;
  }

  .cdp-cta-icon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: none;
    border: none;
    font-size: 1.3rem;
  }
}

/* ── Impresión y Exportación ──────────────────────────────────── */
@media print {
  .adsbygoogle,
  #cdp-chatbot,
  iframe[name^="google_ads_iframe"],
  [id^="google_ads_iframe"] {
    display: none !important;
  }
}

body.exporting-mode .adsbygoogle,
body.exporting-mode #cdp-chatbot,
body.exporting-mode iframe[name^="google_ads_iframe"],
body.exporting-mode [id^="google_ads_iframe"] {
  display: none !important;
}

/* ── Leaflet Control Size Fix ─────────────────────────────────── */
.leaflet-control-layers-toggle {
  width: 30px !important;
  height: 30px !important;
  background-size: 16px !important;
}
.leaflet-touch .leaflet-control-layers-toggle {
  width: 34px !important;
  height: 34px !important;
  background-size: 18px !important;
}
.leaflet-touch .leaflet-bar a {
  width: 34px !important;
  height: 34px !important;
  line-height: 34px !important;
}