/**
 * Header Styles for Miraas Theme
 * This file contains all header-related styles consolidated in one place
 */

/* -------------------------------------------------------------
 * Header
 * -------------------------------------------------------------
 */
.site-header {
  width: 100%;
  background-color: var(--color-primary);
  border-bottom: 1px solid rgba(201, 167, 77, 0.2);
  position: relative;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) 0;
  gap: var(--spacing-lg);
  flex-direction: row;
}

.site-branding {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  max-width: 250px;
}

.site-branding img {
  max-width: 100%;
  height: auto;
}

.custom-logo-link {
  display: block;
  max-width: 250px;
}

.site-title {
  font-size: 1.75rem;
  margin-bottom: 0;
  color: var(--color-accent);
  font-family: var(--font-heading);
  letter-spacing: 1px;
}

.site-description {
  font-size: 0.75rem;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 0.25rem;
}

/* Main Navigation - centered */
.main-navigation {
  display: block;
  flex: 1;
  text-align: center;
  padding: 0 20px; /* Add padding to prevent menu items from crowding the logo and actions */
}

.menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--spacing-md);
  justify-content: center;
  flex-wrap: wrap; /* Allow menu items to wrap if needed */
}

.menu-item {
  display: inline-block;
  position: relative;
}

.menu-item a {
  color: var(--color-accent);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  display: block;
}

.menu-item a:hover {
  color: var(--color-accent);
  text-shadow: 0 0 5px rgba(201, 167, 77, 0.3); /* Subtle glow effect using accent color */
}

.menu-item.current-menu-item > a,
.menu-item.current-menu-ancestor > a {
  color: var(--color-accent);
  text-shadow: 0 0 5px rgba(201, 167, 77, 0.3); /* Subtle glow effect using accent color */
}

.sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--color-primary);
  min-width: 200px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  z-index: 10;
  border: 1px solid rgba(201, 167, 77, 0.4); /* Accent color border with transparency */
}

.menu-item:hover > .sub-menu {
  display: block;
}

.sub-menu .menu-item {
  display: block;
  width: 100%;
}

.sub-menu .menu-item a {
  padding: 0.75rem 1rem;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  flex: 0 0 auto;
  justify-content: flex-end;
  min-width: 250px; /* Match logo width for balance */
}

.header-action {
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  transition: color 0.3s ease;
  position: relative;
}

/* Make icons gold for better visibility */
.header-action svg,
.header-action i {
  color: var(--color-accent);
  stroke: var(--color-accent);
  fill: none; /* Keep icons outlined */
  stroke-width: 2px; /* Make stroke thicker */
  width: 24px !important; /* Force width */
  height: 24px !important; /* Force height */
}

.header-action:hover {
  color: var(--color-secondary);
  opacity: 0.8;
}

.header-action:hover svg,
.header-action:hover i {
  color: var(--color-accent);
  stroke: var(--color-accent);
  fill: none;
  filter: drop-shadow(0 0 2px rgba(201, 167, 77, 0.7)); /* Subtle glow effect */
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: var(--color-accent);
  color: #000000; /* Black text for contrast */
  font-size: 0.75rem;
  width: 20px; /* Slightly larger */
  height: 20px; /* Slightly larger */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* font-weight removed */
  border: 2px solid #000000; /* Thicker black border for better definition */
  box-shadow: 0 0 5px rgba(201, 167, 77, 0.5); /* Subtle glow effect */
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  color: var(--color-accent);
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
  transform: scale(1.1); /* Slight grow effect on hover */
  color: var(--color-accent);
  opacity: 0.8;
}

.mobile-menu-toggle i {
  stroke: currentColor;
  stroke-width: 2px; /* Thicker stroke for better visibility */
}

/* Search Overlay */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-overlay.active {
  opacity: 1;
  visibility: visible;
}

.search-overlay .search-form {
  width: 80%;
  max-width: 600px;
}

.search-overlay .search-form-wrapper {
  display: flex;
  border-bottom: 2px solid var(--color-accent);
}

.search-overlay .search-field {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--color-accent);
  font-size: 1.5rem;
  padding: 1rem;
}

.search-overlay .search-submit {
  background: transparent;
  border: none;
  color: var(--color-accent);
  font-size: 1.5rem;
  padding: 1rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.search-overlay .search-submit:hover {
  color: var(--color-secondary);
}

/* Mobile Responsive Styles */
@media (max-width: 992px) {
  .menu {
    gap: var(--spacing-sm);
  }
  
  .menu-item a {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 768px) {
  .header-inner {
    flex-direction: row;
    gap: var(--spacing-md);
    justify-content: space-between;
    flex-wrap: wrap;
    padding: var(--spacing-sm) 0;
  }

  .site-branding {
    width: auto;
    justify-content: flex-start;
    flex: 0 0 auto;
    max-width: 120px; /* Slightly smaller on mobile */
  }

  .header-actions {
    width: auto;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    min-width: 120px; /* Match mobile logo width */
  }
  
  /* Show mobile menu toggle on mobile */
  .mobile-menu-toggle {
    display: flex;
  }
  
  /* Hide main navigation on mobile */
  .main-navigation {
    display: none;
    flex: 0 0 100%; /* Full width when visible */
    order: 3; /* Push below logo and actions */
  }
  
  .main-navigation.active {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--color-primary);
    z-index: 100;
    border-top: 1px solid rgba(201, 167, 77, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  }
  
  .main-navigation .menu {
    display: flex;
    flex-direction: column;
    padding: var(--spacing-md);
  }
  
  .menu-item {
    display: block;
    width: 100%;
    margin-bottom: var(--spacing-xs);
  }
  
  .menu-item a {
    padding: var(--spacing-sm) 0;
  }
  
  .sub-menu {
    position: static;
    box-shadow: none;
    border: none;
    background-color: transparent;
    padding-left: var(--spacing-md);
    width: 100%;
  }
  
  .search-overlay .search-field {
    font-size: 1rem;
    padding: 0.875rem 1rem;
  }

  .search-overlay .search-submit {
    padding: 0.875rem 1rem;
  }
}

/* Fallback for when Feather icons don't load */
.header-action::after {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  position: absolute;
  top: 0;
  left: 0;
  background-color: transparent;
  z-index: -1;
}

.account-link::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23C9A74D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='12' cy='7' r='4'%3E%3C/circle%3E%3C/svg%3E");
}

.search-toggle::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23C9A74D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
}

.cart-link::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23C9A74D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z'%3E%3C/path%3E%3Cline x1='3' y1='6' x2='21' y2='6'%3E%3C/line%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'%3E%3C/path%3E%3C/svg%3E");
}

.mobile-menu-toggle::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23C9A74D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='3' y1='12' x2='21' y2='12'%3E%3C/line%3E%3Cline x1='3' y1='6' x2='21' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='18' x2='21' y2='18'%3E%3C/line%3E%3C/svg%3E");
} 