.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: none;
  background: #fff9f0;
  transition: box-shadow 0.3s ease;
}

.logo {
  flex-shrink: 0;
}

.logo img {
  width: 100px;
  cursor: pointer;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 24px;
  flex: 1;
  justify-content: center;
  align-items: center;
}

.nav-links li {
  position: relative;
}

.nav-links > li > a {
  text-decoration: none;
  color: #111;
  font-size: 14px;
  font-weight: 500;
  padding: 20px 0;
  display: block;
  transition: color 0.2s;
}

.nav-links > li > a:hover {
  color: #757575;
}

.nav-links > li > a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #111;
  transition: width 0.3s;
}

.nav-links > li > a:hover::after {
  width: 100%;
}

/* Dropdown Overlay Background */
.dropdown-overlay {
  position: fixed;
  top: var(--navbar-top, 60px);
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.15);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.nav-links li:hover .dropdown-overlay {
  opacity: 1;
  visibility: visible;
}

.dropdown {
  position: fixed;
  top: var(--navbar-top, 60px);
  left: 0;
  right: 0;
  background-color: #fff9f0;
  box-shadow: 0 1px 2px -1px rgba(0, 0, 0, 0.08);
  padding: 40px 48px;
  display: none;
  margin-top: 0;
  z-index: 1000;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.nav-links li:hover .dropdown {
  display: block;
}

.dropdown-content {
  display: flex;
  gap: 25px;
  width: fit-content;
  min-width: 100%;
  justify-content: center;
}

.dropdown-column {
  min-width: 200px;
  max-width: 200px;
  flex-shrink: 0;
}

.dropdown-column h3 {
  font-size: 13px;
  font-weight: 500;
  color: #111;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.dropdown-column ul {
  list-style: none;
}

.dropdown-column li {
  margin-bottom: 12px;
}

.dropdown-column a {
  font-size: 12px;
  color: #757575;
  text-decoration: none;
  transition: color 0.2s;
  padding: 0;
  white-space: nowrap;
}

.dropdown-column a:hover {
  color: #111;
}

.dropdown-column a::after {
  display: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

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

.search-input {
  padding: 8px 12px 8px 40px;
  border: none;
  border-radius: 100px;
  background-color: #fff;
  width: 180px;
  font-size: 14px;
  transition: all 0.3s;
  cursor: pointer;
}

.search-input:focus {
  outline: none;
  background-color: #e5e5e5;
}

.search-icon {
  position: absolute;
  left: 12px;
  width: 20px;
  height: 20px;
  pointer-events: none;
}

/* Hide search icon button by default (desktop) */
.search-icon-btn {
  display: none;
}

.search-icon-btn img {
  width: 24px;
  height: 24px;
}

/* Search Overlay */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #FFF9F0;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.search-overlay-header {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid #e5e5e5;
  gap: 16px;
  transform: translateY(-20px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.search-overlay.active .search-overlay-header {
  transform: translateY(0);
  opacity: 1;
  transition-delay: 0.1s;
}

.search-overlay-input-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-overlay-input {
  width: 100%;
  padding: 12px 12px 12px 44px;
  border: none;
  border-radius: 100px;
  background-color: #fff;
  font-size: 16px;
}

.search-overlay-input:focus {
  outline: none;
  background-color: #e5e5e5;
}

.search-overlay-icon {
  position: absolute;
  left: 14px;
  width: 20px;
  height: 20px;
  fill: #111;
}

.search-cancel-btn {
  background: none;
  border: none;
  font-size: 16px;
  color: #111;
  cursor: pointer;
  padding: 8px 0;
  font-weight: 400;
}

.search-overlay-content {
  padding: 32px 20px;
  overflow-y: auto;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.search-overlay.active .search-overlay-content {
  transform: translateY(0);
  opacity: 1;
  transition-delay: 0.2s;
}

.popular-search-title {
  font-size: 14px;
  color: #757575;
  margin-bottom: 20px;
  font-weight: 400;
}

.popular-search-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.search-term-pill {
  padding: 8px 20px;
  background-color: #fff;
  border: none;
  border-radius: 100px;
  font-size: 14px;
  color: #111;
  cursor: pointer;
  transition: background-color 0.2s;
  text-decoration: none;
  display: inline-block;
}

.search-term-pill:hover {
  background-color: #e5e5e5;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  position: relative;
  transition: transform 0.3s ease;
}

.icon-btn:hover {
  transform: scale(1.1);
}

.cart-badge {
  position: absolute;
  bottom: 4px;
  right: 2px;
  background-color: #09233A;
  color: white;
  font-size: 11px;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
  fill: #111;
}

/* Mobile Drawer Styles */
.mobile-drawer-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s;
}

.mobile-drawer-overlay.active {
  display: block;
  opacity: 1;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 380px;
  max-width: 85vw;
  height: 100vh;
  height: 100dvh; /* Use dynamic viewport height for mobile browsers */
  background-color: #FFF9F0;
  z-index: 9999;
  transition: right 0.3s;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.mobile-drawer.active {
  right: 0;
}

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

.drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.drawer-close svg {
  width: 24px;
  height: 24px;
  fill: #111;
}

.drawer-menu {
  list-style: none;
  flex: 1;
  overflow-y: auto;
}

.drawer-menu-item {
  border-bottom: 1px solid #e5e5e5;
}

.drawer-menu-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  text-decoration: none;
  color: #111;
  font-size: 18px;
  font-weight: 400;
  transition: background-color 0.2s;
}

.drawer-menu-link:hover {
  background-color: #fff;
}

.drawer-menu-link svg {
  width: 20px;
  height: 20px;
  fill: #111;
}

/* Drawer footer for user login */
.drawer-footer {
  padding: 5px;
  border-top: 1px solid #e5e5e5;
  margin-top: auto;
  flex-shrink: 0;
}

.drawer-user-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  text-decoration: none;
  color: #111;
  font-size: 16px;
  font-weight: 400;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.drawer-user-link img {
  width: 24px;
  height: 24px;
}

/* Submenu Drawer */
.submenu-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 380px;
  max-width: 85vw;
  height: 100vh;
  background-color: #FFF9F0;
  z-index: 10000;
  transition: right 0.3s;
  overflow-y: auto;
}

.submenu-drawer.active {
  right: 0;
}

.submenu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #e5e5e5;
}

.submenu-back,
.submenu-close-btn {
  background: none;
  border: none;
  padding: 4px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.submenu-back img,
.submenu-close-btn img {
  width: 20px;
  height: 20px;
}

.submenu-title {
  font-size: 18px;
  font-weight: 500;
}

.submenu-content {
  padding: 24px;
}

.submenu-section {
  margin-bottom: 32px;
}

.submenu-section h3 {
  font-size: 18px;
  font-weight: 500;
  color: #111;
  margin-bottom: 16px;
}

.submenu-section ul {
  list-style: none;
}

.submenu-section li {
  margin-bottom: 16px;
}

.submenu-section a {
  font-size: 13px;
  color: #757575;
  text-decoration: none;
  transition: color 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.submenu-section a:hover {
  color: #111;
}

.submenu-section a svg {
  width: 16px;
  height: 16px;
  fill: #757575;
}

.submenu-link-text {
  flex: 1;
}

.submenu-section-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  padding: 8px 12px;
}

.submenu-section-link h3 {
  margin: 0;
  font-size: 16px;
}

.submenu-section-link img {
  width: 16px;
  height: 16px;
}

/* Cart Drawer Overlay */
.cart-drawer-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s;
}

.cart-drawer-overlay.active {
  display: block;
  opacity: 1;
}

/* Cart Drawer - Fixed for mobile viewport */
.cart-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 420px;
  max-width: 90vw;
  height: 100vh;
  height: 100dvh; /* Use dynamic viewport height for mobile browsers */
  background-color: #FFF9F0;
  z-index: 9999;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cart-drawer.active {
  right: 0;
}

.cart-header-title {
  flex: 1;
  font-family: "EditorsNoteRegular", sans-serif;
  font-weight: 400;
  font-size: 1.3rem;
}

.cart-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  min-height: 0;
}

