/* ==========================================================================
   MEDICUBE US - HEADER & NAVIGATION STYLES
   ========================================================================== */

/* Top Announcement Bar */
.announcement-bar-wrapper {
  background-color: #000000;
  color: #ffffff;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  font-weight: 500;
  height: var(--announcement-height);
  position: relative;
  z-index: 101;
}

.announcement-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.announcement-slider {
  flex: 1;
  text-align: center;
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.announcement-item {
  position: absolute;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  white-space: nowrap;
}

.announcement-item.active {
  position: relative;
  opacity: 1;
  transform: translateY(0);
}

.announcement-item strong {
  font-weight: 700;
  color: #ffde59;
}

.announcement-item a {
  text-decoration: underline;
  margin-left: 6px;
}

.announcement-arrow {
  background: none;
  border: none;
  color: #ffffff;
  padding: 4px 8px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.announcement-arrow:hover {
  opacity: 1;
}

.announcement-country {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  cursor: pointer;
}

.country-flag {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-block;
  background-image: url('../assets/icons/us.svg');
  background-size: cover;
  background-position: center;
}

/* Sticky Header */
.site-header-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  max-width: 100vw;
  background-color: var(--color-background);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--transition-normal);
  box-sizing: border-box;
}

.site-header-wrapper.scrolled {
  box-shadow: var(--shadow-sm);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  position: relative;
}

/* Header Left (Mobile menu & Flag) */
.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-mobile-menu {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}

.btn-mobile-menu img {
  width: 22px;
  height: 22px;
}

/* Header Logo */
.header-logo-wrap {
  display: flex;
  align-items: center;
}

.header-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
}

/* Header Center: Desktop Navigation */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 100%;
}

.nav-item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary);
  padding: 0 4px;
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  transition: color var(--transition-fast);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
  transform: scaleX(0);
  transition: transform var(--transition-normal);
}

.nav-item:hover .nav-link,
.nav-link.active {
  color: #000000;
}

.nav-item:hover .nav-link::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.nav-link .badge-save {
  margin-left: 6px;
  font-size: 0.6875rem;
  background-color: var(--color-accent-red);
  color: #ffffff;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
}

/* Mega Menu Dropdown */
.mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background-color: #ffffff;
  box-shadow: var(--shadow-lg);
  border-top: 1px solid var(--color-border);
  width: 100vw;
  max-width: 1200px;
  padding: 32px 40px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  pointer-events: none;
  z-index: 1000;
}

.nav-item:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.mega-menu-col h4 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
  color: #121212;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 8px;
}

.mega-menu-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mega-menu-col li a {
  font-size: 0.8125rem;
  color: #555555;
  transition: color var(--transition-fast);
}

.mega-menu-col li a:hover {
  color: #000000;
  font-weight: 600;
}

.mega-menu-featured {
  background-color: var(--color-bg-light);
  padding: 16px;
  border-radius: var(--border-radius-sm);
  text-align: center;
}

.mega-menu-featured img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 10px;
}

.mega-menu-featured h5 {
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.mega-menu-featured p {
  font-size: 0.75rem;
  color: var(--color-accent-red);
  font-weight: 600;
}

/* Header Right: Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-icon-btn {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}

.header-icon-btn img,
.header-icon-btn svg {
  width: 22px;
  height: 22px;
  transition: transform var(--transition-fast);
}

.header-icon-btn:hover img,
.header-icon-btn:hover svg {
  transform: scale(1.08);
}

.cart-count-badge {
  position: absolute;
  top: 0px;
  right: -2px;
  background-color: var(--color-primary);
  color: #ffffff;
  font-size: 0.6875rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  transition: transform var(--transition-normal);
}

.cart-count-badge.bump {
  transform: scale(1.3);
}

/* Mobile Menu Drawer */
.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.mobile-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 85%;
  max-width: 360px;
  height: 100%;
  background-color: #ffffff;
  z-index: 1001;
  transform: translateX(-100%);
  transition: transform var(--transition-slow);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.mobile-drawer-overlay.active .mobile-menu-drawer {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.btn-close-drawer {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
}

.btn-close-drawer img {
  width: 18px;
  height: 18px;
}

.mobile-nav-list {
  padding: 16px 0;
  flex: 1;
}

.mobile-nav-item {
  border-bottom: 1px solid #f2f2f2;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #121212;
  text-transform: uppercase;
}

.mobile-nav-sublist {
  display: none;
  background-color: var(--color-bg-light);
  padding: 8px 20px 14px;
}

.mobile-nav-sublist.open {
  display: block;
}

.mobile-nav-sublist li a {
  display: block;
  padding: 8px 0;
  font-size: 0.875rem;
  color: #444444;
}

.mobile-drawer-footer {
  padding: 20px;
  background-color: var(--color-bg-light);
  border-top: 1px solid var(--color-border);
}

.mobile-account-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.mobile-social-links {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}

.mobile-social-links a img {
  width: 20px;
  height: 20px;
  opacity: 0.8;
}

/* Responsive */
@media (max-width: 991px) {
  .desktop-nav {
    display: none;
  }
  .btn-mobile-menu {
    display: block;
  }
  .site-header {
    height: var(--header-mobile-height);
    width: 100%;
  }
  .header-logo {
    height: 28px;
    max-width: 140px;
  }
}

@media (max-width: 768px) {
  .announcement-country {
    display: none;
  }
  .announcement-slider {
    font-size: 0.72rem;
    padding: 0 10px;
  }
  .announcement-item {
    font-size: 0.72rem;
  }
  .site-header-wrapper {
    width: 100%;
    max-width: 100vw;
  }
  .site-header {
    padding: 0 4px;
    height: 54px;
    width: 100%;
  }
  .header-left {
    gap: 6px;
  }
  .btn-mobile-menu {
    padding: 6px;
  }
  .btn-mobile-menu img {
    width: 20px;
    height: 20px;
  }
  .header-logo-wrap {
    flex: 1;
    justify-content: center;
  }
  .header-logo {
    height: 24px;
    max-width: 125px;
  }
  .header-actions {
    gap: 6px;
  }
  .header-icon-btn {
    padding: 6px;
  }
  .header-icon-btn img {
    width: 20px;
    height: 20px;
  }
  .cart-count-badge {
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    font-size: 9px;
  }
}
