/* ==== Header styles ==== */
header.auto-hide-header {
  background-color: var(--light-color);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1030;
  transition: top 0.3s ease-in-out;
}

.main-logo img {
  max-height: 75px;
  transition: max-height 0.3s ease;
}

.search-bar {
  border: 1px solid #eaeaea;
  background-color: #fff;
}

.search-bar input.form-control {
  font-size: 0.9rem;
}

.search-bar .btn-link {
  color: var(--primary-color);
}

.search-bar .btn-link:hover {
  color: var(--primary-hover);
}

.search-bar ::placeholder {
  font-family: var(--secondary-font);
}

.search-bar:focus-within {
  box-shadow: 0 0 0 0.25rem rgba(74, 124, 89, 0.25);
}

.auth-container .auth-buttons .btn,
.auth-container .user-info .btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.auth-container .user-info {
  font-size: 0.9rem;
  color: var(--dark-color);
}

.auth-container .user-info strong {
  font-weight: 600;
}

/* Cart and Wishlist icons */
.ms-3.d-flex > a .fas {
  font-size: 1.3rem;
  color: var(--dark-color);
  transition: color 0.2s ease-in-out;
}

.ms-3.d-flex > a:hover .fas {
  color: var(--primary-color);
}

.ms-3.d-flex > a .badge {
  font-size: 0.7rem;
  line-height: 1;
  padding: 0.3em 0.5em;
}

/* Navigation Menu */
nav.navbar {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

nav.navbar .navbar-nav .nav-link {
  font-weight: 600;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--light-dark-color);
}

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

nav.navbar .navbar-nav .nav-link.active {
  color: var(--primary-color);
  position: relative;
}

nav.navbar .navbar-nav .nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 0px;
  left: 1rem;
  right: 1rem;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

nav.navbar .dropdown-menu {
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
  border: none;
  margin-top: 0.5rem;
}

nav.navbar .dropdown-item {
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 500;
}

nav.navbar .dropdown-item:hover {
  background-color: var(--light-primary-color);
  color: var(--primary-color);
}

nav.navbar .dropdown-item:active {
  background-color: var(--primary-color);
  color: var(--light-color);
}

/* Mobile Navbar Toggler */
nav.navbar .navbar-toggler {
  border-color: rgba(0, 0, 0, 0.1);
}

nav.navbar .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(46, 58, 69, 0.7)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Search Modal for mobile */
#searchModal .modal-content {
  border-radius: 0.75rem;
}

#searchModal .form-control {
  font-size: 1rem;
}

#searchModal .btn-primary {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* Header row elements */
header .row.py-3 {
  min-height: var(--header-height-min);
}

/* Auth container */
header .auth-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Search suggestions */
.search-suggestions-container {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #fff;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 .25rem .25rem;
  z-index: 1050;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 .5rem 1rem rgba(0, 0, 0, 0.15);
}

.search-suggestions-container .suggestion-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

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

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

.search-suggestions-container .suggestion-item a {
  text-decoration: none;
  color: #212529;
  display: block;
}

/* Account dropdown styling */
.user-info .dropdown-menu {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  border: none;
  margin-top: 0.5rem;
  padding: 0.5rem 0;
}

.user-info .dropdown-item {
  padding: 0.5rem 1.2rem;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.user-info .dropdown-item:hover {
  background-color: var(--light-primary-color);
  color: var(--primary-color);
}

.user-info .dropdown-item i {
  width: 1.25rem;
  text-align: center;
}

.user-info .dropdown-divider {
  margin: 0.4rem 0;
}

.user-info .dropdown-item.logout-link {
  color: var(--danger-color);
}

.user-info .dropdown-item.logout-link:hover {
  background-color: #f8d7da;
}

/* Responsive header adjustments */
@media (max-width: 991.98px) {
  .main-logo img {
    max-height: 50px;
  }

  nav.navbar .navbar-nav .nav-link.active::after {
    left: 0.75rem;
    right: 0.75rem;
  }

  .auth-container .auth-buttons .btn,
  .auth-container .user-info .btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .ms-3.d-flex > a .fas {
    font-size: 1.2rem;
  }
}

@media (max-width: 767.98px) {
  header.auto-hide-header .container.py-2 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }

  header.auto-hide-header .row.py-3 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    min-height: auto;
  }

  .main-logo img {
    max-height: 45px;
  }

  .auth-container {
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
  }

  .auth-container .user-info {
    font-size: 0.85rem;
    margin-right: 0;
    text-align: right;
  }

  .auth-container .user-info .d-flex {
    justify-content: flex-end;
  }

  .ms-3.d-flex {
    margin-left: 0.5rem !important;
  }

  nav.navbar .navbar-collapse {
    max-height: 70vh;
    overflow-y: auto;
    background-color: var(--light-color);
    padding: 1rem;
    margin-top: 0.5rem;
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
  }
}

@media (max-width: 575.98px) {
  .main-logo {
    text-align: center !important;
    width: 100%;
    margin-bottom: 0.5rem;
  }

  header .row.py-3 > div[class*="col-sm-"] {
    display: flex;
    justify-content: center;
    width: auto;
    flex-basis: 0;
    flex-grow: 1;
  }

  header .row.py-3 .col-lg-3 {
    flex-grow: 0;
    flex-basis: auto;
  }

  header .row.py-3 .col-lg-4 {
    justify-content: center !important;
  }

  .auth-container {
    align-items: center;
    width: 100%;
    justify-content: center;
  }

  .auth-container .user-info {
    text-align: center;
  }

  .auth-container .user-info .d-flex {
    justify-content: center;
  }

  .ms-3.d-flex {
    margin-top: 0.5rem;
    width: 100%;
    justify-content: center;
  }
}

/* Badge animation */
@keyframes badgePulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.badge-pulse {
  animation: badgePulse 0.5s ease-in-out;
}
