/* ==========================================================================
   HEADER — CLEAN, STICKY & PREMIUM WITH STRICTLY SINGLE CENTRAL SEARCH
   ========================================================================== */

/* Top Announcement Bar */
.cm-top-bar {
  background: linear-gradient(90deg, #0B192C 0%, #0056E0 50%, #0B192C 100%);
  color: #FFFFFF;
  font-size: 11px;
  padding: 5px 0;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.2px;
  position: relative;
  z-index: 100;
}

@media (min-width: 768px) {
  .cm-top-bar {
    font-size: var(--cm-text-xs, 12px);
    padding: 6px 0;
  }
}

.cm-top-bar-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--cm-space-3, 12px);
  flex-wrap: wrap;
}

.cm-top-bar-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Main Sticky Header */
.cm-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--cm-border, #E2E8F0);
  z-index: 1000;
  transition: box-shadow 0.2s ease;
}

.cm-header.scrolled {
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
}

.cm-header-main {
  min-height: 58px;
  padding: 6px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .cm-header-main {
    min-height: 66px;
    padding: 0;
    gap: 20px;
    flex-wrap: nowrap;
  }
}

/* Brand Logo (Order 1 on all viewports) */
.cm-brand-logo-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
  order: 1;
}

.cm-brand-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
  transition: transform 0.15s ease;
}

@media (min-width: 768px) {
  .cm-brand-logo-img {
    height: 44px;
  }
}

.cm-brand-logo-link:hover .cm-brand-logo-img {
  transform: scale(1.02);
}

/* ==========================================================================
   THE ONLY SEARCH BAR ON THE ENTIRE WEBSITE
   ========================================================================== */
.cm-header-search-wrap {
  flex: 1 1 100%;
  max-width: 100%;
  position: relative;
  order: 3;
  margin-top: 4px;
}

@media (min-width: 768px) {
  .cm-header-search-wrap {
    flex: 1 1 auto;
    max-width: 480px;
    order: 2;
    margin: 0 auto;
  }
}

@media (min-width: 1200px) {
  .cm-header-search-wrap {
    max-width: 540px;
  }
}

.cm-header-search-form {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  border-radius: 999px;
  padding: 2px 4px 2px 14px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.cm-header-search-form:focus-within {
  border-color: var(--cm-primary, #0056E0);
  box-shadow: 0 0 0 3px rgba(0, 86, 224, 0.12), 0 4px 12px rgba(0, 86, 224, 0.08);
}

.cm-header-search-icon {
  color: var(--cm-primary, #0056E0);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  flex-shrink: 0;
}

.cm-header-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--cm-text-main, #0F172A);
  height: 32px;
  padding: 0;
  font-family: inherit;
  min-width: 0;
}

@media (min-width: 768px) {
  .cm-header-search-input {
    font-size: 13.5px;
    height: 34px;
  }
}

.cm-header-search-input::placeholder {
  color: var(--cm-text-muted, #94A3B8);
  font-weight: 400;
}

.cm-header-search-btn {
  height: 28px;
  padding: 0 12px;
  background: var(--cm-primary, #0056E0);
  color: #FFFFFF;
  border: none;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .cm-header-search-btn {
    height: 32px;
    padding: 0 14px;
    font-size: 12px;
  }
}

.cm-header-search-btn:hover {
  background: var(--cm-primary-hover, #0044B3);
  transform: translateY(-1px);
}

/* Header Live Dropdown */
.cm-header-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid var(--cm-border, #E2E8F0);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  z-index: 1100;
  max-height: 360px;
  overflow-y: auto;
}

/* Desktop Navigation Links (Order 3 on desktop) */
.cm-header-nav-links {
  display: none;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
  order: 3;
}

@media (min-width: 992px) {
  .cm-header-nav-links {
    display: flex;
  }
}

.cm-header-nav-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--cm-text-secondary, #475569);
  text-decoration: none;
  transition: color 0.15s ease;
  padding: 6px 0;
  position: relative;
}

.cm-header-nav-link:hover,
.cm-header-nav-link.active {
  color: var(--cm-primary, #0056E0);
}

.cm-header-nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--cm-primary, #0056E0);
  border-radius: 999px;
}

/* Header Right Actions (Order 2 on mobile, Order 4 on desktop) */
.cm-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  order: 2;
}

@media (min-width: 768px) {
  .cm-header-actions {
    order: 4;
    gap: 10px;
  }
}

/* Cart Button */
.cm-header-cart-btn {
  height: 36px;
  padding: 0 12px;
  background: var(--cm-primary, #0056E0);
  color: #FFFFFF;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 86, 224, 0.25);
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
}

@media (min-width: 768px) {
  .cm-header-cart-btn {
    height: 38px;
    padding: 0 14px;
    font-size: 13px;
  }
}

.cm-header-cart-btn:hover {
  background: var(--cm-primary-hover, #0044B3);
  transform: translateY(-1px);
}

.cm-header-cart-badge {
  background: #FFFFFF;
  color: var(--cm-primary, #0056E0);
  font-size: 11px;
  font-weight: 900;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.cm-header-cart-badge.bump {
  animation: badgeBump 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badgeBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* Mobile Hamburger Toggle Button */
.cm-header-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #F1F5F9;
  border: 1px solid var(--cm-border, #E2E8F0);
  color: var(--cm-text-main, #0F172A);
  cursor: pointer;
  transition: all 0.15s ease;
}

@media (min-width: 992px) {
  .cm-header-menu-btn {
    display: none !important;
  }
}

.cm-header-menu-btn:hover {
  background: #E2E8F0;
}

/* ==========================================================================
   MOBILE NAVIGATION DRAWER & BACKDROP
   ========================================================================== */
.cm-mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  display: none;
}

.cm-mobile-nav-backdrop.active {
  opacity: 1;
  visibility: visible;
  display: block;
}

.cm-mobile-nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 290px;
  max-width: 85vw;
  background: #FFFFFF;
  z-index: 9999;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.cm-mobile-nav-drawer.active {
  transform: translateX(0);
}

@media (min-width: 992px) {
  .cm-mobile-nav-drawer,
  .cm-mobile-nav-backdrop {
    display: none !important;
  }
}

.cm-mobile-drawer-header {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--cm-border, #E2E8F0);
  background: #F8FAFC;
}

.cm-mobile-drawer-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 1px solid var(--cm-border, #E2E8F0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--cm-text-secondary, #475569);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cm-mobile-drawer-close:hover {
  background: #F1F5F9;
  color: #EF4444;
}

.cm-mobile-drawer-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.cm-mobile-drawer-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cm-mobile-drawer-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--cm-text-muted, #94A3B8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cm-mobile-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cm-mobile-drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--cm-text-main, #0F172A);
  text-decoration: none;
  transition: all 0.15s ease;
}

.cm-mobile-drawer-link:hover,
.cm-mobile-drawer-link.active {
  background: var(--cm-primary-light, #EFF6FF);
  color: var(--cm-primary, #0056E0);
}

.cm-mobile-drawer-badge {
  margin-left: auto;
  background: var(--cm-primary, #0056E0);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
}
