/* ============================================
   HOMEPAGE DARK HEADER - MOBILE FIRST
   Qatar Shoes - qatarshoes theme

   This header is DIFFERENT from header-main.php:
   - Dark background (#2d1f1f) instead of white
   - White icons/text instead of dark
   - No logo in header (logo is in hero below)
   ============================================ */

/* Base Header (applies to all viewports) */
.home-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #2d1f1f;
  color: #fff;
  transition: transform 0.3s ease;
}

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

/* ============================================
   MOBILE STYLES (< 1024px) - PRIMARY FOCUS
   ============================================ */

/* Hide desktop layout on mobile */
.home-header-desktop {
  display: none;
}

/* Mobile header container */
.home-header-mobile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
  padding: 0 14px;
}

/* Mobile hamburger button */
.home-menu-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px 0;
}

.home-menu-toggle svg {
  width: 22px;
  height: 22px;
}

.home-menu-toggle .menu-text {
  font-family: 'Maison Neue Book', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  letter-spacing: 0.5px;
  text-transform: capitalize;
}

/* Mobile icons (search + cart) */
.home-header-icons {
  display: flex;
  align-items: center;
  gap: 16px;
}

.home-search-btn,
.home-cart-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  text-decoration: none;
}

.home-search-btn svg,
.home-cart-btn svg {
  width: 22px;
  height: 22px;
}

/* ============================================
   SEARCH OVERLAY
   ============================================ */

.home-search-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  padding: 0;
  cursor: pointer;
}

.home-search-overlay.active {
  display: flex;
  justify-content: flex-start;
}

.home-search-overlay-content {
  width: 55%;
  max-width: 700px;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 20px 30px;
  cursor: default;
  background: rgba(255, 255, 255, 0.98);
}

@media (max-width: 768px) {
  .home-search-overlay-content {
    width: 75%;
  }
}

.search-overlay-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.search-overlay-input {
  flex: 1;
  padding: 12px 16px;
  font-family: 'Maison Neue Book', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  outline: none;
  color: #2d1f1f;
}

.search-overlay-input:focus {
  border-color: #2d1f1f;
}

.search-overlay-input::placeholder {
  color: #999;
}

.search-overlay-close {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  color: #2d1f1f;
}

.search-overlay-results {
  flex: 1;
  overflow-y: auto;
}

/* ============================================
   DESKTOP STYLES (>= 1024px)
   ============================================ */

@media (min-width: 1024px) {
  /* Hide mobile layout on desktop */
  .home-header-mobile {
    display: none;
  }

  /* Show desktop layout */
  .home-header-desktop {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    height: 80px;
    padding: 0 40px;
  }

  /* Left section: dept toggle + search */
  .home-header-left {
    display: flex;
    align-items: center;
    gap: 24px;
  }

  /* Department toggle */
  .home-dept-toggle {
    display: flex;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    overflow: hidden;
  }

  .home-dept-toggle .dept-btn {
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-family: 'Maison Neue Book', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    transition: color 0.2s ease;
  }

  .home-dept-toggle .dept-btn:hover {
    color: rgba(255, 255, 255, 0.8);
  }

  .home-dept-toggle .dept-btn.active {
    color: #fff;
  }

  /* Search box (desktop) */
  .home-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
  }

  .home-search-box:hover {
    background: rgba(255, 255, 255, 0.15);
  }

  .home-search-box input {
    background: transparent;
    border: none;
    color: #fff;
    outline: none;
    font-family: 'Maison Neue Book', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    cursor: pointer;
    width: 80px;
  }

  .home-search-box input::placeholder {
    color: rgba(255, 255, 255, 0.6);
  }

  .home-search-box svg {
    color: rgba(255, 255, 255, 0.6);
  }

  /* Center: Navigation */
  .home-nav-desktop {
    display: flex;
    justify-content: center;
  }

  /* Override navigation styles for dark header */
  .home-nav-desktop .nav-menu {
    display: flex;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .home-nav-desktop .nav-menu a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-family: 'Maison Neue Book', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    transition: color 0.2s ease;
  }

  .home-nav-desktop .nav-menu a:hover {
    color: #fff;
  }

  /* Right section: account + cart */
  .home-header-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
  }

  .home-account-btn,
  .home-cart-btn-desktop {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 8px 16px;
    font-family: 'Maison Neue Book', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    transition: border-color 0.2s ease;
  }

  .home-account-btn:hover,
  .home-cart-btn-desktop:hover {
    border-color: rgba(255, 255, 255, 0.3);
  }

  .home-account-btn svg,
  .home-cart-btn-desktop svg {
    width: 18px;
    height: 18px;
  }

  .home-cart-btn-desktop .cart-count {
    font-size: 14px;
  }
}

