/* Kitchen Keepers - Three Section Header CSS */
:root {
  /* Colors */
  --primary-color: #2E7D32;
  --primary-light: #4CAF50;
  --primary-dark: #1B5E20;
  --secondary-color: #FF6F00;
  --bg-color: #FFFFFF;
  --surface-color: #F8F9FA;
  --text-primary: #212529;
  --text-secondary: #6C757D;
  --border-color: #DEE2E6;
  --shadow: 0 2px 10px rgba(0,0,0,0.1);
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  
  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  
  /* Transitions */
  --transition: all 0.3s ease;
}

/* Dark theme */
[data-theme="dark"] {
  --bg-color: #121212;
  --surface-color: #1E1E1E;
  --text-primary: #FFFFFF;
  --text-secondary: #B0B0B0;
  --border-color: #333333;
  --shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* Header Styles */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-color);
  box-shadow: var(--shadow);
}

/* First Section: Header Top */
.header-top {
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  padding: var(--spacing-sm) 0;
}

.header-top-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-lg);
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-shrink: 0;
}

.logo i {
  font-size: 1.5rem;
}

/* Search Container */
.search-container {
  flex: 1;
  max-width: 500px;
  margin: 0 var(--spacing-lg);
}

.search-bar {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md) var(--spacing-sm) 2.5rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  transition: var(--transition);
  background: var(--bg-color);
  color: var(--text-primary);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.search-icon {
  position: absolute;
  left: var(--spacing-sm);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-shrink: 0;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  text-decoration: none;
}

.action-btn:hover {
  background: var(--border-color);
  color: var(--primary-color);
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--secondary-color);
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* User Dropdown */
.user-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  min-width: 150px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition);
}

.user-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}

.dropdown-menu a:hover {
  background: var(--surface-color);
  color: var(--primary-color);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.875rem;
  gap: var(--spacing-xs);
}

.btn-sm {
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: 0.8rem;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-primary);
  cursor: pointer;
  padding: var(--spacing-xs);
}

/* Second Section: Navigation */
.header-nav {
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  padding: var(--spacing-sm) 0;
}

.main-nav {
  display: flex;
  justify-content: center;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: var(--spacing-lg);
  margin: 0;
  padding: 0;
}

.nav-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  transition: var(--transition);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  min-height: 40px;
}

.nav-link:hover {
  color: var(--primary-color);
  background: var(--surface-color);
}

.nav-link.active {
  color: #007bff;
  background: var(--surface-color);
  font-weight: 600;
  border-bottom: 2px solid #007bff;
}

/* Navigation Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown .nav-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.dropdown-arrow {
  font-size: 0.7rem;
  transition: var(--transition);
}

.nav-dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition);
  z-index: 1000;
}

.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-link {
  display: block;
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color);
}

.nav-dropdown-link:last-child {
  border-bottom: none;
}

.nav-dropdown-link:hover {
  background: var(--surface-color);
  color: #007bff;
}

/* Third Section: Marquee */
.header-marquee {
  background: var(--primary-color);
  color: white;
  padding: var(--spacing-xs) 0;
  overflow: hidden;
}

.marquee-content {
  white-space: nowrap;
  display: inline-block;
  padding-left: 100%; /* start fully off-screen to the right */
  animation: marquee 40s linear infinite;
  font-size: 0.85rem;
  font-weight: 500;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* Mobile Navigation */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-nav.active {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  height: 100%;
  background: var(--bg-color);
  box-shadow: var(--shadow);
  transform: translateX(100%);
  transition: var(--transition);
}

.mobile-nav.active .mobile-nav-content {
  transform: translateX(0);
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
}

.mobile-nav-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mobile-nav-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-primary);
  cursor: pointer;
  padding: var(--spacing-xs);
}

.mobile-nav-menu {
  list-style: none;
  padding: var(--spacing-lg);
}

.mobile-nav-menu li {
  margin-bottom: var(--spacing-sm);
}

.mobile-nav-link {
  display: block;
  color: var(--text-primary);
  text-decoration: none;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.mobile-nav-link:hover {
  background: var(--surface-color);
  color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-top-content {
    gap: var(--spacing-sm);
  }
  
  .logo {
    font-size: 1rem;
  }
  
  .search-container {
    flex: 1;
    margin: 0 var(--spacing-sm);
    max-width: none;
  }
  
  .search-input {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: var(--spacing-xs) var(--spacing-sm) var(--spacing-xs) 2rem;
  }
  
  .header-actions {
    gap: var(--spacing-xs);
  }
  
  .btn {
    display: none; /* Hide login/signup buttons on mobile */
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  /* Hide desktop navigation on mobile */
  .nav-menu {
    display: none;
  }
  
  .header-nav {
    display: none;
  }
  
  /* Show mobile navigation */
  .mobile-nav {
    display: block;
  }
}

@media (max-width: 480px) {
  .header-top {
    padding: var(--spacing-xs) 0;
  }
  
  .logo span {
    display: none; /* Hide text, keep icon only */
  }
  
  .search-input {
    font-size: 14px;
  }
  
  .marquee-content {
    font-size: 0.75rem;
  }
}

/* Utility Classes */
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }

/* Main Content */
.main-content {
  min-height: calc(100vh - 200px);
}