/*
 * BINABY | site.css
 * Global palette, spacing, typography, shared tokens, header and site layout.
 * Main selectors: .pz-nav, .header-search-input, .pz-user, .pz-lang, .page-container
 * Keep cascade order and media conditions. Edit existing rules instead of appending patches.
 * Shared tokens: site.css. File map and rationale: CSS_MAINTENANCE.md.
 */

:root {
  --binaby-navy: #122f70;
  --editorial-ink: #101f3b;
  --editorial-paper: #f8fafc;
  --editorial-line: #dadfe6;
  --editorial-warm: #e07a50;
  --night-surface: #112548;
  --night-soft: #1c355b;
  --night-line: #435a7a;
  --night-text: #f5f8ff;
  --night-muted: #c1cfe4;
  --night-teal: #70d6c5;
  --night-blue: #80aaff;
  --night-violet: #b2a2f8;
  --binaby-blue: #428ed9;
  --binaby-blue-bright: #4f8ef7;
  --accent-teal: #2fb7a8;
  --accent-coral: #ff7a59;
  --accent-violet: #7c6ff2;
  --accent-gold: #f2b84b;
  --surface-blue: #eef5ff;
  --surface-mint: #edf9f6;
  --surface-peach: #fff1ec;
  --surface-lavender: #f3f0ff;
  --surface-cream: #fff8e8;
  --surface-page: #f8fafc;
  --surface-card: #ffffff;
  --ink-teal: #136e65;
  --ink-violet: #5642ae;
  --ink-coral: #a4402b;
  --data-lower: #168479;
  --data-center: #246db3;
  --data-upper: #6957d6;
  --border-peach: #eed8ce;
  --footer-link-hover: #c4e2ff;
  /* Deeper interaction blue keeps white button labels above 4.5:1. */
  --action: #2459d3;
  --action-hover: #1946af;
  --section-space: clamp(32px, 4vw, 60px);
  --brand-50: #f6f8fc;
  --brand-100: var(--surface-blue);
  --brand-200: #dbe7f6;
  --brand-300: #c4d6ee;
  --brand-400: #9fbce0;
  --brand-500: #6f8fb8;
  --brand-600: #55769f;
  --brand-700: #435f80;
  --brand-800: #354c67;
  --brand-900: #293b50;
  --bg: var(--surface-page);
  --bg-elevated: #fbfcfe;
  --surface: var(--surface-card);
  --surface-2: #f9fafc;
  --surface-3: #f3f5f8;
  --border: #e0e5ec;
  --border-strong: #cfd8e3;
  --text: #142340;
  --text-soft: #344255;
  --muted: #5d6b7d;
  --muted-2: #65748a;
  --success: #3f8f63;
  --danger: #c25757;
  --warning: #a9782a;
  --font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --text-xs: 0.78rem;
  --text-sm: 0.92rem;
  --text-md: 1rem;
  --text-lg: 1.08rem;
  --text-xl: 1.28rem;
  --text-2xl: 1.72rem;
  --text-3xl: clamp(2rem, 2.2vw, 2.75rem);
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 28px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-14: 56px;
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.04), 0 6px 20px rgba(16, 24, 40, 0.05);
  --shadow-2: 0 10px 30px rgba(16, 24, 40, 0.07);
  --shadow-3: 0 18px 45px rgba(16, 24, 40, 0.08);
  --focus: 0 0 0 3px rgb(66 142 217 / 24%);
  --ss-accent: var(--brand-600);
  --ss-border: var(--brand-border, rgba(0,0,0,.10));
  --ss-muted: var(--brand-muted, rgba(0,0,0,.60));
  --ss-bg: var(--brand-bg, #ffffff);
  --ss-band-cheap: var(--surface-mint);
  --ss-band-typical: var(--surface-blue);
  --ss-band-premium: var(--surface-lavender);
  --ss-rail-bg: color-mix(in srgb, black 4%, white);
  --app-header-offset: 212px;
  --app-header-offset-mobile: 140px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: var(--font);
  font-size: var(--text-md);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.12;
}

h1 {
  font-size: var(--text-3xl);
}

h2 {
  font-size: clamp(1.45rem, 1.5vw, 2rem);
}

