/* =============================================================
   ShoppingPH — Header + Category Bar
   ============================================================= */

/* ── TOPBAR (above main header — promos / login) ─────────────── */
.sph-topbar {
  background: var(--sph-red-deeper);
  color: rgba(255,255,255,0.85);
  font-size: var(--text-xs);
  height: var(--topbar-height);
  display: flex;
  align-items: center;
}

.sph-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.sph-topbar__promo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.sph-topbar__promo-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sph-gold);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.8); }
}

.sph-topbar__links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.sph-topbar__links a {
  color: rgba(255,255,255,0.8);
  font-size: var(--text-xs);
  transition: color var(--duration-fast);
}

.sph-topbar__links a:hover {
  color: var(--sph-white);
}

.sph-topbar__sep {
  width: 1px;
  height: 12px;
  background: rgba(255,255,255,0.3);
}


/* ── MAIN HEADER ─────────────────────────────────────────────── */
.sph-header {
  background: var(--sph-red);
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.sph-header__inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: var(--space-4);
}

/* Logo */
.sph-header__logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.sph-header__logo img,
.sph-header__logo svg {
  height: 36px;
  width: auto;
}

/* White background pill for logo readability on red header */
.sph-header__logo-wrap {
  background: var(--sph-white);
  border-radius: var(--radius-md);
  padding: 4px var(--space-3);
  display: flex;
  align-items: center;
  transition: box-shadow var(--duration-fast);
}

.sph-header__logo-wrap:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Search */
.sph-header__search {
  flex: 1;
  max-width: 600px;
}

.sph-header__search .search-form {
  max-width: none;
  box-shadow: none;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.95);
}

.sph-header__search .search-form:focus-within {
  border-color: var(--sph-white);
  background: var(--sph-white);
}

.sph-header__search .search-form__btn {
  background: var(--sph-red-dark);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  height: 100%;
}

/* Header actions */
.sph-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

.sph-header__action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  color: var(--sph-white);
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: background var(--duration-fast);
  text-align: center;
}

.sph-header__action-btn:hover {
  background: rgba(255,255,255,0.15);
}

.sph-header__action-btn svg {
  width: 20px;
  height: 20px;
}

/* Mobile hamburger */
.sph-header__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast);
}

.sph-header__hamburger:hover {
  background: rgba(255,255,255,0.15);
}

.sph-header__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--sph-white);
  border-radius: 2px;
  transition: all var(--duration-base) var(--ease-spring);
  transform-origin: center;
}

/* Hamburger → X animation */
.sph-header__hamburger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.sph-header__hamburger.is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.sph-header__hamburger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* ── CATEGORY BAR ────────────────────────────────────────────── */
.sph-catbar {
  background: var(--sph-white);
  border-bottom: 1px solid var(--sph-gray-200);
  height: var(--catbar-height);
  position: sticky;
  top: var(--header-height);
  z-index: calc(var(--z-header) - 1);
  box-shadow: var(--shadow-xs);
}

.sph-catbar__inner {
  display: flex;
  align-items: center;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  gap: 0;
}

.sph-catbar__inner::-webkit-scrollbar {
  display: none;
}

.sph-catbar__item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--sph-gray-700);
  white-space: nowrap;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all var(--duration-fast) var(--ease-default);
  height: 100%;
}

.sph-catbar__item:hover {
  color: var(--sph-red);
  border-bottom-color: var(--sph-red-light);
}

.sph-catbar__item.is-active {
  color: var(--sph-red);
  border-bottom-color: var(--sph-red);
  font-weight: var(--weight-semibold);
}

.sph-catbar__item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Scroll arrows for cat bar */
.sph-catbar__arrow {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 100%;
  flex-shrink: 0;
  cursor: pointer;
  color: var(--sph-gray-500);
  background: linear-gradient(90deg, transparent, var(--sph-white));
  transition: color var(--duration-fast);
}

.sph-catbar__arrow:hover { color: var(--sph-red); }
.sph-catbar__arrow--left { background: linear-gradient(270deg, transparent, var(--sph-white)); }

.sph-catbar__arrow.is-visible {
  display: flex;
}


/* ── MOBILE NAV DRAWER ───────────────────────────────────────── */
.sph-mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  height: 100%;
  background: var(--sph-white);
  z-index: var(--z-modal);
  transform: translateX(-100%);
  transition: transform var(--duration-slow) var(--ease-out);
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

.sph-mobile-nav.is-open {
  transform: translateX(0);
}

.sph-mobile-nav__head {
  background: var(--sph-red);
  padding: var(--space-5) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sph-mobile-nav__close {
  color: var(--sph-white);
  padding: var(--space-2);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast);
}

.sph-mobile-nav__close:hover {
  background: rgba(255,255,255,0.15);
}

.sph-mobile-nav__close svg {
  width: 20px;
  height: 20px;
}

.sph-mobile-nav__search {
  padding: var(--space-4);
  border-bottom: 1px solid var(--sph-gray-200);
}

.sph-mobile-nav__search .search-form {
  max-width: none;
  border: 1px solid var(--sph-gray-300);
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.sph-mobile-nav__section {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--sph-gray-100);
}

.sph-mobile-nav__section-title {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--sph-gray-400);
  padding: 0 var(--space-5);
  margin-bottom: var(--space-2);
}

.sph-mobile-nav__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--sph-gray-800);
  transition: all var(--duration-fast);
}

.sph-mobile-nav__link:hover,
.sph-mobile-nav__link.is-active {
  background: var(--sph-red-light);
  color: var(--sph-red-dark);
}

.sph-mobile-nav__link svg {
  width: 18px;
  height: 18px;
  color: var(--sph-red);
}

/* Overlay */
.sph-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: calc(var(--z-modal) - 1);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-slow) var(--ease-out);
  backdrop-filter: blur(2px);
}

.sph-nav-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}


/* ── RESPONSIVE HEADER ADJUSTMENTS ──────────────────────────── */
@media (max-width: 767px) {
  .sph-header__hamburger {
    display: flex;
  }

  .sph-header__search {
    display: none;
  }

  .sph-header__actions .sph-header__action-btn span {
    display: none;
  }

  .sph-topbar {
    display: none;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .sph-header__search {
    max-width: 360px;
  }

  .sph-header__action-btn span {
    display: none;
  }
}
