/* PPA Mini Chef PATCH 39620 | Header compact + Android modal scroll
   Scope: header dimensions and today popup only. No functions removed. */

/* DESKTOP: preserve the logo, search, navigation, language, avatar/name and
   the SEPARATE "Cerrar sesión" action while reducing wasted horizontal space. */
@media (min-width: 1321px) {
  .topbar {
    grid-template-columns: minmax(140px, 170px) minmax(190px, 1fr) max-content max-content !important;
    gap: clamp(6px, .6vw, 11px) !important;
    padding: 10px clamp(12px, 1.45vw, 26px) !important;
  }
  .topbar .brand.mc-brand { min-width: 0; }
  .topbar .mc-brand-lockup { width: 154px; max-width: 100%; height: auto; }
  .topbar .top-search { min-width: 0; padding-inline: 12px; }
  .topbar .top-search input { min-width: 0; padding-block: 11px; font-size: 13px; }
  .topbar .desktop-nav { gap: 2px; min-width: 0; }
  .topbar .desktop-nav-item { padding: 9px clamp(6px, .60vw, 11px); font-size: 11.5px; }
  .topbar .top-actions { gap: 6px; min-width: 0; }
  .topbar .language-picker { height: 40px; padding-inline: 7px; }
  .topbar #authButton,
  .topbar .top-actions > button,
  .topbar .top-actions [id*="logout" i],
  .topbar .top-actions [class*="logout" i] {
    min-height: 40px;
    padding: 7px 10px;
    font-size: 11.5px;
  }
  .topbar .account-trigger.account-logged { padding: 5px 9px 5px 5px; gap: 5px; }
  .topbar .header-account-name { max-width: 100px; }
  .topbar .header-avatar { width: 30px; height: 30px; }
}

/* TABLET/SMALL LAPTOP: wrap navigation instead of clipping any controls. */
@media (min-width: 921px) and (max-width: 1320px) {
  .topbar {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 12px !important;
    padding: 9px 15px !important;
  }
  .topbar .brand.mc-brand { flex: 0 0 145px; min-width: 0; }
  .topbar .mc-brand-lockup { width: 145px; max-width: 100%; height: auto; }
  .topbar .top-search { flex: 1 1 250px; min-width: 180px; max-width: none; padding-inline: 12px; }
  .topbar .desktop-nav { order: 3; flex: 1 1 100%; justify-content: center; gap: 5px; }
  .topbar .desktop-nav-item { padding: 9px 12px; font-size: 12px; }
  .topbar .top-actions { flex: 0 1 auto; gap: 6px; }
  .topbar .top-actions > button,
  .topbar #authButton { min-height: 40px; padding: 7px 10px; font-size: 12px; }
  .topbar .header-account-name { max-width: 88px; }
}

/* MOBILE: keep tap areas large. Do not hide account or sign out actions. */
@media (max-width: 920px) {
  .topbar .brand.mc-brand { min-height: 44px; }
  .topbar .top-actions { gap: 6px; }
  .topbar .language-picker,
  .topbar #authButton,
  .topbar .top-actions > button,
  .topbar .top-actions a,
  .topbar .top-actions select {
    min-height: 44px !important;
    touch-action: manipulation;
  }
  .topbar .account-trigger.account-logged { padding: 5px 8px 5px 5px; }
  .topbar .header-avatar { width: 32px; height: 32px; }
}
@media (max-width: 430px) {
  .topbar { display: flex !important; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px !important; }
  .topbar .brand.mc-brand { flex: 0 1 auto; }
  .topbar .top-actions { min-width: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; }
}

/* ANDROID CHROME SCROLL FIX (09B popup with 10C compact layout).
   Previously both the modal body and shell were overflow:hidden, leaving a
   nested scroll region unreliable for vertical touch gestures. Use ONE
   scrollable body and natural-height results instead. */
@media (max-width: 720px) {
  body .ppa-today-overlay09b {
    box-sizing: border-box;
    align-items: stretch !important;
    justify-content: center !important;
    padding: 8px !important;
    overflow: hidden !important;
    overscroll-behavior: contain;
  }
  body .ppa-today-overlay09b .ppa-today-dialog09b {
    width: 100% !important;
    max-height: calc(100vh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior-y: contain;
  }
  body .ppa-today-overlay09b .ppa-today-dialog09b.ppa-today-compact10c {
    display: flex !important;
    flex-direction: column !important;
    height: calc(100vh - 16px) !important;
    height: calc(100dvh - 16px) !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  body .ppa-today-overlay09b .ppa-today-dialog09b.ppa-today-compact10c .ppa-today-modal-body09b {
    box-sizing: border-box;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    overscroll-behavior-y: contain;
  }
  body .ppa-today-overlay09b .ppa-today-dialog09b.ppa-today-compact10c .ppa-today-shell {
    display: block !important;
    min-height: 100% !important;
    height: auto !important;
    overflow: visible !important;
    padding-bottom: 24px !important;
  }
  body .ppa-today-overlay09b .ppa-today-dialog09b.ppa-today-compact10c .ppa-today-scroll10c {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    flex: none !important;
    touch-action: pan-y !important;
  }
  body .ppa-today-overlay09b .ppa-today-dialog09b.ppa-today-compact10c .ppa-today-compact-dock10c {
    position: static !important;
  }
}
