/* Header Styles */
header {
  background-color: #fff;
  box-shadow: var(--box-shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  overflow-x: hidden;
  overflow: visible;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  gap: 15px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  flex-wrap: wrap;
  overflow-x: hidden;
  position: relative;
}

@media (max-width: 768px) {
  header .container {
    padding: 12px 15px;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  header .container {
    padding: 10px 12px;
    gap: 8px;
  }
}

.logo-container {
  flex: 0 0 auto;
  min-width: 0;
}

.logo-container img {
  height: 50px;
  width: auto;
  max-width: 100%;
}

@media (max-width: 768px) {
  .logo-container img {
    height: 40px;
  }
}

@media (max-width: 480px) {
  .logo-container img {
    height: 35px;
  }
}

.search-container {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

/* Modern pill-shaped search bar for header */
.search-bar-pill {
  display: flex;
  align-items: center;
  background: #f7f7f7;
  border-radius: 999px;
  padding: 0.25rem 1.25rem;
  box-shadow: none;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  position: relative;
  box-sizing: border-box;
}

.search-bar-pill-input {
  border: none;
  background: transparent;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border-radius: 999px;
  font-size: 1.15rem;
  width: 100%;
  outline: none;
  color: #222;
}

.search-bar-pill-input::placeholder {
  color: #666;
  opacity: 1;
}

.search-bar-pill-btn {
  position: absolute;
  right: 18px;
  background: none;
  border: none;
  color: #444;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  top: 0;
  bottom: 0;
  margin: auto 0;
  padding: 0;
  transition: color 0.2s;
}

.search-bar-pill-btn:hover {
  color: #ef4444;
}

@media (max-width: 768px) {
  .search-container {
    flex: 1 0 100%;
    order: 3;
    margin-top: 0.75rem;
  }

  .search-bar-pill {
    width: 100%;
    max-width: 100%;
    padding: 0.25rem 0.75rem;
  }

  .search-bar-pill-input {
    font-size: 1rem;
    padding: 0.5rem 2.2rem 0.5rem 0.75rem;
  }

  .search-bar-pill-btn {
    right: 10px;
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .search-container {
    margin-top: 0.5rem;
  }

  .search-bar-pill {
    padding: 0.2rem 0.6rem;
  }

  .search-bar-pill-input {
    font-size: 0.9rem;
    padding: 0.45rem 2rem 0.45rem 0.6rem;
  }

  .search-bar-pill-btn {
    right: 8px;
    font-size: 1rem;
  }
}

/* Remove old search-box and search-button styles for header */
header .search-box,
header .search-button {
  display: none !important;
}

nav {
  flex: 0 0 auto;
  min-width: 0;
}

nav ul {
  display: flex;
  list-style-type: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

nav ul li {
  position: relative;
  margin-right: 20px;
}

@media (max-width: 768px) {
  nav {
    order: 2;
    flex: 1;
    display: flex;
    justify-content: flex-end;
  }

  nav ul li {
    margin-right: 12px;
  }

  nav ul li a {
    font-size: 14px;
    padding: 8px 0;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  nav ul li {
    margin-right: 8px;
  }

  nav ul li a {
    font-size: 13px;
    padding: 6px 0;
    white-space: nowrap;
  }
}

@media (max-width: 360px) {
  nav {
    display: none;
  }
}

nav ul li a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  padding: 10px 0;
  transition: color 0.3s;
}

nav ul li a:hover {
  color: var(--primary-color);
}

.user-name {
  margin-left: 8px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .user-name {
    display: none;
  }
}

.wishlist-count,
.cart-count {
  position: absolute;
  top: -1px;
  right: -4px;
  background-color: var(--accent-color);
  color: white;
  font-size: 10px;
  font-weight: bold;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  z-index: 2;
  text-align: center;
}

/* Animation for count updates */
.wishlist-count.updated,
.cart-count.updated {
  animation: countUpdate 0.5s ease;
}

@keyframes countUpdate {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.3);
  }

  100% {
    transform: scale(1);
  }
}

.account {
  position: relative;
  overflow: visible;
  z-index: 1001;
}

.dropdown-content {
  display: none;
  position: absolute;
  background: #fff;
  min-width: 200px;
  box-shadow: var(--box-shadow);
  z-index: 1;
  border-radius: 4px;
  padding: 10px 0;
}

.categories-dropdown:hover .dropdown-content {
  display: block;
}

.user-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  gap: 0;
  overflow: visible;
  position: relative;
}

.wishlist,
.cart,
.account {
  margin-left: 20px;
  position: relative;
  cursor: pointer;
}

@media (max-width: 768px) {
  .wishlist,
  .cart,
  .account {
    margin-left: 12px;
  }
}

@media (max-width: 480px) {
  .wishlist,
  .cart,
  .account {
    margin-left: 6px;
  }
}

@media (max-width: 360px) {
  .wishlist,
  .cart,
  .account {
    margin-left: 4px;
  }
}

.wishlist a,
.cart a,
.account a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 16px;
  display: flex;
  align-items: center;
  height: 36px;
  transition: all 0.2s ease;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .wishlist a,
  .cart a,
  .account a {
    padding: 8px;
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .wishlist a,
  .cart a,
  .account a {
    padding: 6px;
    font-size: 16px;
  }
}

@media (max-width: 360px) {
  .wishlist a,
  .cart a,
  .account a {
    padding: 5px;
    font-size: 14px;
  }
}

.wishlist a:hover,
.cart a:hover,
.account a:hover {
  color: var(--primary-color);
  background-color: rgba(var(--primary-rgb), 0.08);
  transform: translateY(-2px);
}

/* Active state for wishlist items */
.wishlist.has-items a {
  color: var(--accent-color);
}

/* Account dialog backdrop */
.account-dialog-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
  align-items: center;
  justify-content: center;
}

.account-dialog-backdrop.active {
  display: flex;
  opacity: 1;
}

/* Account dialog modal */
.account-dialog-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 400px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
}