h3 {
  font-size: clamp(1.15rem, 1.15vw, 1.4rem);
}

p {
  color: var(--text-soft);
  margin-top: 0;
}

small,
.text-muted {
  color: var(--muted) !important;
}

.page-container {
  width: calc(100% - 48px);
  max-width: none;
  margin: 0 auto;
  padding: 18px 0 0;
}

@media (max-width: 767.98px) {
  .page-container {
    width: calc(100% - 20px);
    max-width: none;
  }
}

.container-fluid {
  width: calc(100% - 48px);
  max-width: none;
  margin-inline: auto;
}

@media (max-width: 767.98px) {
  .container-fluid {
    width: calc(100% - 20px);
  }
}

.form-control,
.form-select {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
}

.form-control::placeholder {
  color: var(--muted-2);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-500);
  box-shadow: var(--focus);
  background: var(--surface);
  color: var(--text);
}

.form-check-input {
  border-color: var(--border-strong);
}

.form-check-input:checked {
  background-color: var(--brand-600);
  border-color: var(--brand-600);
}

.btn {
  border-radius: 12px;
  font-weight: 600;
}

.btn-primary {
  background: var(--action);
  border-color: var(--action);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--action-hover);
  border-color: var(--action-hover);
}

.btn-outline-light {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface);
}

.btn-outline-light:hover,
.btn-outline-light:focus {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.btn-outline-secondary {
  color: var(--text-soft);
  border-color: var(--border);
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
}

.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-2);
  padding: 8px;
}

.dropdown-item {
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  color: var(--text);
}

.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item.active {
  background: var(--surface-3);
  color: var(--text);
}

.alert {
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: #fff7f7;
  color: #7d2d2d;
}

.brand-logo {
  height: 40px;
  width: auto;
  display: block;
}

.brand-name {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.2px;
}

.footer-logo {
  height: 60px;
  width: auto;
}

.pz-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  object-fit: cover;
  display: inline-block;
}

/* suggestion box */

.ss-nav-usericon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid var(--text);
  display: inline-block;
  position: relative;
}

.ss-nav-usericon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translateX(-50%);
  width: 12px;
  height: 7px;
  border-radius: 999px 999px 6px 6px;
  background: var(--text);
}

.ss-nav-usericon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--text);
}

hr {
  border-color: var(--border);
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* Suggestion dropdown must be above nav/subnav/page controls */

#suggest-box {
  position: absolute !important;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 3200 !important;
  display: none;
}

/* Page content stays below */

.page-container,
.products-layout,
.products-gridWrap,
.gbar,
.grid-head {
  position: relative;
  z-index: 1;
}

#suggest-box {
  margin-top: 6px !important;
  border-radius: 12px !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-2) !important;
  overflow: hidden !important;
  background: var(--surface) !important;
}

#suggest-box .list-group-item {
  min-height: 42px !important;
  padding: 0 0.85rem !important;
  font-size: 0.95rem !important;
  display: flex !important;
  align-items: center !important;
  line-height: 1.1 !important;
  font-weight: 400 !important;
  color: var(--text) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--border) !important;
  background: var(--surface) !important;
}

#suggest-box .list-group-item:last-child {
  border-bottom: 0 !important;
}

#suggest-box .list-group-item:hover,
#suggest-box .list-group-item:focus,
#suggest-box .list-group-item:active {
  background: var(--surface-3) !important;
  color: var(--text) !important;
}

#suggest-box .list-group-item-action {
  transition: background-color .15s ease, color .15s ease !important;
}

/* mobile */

@media (max-width: 767.98px) {
  #suggest-box .list-group-item {
    min-height: 38px !important;
    font-size: 0.9rem !important;
    padding: 0 0.75rem !important;
  }
}

/* account/logout button compact */

@media (max-width: 767.98px) {

  .brand-logo {
    height: 34px !important;
    width: auto !important;
  }

  .page-container {
    padding-top: 10px !important;
  }
}

