/* =========================================================
   Header (sticky glass), nav, top bar (footer)
   ========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--t-base) var(--ease-out), background var(--t-base) var(--ease-out);
}
.site-header.is-scrolled {
  box-shadow: var(--shadow-sm);
  background: rgba(255, 255, 255, 0.88);
}

.header-inner {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
  min-height: var(--header-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-3) 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  user-select: none;
}
.brand img {
  display: block;
  flex-shrink: 0;
  height: 52px;
  width: auto;
  max-height: 56px;
  max-width: min(148px, 34vw);
  object-fit: contain;
  object-position: left center;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base) var(--ease-spring);
}
.brand:hover img { transform: scale(1.04); }
.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-name .name {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand-name .tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ---------- Primary nav ---------- */
.nav-primary { justify-self: center; }
.nav-primary ul {
  list-style: none;
  margin: 0;
  padding: 6px;
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
}
.nav-primary a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--t-base) var(--ease-out), background var(--t-base) var(--ease-out);
}
.nav-primary a:hover { color: var(--text); background: var(--surface-2); }
.nav-primary a.active {
  color: #fff;
  background: linear-gradient(180deg, var(--rgt-red-500), var(--rgt-red-600));
  box-shadow: var(--shadow-glow);
}

/* ---------- Header actions ---------- */
.header-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.location-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 40px;
  max-width: 320px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-base) var(--ease-out), border-color var(--t-base) var(--ease-out);
}
.location-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-strong);
}
.location-btn .pin {
  width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--primary);
}
.location-btn .label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

/* ---------- App content area ---------- */
.app-main {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ---------- Footer / top-bar ---------- */
.site-footer {
  margin-top: var(--space-12);
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.footer-inner {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
  padding: var(--space-8) 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: var(--space-6);
  align-items: center;
}
.footer-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: 0.92rem;
}
.footer-item .icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
}
.footer-item .icon svg { width: 16px; height: 16px; }
.footer-legal {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  justify-content: flex-end;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.footer-legal a { color: var(--primary); font-weight: 600; }
.footer-legal a:hover { text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .header-inner {
    grid-template-columns: auto auto;
    grid-template-areas:
      'brand actions'
      'nav   nav';
  }
  .brand { grid-area: brand; }
  .header-actions { grid-area: actions; }
  .nav-primary { grid-area: nav; justify-self: stretch; }
  .nav-primary ul { width: 100%; justify-content: space-between; }
  .nav-primary a { flex: 1; justify-content: center; }
  .location-btn { display: none; }
  .footer-inner { grid-template-columns: 1fr; text-align: center; gap: var(--space-3); }
  .footer-item, .footer-legal { justify-content: center; }
}

@media (max-width: 480px) {
  .brand-name .tag { display: none; }
  .nav-primary a { font-size: 0.85rem; padding: 0 10px; }
}
