/* ═══ IT4Y_MKT_SBMOB_2026_07_05 — mobile nav drawer repair + polish (final cascade layer).
   The <=640px tap-target rule `html body .sidebar a{display:block!important}` was
   destroying the drawer's flex rows on phones (icon stacked above label, logo mark above
   brand name). Restores the rows at equal specificity + later cascade, keeps the 44px
   tap-target intent, and normalizes the drawer's side gutter to one consistent 16px. ═══ */
@media (max-width: 900px){
  /* 1 — restore flex rows the block-collapse destroyed (phones <=640 hit this) */
  html body .sidebar .logo-wrap,
  html body .sidebar-nav a,
  html body .sidebar-contact a,
  html body .sidebar .sb-fb-link{
    display:flex !important;
    flex-direction:row !important;
    align-items:center !important;
  }
  /* keep tap-target sizes the a11y layer wanted, with consistent geometry */
  html body .sidebar-nav a{
    min-height:44px !important; padding:10px 12px !important;
    font-size:15px !important; line-height:1.35 !important; gap:12px !important;
  }
  html body .sidebar-contact a{
    min-height:40px !important; padding:9px 4px !important;
    font-size:14px !important; line-height:1.4 !important; gap:9px !important;
  }
  /* nav icon chip stays a fixed square beside the label */
  html body .sidebar-nav a .nav-icon{
    display:flex !important; align-items:center !important; justify-content:center !important;
    width:28px !important; height:28px !important; flex:0 0 28px !important;
  }
  /* 2 — one consistent 16px side gutter down the whole drawer (was 18/14/16 mix) */
  .sidebar-logo{ padding:20px 16px 16px !important; }
  .sidebar-status{ margin:10px 16px !important; padding:11px 14px !important; }
  .sidebar-section{ padding:14px 16px !important; }
  .sidebar-section + .sidebar-section::before{ left:16px !important; right:16px !important; }
  .sidebar-bottom{ padding:14px 16px 18px !important; }
  /* 3 — logo row: mark beside text, tagline aligned under name */
  .sidebar .logo-wrap{ gap:10px !important; margin-bottom:6px !important; }
  .sidebar .logo-text-wrap{ display:flex !important; flex-direction:column !important; }
  /* 4 — theme row: label left, button right, vertically centered */
  .sidebar .theme-row{
    display:flex !important; align-items:center !important;
    justify-content:space-between !important; gap:10px !important;
  }
}


/* ═══ IT4Y_MKT_SBSCROLL_2026_07_05 — mobile drawer scroll/cutoff fix.
   100vh on phones = LARGEST viewport, so the drawer bottom (last contact links,
   CTA, theme row) sat below the visible screen and was unreachable at max scroll;
   no safe-area clearance; and sbOpen() never locked the page, so touch scroll
   chained to the page behind. dvh tracks the real visible height live. ═══ */
@media (max-width: 900px){
  html body .sidebar{
    height:100vh !important;              /* legacy fallback */
    height:100dvh !important;
    max-height:100vh !important;
    max-height:100dvh !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain;          /* end-of-list never scrolls the page behind */
    touch-action:pan-y;
  }
  /* the drawer's final row must clear the iOS home indicator */
  html body .sidebar .sidebar-bottom{
    padding-bottom:calc(20px + env(safe-area-inset-bottom, 0px)) !important;
  }
  /* page scroll frozen while the drawer is open (sbOpen/sbClose toggle this) */
  html body.sb-lock{ overflow:hidden !important; }
}


/* ═══ IT4Y_MKT_SBHDR_2026_07_05 — mobile drawer header redesign (final cascade layer).
   In-drawer X close trigger + hamburger hidden while open + header spacing balance. ═══ */