.account-dialog-backdrop.active .account-dialog-modal {
  opacity: 1;
  transform: scale(1);
}

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

.account-dialog-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-color);
}

.account-dialog-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #666;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.account-dialog-close:hover {
  background-color: #f5f5f5;
  color: #333;
}

.account-dialog-content {
  padding: 8px 0;
  overflow-y: auto;
}

.account-dialog-content a {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 16px;
  transition: background-color 0.2s ease;
  box-sizing: border-box;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  gap: 12px;
}

.account-dialog-content a i {
  width: 20px;
  text-align: center;
  color: #666;
  font-size: 18px;
}

.account-dialog-content a span {
  flex: 1;
}

.account-dialog-content a:hover {
  background-color: #f5f5f5;
}

.account-dialog-content a:hover i {
  color: var(--primary-color);
}

.account-dialog-content a:active {
  background-color: #eeeeee;
}

@media (max-width: 480px) {
  .account-dialog-modal {
    width: 95%;
    max-width: none;
    border-radius: 12px 12px 0 0;
    max-height: 85vh;
  }

  .account-dialog-header {
    padding: 16px 20px;
  }

  .account-dialog-header h3 {
    font-size: 18px;
  }

  .account-dialog-content {
    padding: 4px 0;
  }

  .account-dialog-content a {
    padding: 16px 20px;
    font-size: 15px;
  }
}

.dropdown-content a {
  display: block;
  padding: 12px 20px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.2s ease;
  box-sizing: border-box;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.dropdown-content a:hover {
  background-color: #f5f5f5;
}

.dropdown-content a:active {
  background-color: #eeeeee;
}

/* Cart badge positioning */
.cart {
  position: relative;
}

.cart-badge {
  position: absolute;
  top: 4px;
  right: -12px;
  background-color: #e74c3c;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  z-index: 2;
  color: white;
  font-size: 10px;
  font-weight: bold;
}

.logo-location-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 100%;
  padding: 0;
  height: 45px;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  background: #ef4444;
  overflow-x: hidden;
}

.standard-logo {
  margin: 0;
  padding: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.standard-logo img {
  height: 75px;
  width: auto;
  margin: 0 auto;
}

.location-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-size: 1.1rem;
  font-weight: 100;
  padding: 8px 0;
  letter-spacing: 0.5px;
  position: relative;
  box-sizing: border-box;
  overflow-x: hidden;
}

.location-bar .location-text {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .location-bar {
    font-size: 0.9rem;
    padding: 6px 8px;
    flex-wrap: wrap;
    gap: 4px;
  }

  .location-bar .location-text {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px 8px;
  }
}

@media (max-width: 480px) {
  .location-bar {
    font-size: 0.75rem;
    padding: 6px 4px;
  }

  .location-bar span {
    margin-left: 4px;
  }

  .location-bar .address {
    display: none;
  }

  .location-bar .hours {
    display: none;
  }
}

.location-bar .location {
  font-weight: normal;
  margin-right: 8px;
}

.location-bar .city,
.location-bar .status {
  font-weight: normal;
}

.location-bar span {
  margin-left: 8px;
}

.menu-hidden {
  display: none;
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 15px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s;
}

.google-btn:hover {
  background-color: #f8f8f8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.google-btn img {
  width: 20px;
  height: 20px;
  margin-right: 10px;
}

/* Search Suggestions Styles */
.search-container {
  position: relative;
  overflow: visible;
}

header .container {
  overflow: visible;
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 9999;
  border: 1px solid #e0e0e0;
  margin: 0;
  padding: 0;
  min-width: 100%;
  box-sizing: border-box;
}

.search-suggestion-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.2s;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
  font-size: 1rem;
}

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

.search-suggestion-item:hover,
.search-suggestion-item.highlighted {
  background-color: #f5f5f5;
  color: var(--primary-color);
}

.search-suggestion-item i {
  margin-right: 12px;
  color: #666;
  font-size: 0.9rem;
}

.search-suggestion-item:hover i,
.search-suggestion-item.highlighted i {
  color: var(--primary-color);
}

.search-suggestion-item:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: -2px;
}

/* Scrollbar styling for suggestions */
.search-suggestions::-webkit-scrollbar {
  width: 8px;
}

.search-suggestions::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 0 8px 8px 0;
}

.search-suggestions::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
  background: #555;
}

@media (max-width: 600px) {
  .search-suggestions {
    font-size: 0.9rem;
  }

  .search-suggestion-item {
    padding: 10px 14px;
  }
}
