/**
 * Header Styles
 * All styles related to the site header, navigation, and search
 */

/* === HEADER === */
.site-header {
  background: var(--color-white);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: var(--z-index-sticky);
  padding: var(--spacing-4);
}

.header-content {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 80px;
}

/* Header sections */
.header-center {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-6);
  flex: 1;
}

.header-actions {
  justify-self: end;
}

.header-search {
  margin-left: 20px;
}

/* Logo image styling */
.site-logo img,
.custom-logo-link img {
  max-width: 160px;
  height: auto;
  max-height: 80px;
  object-fit: contain;
  display: block;
}


.main-navigation ul {
  display: flex;
  list-style: none;
  gap: var(--spacing-6);
  margin: 0;
  padding: 0;
}

.main-navigation a {
  font-weight: var(--font-weight-medium);
}

.main-navigation a:hover,
.main-navigation a:focus {
  color: var(--color-primary-alt);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
}

/* === HEADER ACTIONS === */
.header-actions {
  display: flex;
  align-items: center;
}

/* FiboSearch Specific Styles */

.dgwt-wcas-search-input { /* this needs important*/
  border: none !important;
  border-bottom: 1px solid #ddd !important;
  border-radius: 0 !important;
}

/* === CART ICON === */
.cart-icon, .favorites-icon {
  position: relative;
  font-size: var(--font-size-xl);
  color: var(--color-primary);
  padding: var(--spacing-3);
  border-radius: var(--border-radius-lg);
}

.cart-icon:hover, .favorites-icon:hover {
  color: var(--color-primary-alt);
}

.cart-count {
  position: absolute;
  top: 0;
  right: 0;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  border-radius: var(--border-radius-full);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  transform: translate(25%, -25%);
}

/* === HIDE ADD TO CART LINKS IN HEADER === */
.site-header .added_to_cart {
  display: none !important;
}

.site-header .wc-forward {
  display: none !important;
}

/* === HIDE ADD TO CART LINKS IN STICKY HEADER === */
#sticky-product-header .added_to_cart {
  display: none !important;
}

#sticky-product-header .wc-forward {
  display: none !important;
}

.mobile-search {
  display: none;
}

/* === HEADER RESPONSIVE === */
@media (max-width: 768px) {
  .main-navigation.active {
    display: block ;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    background: var(--color-white);
    box-shadow: var(--shadow-md);
    z-index: 15;
  }

  .site-header {
    padding: 0;;
  }

  .site-header.hide {
    transform: translateY(-50%);
    transition: transform 0.3s ease;
  }

  .mobile-menu-toggle {
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    color: var(--color-primary);
    cursor: pointer;
    padding: var(--spacing-2);
    display: block;
  }

  /* Mobile cart adjustments */
  .cart-icon, .favorites-icon {
    padding: var(--spacing-2);
    font-size: var(--font-size-lg);
  }

  .cart-count {
    width: 15px;
    height: 15px;
    font-size: 10px;
    transform: translate(35%, -35%);
  }

  /* Mobile navigation styles */
  .main-navigation {
    display: none;

  }

   .main-navigation ul {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
    padding: var(--spacing-2) var(--spacing-4) 0; /* keep left/right padding, remove top/bottom */
    margin: 0;
    list-style: none;
  }

  .main-navigation ul:first-child {
      padding-top: var(--spacing-4);
  }

  .main-navigation ul:last-child {
      padding-bottom: var(--spacing-4);
  }

  /* Mobile FiboSearch */
  .dgwt-wcas-search-wrapp {
    width: 100%;
  }
}

@media (max-width: 425px) {
  .header-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
  }

  .header-content {
    display: grid;
    grid-template-columns: 1fr auto;
  }
}

@media (max-width: 550px) {
  .main-navigation.active {
    top: 120px;
  }

  .dgwt-wcas-search-input { /* this needs important*/
    border: none !important;
  }

  .header-center {
    display: none;
  }

  .mobile-search {
    display: block;
    grid-column: 1 / -1;
    width: 100%;
  }

  .header-search {
    margin-left: 10px;
  }

  .header-content {
    grid-template-columns: auto 1fr;
    padding: 0 var(--spacing-2);
  }
}

ul.subheader-menu {
  display: none;
}

.sub-header-menu {
    background-color: white;
    border-top: 1px solid white;
    border-bottom: 1px solid white;
    margin-top: 0;

}

.sub-header-menu .container {
  padding: 0;
  margin: 4px auto;
}

ul.under-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

ul.under-header::-webkit-scrollbar {
    display: none;
}

ul.under-header li a {
    display: block;
    padding: 6px 12px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.2px;
    transition: color 0.2s;
    border-bottom: 3px solid transparent; /* reserve space for active indicator */
}

ul.under-header li a:hover {
    color: #e63946;
}

ul.under-header li.current-menu-item a {
    color: #e63946;
    font-weight: 700;
    border-bottom: 3px solid #e63946; /* active underline indicator */
    background-color: transparent;
}

@media (max-width: 768px) {
    ul.subheader-menu {
      display: flex;
    }

    .sub-header-menu {
        display: none;
    }
}