/* CASA PIZZA — PHASE 3
   Primary destination navigation and restaurant-service priority. */

.site-header {
  height: var(--header-h);
  background: #fff !important;
  border-bottom: 1px solid var(--line) !important;
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(178px, auto) minmax(190px, 1fr) auto;
  align-items: center;
  gap: 20px;
}

.primary-nav {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
}

.primary-nav a {
  min-width: 98px;
  min-height: 42px;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 11px;
  color: var(--navy);
  font-weight: 900;
}

.primary-nav a:hover {
  background: #fff !important;
  color: var(--navy) !important;
}

.primary-nav a[aria-current="page"] {
  background: var(--navy) !important;
  color: #fff !important;
}

.header-tools {
  justify-self: end;
  min-width: 0;
}

.design-service-tools {
  flex: 0 1 auto;
  min-width: 0;
}

.order-status-trigger {
  width: auto;
  min-width: 92px;
  height: 44px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #fff;
  color: var(--navy);
  font-size: .76rem;
  font-weight: 900;
  white-space: nowrap;
}

.order-status-trigger:hover,
.status-open .order-status-trigger {
  background: var(--surface-blue);
}

.service-header-button {
  border-radius: 12px;
  background: #fff;
}

.service-label-short,
.status-label-short {
  display: none;
}

.cart-button {
  min-height: 44px;
  border-radius: 12px !important;
}

/* Homepage information links are intentionally secondary to the two destinations. */
.home-section-nav-shell {
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}

.home-section-nav {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.home-section-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
}

.home-section-nav a:hover,
.home-section-nav a:focus-visible {
  background: #fff;
  color: var(--navy);
}


/* Phase 13 hotfix 2: keep the secondary homepage links visually unchanged,
   but place them directly to the right of the primary segmented navigation
   when the desktop header has enough room. */
.home-section-nav--header {
  display: none;
}

@media (min-width: 1181px) {
  body[data-page="home"] .header-inner {
    grid-template-columns: minmax(178px, auto) auto minmax(0, 1fr) auto;
    gap: 18px;
  }

  body[data-page="home"] .home-section-nav--header {
    display: flex;
    justify-self: start;
    justify-content: flex-start;
    min-width: 0;
  }

  body[data-page="home"] .home-section-nav-shell--compact {
    display: none;
  }
}

/* The mobile dock prioritizes order status over public contact navigation. */
.mobile-bottom-nav button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.mobile-bottom-nav button.is-active {
  background: var(--surface-blue);
  color: var(--blue-dark);
}

@media (max-width: 1220px) {
  .header-inner { gap: 14px; }
  .status-label-full,
  .service-label-full { display: none; }
  .status-label-short,
  .service-label-short { display: inline; }
  .order-status-trigger { min-width: 70px; padding-inline: 10px; }
  .service-header-button { padding-inline: 10px; }
}

@media (max-width: 980px) {
  :root { --header-h: 70px; }
  body { padding-bottom: 72px; }
  body.nav-open { overflow: hidden; }

  .site-header { height: var(--header-h); }
  .header-inner {
    grid-template-columns: minmax(150px, 1fr) auto;
    gap: 10px;
  }

  .primary-nav {
    position: fixed;
    z-index: 1500;
    inset: var(--header-h) 0 0;
    display: none;
    align-content: start;
    justify-self: stretch;
    gap: 6px;
    padding: 22px;
    border: 0;
    border-radius: 0;
    background: #fff;
  }

  .nav-open .primary-nav { display: grid; }
  .primary-nav a {
    min-height: 56px;
    justify-content: flex-start;
    font-size: 1.08rem;
  }

  .header-tools {
    grid-column: 2;
    display: flex;
    align-items: center;
  }

  .menu-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  .design-service-tools {
    position: static !important;
    z-index: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    order: initial !important;
    width: auto !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  .service-header-actions {
    position: fixed;
    z-index: 1190;
    left: 12px;
    right: 12px;
    bottom: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
  }

  .service-header-button { min-height: 46px; }
  .order-status-panel { right: 0; left: auto; }
}

@media (max-width: 820px) {
  body { padding-bottom: 138px; }

  .service-header-actions {
    bottom: 76px;
  }

  .mobile-bottom-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mobile-bottom-nav a,
  .mobile-bottom-nav button {
    min-height: 52px;
    display: grid;
    place-items: center;
    padding: 5px;
    border-radius: 13px;
    font-size: .69rem;
    font-weight: 850;
  }

  .mobile-bottom-nav a::before,
  .mobile-bottom-nav button::before {
    content: none !important;
  }

  .order-status-panel {
    position: fixed;
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 139px;
    width: auto;
  }

  .design-system-toast,
  .toast {
    bottom: 145px;
  }
}

@media (max-width: 620px) {
  .brand-name { font-size: 1.02rem; }
  .header-inner { grid-template-columns: minmax(126px, 1fr) auto; }
  .header-tools { gap: 5px; }
  .order-status-trigger { min-width: 58px; padding-inline: 8px; font-size: .7rem; }
  .cart-button { padding-inline: 8px; }
  .menu-toggle { min-width: 62px !important; }
  .home-section-nav {
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .home-section-nav::-webkit-scrollbar { display: none; }
  .home-section-nav a { white-space: nowrap; }
}

@media print {
  .home-section-nav-shell,
  .mobile-bottom-nav { display: none !important; }
}

@media (max-width: 360px) {
  .header-inner { gap: 8px; }
  .brand { gap: 6px; }
  .brand-logo { width: 34px; height: 34px; }
  .brand-name { font-size: .9rem; }
  .header-tools { gap: 3px; }
  .order-status-trigger { min-width: 50px; padding-inline: 6px; }
  .cart-button { min-width: 44px; padding-inline: 5px; }
  .menu-toggle { min-width: 54px !important; padding-inline: 7px; }
}
