/**
 * Layout: Header & Navigation
 * Usage: Site header, announcement bar, main navigation
 * Dependencies: variables.css, typography.css
 * Last Updated: 2025-06-25
 * 
 * Consolidated header styling from the previous style.css header sections.
 * Includes announcement bar, main header, navigation, and mobile menu.
 */

/*============================================================================
  MAIN HEADER STRUCTURE
============================================================================*/

header.site-header {
  padding-top: 0;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--header-bg);
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

header.site-header .main-header-bar-wrap {
  padding: 0;
  box-shadow: var(--header-shadow);
  position: relative;
  z-index: 99;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  width: 100%;
}

/*============================================================================
  ANNOUNCEMENT BAR
============================================================================*/

.announcement-bar {
  background: var(--accent-black);
  position: relative;
  z-index: 100;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.announcement-bar .top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px;
  min-height: 40px;
  max-width: var(--container-max-width);
  margin: 0 auto;
  width: 100%;
}

.announcement-bar .top-bar .mob-phn {
  display: none;
  font-weight: 600;
}

.announcement-bar .top-bar .mob-phn a {
  color: #fff;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.announcement-bar .top-bar .desk-acc ul {
  padding: 0;
  margin: 0;
  display: flex;
  list-style: none;
  gap: 20px;
}

.announcement-bar .top-bar .desk-acc ul li {
  margin: 0;
  font-weight: 600;
}

.announcement-bar .top-bar .desk-acc ul li a {
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.3s ease;
}

.announcement-bar .top-bar .desk-acc ul li a:hover {
  opacity: 0.9;
}

/*============================================================================
  MAIN HEADER CONTAINER - DESKTOP LAYOUT FIXES
============================================================================*/

.main-header-container {
  padding: var(--header-padding);
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 20px !important;
  max-width: var(--container-max-width);
  margin: 0 auto;
  position: relative;
  flex-wrap: nowrap !important;
  flex-direction: row !important;
  width: 100% !important;
}

/* Critical fix for desktop header stacking issue */
@media (min-width: 922px) {
  .main-header-container {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
  }
  
  .main-header-container > * {
    display: block !important;
    position: relative !important;
    float: none !important;
    clear: none !important;
  }
}

/*============================================================================
  LOGO SECTION
============================================================================*/

