:root {
  --primary-color: #000000;
  --secondary-color: #0087bd;
  --light-color: #f8f9fa;
  --dark-color: #212529;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  padding-top: 80px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================
   HEADER STYLES
   ========================================== */
.navbar {
  padding: 15px 0;
  background-color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  height: 80px;
}

.navbar-brand {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.hamburger-menu {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1040;
}

.hamburger-menu span {
  width: 100%;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.hamburger-menu:hover span {
  background-color: var(--secondary-color);
}

.nav-link {
  color: var(--dark-color);
  font-weight: 500;
  margin: 0 10px;
  transition: color 0.3s;
}

.nav-link:hover {
  color: var(--primary-color);
}

/* More specific selector for header nav only */
.account-page-wrapper .navbar .nav-link:hover {
  color: var(--dark-color) !important;
  cursor: default;
}

.account-page-wrapper .navbar .nav-link {
  pointer-events: none;
}

/* Ensure account page sidebar is not affected by header sidebar styles */
.account-page-wrapper .sidebar-nav {
  position: static;
  width: auto;
  height: auto;
  background-color: transparent;
  box-shadow: none;
  transition: none;
}

.account-page-wrapper .sidebar-menu .nav-link {
  pointer-events: auto !important;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Sidebar Navigation Styles */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidebar-nav {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100%;
  background-color: #fff;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 1051;
  transition: left 0.3s ease;
  overflow-y: auto;
}

/* Desktop: Show navigation inline */
@media (min-width: 993px) {
  .navbar .hamburger-menu {
    display: none;
  }

  .navbar .sidebar-overlay {
    display: none !important;
  }

  .navbar .sidebar-nav {
    position: static;
    width: auto;
    height: auto;
    box-shadow: none;
    transition: none;
    overflow-y: visible;
    left: 0;
    background-color: transparent;
    display: inline-flex;
    align-items: center;
  }

  .navbar .sidebar-header {
    display: none !important;
  }

.navbar .sidebar-close {
    display: none !important;
  }

  .navbar .sidebar-brand {
    display: none !important;
  }

  .navbar .sidebar-menu {
    display: flex;
    align-items: center;
    gap: 0;
    flex-direction: row;
    margin: 0;
    padding: 0;
    list-style: none;
  }

.navbar .sidebar-menu .nav-item {
    border-bottom: none;
    display: inline-block;
  }

  .navbar .sidebar-menu .nav-link {
    padding: 0;
    margin: 0 10px;
    display: inline-block;
    color: var(--dark-color);
    font-weight: 500;
    transition: color 0.3s;
  }

  .navbar .sidebar-menu .nav-link:hover {
    background-color: transparent;
    padding-left: 0;
    color: var(--primary-color) !important;
  }

  .navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .header-right {
    margin-left: auto;
  }
}

.sidebar-nav.active {
  left: 0;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.sidebar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.sidebar-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--dark-color);
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}

.sidebar-close:hover {
  color: var(--secondary-color);
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu .nav-item {
  border-bottom: 1px solid #f0f0f0;
}

.sidebar-menu .nav-link {
  display: block;
  padding: 15px 20px;
  color: var(--dark-color);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  margin: 0;
  pointer-events: auto !important;
}

.sidebar-menu .nav-link:hover {
  background-color: #f8f9fa;
  color: var(--primary-color) !important;
  padding-left: 25px;
}

/* Mobile Search Icon */
.mobile-search-icon {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  color: var(--dark-color);
  transition: all 0.3s ease;
}

.mobile-search-icon:hover {
  color: var(--secondary-color);
  transform: scale(1.1);
}

.mobile-search-icon i {
  font-size: 1.2rem;
}

.mobile-search-close {
  display: none;
  position: absolute;
  left: 10px;
  top: 15px;
  background: transparent;
  border: none;
  color: var(--dark-color);
  font-size: 20px;
  cursor: pointer;
  z-index: 10;
  padding: 5px;
  transition: color 0.3s ease;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
}

.mobile-search-close:hover {
  color: var(--secondary-color);
}

.search-container.mobile-active .mobile-search-close {
  display: flex;
}

/* ==========================================
   SEARCH CONTAINER STYLES
   ========================================== */
.search-container {
  position: relative;
}

/* Hide search container on account pages */
.account-page-wrapper .search-container {
  display: none !important;
}

.account-page-wrapper .mobile-search-icon {
  display: none !important;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 280px;
  padding: 8px 45px 8px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 25px;
  font-size: 14px;
  transition: all 0.3s ease;
  background-color: #f8f9fa;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.1);
  background-color: white;
}

.search-btn {
  position: absolute;
  right: 5px;
  background: var(--primary-color);
  border: none;
  color: white;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.search-btn:hover {
  background: var(--secondary-color);
  transform: scale(1.05);
}

.search-btn i {
  font-size: 14px;
}

.cancel-btn {
  position: absolute;
  right: 45px;
  background: transparent;
  border: none;
  color: #999;
  width: 30px;
  height: 30px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.3s ease;
  top: 50%;
  transform: translateY(-50%);
}

.cancel-btn:hover {
  background: #f0f0f0;
  color: #666;
}

.cancel-btn i {
  font-size: 12px;
}

/* Adjust search input padding when cancel button is visible */
.search-input.has-text {
  padding-right: 80px;
}

.signup-btn {
  padding: 8px 20px;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  background: transparent;
  border-radius: 25px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.signup-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(42, 157, 143, 0.3);
}

.profile-icon {
  text-decoration: none;
  color: var(--dark-color);
  transition: all 0.3s ease;
}

.profile-icon:hover, .cart-icon:hover, .wishlist-icon:hover {
  color: var(--secondary-color);
  transform: scale(1.1);
}

.navbar .dropdown-menu {
  z-index: 1060;
}

header.fixed-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  background-color: #fff;
}

.icon-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.icon-label {
  font-size: 0.75rem;
  color: var(--primary-color);
  margin-top: 4px;
  white-space: nowrap;
}

/* ==========================================
   SEARCH SUGGESTIONS STYLES
   ========================================== */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: white;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.search-history-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  cursor: pointer;
  transition: background-color 0.2s;
  background-color: white;
  border-bottom: 1px solid #f0f0f0;
}

.search-history-item:last-child {
  border-bottom: none;
}

.search-history-item:hover {
  background-color: #f8f9fa;
}

.history-icon {
  color: #666;
  font-size: 14px;
  margin-right: 12px;
  flex-shrink: 0;
}

.history-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.history-term {
  color: #333;
  font-size: 14px;
  font-weight: 400;
  margin-bottom: 2px;
}

.history-category {
  color: #2874f0;
  font-size: 12px;
  font-weight: 400;
}

.suggestion-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  cursor: pointer;
  transition: background-color 0.2s;
  background-color: white;
  border-bottom: 1px solid #f0f0f0;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background-color: #f8f9fa;
}

.suggestion-image {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 5px;
  margin-right: 12px;
}

.suggestion-details {
  display: flex;
  flex-direction: column;
}

.suggestion-name {
  font-weight: 500;
  color: var(--secondary-color);
  margin-bottom: 2px;
}

.suggestion-price {
  color: var(--primary-color);
  font-size: 0.9rem;
}

/* ==========================================
   FOOTER STYLES
   ========================================== */
footer {
  background-color: #000;
  color: #fff;
  padding: 50px 0 20px;
  margin-top: auto;
}

.footer-logo img {
  height: 50px;
  margin-bottom: 20px;
}

.footer-links h5 {
  font-weight: 600;
  margin-bottom: 20px;
  color: #fff;
}

.footer-links ul {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--primary-color);
}

.contact-info i {
  margin-right: 10px;
  color: var(--primary-color);
}

.social-icons {
  margin-top: 20px;
}

.social-icons a {
  display: inline-block;
  width: 36px;
  height: 36px;
  background-color: #333;
  color: #fff;
  border-radius: 50%;
  text-align: center;
  line-height: 36px;
  margin-right: 10px;
  transition: all 0.3s;
}

.social-icons a:hover {
  background-color: var(--primary-color);
  transform: translateY(-3px);
}

.copyright {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #333;
  text-align: center;
  color: #999;
  font-size: 0.9rem;
}

/* Hide search on shop pages */
body.shop-page .search-container {
  display: none !important;
}

body.shop-page .mobile-search-icon {
  display: none !important;
}

/* Hide browser autocomplete and other dropdowns */
input[type="text"]::-webkit-search-cancel-button,
input[type="text"]::-webkit-search-decoration {
  display: none;
}

.search-input {
  autocomplete: off;
}

/* Hide any bootstrap dropdowns that might interfere */
.search-container .dropdown-menu,
.search-container .show {
  display: none !important;
}

/* Ensure only our search suggestions show */
.search-container > *:not(.search-form):not(.search-suggestions) {
  display: none !important;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Large tablets and small laptops (1024px and below) */
@media (max-width: 1024px) {
  .search-input {
    width: 240px;
  }
  
  .header-right {
    gap: 12px;
  }
}

/* Tablets (992px and below) */
@media (max-width: 992px) {
  .hamburger-menu {
    display: flex;
  }

  .navbar .navbar-nav {
    display: none;
  }

  /* Mobile Search Styles */
  .mobile-search-icon {
    display: flex;
  }

  .search-container {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    background-color: #fff;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    margin: 0;
  }

  .search-container.mobile-active {
    display: block;
  }

  .search-container .search-input {
    width: 100%;
    max-width: 100%;
    padding-left: 45px;
  }

  .header-right {
    gap: 12px;
    margin-left: auto;
  }

  .header-right.search-active > *:not(.search-container) {
    opacity: 0.3;
    pointer-events: none;
  }

  .search-input {
    width: 100%;
  }

  .signup-btn {
    display: none;
  }

  .dropdown .icon-label,
  .icon-container .icon-label {
    display: none;
  }

  .navbar .container {
    display: flex;
    align-items: center;
    gap: 15px;
  }

  body {
    padding-top: 70px;
  }

  .navbar {
    height: auto;
    min-height: 70px;
  }
}

/* Small tablets and large phones (768px and below) */
@media (max-width: 768px) {
  .search-container {
    top: 65px;
  }


  .navbar {
    padding: 10px 0;
    min-height: 65px;
  }

  body {
    padding-top: 65px;
  }

  .header-right {
    gap: 10px;
  }
}

/* Mobile phones (576px and below) */
@media (max-width: 576px) {
  .navbar-brand {
    font-size: 1.3rem;
  }

  .profile-icon i, .cart-icon i {
    font-size: 1.2rem;
  }

  .search-input {
    font-size: 13px;
    padding: 7px 40px 7px 45px;
  }

  .search-btn {
    width: 30px;
    height: 30px;
  }

  .search-btn i {
    font-size: 12px;
  }

  .cancel-btn {
    width: 25px;
    height: 25px;
    right: 38px;
  }

  .cancel-btn i {
    font-size: 10px;
  }

  .container {
    padding-left: 10px;
    padding-right: 10px;
  }

  .hamburger-menu {
    width: 25px;
    height: 20px;
  }

  .hamburger-menu span {
    height: 2.5px;
  }
}

/* Extra small phones (375px and below) */
@media (max-width: 375px) {
  .navbar-brand {
    font-size: 1.1rem;
  }

  .search-input {
    font-size: 12px;
    padding: 6px 35px 6px 45px;
  }

  .search-btn {
    width: 28px;
    height: 28px;
  }

  .search-btn i {
    font-size: 11px;
  }

  .cancel-btn {
    width: 22px;
    height: 22px;
    right: 33px;
  }

  .profile-icon i, .cart-icon i {
    font-size: 1.1rem;
  }

  .header-right {
    gap: 8px;
  }
}

/* ==========================================
   LANDSCAPE ORIENTATION FIXES
   ========================================== */
@media (max-height: 500px) and (orientation: landscape) {
  body {
    padding-top: 60px;
  }
  
  .navbar {
    min-height: 60px;
    padding: 8px 0;
  }
  
  .navbar-brand {
    font-size: 1.2rem;
  }
}

/* ==========================================
   HIGH DPI SCREEN OPTIMIZATIONS
   ========================================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .search-btn,
  .cancel-btn {
    transform: translateZ(0);
  }
}

/* ==========================================
   PRINT STYLES
   ========================================== */
@media print {
  header,
  .navbar,
  .search-container {
    display: none !important;
  }
  
  body {
    padding-top: 0 !important;
  }
}

/* ==========================================
   ACCESSIBILITY IMPROVEMENTS
   ========================================== */

/* Focus styles */
.search-input:focus,
.search-btn:focus,
.cancel-btn:focus {
  outline: 2px solid #0087bd;
  outline-offset: 2px;
}

.nav-link:focus {
  outline: 2px solid #0087bd;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .navbar {
    border-bottom: 2px solid #000;
  }
  
  .search-input {
    border-color: #000;
  }
  
  .search-btn {
    background: #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


.cart-count-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.cart-count-badge:empty,
.cart-count-badge[data-count="0"] {
    display: none;
}