/* BDW Mobile Core v12 | Bianchi Desarrollo Web | MIT
   Progressive overrides. Tokens come from the shared BDW design system. */
.bdw-mega__mobile-group-toggle { display:none; }
@media (max-width: 900px) {
  :root { --bdw-mobile-header: 70px; --bdw-mobile-dock: 48px; }
  html { scroll-padding-top: calc(var(--bdw-mobile-header) + 14px); }
  [id] { scroll-margin-top: calc(var(--bdw-mobile-header) + 14px); }
  body { overflow-x: clip; }
  .bdw-shell { width: min(calc(100% - 32px), var(--bdw-shell)); }
  .bdw-header { z-index: 200; }
  .bdw-header__row { min-height:var(--bdw-mobile-header); height:var(--bdw-mobile-header); }
  .bdw-nav {
    top:var(--bdw-mobile-header); bottom:0; left:0; right:0;
    inset:var(--bdw-mobile-header) 0 0;
    max-height:none; height:calc(100dvh - var(--bdw-mobile-header));
    overflow-y:auto; overscroll-behavior:contain;
    padding:12px max(16px, env(safe-area-inset-left)) calc(76px + env(safe-area-inset-bottom));
    scrollbar-gutter:stable;
    box-shadow:0 12px 30px color-mix(in srgb,var(--bdw-ink) 12%,transparent);
  }
  .bdw-nav.is-open { display:flex; }
  .bdw-nav > a:not(.bdw-nav__mobile-cta),.bdw-nav > .bdw-nav__services {
    min-height:48px; padding:12px 14px; border:1px solid var(--bdw-line);
    background:var(--bdw-paper); border-radius:12px;
    font-size:clamp(.88rem,2.8vw,.98rem); font-weight:700;
  }
  .bdw-nav > a:focus-visible,.bdw-nav > button:focus-visible,
  .bdw-mega button:focus-visible,.bdw-mega a:focus-visible { outline:2px solid var(--bdw-ink); outline-offset:2px; }
  .bdw-mega__layout { width:100%; padding:8px 0 4px; }
  .bdw-mega__close { position:sticky; top:0; z-index:2; margin:0 0 8px auto; width:auto; min-height:38px; padding:8px 14px; background:var(--bdw-paper); }
  .bdw-mega__groups { gap:8px; }
  .bdw-mega-group { min-width:0; padding:0; border:1px solid var(--bdw-line); border-radius:14px; overflow:hidden; }
  .bdw-mega-group header { display:none; }
  .bdw-mega-group .bdw-mega__mobile-group-toggle {
    display:flex; align-items:center; justify-content:space-between;
    width:100%; padding:12px 14px; min-height:52px;
    font-size:.9rem; font-weight:800; text-align:left; background:var(--bdw-soft); border:0; border-radius:0;
  }
  .bdw-mega__mobile-group-toggle small { display:block; font-size:.7rem; font-weight:500; color:var(--bdw-muted); margin-top:2px; }
  .bdw-mega__mobile-group-toggle .bdw-mega__arrow { transition:transform .2s ease; font-size:1.05rem; }
  .bdw-mega__mobile-group-toggle[aria-expanded="true"] .bdw-mega__arrow { transform:rotate(180deg); }
  .bdw-mega-group > div { padding:8px; gap:6px; }
  .bdw-mega-group > div a { min-height:42px; padding:10px 12px; font-size:.82rem; line-height:1.35; }
  .bdw-mega-group--wordpress > div { grid-template-columns:minmax(0,1fr); }
  .bdw-mega[data-mobile-accordion="ready"] .bdw-mega-group > div[hidden] { display:none !important; }
  .bdw-service-dialog {
    box-sizing:border-box; width:calc(100% - 24px); max-width:560px;
    max-height:calc(100dvh - 32px); margin:auto;
    overflow-y:auto; overscroll-behavior:contain;
    padding:22px clamp(16px,5vw,26px) 24px;
    border:1px solid var(--bdw-line); border-radius:22px;
  }
  .bdw-service-dialog h2 { font-size:clamp(1.65rem,7vw,2.3rem); line-height:1.1; letter-spacing:-.045em; text-wrap:balance; }
  .bdw-dialog__close { top:10px; right:12px; display:grid; place-items:center; width:44px; height:44px; border-radius:50%; background:var(--bdw-soft); }
  .bdw-dialog__icon { width:48px;height:48px; margin-top:18px; }
  .bdw-dialog__section { margin-top:18px; padding-top:16px; }
  .bdw-dialog__actions { margin-top:20px; gap:9px; }
  .bdw-dialog__actions .bdw-cta { width:100%; min-height:46px; padding:12px; margin:0; }
  .bdw-service-card { min-width:0; border-radius:20px; }
  .bdw-service-card__content { min-width:0; }
  .bdw-service-card__actions { gap:8px; }
  .bdw-service-card__actions > button,.bdw-service-card__actions > a { min-height:40px; justify-content:center; }
  .bdw-footer__rail { min-height:var(--bdw-mobile-dock); }
  .bdw-footer__rail-inner { min-height:var(--bdw-mobile-dock); padding-inline:12px; }
  .bdw-footer__rail-inner > a { flex:0 0 auto; }
  .bdw-footer__rail-inner > a span { display:none; }
  .bdw-footer__rail-inner > div { flex:1 1 auto; justify-content:flex-end; }
  .bdw-footer__rail-inner > div a { max-width:none; font-size:12px; }
  .bdw-footer__brand-icon { width:25px; height:25px; }
  .bdw-content { padding-block:clamp(24px,6vw,44px); }
  .bdw-content__header { margin-bottom:clamp(22px,6vw,38px); }
  .bdw-content__header > p { font-size:clamp(.98rem,3.5vw,1.12rem); line-height:1.55; }
  .bdw-blog-index__identity { gap:10px; margin-top:16px; }
  .bdw-blog-index__github { max-width:100%; }
  .bdw-blog-index__github,.bdw-blog-index__author { overflow-wrap:anywhere; }
  .bdw-service-directory__hero,.bdw-geo-city__hero { padding-inline:0; }
  .bdw-service-directory__hero h1 { font-size:clamp(2.1rem,9vw,3rem); line-height:1.08; }
  .bdw-service-directory__stages { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .bdw-service-directory__stages a { min-width:0; min-height:56px; }
  .bdw-blog-index__header,.bdw-guides-index .bdw-content__header,
  .bdw-guide .bdw-content__header,.bdw-contact__hero {
    min-height:0; padding-top:clamp(18px,4vw,34px); padding-bottom:clamp(20px,5vw,40px);
  }
  .bdw-blog-index__header h1,.bdw-guides-index h1,.bdw-guide h1,
  .bdw-contact__hero h1 { font-size:clamp(2rem,8vw,3.2rem); line-height:1.1; letter-spacing:-.045em; }
}
@media (max-width: 620px) {
  .bdw-shell { width:calc(100% - 28px); }
  .bdw-brand { min-width:0; width:auto; }
  .bdw-brand__mark { width:52px !important; height:52px !important; }
  .bdw-nav { padding-inline:14px; }
  .bdw-service-directory__stages { grid-template-columns:minmax(0,1fr); }
  .bdw-service-card__actions { flex-direction:row; flex-wrap:wrap; }
  .bdw-service-card__actions > button,.bdw-service-card__actions > a { flex:1 1 130px; padding:10px; border-radius:10px; }
  .bdw-service-card__actions > button { border:1px solid color-mix(in srgb,currentColor 22%,transparent); }
  .bdw-service-dialog .bdw-dialog__lead { font-size:.95rem; line-height:1.55; }
}
@media (max-width: 390px) {
  .bdw-nav { padding-inline:10px; }
  .bdw-service-card__actions > button,.bdw-service-card__actions > a { flex-basis:100%; }
  .bdw-service-dialog { width:calc(100% - 16px); border-radius:18px; }
}
@media (prefers-reduced-motion:reduce) {
  .bdw-mega__mobile-group-toggle .bdw-mega__arrow { transition:none; }
}
/* BDW v38 — marca legible en ambos estados, sin cambiar altura de la cabecera.
   Mobile Core se carga después del CSS principal y actúa como contrato final. */
@media (min-width: 1101px) {
  .bdw-header .bdw-brand {width:174px;min-width:174px;min-height:70px;height:70px;}
  .bdw-header .bdw-brand__wordmark strong {font-size:1.88rem;line-height:.95;letter-spacing:-.055em;}
  .bdw-header .bdw-brand__wordmark small {font-size:.59rem;letter-spacing:.13em;margin-top:7px;}
  .bdw-header.is-scrolled .bdw-brand__mark {width:78px !important;height:78px !important;}
}
@media (min-width: 901px) and (max-width:1100px) {
  .bdw-header .bdw-brand {width:151px;min-width:151px;}
  .bdw-header .bdw-brand__wordmark strong {font-size:1.66rem;}
  .bdw-header .bdw-brand__wordmark small {font-size:.52rem;}
  .bdw-header.is-scrolled .bdw-brand__mark {width:68px !important;height:68px !important;}
}
@media (max-width:900px) {
  .bdw-header .bdw-brand {min-width:140px;width:140px;height:var(--bdw-mobile-header,70px);min-height:0;}
  .bdw-header .bdw-brand__wordmark strong {font-size:clamp(1.4rem,4.7vw,1.65rem);line-height:.95;}
  .bdw-header .bdw-brand__wordmark small {font-size:clamp(.46rem,1.5vw,.53rem);letter-spacing:.115em;margin-top:5px;}
  .bdw-header.is-scrolled .bdw-brand__mark {width:62px !important;height:62px !important;}
}
@media (max-width:370px) {
  .bdw-header .bdw-brand {width:119px;min-width:119px;}
  .bdw-header .bdw-brand__wordmark strong {font-size:1.33rem;}
  .bdw-header .bdw-brand__wordmark small {font-size:.445rem;}
  .bdw-header.is-scrolled .bdw-brand__mark {width:56px !important;height:56px !important;}
}