/* Shared shell: single source of truth. Logo artwork/dimensions remain above. */
:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--action);
  outline-offset: 3px;
}
.btn { --bs-btn-disabled-opacity: .55; }
.btn-primary { --bs-btn-active-bg: var(--action-hover); --bs-btn-active-border-color: var(--action-hover); }
.form-control:focus, .form-select:focus { border-color: var(--action); }
.form-check-input:checked { background-color: var(--action); border-color: var(--action); }
.pz-header { position: relative; z-index: 1030; background: var(--surface); border-bottom: 1px solid var(--border); }
.pz-nav { padding: 14px 0 6px; }
.pz-nav > .container-fluid { display: flex; flex-wrap: nowrap; align-items: center; gap: clamp(16px, 2vw, 32px); }
.pz-nav .navbar-brand { flex: 0 0 auto; margin: 0; padding: 0; }
.pz-nav .header-search-form { flex: 1 1 auto; min-width: 0; margin: 0; position: relative; }
.pz-nav .header-search-input { width: 100%; min-height: 52px; padding: 12px 62px 12px 18px; font-size: 16px; border-radius: var(--r-md); background: var(--surface-2); }
.pz-nav .header-search-input:focus { background: var(--surface); box-shadow: var(--focus); }
.pz-nav .header-search-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; padding: 0; display: grid; place-items: center; background: var(--action); color: #fff; border: 0; border-radius: var(--r-sm); }
.pz-nav .header-search-btn:hover { background: var(--action-hover); }
.header-actions { flex: 0 0 auto; gap: 6px; }
.pz-user, .pz-lang { min-height: 44px; padding: 8px 10px; border-radius: var(--r-xs); font-size: 14px; color: var(--text); }
.pz-user:hover, .pz-lang:hover { background: var(--surface-3); color: var(--action); }
.pz-user__label { display: block; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pz-lang { display: inline-flex; align-items: center; line-height: 1; }
.pz-lang__label { display: inline-flex; align-items: center; gap: 6px; line-height: 1; }
.pz-flag { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 16px; width: 16px; height: 12px; margin: 0; line-height: 0; }
.pz-flag svg { display: block; width: 16px; height: 12px; margin: 0; }
.pz-lang > .bi-chevron-down { display: inline-flex; align-items: center; justify-content: center; margin: 0; line-height: 1; }
.pz-lang > .bi-chevron-down::before { display: block; vertical-align: 0; }
.pz-header .dropdown-menu { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 6px; box-shadow: var(--shadow-2); max-width: calc(100vw - 32px); }
.pz-header .dropdown-item { min-height: 44px; display: flex; align-items: center; padding: 8px 12px; white-space: normal; border-radius: var(--r-xs); font-size: 14px; }
.pz-header .dropdown-item:hover, .pz-header .dropdown-item:focus { color: var(--action); background: var(--brand-100); }
.pz-header .dropdown-item.active { color: #fff; background: var(--action); }
.pz-subnav-inner { display: flex; gap: 26px; align-items: center; border-top: 1px solid var(--surface-3); }
.pz-subnav-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: 14px; font-weight: 550; border-bottom: 2px solid transparent; }
.pz-subnav-link:hover, .pz-subnav-link[aria-current="page"] { color: var(--action); border-bottom-color: var(--binaby-blue); }
.pz-menu-toggle { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 1px solid var(--border); border-radius: var(--r-xs); background: var(--surface); color: var(--binaby-navy); }
.pz-menu-toggle[hidden], .pz-subnav[hidden] { display: none; }
.pz-menu-toggle[aria-expanded="true"] { background: var(--brand-100); border-color: var(--action); }
.pz-mobile-language:empty { display: none; }

/* A quiet branded ending. The light plate preserves the supplied logo colors. */
.pz-footer { margin-top: var(--section-space); background: var(--binaby-navy); color: #fff; border-top: 0; }
.pz-footer > .container-fluid { padding-block: 40px; }
.footer-grid { display: grid; grid-template-columns: minmax(240px, 2fr) repeat(4, minmax(0, 1fr)); gap: 24px; }
.footer-brand__plate { display: inline-flex; align-items: center; padding: 10px 14px; background: #fff; border-radius: var(--r-sm); margin-bottom: 18px; }
.footer-statement { color: #fff; font-size: 19px; line-height: 1.4; max-width: 300px; margin-bottom: 10px; }
.footer-description { color: #b2c1d8; font-size: 12px; line-height: 1.65; max-width: 280px; }
.footer-title { color: #fff; font-size: 14px; font-weight: 650; margin-bottom: 10px; }
.footer-link, .footer-social-link { display: flex; align-items: center; gap: 10px; min-height: 44px; color: #dce6f4; font-size: 14px; line-height: 1.4; padding-block: 8px; }
.footer-link:hover, .footer-social-link:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.footer-social-link__icon { display: inline-flex; flex: 0 0 18px; width: 18px; height: 18px; }
.footer-social-link__icon svg { width: 18px; height: 18px; }
.pz-footer-bottom { border-top: 1px solid rgb(255 255 255 / 18%); }
.footer-disclaimer { color: #c6d3e8; font-size: 13px; line-height: 1.7; max-width: 1100px; }
.pz-footer :focus-visible { outline-color: #8fc7ff; }
@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; column-gap: 28px; align-items: center; }
  .footer-brand__plate { grid-row: span 2; justify-self: start; margin-bottom: 0; }
  .footer-statement { max-width: 560px; }
}
@media (max-width: 991.98px) {
  .pz-nav { padding-block: 10px; }
  .pz-nav > .container-fluid { flex-wrap: wrap; gap: 10px; }
  .pz-nav .header-search-form { flex-basis: 100%; order: 3; }
  .pz-header.is-enhanced .pz-subnav { position: absolute; top: 100%; inset-inline: 16px; max-height: min(70vh, 520px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-2); }
  .pz-header .pz-subnav > .container-fluid { width: 100%; }
  .pz-subnav-inner { flex-wrap: wrap; gap: 0 20px; }
  .pz-header.is-enhanced .pz-subnav-inner { flex-direction: column; align-items: stretch; border-top: 0; padding-top: 8px; }
  .pz-header.is-enhanced .pz-subnav-link { padding: 10px; }
  .pz-mobile-language { padding: 8px 0; border-top: 1px solid var(--border); }
  .pz-mobile-language .dropdown-menu { position: static !important; transform: none !important; margin: 0; box-shadow: none; }
  .pz-mobile-language .pz-lang { justify-content: space-between; }
}
@media (max-width: 767.98px) {
  .pz-nav > .container-fluid, .pz-footer > .container-fluid { width: 100%; }
  .pz-user__label { max-width: 100px; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; }
  .footer-brand { display: block; }
  .footer-brand__plate { margin-bottom: 18px; }
  .footer-title { margin-bottom: 4px; }
  .footer-statement { font-size: 18px; }
}
@media (max-width: 359px) {
  .pz-nav > .container-fluid { column-gap: 4px; }
  .header-actions { gap: 0; }
  .pz-user { padding-inline: 5px; font-size: 13px; }
  .pz-user__label { max-width: 65px; }
  .footer-grid { column-gap: 14px; }
}

/* Shared heading/interaction colors; no layout or semantic-status changes. */
h1, h2, h3, h4, h5, h6 { color: var(--binaby-navy); }
.pz-nav .header-search-input { background: var(--surface-card); }
.pz-subnav-link:hover { color: var(--action); border-bottom-color: var(--binaby-blue-bright); }
.pz-footer .footer-link:hover, .pz-footer .footer-social-link:hover { color: var(--footer-link-hover); }

/* Editorial finish: existing shell and navigation behavior are unchanged. */
.pz-header { background: var(--surface-card); }
.pz-nav .header-search-input { background: var(--surface-page); border-color: var(--editorial-line); box-shadow: none; }
.pz-nav .header-search-input:focus { background: var(--surface-card); border-color: var(--action); }
.pz-subnav-inner { border-top-color: var(--border); }
.pz-subnav-link { font-size: 13px; letter-spacing: .01em; }
.pz-footer { background: var(--editorial-ink); border-top: 3px solid var(--action); }
.footer-statement { font-size: clamp(20px, 2vw, 26px); font-weight: 600; letter-spacing: -.03em; }
.footer-title { color: var(--night-muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.footer-description { color: var(--night-muted); }

:root { --report-heading: #182e50; --report-heading-text: #f5f8ff; --report-muted: #ced9e9; --range-track: #c0ccdc; }

/* Binaby phone viewport boundary */
@media (max-width: 800px) {
  html {
    overflow-x: clip;
  }
}
