/* =========================================================
   Grupo Megasur — style.css
   Se carga DESPUÉS de Bootstrap 5.3.
   Breakpoint único de layout: 992px (menú lateral fijo desde ahí).
   ========================================================= */

/* ---------- Fuentes (rutas relativas a /css/) ---------- */
@font-face {
  font-family: 'Aileron-Bold';
  src: url("../img/Fuentes/Aileron-Bold.otf") format("opentype");
  font-display: swap;
}
@font-face {
  font-family: 'Aileron-Black';
  src: url("../img/Fuentes/Aileron-Black.otf") format("opentype");
  font-display: swap;
}
@font-face {
  font-family: 'Aileron-SemiBold';
  src: url("../img/Fuentes/Aileron-SemiBold.otf") format("opentype");
  font-display: swap;
}

/* ---------- Variables ---------- */
:root {
  --brand-green: #006637;
  --brand-green-600: #075a30;
  --ink: #212529;
  --muted: #000;
  --line: #e5e8eb;
  --aside-bg: #fff;
  --aside-hover: #f2f4f6;
  --focus: #0d6efd;
  --sidebar-w: clamp(260px, 22vw, 340px);
  --header-h: 60px;
  /* Proporción real de tus videos: ajústala si no son 16:9 / 9:16 */
  --hero-ratio-desktop: 16 / 9;
  --hero-ratio-mobile: 9 / 16;
}

/* ---------- Base ---------- */
body { color: #000; background: #fff; overflow-x: hidden; }
img, video { max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.Aileron-bold  { font-family: 'Aileron-Bold', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-weight: 400; font-style: normal; }
.Aileron-black { font-family: 'Aileron-Black', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-weight: 400; font-style: normal; letter-spacing: -.5px; }
.Aileron-Semibold { font-family: 'Aileron-SemiBold', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }

.skip-link {
  position: absolute; left: .5rem; top: -4rem; z-index: 2000;
  background: #fff; color: #000; padding: .6rem 1rem; border-radius: .5rem;
  text-decoration: none;
}
.skip-link:focus { top: .5rem; box-shadow: 0 2px 8px rgba(0,0,0,.25); }

/* ---------- Barra superior móvil / tablet ---------- */
.mobile-bar {
  position: sticky; top: 0; z-index: 1030;
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--header-h); padding: .5rem 1rem;
  background: #fff; border-bottom: 1px solid var(--line);
}
.menu-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border: 0; border-radius: .5rem;
  background: transparent; color: var(--ink);
}
.menu-btn:hover { background: var(--aside-hover); }

.brand { display: inline-flex; align-items: center; }
.brand img { height: 34px; width: auto; display: block; }
.mobile-bar .brand img { height: 28px; }

/* ---------- Layout ---------- */
.layout { display: block; }
.layout > main { min-width: 0; }   /* evita que el contenido empuje el grid */

/* ---------- Menú lateral ---------- */
.sidebar { --bs-offcanvas-width: min(86vw, 320px); }
.sidebar .offcanvas-header { justify-content: space-between; border-bottom: 1px solid var(--line); }
.sidebar .offcanvas-body { display: flex; flex-direction: column; padding: 0 0 1rem; overflow-y: auto; }
.brand-desktop { display: none; }

