/* =============================================================================
   ESTILOS INSTITUCIONALES HEADER Y FOOTER — SLEP TALAGANTE
   Replica exacta del diseño oficial de https://sleptalagante.gob.cl/
   ============================================================================= */

:root {
  --slep-navy-brand: #084682;
  --slep-blue-brand: #0f69b4;
  --slep-red-brand: #e22c2c;
  --slep-social-blue: #4181e4;
  --slep-footer-light: #e9e9e9;
  --slep-font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--slep-font-family);
  background-color: #f8fafc;
  color: #334155;
  -webkit-font-smoothing: antialiased;
}

/* =============================================================================
   1. ENCABEZADO INSTITUCIONAL (HEADER)
   ============================================================================= */
.slep-site-header {
  background-color: var(--slep-navy-brand);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(8, 70, 130, 0.18);
  width: 100%;
}

.slep-header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.45rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

/* Marca / Logo y Franja Gob */
.slep-header-brand-box {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-shrink: 0;
}

.slep-gov-flag-stripe {
  display: flex;
  width: 120px;
  height: 9px;
  border-radius: 1px;
  overflow: hidden;
}

.slep-gov-stripe-blue {
  background-color: var(--slep-blue-brand);
  width: 40%;
  height: 100%;
}

.slep-gov-stripe-red {
  background-color: var(--slep-red-brand);
  width: 60%;
  height: 100%;
}

.slep-header-logo-link {
  display: inline-block;
  line-height: 0;
  text-decoration: none;
}

.slep-header-logo-img {
  height: 62px;
  width: auto;
  max-width: 180px;
  display: block;
  object-fit: contain;
}

/* Menú de Navegación */
.slep-header-nav {
  display: flex;
  align-items: center;
}

.slep-nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.slep-nav-item {
  position: relative;
}

.slep-nav-link {
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 0.55rem 0.75rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background-color 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}

.slep-nav-link:hover,
.slep-nav-item:hover > .slep-nav-link {
  background-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.slep-nav-link.active {
  color: #ffffff;
  font-weight: 500;
}

.slep-nav-arrow {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  transition: transform 0.2s ease;
}

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

/* Dropdown Submenú */
.slep-nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--slep-blue-brand);
  min-width: 230px;
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
  display: none;
  z-index: 1001;
  border-top: 2px solid var(--slep-red-brand);
}

.slep-nav-item:hover .slep-nav-dropdown {
  display: block;
  animation: slepDropdownFade 0.2s ease forwards;
}

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

.slep-dropdown-link {
  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 0.6rem 1.25rem;
  display: block;
  transition: background-color 0.15s ease;
}

.slep-dropdown-link:hover {
  background-color: var(--slep-navy-brand);
}

/* Buscador de Cabecera */
.slep-header-search-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.slep-header-search-form {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 3px;
  overflow: hidden;
  height: 38px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
}

.slep-header-search-input {
  border: none;
  padding: 0 0.85rem;
  font-size: 13px;
  font-family: inherit;
  width: 175px;
  outline: none;
  color: #1e293b;
}

.slep-header-search-btn {
  background-color: var(--slep-red-brand);
  border: none;
  color: #ffffff;
  width: 42px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.slep-header-search-btn:hover {
  background-color: #c92323;
}

/* Botón Hamburguesa Móvil */
.slep-mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  padding: 0.4rem;
  cursor: pointer;
  border-radius: 4px;
}

.slep-mobile-menu-toggle:focus {
  outline: 2px solid var(--slep-red-brand);
}

/* Drawer Móvil (Oculto estrictamente en pantallas de escritorio) */
.slep-mobile-drawer {
  display: none !important;
}

/* =============================================================================
   2. MIGAS DE PAN (BREADCRUMB)
   ============================================================================= */
.slep-breadcrumb-bar {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.75rem 1.25rem;
}