.cart-footer {
  flex-shrink: 0;
  background-color: #FFF9F0;
  border-top: 2px solid #eee;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 1;
}

.cart-summary {
  margin-bottom: 16px;
}

.cart-total-items {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 500;
  color: #111;
}

.cart-items-label {
  color: #757575;
}

.cart-items-count {
  font-weight: 400;
  color: #111;
}

.cart-checkout-note {
  font-size: 13px;
  color: #757575;
  margin: 0;
  line-height: 1.4;
}

.checkout-btn {
  width: 100%;
  padding: 16px;
  background-color: #111;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.checkout-btn:hover {
  background-color: #333;
}

.checkout-btn:active {
  transform: scale(0.98);
}

.navbar.scrolled {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
}

/* Mobile styles */
@media (max-width: 960px) {
  .navbar {
    padding: 0 20px;
  }

  .dropdown {
    display: none !important;
  }

  .nav-links {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  .search-container {
    display: none;
  }

  /* Show search icon button in mobile, hide user icon in navbar only */
  .search-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
  }

  .search-icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }

  /* Hide only the user icon in the navbar on mobile */
  .nav-actions > .icon-btn[aria-label="User"] {
    display: none;
  }
  
  .cart-drawer {
    width: 380px;
    height: 100vh;
    height: 100dvh;
  }
  
  .cart-footer {
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  /* Make mobile drawer full height to accommodate footer */
  .mobile-drawer {
    display: flex;
    flex-direction: column;
  }

  .drawer-menu {
    flex: 1;
    overflow-y: auto;
  }
}