/* =============================================
   TASTE OF ASIA - HEADER STYLES
   Matches design from taste_of_asia_design.html
   ============================================= */

/* =============================================
   HEADER BASE
   ============================================= */

/* Fixed header with scroll effect */
.toa-header-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition:
    background-color 0.3s ease,
    backdrop-filter 0.3s ease,
    box-shadow 0.3s ease;
}

/* Transparent state (at top, on home page) */
.toa-header-wrapper:not(.toa-header-scrolled) {
  background-color: transparent;
}

/* Scrolled state - frosted glass */
.toa-header-wrapper.toa-header-scrolled {
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

/* =============================================
   TOP UTILITY BAR
   ============================================= */

.toa-top-bar {
  background: transparent;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.toa-top-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toa-top-bar-text {
  color: var(--toa-gold);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.toa-top-bar-links {
  display: flex;
  gap: 16px;
}

.toa-top-link {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: color 0.15s ease;
}

.toa-top-link:hover {
  color: var(--toa-gold);
}

/* =============================================
   MAIN NAVIGATION
   ============================================= */

.toa-main-nav {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.toa-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Logo Button */
.toa-logo-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}

.toa-logo {
  height: 52px !important;
  width: auto;
  display: block;
}

.toa-logo-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Logo text fallback styles */
.toa-logo-btn .toa-logo-text {
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--toa-gold);
  letter-spacing: 0.08em;
  line-height: 1;
}

/* =============================================
   SEARCH BAR
   ============================================= */

.toa-search-wrap {
  flex: 1;
  max-width: 520px;
  position: relative;
  display: flex;
  align-items: center;
}

.toa-search-icon {
  position: absolute;
  left: 14px;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  z-index: 10;
}

.toa-search-form {
  width: 100%;
}

.toa-search-input {
  width: 100%;
  padding: 10px 16px 10px 44px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  font-size: 14px;
  outline: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-sizing: border-box;
}

.toa-search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* =============================================
   NAV ACTIONS (Account, Cart)
   ============================================= */

.toa-nav-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.toa-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border-radius: 4px;
  color: #fff;
  transition: background 0.15s ease;
  text-decoration: none;
}

.toa-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.toa-icon-btn svg,
.toa-icon-btn i {
  width: 22px;
  height: 22px;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toa-icon-label {
  font-size: 11px;
  white-space: nowrap;
}

/* Cart Button */
.toa-cart-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border-radius: 4px;
  color: #fff;
  transition: background 0.15s ease;
  text-decoration: none;
}

.toa-cart-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.toa-cart-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toa-cart-icon-wrap i {
  font-size: 22px;
}

.toa-cart-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--toa-gold);
  color: var(--toa-crimson);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =============================================
   CATEGORY NAVIGATION (inside main-nav)
   ============================================= */

.toa-category-nav {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
}

.toa-category-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
}

.toa-category-nav-inner::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

.toa-cat-nav-link,
.toa-cat-nav-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.toa-cat-nav-link:hover,
.toa-cat-nav-link.active,
.toa-cat-nav-btn:hover,
.toa-cat-nav-btn.active {
  color: var(--toa-gold);
  border-bottom-color: var(--toa-gold);
}

/* All Categories trigger button */
.toa-mega-trigger {
  font-weight: 700;
}

.toa-mega-trigger svg {
  width: 18px;
  height: 18px;
}

/* =============================================
   MEGA MENU
   ============================================= */

.toa-mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  z-index: 200;
  border-top: 2px solid var(--toa-crimson);
  display: none;
}

/* Show when JS adds .toa-mega-open via hover on trigger/menu */
.toa-mega-open .toa-mega-menu {
  display: block;
}

.toa-mega-menu-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px;
  display: grid;
  grid-template-columns: repeat(6, 1fr) 200px;
  gap: 24px;
}

/* Mega menu columns */
.toa-mega-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toa-mega-col-title {
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  color: var(--toa-crimson);
  padding: 0 0 8px 0;
  border-bottom: 1px solid #eee;
  margin-bottom: 4px;
  text-decoration: none;
  display: block;
}

.toa-mega-sub-link {
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  color: #555;
  padding: 3px 0;
  transition: color 0.15s ease;
  text-decoration: none;
  display: block;
}

.toa-mega-sub-link:hover {
  color: var(--toa-crimson);
}

/* Mega menu promo tile */
.toa-mega-promo {
  grid-column: span 1;
}

.toa-mega-promo-img {
  border-radius: 4px;
  overflow: hidden;
  height: 120px;
  background: var(--toa-crimson);
}

.toa-mega-promo-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.toa-mega-promo-title {
  margin: 8px 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--toa-crimson);
}

.toa-mega-promo-text {
  margin: 0;
  font-size: 12px;
  color: #666;
}

/* =============================================
   MOBILE HEADER
   ============================================= */

@media (max-width: 767px) {
  /* Hide top bar on mobile */
  .toa-top-bar {
    display: none;
  }

  /* Reduce header height */
  .toa-nav-inner {
    height: 60px;
    gap: 12px;
  }

  /* Smaller logo */
  .toa-logo {
    height: 40px;
  }

  /* Hide search bar */
  .toa-search-wrap {
    display: none;
  }

  /* Mobile menu trigger */
  .toa-mobile-menu-btn {
    display: flex;
    background: none;
    border: none;
    cursor: pointer;
    color: #fff;
    padding: 8px;
  }

  /* Hide category nav */
  .toa-category-nav {
    display: none;
  }

  /* Cart compact - no label */
  .toa-icon-label {
    display: none;
  }

  /* Cart button */
  .toa-cart-btn {
    padding: 6px 8px;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  /* Tablet adjustments */
  .toa-search-wrap {
    max-width: 300px;
  }

  /* Scrollable category nav */
  .toa-category-nav-inner {
    padding: 0 16px;
  }
}

@media (min-width: 1024px) {
  /* Desktop - hide mobile menu button */
  .toa-mobile-menu-btn {
    display: none;
  }
}

/* =============================================
   HEADER OFF-CANVAS (Mobile Menu)
   ============================================= */

.toa-offcanvas {
  position: fixed;
  top: 0;
  left: -100%;
  width: 280px;
  height: 100vh;
  background: var(--toa-crimson);
  z-index: 9999;
  transition: left 0.3s ease;
  overflow-y: auto;
}

.toa-offcanvas.open {
  left: 0;
}

.toa-offcanvas-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.toa-offcanvas-overlay.open {
  opacity: 1;
  visibility: visible;
}

.toa-offcanvas-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 24px;
  cursor: pointer;
}

.toa-offcanvas-nav {
  padding: 60px 20px 20px;
}

.toa-offcanvas-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toa-offcanvas-menu li {
  margin: 0;
  padding: 0;
}

.toa-offcanvas-menu a {
  display: block;
  color: rgba(255, 255, 255, 0.85);
  font-size: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: color 0.15s ease;
  text-decoration: none;
}

.toa-offcanvas-menu a:hover {
  color: var(--toa-gold);
}

/* Sub-menu items */
.toa-offcanvas-menu .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0 0 0 16px;
}

.toa-offcanvas-menu .sub-menu a {
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
}