/* ============================================
   MOBILE DRAWER STYLES
   ============================================ */

/* Drawer Overlay */
.home-drawer-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

.home-drawer-overlay.active {
  display: block;
}

/* External Close Button (outside drawer) */
.drawer-close-external {
  position: fixed;
  top: 0px;
  left: min(calc(85% + 12px), calc(320px + 12px));
  z-index: 1000;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 32px;
  font-weight: 300;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.drawer-close-external.active {
  opacity: 1;
  pointer-events: auto;
}

/* Drawer Panel */
.home-mobile-drawer {
  position: fixed;
  top: 0;
  left: -100%;
  width: 85%;
  max-width: 320px;
  height: 100%;
  background: #fff;
  z-index: 999;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: left 0.3s ease;
}

.home-mobile-drawer.active {
  left: 0;
}

/* Drawer Header */
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #e5e5e5;
  flex-shrink: 0;
}

.drawer-logo img {
  height: 25px !important;
  width: auto;
  vertical-align: middle !important;
}

.drawer-close {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  color: #2d1f1f;
}

/* Gender Tabs */
.drawer-tabs {
  display: flex;
  border-bottom: 1px solid #e5e5e5;
  background: #fff;
  flex-shrink: 0;
}

.drawer-tab {
  flex: 1;
  padding: 18px 24px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: 'Maison Neue Book', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  color: #999;
  cursor: pointer;
  text-align: center;
  margin-bottom: -1px;
  transition: all 0.2s ease;
}

.drawer-tab:hover {
  color: #666;
}

.drawer-tab.active {
  color: #2d1f1f;
  border-bottom-color: #2d1f1f;
  font-family: 'Maison Neue Demi', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
}

/* Drawer Navigation */
.drawer-nav {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}

/* Custom scrollbar */
.drawer-nav::-webkit-scrollbar {
  width: 4px;
}

.drawer-nav::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

.drawer-nav::-webkit-scrollbar-track {
  background: transparent;
}

/* Menu Links */
.drawer-nav > a {
  display: block;
  padding: 16px 20px;
  color: #2d1f1f;
  font-family: 'Maison Neue Book', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  text-decoration: none;
  border-bottom: 1px solid #e5e5e5;
  background: #fff;
}

.drawer-nav > a:hover {
  background: #f9f9f9;
}

.drawer-nav > a.sale {
  color: #e53935;
}

/* Expandable Menu Items */
.drawer-expandable {
  border-bottom: 1px solid #e5e5e5;
  background: #fff;
}

.drawer-expand-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 16px 20px;
  background: transparent;
  border: none;
  font-family: 'Maison Neue Book', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  color: #2d1f1f;
  cursor: pointer;
  text-align: left;
}

.drawer-expand-btn:hover {
  background: #f9f9f9;
}

.drawer-expand-btn.sale {
  color: #e53935;
}

.drawer-expand-icon {
  font-size: 18px;
  font-weight: 300;
  color: #2d1f1f;
  transition: transform 0.2s ease;
}

/* Submenu */
.drawer-submenu {
  display: none;
  background: #f5f5f5;
}

.drawer-submenu.open {
  display: block;
}

.drawer-submenu a {
  display: block;
  padding: 14px 20px 14px 35px;
  color: #666;
  font-family: 'Maison Neue Book', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  text-decoration: none;
  border-bottom: 1px solid #e5e5e5;
}

.drawer-submenu a:last-child {
  border-bottom: none;
}

.drawer-submenu a:hover {
  color: #2d1f1f;
  background: #eee;
}
