/* Mini Chef PPA | stable multilingual layout, 2026-10-28.
   Presentation only: no language, recipe, finance or navigation handlers.
   Preserve the existing native language select and its circular flag. */

/* Do not let the selected language name/label change the picker width. */
.topbar .language-picker {
  box-sizing: border-box;
  inline-size: 126px;
  min-inline-size: 126px;
  max-inline-size: 126px;
  flex: 0 0 126px;
  justify-content: center;
  white-space: nowrap;
  direction: ltr;
}
.topbar .language-picker .language-icon {
  flex: 0 0 26px;
  inline-size: 26px;
  block-size: 26px;
  min-inline-size: 26px;
  background-position: center;
  background-size: cover;
}
.topbar .language-picker #languageSelect {
  box-sizing: border-box;
  inline-size: 62px;
  min-inline-size: 62px;
  max-inline-size: 62px;
  flex: 0 0 62px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Desktop: six stable navigation slots, irrespective of translated length.
   Keep menu panels free to extend beyond trigger. */
@media (min-width: 1600px) {
  .topbar .desktop-nav {
    display: grid;
    grid-template-columns: 62px 80px 72px 96px 146px 134px;
    justify-content: center;
    align-items: center;
    gap: 3px;
    min-width: 0;
  }
}
@media (min-width: 1321px) and (max-width: 1599.98px) {
  .topbar .desktop-nav {
    display: grid;
    grid-template-columns: 54px 70px 60px 78px 122px 112px;
    justify-content: center;
    align-items: center;
    gap: 2px;
    min-width: 0;
  }
  .topbar .language-picker {
    inline-size: 110px;
    min-inline-size: 110px;
    max-inline-size: 110px;
    flex-basis: 110px;
  }
  .topbar #authButton { inline-size: 114px; min-inline-size: 114px; max-inline-size: 114px; }
  .topbar #headerLogoutButton { inline-size: 106px; min-inline-size: 106px; max-inline-size: 106px; }
}
@media (min-width: 1321px) {
  .topbar .desktop-nav > .desktop-nav-item,
  .topbar .desktop-nav > .mc-tools-dropdown {
    box-sizing: border-box;
    inline-size: 100%;
    min-inline-size: 0;
    margin: 0;
    justify-self: stretch;
  }
  .topbar .desktop-nav > .desktop-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-block-size: 44px;
    max-block-size: 44px;
    overflow: hidden;
    overflow-wrap: anywhere;
    text-align: center;
    white-space: normal;
    line-height: 1.12;
  }
  .topbar .desktop-nav > .mc-tools-dropdown > .mc-tools-trigger {
    box-sizing: border-box;
    inline-size: 100%;
    min-inline-size: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
  }
  .topbar .desktop-nav .mc-tools-trigger > span[data-i18n] {
    min-inline-size: 0;
    max-inline-size: 78px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar .top-actions { flex-wrap: nowrap; }
  .topbar #authButton {
    box-sizing: border-box;
    inline-size: 140px;
    min-inline-size: 140px;
    max-inline-size: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar #headerLogoutButton {
    box-sizing: border-box;
    inline-size: 124px;
    min-inline-size: 124px;
    max-inline-size: 124px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar .header-account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* The hero panel remains the same height as ES/EN/TR and does not grow
     with longer language strings. Fluid typography preserves more text. */
  .page > .hero {
    box-sizing: border-box;
    block-size: 500px;
    min-block-size: 500px;
    max-block-size: 500px;
  }
  .page > .hero .hero-copy {
    min-inline-size: 0;
    max-block-size: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
  }
  .page > .hero h1 {
    font-size: clamp(35px, 3.6vw, 57px);
    line-height: 1.04;
    overflow-wrap: anywhere;
  }
  .page > .hero p { font-size: clamp(14px, 1.1vw, 17px); line-height: 1.5; }
  .page > .hero .hero-actions .button { white-space: normal; text-align: center; }
}