.site-branding {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.custom-logo-link {
  display: block;
  line-height: 0;
}

.custom-logo,
.ast-logo-title-inline .site-logo-img {
  max-height: var(--logo-max-height);
  width: auto;
  height: auto;
  transition: transform 0.3s ease;
}

.custom-logo:hover,
.ast-logo-title-inline .site-logo-img:hover {
  transform: scale(1.02);
}

/*============================================================================
  SEARCH SECTION
============================================================================*/

.header-custom-search {
  flex: 1;
  max-width: 500px;
  min-width: 300px;
  position: relative;
  margin: 0 20px;
}

.header-custom-search form {
  position: relative;
  display: flex;
  align-items: center;
}

.header-custom-search .search-field {
  width: 100%;
  border: 2px solid #e1e5e9;
  padding: 12px 60px 12px 20px;
  background: #fff;
  border-radius: var(--search-border-radius);
  font-size: 15px;
  font-weight: 400;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.header-custom-search .search-field:focus {
  outline: 0;
  border-color: var(--primary-color);
  box-shadow: 0 2px 12px rgba(215, 4, 15, 0.15);
  transform: translateY(-1px);
}

.header-custom-search .search-field::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.header-custom-search .search-submit,
.search .header-custom-search .search-submit {
  background: var(--primary-color) !important;
  border: none !important;
  font-size: 0;
  padding: 0;
  width: 50px;
  height: 46px;
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: calc(var(--search-border-radius) - 2px);
  background-image: url("/wp-content/uploads/2021/06/search-ratina.png") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 18px !important;
  transition: all 0.3s ease;
  cursor: pointer;
}

.header-custom-search .search-submit:hover,
.search .header-custom-search .search-submit:hover {
  background-color: #b8030d !important;
  transform: translateY(-50%) scale(1.05);
}

/*============================================================================
  HEADER CONTACT INFO
============================================================================*/

.header_contact {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.header_contact .h-cntct {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 15px;
  align-items: center;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.contact-icon,
.phone-icon,
.email-icon {
  color: var(--primary-color);
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.contact-item a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.contact-item a:hover {
  color: var(--primary-color);
}

/*============================================================================
  HEADER ACTIONS
============================================================================*/

.header_actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.header_actions .h-actions {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 15px;
  align-items: center;
}

.action-item {
  position: relative;
}

.action-item a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-size: 13px;
  font-weight: 500;
}

.action-item a:hover {
  background: rgba(215, 4, 15, 0.1);
  color: var(--primary-color);
}

.action-icon,
.account-icon,
.cart-icon {
  color: var(--primary-color);
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.action-item a:hover .action-icon {
  color: var(--primary-color);
}

/* Cart Count Badge */
.cart-count {
  position: absolute;
  top: -2px;
  right: 6px;
  background: var(--primary-color);
  color: white;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/*============================================================================
  MOBILE SEARCH BUTTON
============================================================================*/

.search-btn-div {
  display: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background-color 0.3s ease;
  flex-shrink: 0;
}

.search-btn-div:hover {
  background-color: rgba(215, 4, 15, 0.1);
}

.search-btn-div svg {
  display: block;
}

/*============================================================================
  MOBILE MENU TOGGLE
============================================================================*/

.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  width: 40px;
  height: 40px;
  position: relative;
  border-radius: 8px;
  transition: background-color 0.3s ease;
  flex-shrink: 0;
}

.menu-toggle:hover {
  background-color: rgba(215, 4, 15, 0.1);
}

.menu-toggle-icon,
.menu-toggle-icon:before,
.menu-toggle-icon:after {
  background-color: var(--primary-color);
  content: "";
  display: block;
  height: 3px;
  position: absolute;
  transition: all 0.3s ease;
  width: 24px;
  border-radius: 2px;
}

.menu-toggle-icon {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.menu-toggle-icon:before {
  top: -8px;
}

.menu-toggle-icon:after {
  bottom: -8px;
}

.menu-toggle.toggled .menu-toggle-icon {
  background-color: transparent;
}

.menu-toggle.toggled .menu-toggle-icon:before {
  transform: rotate(45deg);
  top: 0;
}

.menu-toggle.toggled .menu-toggle-icon:after {
  transform: rotate(-45deg);
  bottom: 0;
}

/*============================================================================
  RESPONSIVE - MOBILE
============================================================================*/

@media (max-width: 921px) {
  /* Announcement Bar Mobile */
  .announcement-bar .top-bar {
    flex-direction: column;
    padding: 10px 0;
    gap: 8px;
  }

  .announcement-bar .top-bar .mob-phn {
    display: block;
    order: 1;
  }

  .announcement-bar .top-bar .desk-acc {
    order: 2;
  }

  .announcement-bar .top-bar .desk-acc ul {
    gap: 15px;
    font-size: 13px;
    justify-content: center;
  }

  /* Main Header Mobile Layout */
  .main-header-container {
    flex-wrap: wrap;
  }

  .site-branding {
    order: 1;
    flex: 1;
    max-width: calc(100% - 100px);
  }

  .search-btn-div {
    order: 2;
    display: block;
    margin-left: auto;
  }

  .menu-toggle {
    order: 3;
    display: block;
  }

  .header-custom-search {
    order: 4;
    width: 100%;
    margin-top: 15px;
    max-width: 100%;
    display: none;
  }

  .header-custom-search.active {
    display: block;
  }

  .header-custom-search .search-field {
    border-radius: 12px;
    padding: 14px 60px 14px 18px;
  }

  .header_contact {
    order: 5;
    width: 100%;
    margin-top: 12px;
    text-align: center;
  }

  .header_contact .desktop-only {
    display: none;
  }

  .action-text {
    display: none;
  }

  .header_actions .h-actions {
    gap: 15px;
  }

  .action-item a {
    padding: 6px 8px;
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .announcement-bar .top-bar .desk-acc ul {
    gap: 10px;
    font-size: 12px;
  }

  .main-header-container {
    padding: 10px 0;
  }

  .header-custom-search .search-field {
    font-size: 14px;
    padding: 12px 55px 12px 16px;
  }

  .header-custom-search .search-submit {
    width: 45px;
    height: 42px;
  }

  .site-branding {
    max-width: 60%;
  }

  .header_actions .h-actions {
    gap: 10px;
  }

  .action-item a {
    padding: 4px 6px;
  }

  .action-icon {
    width: 18px;
    height: 18px;
  }

  .cart-count {
    top: -3px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    font-size: 10px;
  }
}

/*============================================================================
  NAVIGATION MENU - Desktop Layout Fix
============================================================================*/
.header-menu {
  background: var(--header-bg);
  border-top: 1px solid var(--header-border);
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.header-menu .ast-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* Desktop Navigation */
.main-navigation {
  display: block;
  width: 100%;
}

.main-header-menu {
  display: flex !important;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 25px;
  flex-wrap: wrap;
}

.main-header-menu > li {
  position: relative;
  margin: 0;
  display: flex;
  align-items: center;
}

.main-header-menu > li > a {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  padding: 18px 0;
  display: block;
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
  white-space: nowrap;
}

.main-header-menu > li > a:hover {
  color: var(--accent-dark, #2d2d2d);
}

.main-header-menu > li.current-menu-item > a {
  color: var(--primary-color);
}

.main-header-menu > li > a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-black, #1a1a1a);
  transition: width 0.3s ease;
}

.main-header-menu > li:hover > a::after {
  width: 100%;
  background: var(--accent-dark, #2d2d2d);
}

.main-header-menu > li.current-menu-item > a::after {
  width: 100%;
  background: var(--primary-color);
}

/* Hide Astra menu decorations on desktop */
@media (min-width: 922px) {
  .main-header-menu .ast-icon,
  .main-header-menu .sub-arrow,
  .main-header-menu .dropdown-toggle {
    display: none;
  }
}

.main-header-menu .menu-text {
  font-weight: inherit;
  color: inherit;
}

/* Dropdown Menus */
.main-header-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  min-width: 220px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  padding: 15px 0;
  list-style: none;
  margin: 0;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.main-header-menu li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.main-header-menu .sub-menu li {
  margin: 0;
  width: 100%;
  display: block;
}

.main-header-menu .sub-menu a {
  padding: 12px 20px;
  font-size: 14px;
  color: var(--text-secondary, #4a4a4a);
  display: block;
  text-decoration: none;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.main-header-menu .sub-menu a:hover {
  color: var(--accent-black, #1a1a1a);
  background-color: var(--bg-light, #f8f9fa);
  border-left-color: var(--accent-black, #1a1a1a);
}