/* ==========================================================================
   HEADER & OMNISEARCH STYLING (DESKTOP & MOBILE)
   ========================================================================== */

/* 1. Top Ticker Bar - Completely removed per user request */
.top-ticker {
  display: none !important;
}

/* 2. Main Sticky Header */
.main-header,
.desktop-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  transition: all var(--transition-normal);
}

[data-theme="dark"] .main-header,
[data-theme="dark"] .desktop-header {
  background: rgba(18, 24, 38, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.main-header-inner,
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Brand Logo */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.brand-logo:hover {
  transform: translateY(-1px);
}

.brand-logo-mark {
  width: auto;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.brand-logo-badge-img {
  height: 48px;
  width: auto;
  max-width: 32px;
  object-fit: contain;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  transition: transform var(--transition-fast);
}

[data-theme="light"] .brand-logo-img-light {
  display: block !important;
}
[data-theme="light"] .brand-logo-img-dark {
  display: none !important;
}

[data-theme="dark"] .brand-logo-img-light {
  display: none !important;
}
[data-theme="dark"] .brand-logo-img-dark {
  display: block !important;
}

.brand-logo:hover .brand-logo-badge-img {
  transform: translateY(-1px) scale(1.05);
}

.brand-logo-mark svg {
  width: auto !important;
  height: 48px !important;
  display: block;
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}

.brand-title {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-title-main {
  color: var(--text-primary);
}

.brand-title-accent {
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
}

[data-theme="dark"] .brand-title-accent {
  background: linear-gradient(135deg, #38bdf8 0%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  text-transform: uppercase;
  line-height: 1;
}

[data-theme="dark"] .brand-subtitle {
  color: #94a3b8;
}

/* Omnisearch Box */
.omnisearch-wrapper,
.omnisearch-container {
  flex: 1;
  max-width: 540px;
  min-width: 0;
  position: relative;
}
.omnisearch-input-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 4px 16px;
  gap: 12px;
  height: 44px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: all var(--transition-fast);
}
.omnisearch-input-box:focus-within {
  border-color: #38bdf8;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
}
.omnisearch-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}
.omnisearch-input::placeholder {
  color: var(--text-muted);
}
.omnisearch-smart-badge {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 9999px;
  padding: 3px 8px;
  font-size: 0.7rem;
  color: #0369a1;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.omnisearch-smart-badge:hover {
  background: rgba(56, 189, 248, 0.22);
}
[data-theme="dark"] .omnisearch-smart-badge {
  color: #38bdf8;
}
.omnisearch-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: none;
}

/* Omnisearch Dropdown Results */
.omnisearch-dropdown,
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  background: var(--bg-surface);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: var(--radius-xl);
  box-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  padding: 12px;
  display: none;
  z-index: 100;
  max-height: 420px;
  overflow-y: auto;
}
.omnisearch-dropdown.active,
.search-dropdown.active {
  display: block;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: background var(--transition-fast);
  cursor: pointer;
}
.search-result-item:hover {
  background: var(--bg-surface-muted);
}
.search-item-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-sunken);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.search-item-info {
  flex: 1;
  min-width: 0;
}
.search-item-title {
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-item-cat {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}
.search-item-price {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent-crimson-text, #be123c);
  white-space: nowrap;
}
[data-theme="dark"] .search-item-price {
  color: #fda4af;
}

/* Header Action Tools (Hotline, Account, Cart) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}
#searchIconBox,
#hotlineIconBox,
#accountIconBox,
#cartIconBox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hotline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-secondary, #94a3b8);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: all 180ms ease;
}
.hotline-badge:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  transform: translateY(-1px);
}
.hotline-badge:active {
  transform: scale(0.98);
}
[data-theme="dark"] .hotline-badge {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}
[data-theme="dark"] .hotline-badge:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #38bdf8;
}

.account-btn,
.btn-account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary, #f8fafc);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 180ms ease;
}
.account-btn:hover,
.btn-account:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  transform: translateY(-1px);
}
.account-btn:active,
.btn-account:active {
  transform: scale(0.98);
}
[data-theme="dark"] .account-btn,
[data-theme="dark"] .btn-account {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}
[data-theme="dark"] .account-btn:hover,
[data-theme="dark"] .btn-account:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #38bdf8;
}

.cart-header-btn {
  position: relative;
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1px solid rgba(56, 189, 248, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  transition: all 200ms ease;
  flex-shrink: 0;
  box-sizing: border-box;
}
.cart-header-btn:hover {
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.55);
  transform: translateY(-1px);
}
.cart-header-btn:active {
  transform: scale(0.97);
}
.cart-badge-count {
  background: #ffffff;
  color: #0369a1;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 1px 7px;
  border-radius: 999px;
  line-height: 1.2;
}
[data-theme="dark"] .cart-header-btn {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-color: rgba(56, 189, 248, 0.45);
  color: #ffffff;
}

/* Theme Toggle Button - Harmonized Pill Capsule */
.theme-toggle-header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 180ms ease;
  user-select: none;
  flex-shrink: 0;
  white-space: nowrap;
  position: static;
  margin: 0;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
}