/* Tablet/small laptop: the nav uses equal slots in its second header row. */
@media (min-width: 921px) and (max-width: 1320px) {
  .topbar .desktop-nav {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: center;
    justify-content: center;
    gap: 4px;
    inline-size: 100%;
    min-block-size: 44px;
  }
  .topbar .desktop-nav > .desktop-nav-item,
  .topbar .desktop-nav > .mc-tools-dropdown {
    min-inline-size: 0;
    inline-size: 100%;
    text-align: center;
  }
  .topbar .desktop-nav > .desktop-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-block-size: 44px;
    max-block-size: 44px;
    overflow: hidden;
    overflow-wrap: anywhere;
    white-space: normal;
    line-height: 1.12;
  }
  .topbar .desktop-nav > .mc-tools-dropdown > .mc-tools-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    inline-size: 100%;
    white-space: nowrap;
  }
  .topbar .desktop-nav .mc-tools-trigger > span[data-i18n] {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .page > .hero {
    box-sizing: border-box;
    block-size: 460px;
    min-block-size: 460px;
    max-block-size: 460px;
  }
  .page > .hero .hero-copy { min-inline-size: 0; max-block-size: 100%; overflow-y: auto; scrollbar-width: thin; }
  .page > .hero h1 { font-size: clamp(33px, 4vw, 49px); line-height: 1.05; overflow-wrap: anywhere; }
}

/* Mobile: preserve readable native select and prevent language-switch reflow.
   No elements are hidden; the hero copy can scroll if an unusually long
   translation is present, rather than clipping content. */
@media (max-width: 920px) {
  .topbar .language-picker {
    inline-size: 100px;
    min-inline-size: 100px;
    max-inline-size: 100px;
    flex-basis: 100px;
    min-block-size: 44px;
  }
  .topbar .language-picker .language-icon {
    inline-size: 24px;
    block-size: 24px;
    min-inline-size: 24px;
    flex-basis: 24px;
  }
  .topbar .language-picker #languageSelect {
    inline-size: 56px;
    min-inline-size: 56px;
    max-inline-size: 56px;
    flex-basis: 56px;
  }
  .topbar #authButton { inline-size: 115px; min-inline-size: 115px; max-inline-size: 115px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar #headerLogoutButton { inline-size: 108px; min-inline-size: 108px; max-inline-size: 108px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bottom-nav .nav-item small { display: block; max-inline-size: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page > .hero {
    box-sizing: border-box;
    block-size: 342px;
    min-block-size: 342px;
    max-block-size: 342px;
  }
  .page > .hero .hero-copy {
    min-inline-size: 0;
    max-block-size: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    overscroll-behavior: contain;
  }
  .page > .hero h1 { overflow-wrap: anywhere; }
  .page > .hero .hero-actions .button { white-space: normal; text-align: center; }
}
@media (max-width: 350px) {
  .topbar .language-picker { inline-size: 94px; min-inline-size: 94px; max-inline-size: 94px; flex-basis: 94px; }
  .page > .hero { block-size: 354px; min-block-size: 354px; max-block-size: 354px; }
}

/* Arabic uses RTL layout while the flag + ISO language code remain readable. */
html[lang="ar"][dir="rtl"] .topbar .language-picker { direction: ltr; }
html[lang="ar"][dir="rtl"] .page > .hero .hero-copy { text-align: start; }

/* Narrow desktop: override the broader desktop control widths above. */
@media (min-width: 1321px) and (max-width: 1599.98px) {
  .topbar #authButton {
    inline-size: 114px;
    min-inline-size: 114px;
    max-inline-size: 114px;
  }
  .topbar #headerLogoutButton {
    inline-size: 106px;
    min-inline-size: 106px;
    max-inline-size: 106px;
  }
}

@media (max-width: 620px) {
  .bottom-nav {
    inline-size: calc(100% - 14px);
    max-inline-size: 480px;
  }
  .bottom-nav .nav-item { min-inline-size: 0; flex: 1 1 0; }
  .page > .hero .hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page > .hero .hero-actions .button {
    box-sizing: border-box;
    min-inline-size: 0;
    inline-size: 100%;
    block-size: 52px;
    min-block-size: 52px;
    max-block-size: 52px;
    padding: 6px 9px;
    font-size: 12px;
    line-height: 1.15;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-wrap: anywhere;
  }
}


/* PPA HEADER NAV V2 | 2026-10-28
   Eight-language stable header and polished menu. Layout-only.
   The AI tab is moved dynamically after Explore: NEVER use positional
   fixed grid slots for its width. All labels retain their own width.
   All existing routes, auth, language picker, Tools dropdown and mobile
   bottom navigation remain untouched. */
