/* ==========================================================================
   EasyEG — Header, Mobile Nav, Grid & Footer (layout.css)
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 16px;
}

.section {
  padding-block: 28px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 1.3rem;
}

/* Top Brand Switcher Strip */
.brand-switcher {
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.82rem;
}

.brand-switcher__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-block: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.brand-switcher__inner::-webkit-scrollbar {
  display: none;
}

.brand-switcher__links {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.brand-pill {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  transition: background 0.2s, color 0.2s;
  font-weight: 600;
}

.brand-pill:hover,
.brand-pill.is-active {
  background: var(--brand-primary);
  color: #ffffff;
}

/* Main Sticky Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  border-bottom: 2px solid var(--brand-primary);
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  min-height: var(--header-height);
  padding-block: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--brand-primary);
  min-width: 0;
  flex: 1;
}

.site-logo > span:last-child {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-logo__mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand-gradient);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.site-logo__sub {
  display: none;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.2;
}

@media (min-width: 560px) {
  .site-logo {
    font-size: 1.1rem;
    flex: initial;
  }
  .site-logo__sub {
    display: block;
  }
}

.desktop-nav {
  display: none;
  align-items: center;
  gap: 18px;
}

.desktop-nav a {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  padding: 6px 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.desktop-nav a:hover,
.desktop-nav a.is-active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  display: grid;
  place-items: center;
  font-size: 1rem;
  transition: background 0.2s, color 0.2s;
}

.icon-btn:hover {
  background: var(--brand-soft);
  color: var(--brand-primary);
}

.cart-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--brand-primary);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}

/* Mobile Drawer */
.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.mobile-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(300px, 84vw);
  background: var(--bg-surface);
  z-index: 210;
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.25s ease, visibility 0.25s ease;
  display: flex;
  flex-direction: column;
  padding: 18px;
  gap: 14px;
  overflow-y: auto;
}

.mobile-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.mobile-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.mobile-drawer__nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-drawer__nav a {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.mobile-drawer__nav a:hover,
.mobile-drawer__nav a.is-active {
  background: var(--brand-soft);
  color: var(--brand-primary);
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  height: var(--bottom-nav-height);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 120;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
}

.mobile-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.mobile-bottom-nav a.is-active {
  color: var(--brand-primary);
}

.mobile-bottom-nav__icon {
  font-size: 1.15rem;
  line-height: 1;
}

/* Responsive Grids */
.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* Footer */
.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  padding-block: 36px 24px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 24px;
}

.footer-title {
  color: #ffffff;
  font-size: 1rem;
  margin-bottom: 10px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 16px;
  text-align: center;
  font-size: 0.85rem;
  color: #94a3b8;
}

@media (min-width: 900px) {
  .desktop-nav {
    display: flex;
  }
  .mobile-menu-trigger,
  .mobile-bottom-nav {
    display: none;
  }
}