.theme-toggle-label {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
}

.theme-toggle-header-btn:active {
  transform: scale(0.97);
}

[data-theme="light"] .theme-toggle-header-btn {
  background: #ffffff;
  border: 1.5px solid #b8daf7;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.04);
}

[data-theme="light"] .theme-toggle-header-btn .theme-icon-box {
  color: #0284c7;
}

[data-theme="light"] .theme-toggle-header-btn:hover {
  background: #e0f0fe;
  border-color: #0284c7;
  color: #0284c7;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

[data-theme="dark"] .theme-toggle-header-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

[data-theme="dark"] .theme-toggle-header-btn .theme-icon-box {
  color: #fbbf24;
}

[data-theme="dark"] .theme-toggle-header-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(251, 191, 36, 0.4);
  color: #fbbf24;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.15);
  transform: translateY(-1px);
}

.theme-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-icon-box svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
  color: currentColor;
  display: block;
}

.theme-toggle-header-btn:hover .theme-icon-box,
.mobile-theme-btn:hover .theme-icon-box {
  transform: rotate(15deg);
}

.theme-toggle-header-btn.is-toggled .theme-icon-box,
.mobile-theme-btn.is-toggled .theme-icon-box {
  animation: themeIconSpin 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes themeIconSpin {
  0% { transform: rotate(-90deg) scale(0.7); opacity: 0.4; }
  100% { transform: rotate(0deg) scale(1); opacity: 1; }
}

.mobile-theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle, rgba(226, 232, 240, 0.8));
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.mobile-theme-btn:active {
  transform: scale(0.95);
}
.cart-badge-count {
  position: absolute;
  top: -3px;
  left: -2px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  font-size: 0.6875rem;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-surface);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

.cart-header-btn .cart-badge-count {
  position: static;
  background: #ffffff;
  color: #0369a1;
  font-size: 0.72rem;
  font-weight: 900;
  width: auto;
  min-width: 20px;
  height: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  box-shadow: none;
  margin-inline-start: 4px;
}

[data-theme="light"] .main-header,
[data-theme="light"] .desktop-header {
  background: #cbe3f7; /* Authentic Light Blue theme */
  border-bottom: 1.5px solid #b3d7f5;
}
[data-theme="light"] .omnisearch-input-box {
  background: #ffffff;
  border-color: #b8daf7;
}
[data-theme="light"] .omnisearch-input {
  color: #0f172a;
}
[data-theme="light"] .hotline-badge,
[data-theme="light"] .account-btn,
[data-theme="light"] .btn-account {
  background: #ffffff;
  border: 1.5px solid #b8daf7;
  color: #0f172a;
}
[data-theme="light"] .hotline-badge:hover,
[data-theme="light"] .account-btn:hover,
[data-theme="light"] .btn-account:hover {
  background: #e0f0fe;
  border-color: #0284c7;
  color: #0284c7;
}

[data-theme="light"] #searchIconBox svg,
[data-theme="light"] #hotlineIconBox svg,
[data-theme="light"] #accountIconBox svg {
  color: #0284c7 !important;
  stroke: #0284c7 !important;
}

