/* ==========================================================================
   KAYAN LUXURY FASHION — HEADER & ANNOUNCEMENT BAR
   ========================================================================== */

/* Announcement Bar */
.announcement-bar {
  background-color: var(--brand-obsidian-ink);
  color: var(--brand-raw-alabaster);
  height: var(--announcement-height);
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  position: relative;
  z-index: calc(var(--z-header) + 1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.announcement-slider {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  position: relative;
  width: 100%;
}

.announcement-item {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.4s var(--ease-out-quart), transform 0.4s var(--ease-out-quart);
  pointer-events: none;
}

.announcement-item.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.announcement-item a {
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
  color: var(--brand-bronze-light);
}

.announcement-timer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.72rem;
}

.announcement-close {
  position: absolute;
  inset-inline-end: var(--space-md);
  background: none;
  border: none;
  color: var(--brand-raw-alabaster);
  opacity: 0.7;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  transition: opacity var(--duration-fast);
}

.announcement-close:hover {
  opacity: 1;
}

/* Site Header */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: var(--z-header);
  background-color: var(--color-surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border-subtle);
  transition: transform 0.35s var(--ease-out-quart),
              background-color var(--duration-normal),
              box-shadow var(--duration-normal),
              padding 0.3s var(--ease-out-quart);
}

.site-header.header-hidden {
  transform: translateY(-100%);
}

.site-header.header-scrolled {
  box-shadow: var(--shadow-sm);
  background-color: var(--color-surface-glass);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding-inline: var(--space-md);
  max-width: var(--container-max);
  margin-inline: auto;
  position: relative;
}

@media (min-width: 1024px) {
  .header-container {
    padding-inline: var(--space-xl);
  }
}

/* Header Left: Department Switcher */
.header-nav-left {
  display: flex;
  align-items: center;
  position: relative;
}

.dept-nav-list {
  display: none;
  align-items: center;
  list-style: none;
  gap: var(--space-sm);
  position: relative;
}

@media (min-width: 1024px) {
  .dept-nav-list {
    display: flex;
  }
}

.dept-nav-item {
  position: relative;
}

.dept-nav-link {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  padding: var(--space-xs) var(--space-2xs);
  display: inline-block;
  transition: color var(--duration-fast);
  position: relative;
}

.dept-nav-link:hover,
.dept-nav-link.active {
  color: var(--color-text);
}

/* Sliding active pill indicator under department */
.dept-sliding-pill {
  position: absolute;
  bottom: 0;
  height: 2px;
  background-color: var(--color-primary);
  transition: left 0.3s var(--ease-out-expo), width 0.3s var(--ease-out-expo);
  pointer-events: none;
}

/* Header Center: Logo */
.header-logo-container {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.header-logo-link svg {
  height: 38px;
  width: auto;
  transition: transform var(--duration-fast) var(--ease-spring);
}

.header-logo-link:hover svg {
  transform: scale(1.02);
}

/* Header Right: Actions */
.header-nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

@media (min-width: 768px) {
  .header-nav-right {
    gap: var(--space-sm);
  }
}

.header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text);
  border: none;
  position: relative;
  transition: background-color var(--duration-fast), color var(--duration-fast), transform var(--duration-fast);
}

.header-btn:hover {
  background-color: var(--color-surface-hover);
  color: var(--color-accent);
}

.header-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
}

.header-lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  height: 34px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-arabic), var(--font-body);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all var(--duration-fast);
}

.header-lang-btn:hover {
  background: var(--color-primary);
  color: var(--color-bg);
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.announcement-tools {
  position: absolute;
  inset-inline-end: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2;
}

.announcement-lang-link {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-arabic), var(--font-body);
  transition: background var(--duration-fast);
}

.announcement-lang-link:hover {
  background: var(--color-accent);
}

/* Badges for Wishlist and Cart */
.header-badge {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background-color: var(--color-accent);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
  transition: transform var(--duration-fast) var(--ease-spring);
}

.header-badge.empty {
  display: none;
}

/* Highlighted "Wear It" UGC Gallery Link */
.header-ugc-link {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  transition: background var(--duration-fast), color var(--duration-fast);
}

@media (min-width: 1200px) {
  .header-ugc-link {
    display: inline-flex;
  }
}

.header-ugc-link:hover {
  background: var(--color-accent);
  color: #FFFFFF;
}

/* Mobile Hamburger Menu Button */
.header-mobile-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  color: var(--color-text);
}

@media (min-width: 1024px) {
  .header-mobile-toggle {
    display: none;
  }
}

/* Hamburger Morph lines */
.hamburger-icon {
  width: 22px;
  height: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background-color: currentColor;
  border-radius: 2px;
  transition: transform 0.3s var(--ease-out-expo), opacity 0.2s ease;
}

.header-mobile-toggle.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.header-mobile-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}
.header-mobile-toggle.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Scroll Progress Bar at the Top */
.scroll-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-accent), var(--brand-obsidian-ink));
  width: 0%;
  z-index: 101;
  transition: width 0.1s ease-out;
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION & MOBILE HEADER OPTIMIZATIONS
   ========================================================================== */

.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(250, 249, 245, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--color-border);
    z-index: 998;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
  }

  [data-theme="dark"] .mobile-bottom-nav {
    background: rgba(18, 18, 20, 0.94);
    border-top-color: rgba(255, 255, 255, 0.1);
  }

  .mobile-nav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 100%;
    background: none;
    border: none;
    color: var(--color-text-subtle);
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-tab:active {
    transform: scale(0.92);
  }

  .mobile-nav-tab.active,
  .mobile-nav-tab:hover {
    color: var(--color-primary);
  }

  .mobile-nav-tab svg {
    width: 20px;
    height: 20px;
  }

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

  .mobile-nav-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: var(--color-accent);
    color: #FFFFFF;
    font-size: 9px;
    font-weight: 800;
    min-width: 15px;
    height: 15px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
  }

  .mobile-nav-badge.empty {
    display: none;
  }

  /* Cleaner top header on phone screens */
  .header-container {
    height: 56px;
    padding-inline: 12px;
  }

  .kayan-logo-svg {
    width: 140px;
    height: 30px;
  }

  #header-search-btn,
  #header-account-btn,
  #header-wishlist-btn {
    display: none;
  }

  .header-lang-btn {
    padding: 4px 10px;
    height: 30px;
    font-size: 11px;
  }
}
