/* Responsive sizing and the mobile menu, shared by the home page and the Customer Account pages.
   Loaded after each page's own styles; nothing here changes colours, type or content. */

/* ---- Container: fluid, stepping up on larger screens instead of staying 1120px wide ---- */
body .wrap{max-width:1240px;padding-inline:clamp(16px,3vw,32px)}
@media (min-width:1500px){body .wrap{max-width:1360px}}
@media (min-width:1800px){body .wrap{max-width:1480px}}
html,body{overflow-x:clip}
body img,body video{max-width:100%}

/* ---- Desktop menu (1024px and up): every link visible, nothing cut off ---- */
@media (min-width:1024px){
  body .navrow{overflow:visible}
  body .navrow ul{justify-content:space-between;gap:8px}
  body .nav-toggle{display:none}
}
@media (min-width:1024px) and (max-width:1279.98px){
  body .navrow a{font-size:.86rem}
}

/* ---- Phone and tablet menu (below 1024px): a button opens a drop-down panel ---- */
.nav-toggle{display:none}
@media (max-width:1023.98px){
  html.js-nav body .nav-toggle{
    display:inline-flex;align-items:center;justify-content:center;flex:none;
    width:46px;height:46px;padding:0;border:1px solid var(--line);border-radius:12px;
    background:var(--paper);color:var(--ink);cursor:pointer;-webkit-tap-highlight-color:transparent
  }
  html.js-nav body .nav-toggle:focus-visible{outline:3px solid var(--label);outline-offset:2px}
  html.js-nav body .nav-toggle svg{width:24px;height:24px;display:block}
  html.js-nav body .nav-toggle .x{display:none}
  html.js-nav body header.nav-open .nav-toggle .x{display:block}
  html.js-nav body header.nav-open .nav-toggle .bars{display:none}
  html.js-nav body .bar{gap:10px}
  html.js-nav body .bar .brand{margin-right:auto}
  html.js-nav body .navrow{
    position:absolute;left:0;right:0;top:100%;z-index:9;
    background:var(--paper);border-top:1px solid var(--line);
    border-radius:0 0 16px 16px;box-shadow:0 18px 30px rgba(10,31,79,.16);
    overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;
    max-height:0;opacity:0;visibility:hidden;
    transition:max-height .28s ease,opacity .2s ease,visibility 0s linear .28s
  }
  html.js-nav body header.nav-open .navrow{
    max-height:calc(100vh - 124px);max-height:calc(100dvh - 124px);opacity:1;visibility:visible;
    transition:max-height .28s ease,opacity .2s ease
  }
  html.js-nav body .navrow ul{flex-direction:column;gap:0;white-space:normal;padding:6px 0 10px}
  html.js-nav body .navrow a{display:block;padding:11px clamp(16px,3vw,32px);font-size:1rem;border-bottom:0}
  html.js-nav body .navrow a[aria-current="page"]{border-bottom:0;background:var(--surface);box-shadow:inset 4px 0 0 var(--accent)}
}
@media (max-width:1023.98px) and (min-width:600px){
  html.js-nav body .navrow ul{display:grid;grid-template-columns:1fr 1fr}
}
@media (max-width:380px){
  body .logo{height:44px}
  body .bar .btn{padding:9px 12px}
}
@media (prefers-reduced-motion:reduce){
  html.js-nav body .navrow,html.js-nav body header.nav-open .navrow{transition:none}
}

/* Grid children may shrink below their content's natural width, so a wide form row
   can no longer push a whole page section past the edge of a phone screen. */
body .two > *,body .hero-grid > *,body .cards > *,body .promo > *,body .explain > *{min-width:0}
body .est-out{grid-template-columns:repeat(2,minmax(0,1fr))}
@media (max-width:430px){
  body .est-out div{padding:10px}
  body .est-out b{font-size:clamp(1.05rem,5.4vw,1.5rem);overflow-wrap:anywhere}
}

/* Gallery: a landscape photo or video takes two columns so it is not cropped to a tall frame. */
@media (min-width:560px){
  body .gallery.tall figure.wide{grid-column:span 2}
  body .gallery.tall figure.wide img,body .gallery.tall figure.wide video{aspect-ratio:18/14}
}
@media (max-width:559.98px){
  body .gallery.tall figure.wide img,body .gallery.tall figure.wide video{aspect-ratio:16/10}
}