.slep-breadcrumb-inner {
  max-width: 1200px;
  margin: 0 auto;
  font-size: 13px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.slep-breadcrumb-inner a {
  color: var(--slep-blue-brand);
  text-decoration: none;
  transition: color 0.15s ease;
}

.slep-breadcrumb-inner a:hover {
  text-decoration: underline;
  color: var(--slep-navy-brand);
}

.slep-breadcrumb-current {
  color: #0f172a;
  font-weight: 600;
}

/* =============================================================================
   3. PIE DE PÁGINA (FOOTER OFICIAL)
   ============================================================================= */
.slep-site-footer {
  margin-top: 3.5rem;
  width: 100%;
  font-family: var(--slep-font-family);
}

/* Franja superior del footer (azul/roja) */
.slep-footer-top-accent {
  display: flex;
  height: 4px;
  width: 100%;
}

.slep-footer-stripe-blue {
  background-color: var(--slep-blue-brand);
  width: 50%;
  height: 100%;
}

.slep-footer-stripe-red {
  background-color: var(--slep-red-brand);
  width: 50%;
  height: 100%;
}

/* Bloque Azul Oscuro Principal */
.slep-footer-main {
  background-color: var(--slep-navy-brand);
  color: #ffffff;
  padding: 2.75rem 1.5rem 2.25rem 1.5rem;
}

.slep-footer-container {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 210px 1.4fr 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.slep-footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.85rem 0;
  letter-spacing: 0.2px;
}

.slep-footer-logo-img {
  max-width: 190px;
  height: auto;
  display: block;
}

.slep-footer-location-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 13px;
  line-height: 1.45;
  color: #f1f5f9;
}

.slep-footer-pin-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  object-fit: contain;
}

.slep-footer-divider {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin: 1rem 0;
}

.slep-footer-contact-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 13px;
  color: #f1f5f9;
  margin-bottom: 0.45rem;
}

.slep-footer-contact-row a {
  color: #ffffff;
  text-decoration: none;
}

.slep-footer-contact-row a:hover {
  text-decoration: underline;
}

.slep-footer-links-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
}

.slep-footer-links-list li {
  margin-bottom: 0.5rem;
}

.slep-footer-links-list a {
  color: #ffffff;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.slep-footer-links-list a:hover {
  text-decoration: underline;
  opacity: 0.9;
}

/* Franja divisoria central (bicolor azul/rojo) */
.slep-footer-mid-stripe {
  height: 6px;
  width: 100%;
  background: linear-gradient(90deg, var(--slep-blue-brand) 50%, var(--slep-red-brand) 50%);
}

/* Barra Celeste de Redes Sociales */
.slep-footer-social-bar {
  background-color: var(--slep-social-blue);
  padding: 1.25rem 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.slep-social-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
}

.slep-social-link {
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.slep-social-link:hover {
  transform: scale(1.15);
  opacity: 0.92;
}

.slep-social-link svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Barra Inferior Enlaces Institucionales */
.slep-footer-bottom-bar {
  background-color: var(--slep-footer-light);
  padding: 1.6rem 1rem;
}

.slep-bottom-links-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  flex-wrap: wrap;
  max-width: 1100px;
  margin: 0 auto;
}

.slep-bottom-link {
  color: var(--slep-blue-brand);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.slep-bottom-link:hover {
  color: var(--slep-navy-brand);
  text-decoration: underline;
}

/* =============================================================================
   4. RESPONSIVE / ADAPTACIÓN MÓVIL
   ============================================================================= */
@media (max-width: 991px) {
  .slep-header-nav,
  .slep-header-search-wrap {
    display: none !important;
  }

  .slep-mobile-menu-toggle {
    display: block !important;
  }

  /* Drawer móvil */
  .slep-mobile-drawer {
    display: none !important;
    background-color: var(--slep-navy-brand);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding: 1.25rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  }

  .slep-mobile-drawer.open {
    display: block !important;
  }

  .slep-mobile-drawer .slep-nav-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }

  .slep-mobile-drawer .slep-nav-link {
    padding: 0.75rem 0.5rem;
    font-size: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
  }

  .slep-mobile-drawer .slep-nav-dropdown {
    position: static;
    box-shadow: none;
    border-radius: 0;
    border-top: none;
    background: rgba(0, 0, 0, 0.15);
    padding: 0.35rem 0 0.5rem 1rem;
    display: none;
  }

  .slep-mobile-drawer .slep-nav-item.open-sub .slep-nav-dropdown {
    display: block;
  }

  .slep-mobile-search-form {
    display: flex;
    margin-top: 1rem;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
  }

  .slep-mobile-search-form input {
    flex: 1;
    border: none;
    padding: 0 0.85rem;
    font-size: 14px;
    outline: none;
  }

  .slep-mobile-search-form button {
    background-color: var(--slep-red-brand);
    border: none;
    color: #ffffff;
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Footer en Móvil */
  .slep-footer-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}