@media (min-width: 921px) {
  .topbar .desktop-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 5px;
    box-sizing: border-box;
    inline-size: max-content;
    min-inline-size: 0;
    max-inline-size: 100%;
    padding: 4px;
    border: 1px solid rgba(222, 210, 196, .8);
    border-radius: 19px;
    background: rgba(255,255,255,.62);
    box-shadow: 0 5px 18px rgba(47,32,22,.035);
  }
  .topbar .desktop-nav > .desktop-nav-item {
    box-sizing: border-box;
    display: inline-flex;
    flex: 0 0 auto;
    justify-content: center;
    align-items: center;
    inline-size: auto;
    min-inline-size: max-content;
    max-inline-size: none;
    min-block-size: 42px;
    max-block-size: none;
    margin: 0;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    box-shadow: none;
    color: #544b43;
    font-size: 12px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: 0;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    overflow: visible;
    text-overflow: clip;
    text-decoration: none;
    text-align: center;
    transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
  }
  .topbar .desktop-nav > .desktop-nav-item:not(.creator-ai-nav):hover,
  .topbar .desktop-nav > .desktop-nav-item:not(.creator-ai-nav).active {
    background: #fff8f1;
    border-color: #f1dfcf;
    box-shadow: 0 3px 11px rgba(67,43,22,.055);
    color: #332820;
  }
  .topbar .desktop-nav > .creator-ai-nav,
  .topbar .desktop-nav > .creator-ai-nav.active {
    border-color: #d95430;
    background: linear-gradient(135deg,#fb7a4e,#e55730);
    color: #fff;
    box-shadow: 0 5px 15px rgba(221,80,43,.18);
    font-weight: 900;
    padding-inline: 15px;
  }
  .topbar .desktop-nav > .creator-ai-nav:hover,
  .topbar .desktop-nav > .creator-ai-nav.active:hover {
    border-color: #bf3f20;
    background: linear-gradient(135deg,#ee6c40,#c94d27);
    color: #fff;
    box-shadow: 0 7px 18px rgba(221,80,43,.23);
    transform: translateY(-1px);
  }
  .topbar .desktop-nav > .mc-tools-dropdown {
    display: inline-flex;
    align-items: center;
    justify-self: auto;
    flex: 0 0 auto;
    inline-size: auto;
    min-inline-size: max-content;
    max-inline-size: none;
    margin: 0;
  }
  .topbar .desktop-nav > .mc-tools-dropdown > .mc-tools-trigger {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    inline-size: auto;
    min-inline-size: max-content;
    min-block-size: 42px;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 12px;
    line-height: 1.15;
    white-space: nowrap;
    background: #e9f6ee;
    color: #17613d;
    border-color: #cce9d4;
  }
  .topbar .desktop-nav .mc-tools-trigger > span[data-i18n] {
    max-inline-size: none;
    min-inline-size: max-content;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
  }
  .topbar .desktop-nav .ppa-tools-gratis { top: -12px; }
  .topbar .top-search {
    min-inline-size: 0;
    border-color: #e7dace;
    box-shadow: 0 5px 17px rgba(58,41,25,.045);
  }
  .topbar .language-picker { border-color: #e7dace; border-radius: 14px; }
  .topbar #authButton { border-radius: 14px; }
  .topbar .desktop-nav > .desktop-nav-item:focus-visible,
  .topbar .desktop-nav > .mc-tools-dropdown > .mc-tools-trigger:focus-visible {
    outline: 3px solid #e5a65f;
    outline-offset: 3px;
  }
}
/* Spacious desktops: search area absorbs unused width; buttons stay single-line. */
@media (min-width: 1801px) {
  .topbar {
    display: grid !important;
    grid-template-columns: minmax(146px, 172px) minmax(170px, 1fr) max-content max-content !important;
    gap: 13px !important;
    padding: 10px clamp(14px, 1.3vw, 26px) !important;
  }
  .topbar > .top-search { width: 100%; max-width: 480px; }
  .topbar > .desktop-nav { width: max-content; }
  .topbar > .top-actions { min-width: 0; flex-wrap: nowrap; }
}
/* Small desktops and tablets: deliberate second row, not six squeezed columns. */
@media (min-width: 921px) and (max-width: 1800px) {
  .topbar {
    display: grid !important;
    grid-template-columns: minmax(135px, 165px) minmax(165px, 1fr) max-content !important;
    grid-template-areas: "brand search actions" "nav nav nav";
    gap: 9px 13px !important;
    padding: 9px 16px !important;
  }
  .topbar > .brand { grid-area: brand; }
  .topbar > .top-search { grid-area: search; width: 100%; min-width: 0; max-width: none; }
  .topbar > .top-actions { grid-area: actions; justify-self: end; min-width: 0; flex-wrap: nowrap; }
  .topbar > .desktop-nav {
    grid-area: nav;
    order: initial;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
  }
}
html[lang="ar"][dir="rtl"] .topbar .desktop-nav .ppa-tools-gratis {
  right: auto;
  left: 9px;
}
@media (prefers-reduced-motion: reduce) {
  .topbar .desktop-nav > .desktop-nav-item { transition: none; }
}