[data-theme="dark"] #searchIconBox svg,
[data-theme="dark"] #hotlineIconBox svg,
[data-theme="dark"] #accountIconBox svg {
  color: #38bdf8 !important;
  stroke: #38bdf8 !important;
}

/* Mobile Top Nav (visible only on mobile) */
.mobile-top-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  max-width: 100%;
  box-sizing: border-box;
}

.mobile-top-bar .brand-logo {
  display: inline-flex;
  align-items: center;
}

.mobile-top-bar .brand-title {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  transform: translateY(2px);
}

.mobile-top-bar .brand-logo-badge-img {
  height: 34px;
}

.mobile-top-bar .cart-header-btn {
  width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  justify-content: center;
  gap: 0;
  position: relative;
}

.mobile-top-bar .cart-header-btn .cart-badge-count {
  position: absolute;
  top: -4px;
  left: -4px;
  margin-inline-start: 0;
  padding: 0;
  width: 18px;
  height: 18px;
  min-width: 18px;
  font-size: 0.65rem;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  border: 2px solid var(--bg-surface, #ffffff);
}

.mobile-search-strip {
  display: none;
}

[data-theme="light"] .mobile-top-bar,
[data-theme="light"] .mobile-search-strip {
  background: #cbe3f7;
  border-bottom: 1.5px solid #b3d7f5;
}
[data-theme="light"] .mobile-top-bar .btn-icon,
[data-theme="light"] .mobile-theme-btn {
  background: #ffffff;
  border: 1.5px solid #b8daf7;
  color: #0284c7;
}

[data-theme="dark"] .mobile-theme-btn,
[data-theme="dark"] .mobile-top-bar .btn-icon {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
}

@media (max-width: 1080px) {
  .top-ticker { display: none; }
  .hotline-badge { display: none; }
  .main-header-inner,
  .header-inner { gap: 12px; padding: 14px 16px; }
  .omnisearch-wrapper,
  .omnisearch-container { max-width: 240px; }
  .omnisearch-input-box { height: 36px; padding: 0 12px; }
  .omnisearch-input { min-width: 0; font-size: 0.78rem; }
  .omnisearch-btn { padding: 0 12px; }
  .account-btn,
  .btn-account,
  .cart-header-btn { height: 36px; padding: 0 12px; font-size: 0.78rem; gap: 6px; white-space: nowrap; }
  .theme-toggle-header-btn { height: 36px; padding: 0 12px; font-size: 0.78rem; gap: 6px; white-space: nowrap; }
}

@media (max-width: 900px) {
  .mobile-theme-btn,
  .mobile-top-bar .btn-icon,
  .mobile-top-bar .cart-header-btn,
  .theme-toggle-header-btn {
    border-radius: 50%;
  }
}

@media (max-width: 768px) {
  .main-header,
  .desktop-header { display: none; }
  .theme-toggle-header-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    gap: 0;
    border-radius: 50%;
  }
  .theme-toggle-header-btn .theme-toggle-label {
    display: none;
  }
  .mobile-top-bar { display: flex; }
  .mobile-top-bar .mobile-theme-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .mobile-search-strip { display: block; }
}

@media (max-width: 380px) {
  .mobile-top-bar {
    padding: 10px 10px;
    gap: 6px;
  }
  .mobile-top-bar > div {
    min-width: 0;
  }
  .mobile-top-bar .brand-logo {
    gap: 5px !important;
  }
  .mobile-top-bar .brand-logo-mark {
    width: auto !important;
    height: 30px !important;
  }
  .mobile-top-bar .brand-logo-badge-img {
    height: 30px !important;
    max-width: 22px;
  }
  .mobile-top-bar .brand-title {
    font-size: 0.92rem !important;
    white-space: nowrap;
  }
  .mobile-top-bar .mobile-theme-btn,
  .mobile-top-bar .btn-icon,
  .mobile-top-bar .cart-header-btn {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50%;
  }
  .mobile-top-bar .cart-header-btn .cart-badge-count {
    top: -3px;
    left: -2px;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    font-size: 0.6rem !important;
  }
}