.side-nav { display: flex; flex-direction: column; gap: .15rem; padding: .75rem .5rem; }
.side-nav > a,
.side-nav > button {
  display: flex; align-items: center; gap: .5rem;
  width: 100%; min-height: 44px; padding: .75rem 1rem;
  border: 0; border-radius: .5rem; background: transparent;
  color: var(--ink); font-size: 1rem; font-weight: 600; letter-spacing: -.5px;
  text-align: left; text-decoration: none;
}
.side-nav > a:hover,
.side-nav > button:hover,
.side-nav > a[aria-current="page"] { background: var(--aside-hover); }
.side-nav .caret { margin-left: auto; color: #6b747c; transition: transform .2s ease; }
.side-nav button[aria-expanded="true"] .caret { transform: rotate(180deg); }

.sub-menu { padding-left: 1rem; }
.sub-menu a {
  display: flex; align-items: center; min-height: 44px; padding: .6rem 1rem;
  border-radius: .5rem; color: var(--ink); text-decoration: none; letter-spacing: -.5px;
}
.sub-menu a:hover { background: var(--aside-hover); }
.sub-menu img { height: auto; }

/* Botones de acción (Facturación / Vales / Atención) */
.cta-stack {
  list-style: none; margin: .5rem 0 0; padding: 0 1rem 0 1.25rem;
  display: grid; gap: .9rem; justify-items: start;
}
.cta-stack li { width: 100%; max-width: 260px; }
.btn-pill-icon {
  position: relative; display: flex; align-items: center;
  width: 100%; min-height: 44px;
  padding: .4rem 1rem .4rem 2.5rem;
  border-radius: 9999px; background: var(--brand-green); color: #fff;
  font-size: .875rem; font-weight: 600; line-height: 1.2; letter-spacing: .2px;
  text-transform: uppercase; text-decoration: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
  transition: transform .04s ease, filter .2s ease;
}
.btn-pill-icon:hover { color: #fff; background: var(--brand-green-600); }
.btn-pill-icon:active { transform: translateY(1px); }
.icon-wrapper {
  position: absolute; top: 50%; left: -14px; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #66A387; box-shadow: 0 0 0 1px #4C9473, 0 1px 2px rgba(0,0,0,.08);
}
.icon-24 { width: 24px; height: 24px; }

/* Bloque de contacto */
.contact-block { padding: 1.25rem 1.25rem 0; margin-top: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); }
.contact-block address { margin: 0 0 .75rem; font-size: .875rem; line-height: 1.5; }
.contact-block .phones { margin: 0 0 1rem; font-size: .875rem; }
.contact-block a { color: inherit; }
.contact-block .phones a { text-decoration: none; }
.contact-block .phones a:hover { text-decoration: underline; }
.privacy-link { display: inline-block; margin-bottom: 1rem; font-size: .875rem; text-decoration: none; }
.privacy-link:hover { text-decoration: underline; }
.emme { display: block; margin-bottom: .75rem; }
.copyright { margin: 0; font-size: .75rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; background: var(--aside-hover);
  width: 100%;   /* sin esto, max-height + aspect-ratio encogen el ancho */
  aspect-ratio: var(--hero-ratio-mobile);
  max-height: 78vh; max-height: 78dvh;
}
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Contenido ---------- */
.content { width: 100%; max-width: 1440px; margin-inline: auto; padding: clamp(1rem, 2.5vw, 2rem); }

.banner-adblue { margin-top: .5rem; }
.banner-adblue a { display: block; }
.banner-adblue img { display: block; width: 100%; height: auto; }

.tarjetas { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; margin-top: 2rem; }
.tarjeta { flex: 1 1 15rem; max-width: 26rem; margin: 0; text-align: center; }
.tarjeta a { display: block; }
.tarjeta img {
  display: block; width: 100%; height: auto; border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,.15); transition: transform .2s ease;
}
.tarjeta figcaption { margin-top: .6rem; font-size: 1rem; }
@media (hover: hover) { .tarjeta img:hover { transform: scale(1.03); } }

/* ---------- Escritorio / laptop (≥ 992px): menú fijo ---------- */
@media (min-width: 992px) {
  .mobile-bar { display: none; }

 .layout > .sidebar{
  position: sticky;
  top:0;
  height: 100dvh !important;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  background: var(--aside-bg) !important;
  border-right: 1px solid var(--line) !important; 

 }
  .sidebar .offcanvas-body { display: flex; flex-direction: column; flex-grow: 1; padding: 0 0 1rem; overflow: visible; }
  .brand-desktop { display: inline-flex; padding: 1rem 1rem .5rem 1.25rem; }

  .hero { aspect-ratio: var(--hero-ratio-desktop); max-height: 80vh; max-height: 80dvh; }
}

/* Pantallas bajas (laptops con escalado del 125–150 %): botones y menú más compactos */
@media (min-width: 992px) and (max-height: 700px) {
  .side-nav > a, .side-nav > button { min-height: 40px; padding-block: .5rem; }
  .cta-stack { gap: .6rem; }
}

/* Movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* =========================================================
   Legado: formulario / pantalla dividida.
   No se usan en index ni en las estaciones; se conservan por si
   las usa bolsadetrabajo.html o /atencion. Bórralas si no es así.
   ========================================================= */
.bg-left  { background-color: #E9DDE9; min-height: 100vh; }
.bg-right { background-image: url("../img/Pantalla Principal.png"); background-size: cover; background-position: center; min-height: 100vh; }
.formulario-wrapper { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 420px; max-width: 90%; }
.formulario-box { background-color: #1b5e20; padding: 30px; border-radius: 15px; color: #fff; box-shadow: 0 10px 25px rgba(0,0,0,.3); }
@media (max-width: 767.98px) {
  .bg-left, .bg-right { min-height: 50vh; }
  .bg-right { background-position: top; }
  .formulario-wrapper { top: 40%; width: 100%; padding: 20px; }
  .formulario-box { border-radius: 12px; padding: 20px; }
}
