/* ==========================================================================
   GOZOFOOD.COM - NAVIGATION & HEADER
   ==========================================================================
   
   Consolidated navigation and header styles combining:
   - Navigation Styles (new-navigation.css)
   - Header Fixes (simple-header.css)
   
   This file handles all header and navigation functionality.
   
   Author: Gozofood.com Development Team
   Version: 1.0 - Consolidated
   Last Updated: September 2025
   ========================================================================== */

/* ==========================================================================
   HEADER FOUNDATION
   ========================================================================== */

/* Ensure header stays fixed at all times */
.header {
  display: block !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: 70px !important;
  background-color: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
  z-index: 9999 !important;
  transform: none !important;
  transition: box-shadow 0.3s ease;
  opacity: 1 !important;
  visibility: visible !important;
  overflow: hidden !important;
}

/* Header scrolled state */
.header--scrolled {
  background-color: rgba(255, 255, 255, 1) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.header--scrolled::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background: linear-gradient(to right, transparent, var(--color-primary-yellow), transparent);
  border-radius: 100px;
  opacity: 0.8;
  z-index: 1;
}

/* Header container */
.header__container {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  box-sizing: border-box;
  overflow: hidden;
}

/* ==========================================================================
   MAIN NAVIGATION
   ========================================================================== */

.nav {
  height: 100%;
  position: relative;
  overflow: hidden;
}

.nav__container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

/* ==========================================================================
   BRAND & LOGO
   ========================================================================== */

.nav__brand {
  display: flex;
  align-items: center;
  height: 100%;
  z-index: 1002;
}

.nav__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--color-primary-green);
  font-family: var(--font-family-secondary);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-3xl);
  transition: transform 0.3s ease;
}

.nav__logo:hover,
.nav__logo:focus {
  transform: translateY(-2px);
  color: var(--color-primary-green);
  text-decoration: none;
}

.nav__logo-image {
  height: 40px;
  width: auto;
  margin-right: var(--spacing-xs);
}

/* ==========================================================================
   DESKTOP NAVIGATION
   ========================================================================== */

.nav__desktop {
  display: flex;
  align-items: center;
  height: 100%;
  gap: var(--spacing-lg);
  overflow: hidden;
}

.nav__desktop-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--spacing-md);
  height: 100%;
  align-items: center;
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav__desktop-menu::-webkit-scrollbar {
  display: none;
}

.nav__desktop-item {
  height: 100%;
  display: flex;
  align-items: center;
  position: relative;
}

.nav__desktop-link {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 var(--spacing-sm);
  text-decoration: none !important;
  border: none !important;
  border-bottom: none !important;
  outline: none !important;
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-base);
  transition: color 0.3s ease;
  position: relative;
  box-shadow: none !important;
}

.nav__desktop-link::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-primary-yellow);
  transition: all 0.3s ease;
  transform: translateX(-50%) translateY(10px);
}

.nav__desktop-link:hover,
.nav__desktop-link:focus {
  color: var(--color-primary-green);
  text-decoration: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

/* Additional override to ensure no global link styles interfere */
.nav .nav__desktop-link:hover,
.nav .nav__desktop-link:focus,
.header .nav__desktop-link:hover,
.header .nav__desktop-link:focus {
  text-decoration: none !important;
  border-bottom: none !important;
  border: none !important;
}

.nav__desktop-link:hover::after,
.nav__desktop-link:focus::after,
.nav__desktop-link--active::after {
  width: 100%;
}

.nav__desktop-link--active {
  color: var(--color-primary-green);
  text-decoration: none !important;
  border-bottom: none !important;
}

/* ==========================================================================
   SEARCH FUNCTIONALITY
   ========================================================================== */

.nav__search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--color-text-primary);
  transition: all 0.3s ease;
}

.nav__search-btn:hover,
.nav__search-btn:focus {
  background-color: rgba(0, 0, 0, 0.1);
  color: var(--color-primary-green);
  outline: none;
}

