/* New header design (from header.html) */

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

:root {
  --yellow: #F5C518;
  --yellow-light: #ffd84d;
  --navy: #1A2C5B;
  --navy-mid: #243d7a;
  --white: #ffffff;
}

/* Reserve scrollbar space so header doesn't shift when sidebar opens (no-scroll) */
html {
  scrollbar-gutter: stable;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f5;
  margin: 0;
  padding-top: 68px; /* offset for fixed header height */
}

/* ── HEADER ── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  width: 100%;
  background: var(--yellow);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  height: 68px;
  box-shadow: 0 2px 16px rgba(26,44,91,0.13);
}

/* Yellow-to-slightly-lighter subtle gradient */
.header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--navy) 0%, transparent 60%);
  opacity: 0.18;
}

/* ── HAMBURGER ── */
.hamburger-menu {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}

.hamburger-menu span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: var(--navy);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ── LOGO ── */
.logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 8px;
}

.logo img {
  height: 28px;
  width: auto;
  object-fit: contain;
}

/* Fallback text logo if image missing */
.logo-text {
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.5px;
  line-height: 1;
}

.logo-text span {
  color: var(--white);
  background: var(--navy);
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 14px;
}

/* Right side: search + nav icons */
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* ── SEARCH ── */
.search-form {
  width: 260px;
  max-width: 320px;
  display: flex;
  align-items: center;
}

.search-wrap {
  display: flex;
  width: 100%;
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(26,44,91,0.1);
  border: 2px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-wrap:focus-within {
  border-color: var(--navy);
  box-shadow: 0 2px 16px rgba(26,44,91,0.18);
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 16px;
  font-size: 13px;
  color: #333;
  background: transparent;
}

.search-input::placeholder {
  color: #aaa;
}

.search-btn {
  background: var(--navy);
  border: none;
  padding: 0 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  color: var(--yellow);
  font-size: 14px;
  height: 42px;
}

.search-btn:hover {
  background: var(--navy-mid);
}

/* ── NAV LINKS ── */
.nav-links {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Single pill container for both icons */
.icon-pill-group {
  display: flex;
  align-items: center;
  background: var(--navy);
  border-radius: 50px;
  padding: 6px 8px;
  gap: 2px;
  box-shadow: 0 4px 14px rgba(26,44,91,0.25);
}

/* Each icon button inside the pill */
.nav-btn-outer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.18s;
}

.nav-btn-outer:hover {
  background: rgba(255,255,255,0.12);
}

/* Divider between the two icons */
.icon-pill-divider {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,0.18);
  margin: 0 2px;
  flex-shrink: 0;
}

.nav-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-btn i {
  font-size: 17px;
  color: var(--yellow);
}

/* Cart badge */
.cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--yellow);
  color: var(--navy);
  font-size: 9px;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* ── DROPDOWN ── */
.dropdown-wrap {
  position: relative;
}

/* Bridge the hover gap between icon and dropdown panel */
.dropdown-wrap::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 0;
  width: 100%;
  height: 16px;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  margin-top: 8px;
  right: -8px;
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(26,44,91,0.14);
  min-width: 190px;
  padding: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) skewX(0deg);
  transition: opacity 0.2s, transform 0.2s;
  border: 1px solid #eee;
  z-index: 200;
}

.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 22px;
  width: 12px;
  height: 12px;
  background: var(--white);
  border-left: 1px solid #eee;
  border-top: 1px solid #eee;
  transform: rotate(45deg);
}

.dropdown-wrap:hover .dropdown-menu {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* Keep dropdown open while hovering the panel itself */
.dropdown-menu:hover {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: #444;
  transition: background 0.15s, color 0.15s;
}

.dropdown-menu a:hover {
  background: #FFF8DC;
  color: var(--navy);
}

.dropdown-menu a i {
  font-size: 13px;
  color: #aaa;
  width: 16px;
  text-align: center;
}

.dropdown-menu a:hover i {
  color: var(--navy);
}

.dropdown-divider {
  height: 1px;
  background: #f0f0f0;
  margin: 6px 8px;
}

.empty-message {
  padding: 12px 14px;
  font-size: 12px;
  color: #aaa;
  text-align: center;
}

/* Login CTA in dropdown */
.dropdown-menu .cta-link {
  background: var(--yellow);
  color: var(--navy);
  font-weight: 700;
  margin-top: 4px;
}

.dropdown-menu .cta-link:hover {
  background: var(--yellow-light);
}

.dropdown-menu .cta-link i {
  color: var(--navy);
}

/* Support click-to-toggle from JS as well as hover */
.dropdown-menu.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* ── DEMO PAGE (not used in PHP, safe to keep) ── */
.demo-body {
  padding: 40px 32px;
  color: #bbb;
  font-size: 13px;
}

/* Utility helpers reused by JS */
.hidden {
  display: none !important;
}

.no-scroll {
  overflow: hidden;
  height: 100vh;
}

/* ── HAMBURGER OPEN ANIMATION (X) ── */
.hamburger-menu.active span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger-menu.active span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ── SIDEBAR ── */
#sidebar {
  transition: transform 0.3s ease-in-out;
  top: 68px;
  height: calc(100vh - 68px);
}

/* ── MOBILE SEARCH PANEL ── */
/* Hidden by default; only rendered/visible on small screens */
.mobile-search-panel {
  display: none;
  position: fixed;
  top: 68px;
  left: 0;
  right: 0;
  background: var(--yellow);
  padding: 10px 16px 12px;
  z-index: 98;
  transform: translateY(-110%);
  transition: transform 0.25s ease;
  box-shadow: 0 4px 16px rgba(26,44,91,0.18);
}

.mobile-search-panel.visible {
  transform: translateY(0);
}

.mobile-search-wrap {
  display: flex;
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(26,44,91,0.1);
}

.mobile-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 11px 16px;
  font-size: 14px;
  color: #333;
  background: transparent;
}

.mobile-search-input::placeholder {
  color: #aaa;
}

.mobile-search-btn {
  background: var(--navy);
  border: none;
  padding: 0 18px;
  cursor: pointer;
  color: var(--yellow);
  font-size: 14px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.mobile-search-btn:hover {
  background: var(--navy-mid);
}

/* Search toggle icon — hidden on desktop */
.search-toggle-btn {
  display: none;
}

.search-divider {
  display: none;
}

/* ── RESPONSIVE BREAKPOINTS ── */

/* Tablet: shrink search */
@media (max-width: 900px) {
  .search-form {
    width: 200px;
  }
}

/* Small tablet */
@media (max-width: 700px) {
  .header {
    gap: 10px;
    padding: 0 16px;
  }
  .search-form {
    width: 150px;
  }
  .header-right {
    gap: 8px;
  }
}

/* Mobile: hide search bar, show search icon in pill */
@media (max-width: 540px) {
  .header {
    padding: 0 12px;
    gap: 8px;
  }

  .header-right {
    gap: 6px;
  }

  /* Hide the inline search form */
  .search-form {
    display: none;
  }

  /* Show mobile search toggle inside pill */
  .search-toggle-btn {
    display: flex;
  }

  .search-divider {
    display: block;
  }

  /* Show the mobile search panel container */
  .mobile-search-panel {
    display: block;
  }

  /* Smaller pill icons */
  .nav-btn-outer {
    width: 34px;
    height: 34px;
  }

  .nav-btn i {
    font-size: 15px;
  }

  .icon-pill-group {
    padding: 4px 6px;
  }
}

/* Extra small phones */
@media (max-width: 360px) {
  .header {
    padding: 0 8px;
    gap: 6px;
  }

  .logo img {
    height: 22px;
  }
}
