/* =====================================================================
   Wakah Logistics: app layout layer
   Loaded AFTER main.css by resources/views/layouts/app.blade.php.
   main.css stays the single source of brand styles; this file only adds
   page-frame behaviour (container width, nav, footer, small screens).
   Breakpoints: 1000px (tablet), 820px (phone/menu), 480px, 370px.
   ===================================================================== */

:root {
  --wrap: 1240px;
  /* side gutter: 5vw on normal screens, centred to --wrap on wide ones */
  --pad: max(5vw, calc((100vw - var(--wrap)) / 2));
  --nav-h: 68px;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + 8px);
}

img, svg {
  max-width: 100%;
}

img {
  height: auto;
}

/* ---------- page frame: one gutter for nav, sections and footer ---------- */
nav,
section,
footer {
  padding-left: max(var(--pad), env(safe-area-inset-left, 0px));
  padding-right: max(var(--pad), env(safe-area-inset-right, 0px));
}

.hero {
  min-height: 100vh;
  min-height: 100svh; /* stable height on phones with collapsing URL bars */
}

/* ---------- accessibility ---------- */
.skip {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--o);
  color: #000;
  font-weight: 700;
  text-decoration: none;
  transition: top .2s;
}

.skip:focus {
  top: calc(env(safe-area-inset-top, 0px) + 10px);
}

:focus-visible {
  outline: 2px solid var(--o);
  outline-offset: 3px;
}

nav ul a[aria-current="page"] {
  color: var(--o);
}

/* ---------- nav (desktop) ---------- */
nav {
  gap: 20px;
}

nav .logo {
  flex: none;
}

nav ul {
  margin-left: auto;
  margin-right: 8px;
}

nav .btn {
  flex: none;
  white-space: nowrap;
}

/* ---------- buttons / rows ---------- */
.btn {
  white-space: nowrap;
}

.row .btn {
  justify-content: center;
}

/* ---------- tablet ---------- */
@media (max-width: 1000px) {
  .two {
    grid-template-columns: 1fr;
  }

  .fg {
    grid-template-columns: 1fr 1fr;
    gap: 34px;
  }

  .fg > div:first-child,
  .fg > div:last-child {
    grid-column: 1 / -1;
  }

  .fc {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }
}

/* ---------- phone / menu mode ---------- */
@media (max-width: 820px) {
  :root {
    --nav-h: 62px;
  }

  nav {
    gap: 10px;
    padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
    padding-bottom: 10px;
  }

  /* main.css declares the base `.burger{display:none}` after its own mobile
     rule, so the button never appeared on phones. Win the cascade here. */
  nav .burger {
    display: grid;
  }

  /* logo left, then Quote button, then burger on the far right */
  nav .logo {
    margin-right: auto;
  }

  nav .logo img {
    width: 124px;
  }

  nav .btn {
    order: 2;
    padding: 9px 16px;
    font-size: .85rem;
  }

  nav .burger {
    order: 3;
  }

  nav ul {
    order: 4;
    margin: 0;
    max-height: calc(100vh - var(--nav-h));
    max-height: calc(100svh - var(--nav-h));
    overflow-y: auto;
    /* opaque: a backdrop-filter nested inside nav's own blur doesn't render */
    background: var(--bg);
    box-shadow: 0 22px 40px rgba(0, 0, 0, .28);
  }

  nav ul a {
    padding-left: max(5vw, env(safe-area-inset-left, 0px));
    padding-right: max(5vw, env(safe-area-inset-right, 0px));
  }

  section {
    padding-top: 68px;
    padding-bottom: 68px;
  }

  .hero {
    padding-top: calc(var(--nav-h) + 36px);
  }

  .grid {
    margin-top: 28px;
  }

  .band {
    padding: 30px 22px;
  }

  /* hover tilt makes no sense on touch screens */
  .card.on,
  .card:not(.rv) {
    transform: none !important;
  }
}

/* ---------- small phones ---------- */
@media (max-width: 480px) {
  body {
    font-size: 15.5px;
  }

  section {
    padding-top: 52px;
    padding-bottom: 52px;
  }

  .hero {
    padding-top: calc(var(--nav-h) + 24px);
  }

  h1 {
    font-size: clamp(2.1rem, 10.5vw, 2.7rem);
  }

  .lead {
    font-size: 1rem;
  }

  .trust {
    gap: 8px 16px;
    font-size: .85rem;
  }

  .grid {
    gap: 14px;
    margin-top: 24px;
  }

  .card {
    padding: 22px 20px;
    border-radius: 18px;
  }

  .ic {
    width: 46px;
    height: 46px;
    margin-bottom: 12px;
  }

  .row {
    gap: 10px;
    margin-top: 22px;
  }

  /* two buttons per line, the third fills the next line */
  .row .btn {
    flex: 1 1 140px;
  }

  .chips {
    gap: 8px;
  }

  .chip {
    padding: 8px 14px;
    font-size: .85rem;
  }

  .band {
    grid-template-columns: 1fr 1fr;
    gap: 22px 12px;
    padding: 26px 16px;
    border-radius: 20px;
  }

  .band b {
    font-size: 2rem;
  }

  .fin {
    border-radius: 22px;
    padding: 34px 20px;
  }

  details {
    padding: 14px 16px;
  }

  .fg {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .fc {
    grid-template-columns: 1fr;
  }

  footer {
    padding-top: 52px;
  }

  .fb {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-top: 36px;
  }
}

/* very narrow phones: the bottom bar already carries "Quote" */
@media (max-width: 370px) {
  nav .btn {
    display: none;
  }

  nav .logo img {
    width: 112px;
  }
}

/* ---------- landscape phones ---------- */
@media (max-height: 480px) and (orientation: landscape) {
  .hero {
    min-height: 0;
    padding-top: calc(var(--nav-h) + 24px);
    padding-bottom: 48px;
  }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .mq div,
  .fab {
    animation: none;
  }

  .rv {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