#sb-close-x{ display:none; }               /* desktop rail: never rendered */
@media (max-width: 900px){
  /* 1 — the drawer header hosts the absolutely-positioned close trigger */
  html body .sidebar .sidebar-logo{ position:relative !important; padding:18px 16px 14px !important; }
  html body #sb-close-x{
    display:flex; align-items:center; justify-content:center;
    position:absolute; top:29px; inset-inline-end:12px;      /* centers on the 60px logo row; mirrors on RTL */
    width:38px; height:38px; padding:0;
    background:var(--ds-surface-2, rgba(128,144,168,.10));
    border:1px solid var(--ds-border-soft, var(--border, rgba(128,144,168,.28)));
    border-radius:10px; color:var(--muted, inherit); cursor:pointer;
    touch-action:manipulation; -webkit-tap-highlight-color:transparent;
    transition:background .15s ease, border-color .15s ease, color .15s ease, transform .12s ease;
  }
  html body #sb-close-x:hover{
  background:var(--ds-blue-soft, var(--blue-dim, rgba(66,153,225,.15)));
  border-color:var(--ds-blue, var(--blue, #4299e1));
  color:var(--ds-blue-text, var(--blue, #4299e1));
  }
  html body #sb-close-x:active{ transform:scale(.92); }
  html body #sb-close-x svg{ width:16px; height:16px; display:block; pointer-events:none; }
  /* text never underlaps the X (52px = 38px button + 12px inset + 2px air) */
  html body .sidebar .logo-wrap{ padding-inline-end:52px !important; margin-bottom:4px !important; }
  html body .sidebar .logo-tagline{ margin-top:2px !important; }
  html:not([dir="rtl"]) body .sidebar .logo-tagline{ letter-spacing:1.6px !important; }
  /* 2 — floating hamburger fully hidden while the drawer is open (body.sb-lock).
     The mobile layer forces .topbar-menu-btn display:flex !important, so hide via
     visibility (no layout shift, smooth fade, untouchable). */
  html body.sb-lock #sidebar-toggle-topbar{
    opacity:0 !important; visibility:hidden !important; pointer-events:none !important;
    transition:opacity .18s ease, visibility 0s linear .18s;
  }
  /* 3 — status row becomes a balanced capsule on the drawer's 16px gutter */
  html body .sidebar .sidebar-status{
    margin:12px 16px !important; padding:10px 12px !important;
    border:1px solid var(--ds-border-soft, var(--border, rgba(128,144,168,.28))) !important;
    border-radius:10px !important;
    background:var(--ds-surface-2, rgba(72,187,120,.05));
  }
}


/* ═══ IT4Y_MKT_SBRADIUS_2026_07_05 — drawer outer-edge rounding + elevation (final cascade layer).
   Logical corner radii mirror per direction: LTR (left-anchored drawer) rounds its right
   corners, RTL /ar (right-anchored) rounds its left corners. Direction-neutral shadow. ═══ */
@media (max-width: 900px){
  html body .sidebar{
    border-start-end-radius:18px !important;
    border-end-end-radius:18px !important;
    box-shadow:0 12px 48px rgba(2,8,20,.24), 0 0 0 1px var(--ds-border-soft, rgba(128,144,168,.16)) !important;
  }
}


/* Drawer outer corners on the inline-end edge, restated with physical properties for engines that
   drop border-start/end-end-radius. */
@media (max-width: 900px){
  html:not([dir="rtl"]) body .sidebar{ border-top-right-radius:18px !important; border-bottom-right-radius:18px !important; }
  html[dir="rtl"] body .sidebar{ border-top-left-radius:18px !important; border-bottom-left-radius:18px !important; }
}


/* Drawer close button anchored at the inline end, restated with physical properties for engines that
   drop logical properties. */
@media (max-width: 900px){
  html:not([dir="rtl"]) body #sb-close-x{ right:12px; left:auto; }
  html:not([dir="rtl"]) body .sidebar .logo-wrap{ padding-right:52px !important; }
  html[dir="rtl"] body #sb-close-x{ left:12px; right:auto; }
  html[dir="rtl"] body .sidebar .logo-wrap{ padding-left:52px !important; }
}


/* ═══ IT4Y_MKT_SBELITE_2026_07_05 — premium mobile drawer (final cascade layer). ═══ */
@media (max-width: 900px){
  /* ── motion & elevation ──────── */
  html body .sidebar{
    transition: transform .38s cubic-bezier(.32,.72,.24,1) !important;
    scrollbar-width: none;
  }
  html body .sidebar::-webkit-scrollbar{ display:none; }
  html body .sidebar.sb-open{
    box-shadow: 0 24px 80px rgba(2,10,26,.34), 0 2px 24px rgba(2,10,26,.18), 0 0 0 1px rgba(128,144,168,.10) !important;
  }
  html body #sb-backdrop{
    background: rgba(8,15,30,.44) !important;
    -webkit-backdrop-filter: blur(7px) saturate(.92);
    backdrop-filter: blur(7px) saturate(.92);
    transition: opacity .3s ease !important;
  }
  /* staggered content entrance — vertical, so it mirrors nothing (RTL-safe);
     final .sb-open state is plain rules, so engines without transitions
     simply show content instantly */
  html body .sidebar > *{
    transition: opacity .32s ease, transform .34s cubic-bezier(.22,.61,.36,1);
  }
  html body .sidebar:not(.sb-open) > *{ opacity:0; transform:translateY(10px); transition-duration:.14s; }
  html body .sidebar.sb-open > *{ opacity:1; transform:none; }
  html body .sidebar.sb-open > *:nth-child(1){ transition-delay:.04s; }
  html body .sidebar.sb-open > *:nth-child(2){ transition-delay:.08s; }
  html body .sidebar.sb-open > *:nth-child(3){ transition-delay:.12s; }
  html body .sidebar.sb-open > *:nth-child(4){ transition-delay:.16s; }
  html body .sidebar.sb-open > *:nth-child(5){ transition-delay:.20s; }
  html body .sidebar.sb-open > *:nth-child(6){ transition-delay:.24s; }

  /* ── header: borderless brand row ──────── */
  html body .sidebar .sidebar-logo{ padding:20px 16px 14px !important; border-bottom:none !important; }
  html body .sidebar .logo-wrap{ gap:12px !important; margin-bottom:0 !important; }
  html body .sidebar .logo-svg{
    width:40px !important; height:40px !important; border-radius:11px;
    box-shadow: 0 4px 14px rgba(4,10,22,.30), 0 0 0 1px rgba(66,153,225,.22);
  }
  html body .sidebar .logo-tagline{ font-size:8.5px !important; letter-spacing:2.1px !important; opacity:.72; margin-top:3px !important; }
  html body #sb-close-x{ top:22px; width:36px; height:36px; border-radius:11px; }

  /* ── status micro-capsule ──────── */
  html body .sidebar .sidebar-status{
    margin:0 16px 4px !important; padding:9px 12px !important;
    border:1px solid rgba(72,187,120,.30) !important; border-radius:12px !important;
    background: linear-gradient(180deg, rgba(72,187,120,.11), rgba(72,187,120,.045)) !important;
    font-size:10.5px !important; font-weight:600; letter-spacing:.07em; text-transform:uppercase;
  }
  html body .sidebar .status-pulse{ width:8px !important; height:8px !important; box-shadow:0 0 0 3px rgba(72,187,120,.16); }

  /* ── sections, titles, dividers (12px gutter → 24px content rhythm) ─── */
  html body .sidebar .sidebar-section{ padding:12px 12px 10px !important; }
  html body .sidebar .sidebar-section-title{
    font-size:10px !important; letter-spacing:1.8px !important;
    margin:0 12px 8px !important; opacity:.78;
  }
  html body .sidebar .sidebar-section + .sidebar-section::before{
    left:12px !important; right:12px !important; height:1px !important;
    background: linear-gradient(90deg, transparent, var(--border, rgba(128,144,168,.22)) 18%, var(--border, rgba(128,144,168,.22)) 82%, transparent) !important;
  }

  /* ── navigation rows: rounded tap-cards + tinted icon chips ──────── */
  html body .sidebar-nav a{
    min-height:46px !important; padding:10px 12px !important; margin:1px 0;
    border-radius:12px !important; gap:12px !important;
    font-size:15px !important; font-weight:600 !important; letter-spacing:-.005em;
    transition: background .16s ease, transform .12s ease;
  }
  html body .sidebar-nav a:active{ background:var(--surface2, rgba(128,144,168,.12)) !important; transform:scale(.985); }
  html body .sidebar-nav a .nav-icon{
    width:32px !important; height:32px !important; flex:0 0 32px !important;
    border-radius:9px !important; font-size:16px !important;
    background: var(--surface2, rgba(128,144,168,.10)) !important;
    box-shadow: inset 0 0 0 1px var(--border, rgba(128,144,168,.18));
  }

  /* ── about copy ──────── */
  html body .sidebar .sidebar-about{
    font-size:13px !important; line-height:1.6 !important;
    color: var(--text2, inherit) !important; padding:0 12px !important; opacity:.92;
  }

  /* ── contact rows (match nav cards, no hard dividers) ──────── */
  html body .sidebar-contact a{
    min-height:42px !important; padding:9px 12px !important; margin:1px 0;
    border-radius:12px !important; gap:11px !important;
    font-size:14px !important; font-weight:500 !important;
    border-bottom:none !important; border-top:none !important;
    transition: background .16s ease;
  }
  html body .sidebar-contact a:active{ background:var(--surface2, rgba(128,144,168,.12)) !important; }

  /* ── docked footer ──────── */
  html body .sidebar .sidebar-bottom{
    padding:14px 16px calc(18px + env(safe-area-inset-bottom, 0px)) !important;
    border-top:1px solid var(--border, rgba(128,144,168,.20)) !important;
    background: linear-gradient(180deg, rgba(128,144,168,.055), rgba(128,144,168,.015));
  }
  html body .sidebar .cta-sidebar{
    padding:13px 16px !important; border-radius:13px !important;
    font-size:15px !important; letter-spacing:.01em; margin-bottom:10px !important;
    box-shadow: 0 8px 22px rgba(37,99,235,.30), inset 0 1px 0 rgba(255,255,255,.18);
    transition: transform .12s ease, box-shadow .2s ease;
  }
  html body .sidebar .cta-sidebar:active{ transform: translateY(1px) scale(.99); box-shadow:0 4px 12px rgba(37,99,235,.28); }
  html body .sidebar .dash-sidebar-btn{
    display:block; text-align:center; padding:11px 16px !important;
    border:1px solid var(--border, rgba(128,144,168,.26)) !important; border-radius:13px !important;
    background: var(--surface2, transparent); color: var(--text, inherit) !important;
    font-size:14px !important; font-weight:600; text-decoration:none; margin-bottom:12px !important;
    transition: background .16s ease, transform .12s ease;
  }
  html body .sidebar .dash-sidebar-btn:active{ transform:scale(.99); }
  html body .sidebar .theme-row{ padding:2px 2px 0 !important; }
  html body .sidebar .theme-label{ font-size:13px !important; font-weight:500; color:var(--text2, inherit); }
  html body .sidebar .theme-toggle-btn{ width:38px !important; height:38px !important; border-radius:11px !important; }
}
@media (prefers-reduced-motion: reduce){
  html body .sidebar, html body .sidebar > *, html body #sb-backdrop{ transition:none !important; }
  html body .sidebar:not(.sb-open) > *{ opacity:1; transform:none; }
}


/* ═══ IT4Y_MKT_SBLOCALE_2026_07_05 — drawer to true top. The drawer's language & currency row is
   .lc-drawer-row (marketing-locale-picker.css, IT4Y_MKT_LOCALE_PICKER_2026_11_11). ═══ */
@media (max-width: 900px){
  /* 1 — drawer owns the full viewport height */
  html body .sidebar{
    top:0 !important;
    height:100vh !important; height:100dvh !important;
    max-height:100vh !important; max-height:100dvh !important;
  }
  html body .sidebar .sidebar-logo{ padding-top:calc(20px + env(safe-area-inset-top, 0px)) !important; }
  /* 2 — footer keeps its stagger slot after the locale row shifts indexes */
  html body .sidebar.sb-open > *:nth-child(7){ transition-delay:.28s; }
}