/* ---- Services drop-down: Services, How it works, Import Academy and Pre-order under one entry ---- */
.navrow .navdrop{display:inline-flex;align-items:center;gap:5px;margin:0;padding:0 0 3px;border:0;background:none;cursor:pointer;
  font:inherit;font-family:var(--mono);font-size:.95rem;font-weight:600;color:var(--muted);-webkit-tap-highlight-color:transparent}
.navrow .navdrop:hover,.navrow .has-sub.open>.navdrop{color:var(--ink)}
.navrow .navdrop.is-current{color:var(--accent)}
.navrow .navdrop:focus-visible{outline:3px solid var(--label);outline-offset:3px;border-radius:4px}
.navrow .navdrop .chev{transition:transform .18s ease}
.navrow .has-sub.open>.navdrop .chev{transform:rotate(180deg)}
/* Without the script the four links simply sit in the row, as before. */
html:not(.js-nav) .navrow .navdrop{display:none}
html:not(.js-nav) .navrow .has-sub,html:not(.js-nav) .navrow .submenu{display:contents}
@media (min-width:1024px){
  html.js-nav body .navrow .has-sub{position:relative}
  html.js-nav body .navrow .navdrop{border-bottom:2px solid transparent}
  html.js-nav body .navrow .navdrop.is-current{border-bottom-color:var(--accent)}
  html.js-nav body .navrow ul.submenu{display:none;position:absolute;left:-14px;top:calc(100% + 10px);z-index:20;min-width:200px;
    flex-direction:column;justify-content:flex-start;gap:2px;padding:8px;white-space:nowrap;
    background:var(--paper);border:1px solid var(--line);border-radius:12px;box-shadow:0 14px 28px rgba(10,31,79,.16)}
  html.js-nav body .navrow ul.submenu::before{content:"";position:absolute;left:0;right:0;top:-12px;height:12px}
  html.js-nav body .navrow .has-sub.open>ul.submenu,html.js-nav body .navrow .has-sub:hover>ul.submenu{display:flex}
  html.js-nav body .navrow ul.submenu a{display:block;padding:9px 12px;border-radius:8px;border-bottom:0;color:var(--ink)}
  html.js-nav body .navrow ul.submenu a:hover{background:var(--surface)}
  html.js-nav body .navrow ul.submenu a[aria-current="page"]{border-bottom:0;color:var(--accent);background:var(--surface)}
}
@media (max-width:1023.98px){
  html.js-nav body .navrow .navdrop{display:flex;justify-content:space-between;width:100%;padding:11px clamp(16px,3vw,32px);font-size:1rem;text-align:left}
  html.js-nav body .navrow .navdrop.is-current{box-shadow:inset 4px 0 0 var(--accent)}
  html.js-nav body .navrow ul.submenu{display:none;padding:0 0 6px}
  html.js-nav body .navrow .has-sub.open>ul.submenu{display:block}
  html.js-nav body .navrow ul.submenu a{padding-left:calc(clamp(16px,3vw,32px) + 16px);font-weight:500}
}
@media (max-width:1023.98px) and (min-width:600px){
  html.js-nav body .navrow .has-sub{grid-column:1/-1}
}
@media (prefers-reduced-motion:reduce){.navrow .navdrop .chev{transition:none}}

/* On phones, the existing header hamburger becomes the customer account menu.
   The wider layout keeps its original site navigation and dashboard tabs. */
.account-menu-nav{display:none!important}
@media (max-width:767.98px){
  html.js-nav body.account-page .navrow>ul:not(.account-menu-nav){display:none}
  html.js-nav body.account-page .navrow>.account-menu-nav{display:flex!important;list-style:none;margin:0;flex-direction:column;gap:0;white-space:normal;padding:6px 0 10px}
  html.js-nav body.account-page .account-menu-nav button{display:block;width:100%;padding:11px clamp(16px,3vw,32px);border:0;background:transparent;color:var(--muted);text-align:left;font:inherit;font-family:var(--mono);font-size:1rem;letter-spacing:0;text-transform:none;cursor:pointer}
  html.js-nav body.account-page .account-menu-nav button:hover{color:var(--ink)}
  html.js-nav body.account-page .account-menu-nav button[aria-current="page"]{color:var(--ink);background:var(--surface);box-shadow:inset 4px 0 0 var(--accent)}
  html.js-nav body.account-page .account-tabs,
  html.js-nav body.account-page #app>.head>.row{display:none}
}