/* Search form positioned outside header */
.nav__search-form {
  position: fixed !important;
  top: 70px !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  background-color: rgba(255, 255, 255, 0.5) !important;
  backdrop-filter: blur(10px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  border-radius: 0 !important;
  z-index: 1001 !important;
  padding: 20px !important;
  
  /* Hidden by default */
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(-10px) !important;
  transition: all 0.3s ease !important;
}

.nav__search-form--active {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

.nav__search-form-container {
  max-width: 600px !important;
  margin: 0 auto !important;
  position: relative !important;
  border-radius: 0 !important;
}

.nav__search-input {
  width: 100% !important;
  padding: 12px 50px 12px 20px !important;
  border: 2px solid rgba(0, 0, 0, 0.1) !important;
  border-radius: 0 !important;
  font-size: 16px !important;
  outline: none !important;
  transition: border-color 0.3s ease !important;
}

.nav__search-input:focus {
  border-color: var(--color-primary-green) !important;
}

.nav__search-submit,
.nav__search-close {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  padding: 8px !important;
  color: #666 !important;
  transition: color 0.3s ease !important;
}

.nav__search-submit {
  right: 45px !important;
}

.nav__search-close {
  right: 10px !important;
}

.nav__search-submit:hover,
.nav__search-close:hover {
  color: var(--color-primary-green) !important;
}

/* ==========================================================================
   MOBILE NAVIGATION
   ========================================================================== */

/* Mobile toggle button */
.navigation__toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 22px;
  background: transparent;
  border: none;
  padding: var(--spacing-xs);
  cursor: pointer;
  z-index: 1003;
}

.navigation__toggle-line {
  width: 100%;
  height: 3px;
  background: var(--color-text-primary);
  transition: all 0.3s ease;
  transform-origin: center;
}

.navigation__toggle--active .navigation__toggle-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  width: 100%;
}

.navigation__toggle--active .navigation__toggle-line:nth-child(2) {
  opacity: 0;
}

.navigation__toggle--active .navigation__toggle-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  width: 100%;
}

/* Mobile Menu - Hidden by Default */
.navigation__menu {
  display: none;
}

/* Mobile navigation panel */
.navigation__menu-mobile {
  position: fixed;
  top: 0;
  right: -100%;
  width: 320px;
  height: 100vh;
  background: var(--color-white);
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  z-index: 1002;
  transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.navigation__menu-mobile::-webkit-scrollbar {
  display: none;
}

.navigation__menu-mobile.active,
.navigation__menu-mobile.navigation__menu--open {
  right: 0;
}

.nav__mobile-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav__mobile-brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

/* Mobile close button */
.nav__mobile-close {
  background: none;
  border: none;
  padding: var(--spacing-xs);
  cursor: pointer;
  color: var(--color-text-primary);
  border-radius: var(--border-radius-md);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.nav__mobile-close:hover,
.nav__mobile-close:focus {
  background: rgba(0, 0, 0, 0.08);
  color: var(--color-primary-green);
  transform: scale(1.05);
  outline: none;
}

.nav__mobile-close:active {
  transform: scale(0.95);
  background: rgba(0, 0, 0, 0.12);
}

.nav__mobile-logo {
  width: 32px;
  height: 32px;
}

.nav__mobile-title {
  font-family: var(--font-family-secondary);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary-green);
  margin: 0;
}

.nav__mobile-content {
  padding: var(--spacing-md);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav__mobile-content::-webkit-scrollbar {
  display: none;
}

.nav__mobile-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__mobile-item {
  margin-bottom: var(--spacing-xs);
  opacity: 0;
  transform: translateX(20px);
  animation: slideInLeft 0.3s ease forwards;
  animation-delay: calc(var(--item-index, 0) * 0.1s);
}

@keyframes slideInLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.nav__mobile-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  text-decoration: none;
  color: var(--color-text-primary);
  border-radius: var(--border-radius-md);
  transition: all 0.3s ease;
  font-weight: var(--font-weight-medium);
}

.nav__mobile-link:hover,
.nav__mobile-link:focus,
.nav__mobile-link--active {
  background: transparent;
  color: var(--color-primary-green);
  transform: translateX(4px);
}

.nav__mobile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

/* Mobile navigation footer */
.nav__mobile-footer {
  padding: var(--spacing-lg);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  margin-top: auto;
}

.nav__mobile-social {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  margin-bottom: var(--spacing-lg);
}

.nav__mobile-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  color: var(--color-text-secondary);
  transition: all 0.3s ease;
}

.nav__mobile-social-link:hover,
.nav__mobile-social-link:focus {
  background: transparent;
  color: var(--color-primary-green);
  transform: scale(1.1);
}

.nav__mobile-search {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: rgba(0, 0, 0, 0.05);
  border-radius: var(--border-radius-md);
}

.nav__mobile-search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: var(--spacing-xs);
  font-size: var(--font-size-sm);
  outline: none;
}

.nav__mobile-search-icon {
  color: var(--color-text-secondary);
}

/* Backdrop */
.navigation__backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.navigation__backdrop--visible {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   RESPONSIVE STYLES
   ========================================================================== */

@media (max-width: 991px) {
  .nav__desktop {
    display: none;
  }
  
  .navigation__toggle {
    display: flex;
  }
}

@media (max-width: 768px) {
  .navigation__menu-mobile {
    width: 280px;
  }
  
  .header__container {
    padding: 0 var(--spacing-sm);
  }
}
