/* Header Styles */
.header {
  position: fixed;
  z-index: 10;
  top: 0;
  display: flex;
  direction: ltr;
  align-items: center;
  /* max-width: 1440px; */
  width: 100%;
  height: 90px;
  /* margin-left: calc(max(0px, 100vw - 1440px) / 2); */
  border-bottom: var(--border-gray);
  background-color: var(--background);
  padding: 10px 40px;
  gap: 50px;
  font-size: 20px;
  font-weight: 500;
}

#locations-toggle {
  cursor: pointer;
}

.header-conserver {
  width: 100vw;
  height: 125px;
}

@media (max-width: 676px) {
  .header-conserver {
    height: 90px;
  }
}

.locations {
  box-shadow: -6px 5px 8px 0px #00000059;
  position: fixed;
  z-index: 10;
  top: 90px;
  left: 0;
  width: 100%;
  background-color: var(--light-green);
  font-size: 16px;
  color: var(--text-color);
}

@media (max-width: 800px) {
  .locations {
    top: 70px;
  }
}


.header .cart-icon {
  font-size: 1.8rem;
  color: var(--primary);
  cursor: pointer;
}

.logo {
  width: 100px;
}

#menu {
  display: none;
  cursor: pointer;
}
ul {
  list-style: none;
}
.current {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.current {
  padding: 10px 40px;
  border-bottom: 1px solid gray;
  cursor: pointer;
}
.current p,
.saved div {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* .saved div:hover {
  background-color: var(--primary);
  color: white;
} */
.saved {
  display: none;
  z-index:10;
  opacity: 0;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  min-width: 300px;
  max-width: 90vw;
  overflow: hidden;
  min-height: 250px;
  box-shadow: 0 0 15px 0px #00000047;
  border-radius: 15px;
  padding: 20px;
  transition: opacity 0.3s ease-in-out;
}
.saved.active {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}
.saved-locations {
  display: flex;
  flex-direction: row;
  width: 100%;
  justify-content: center;
  align-items: center;
  gap: 15px;
  padding: 10px;
  overflow-x: auto !important;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;
}
.saved-locations::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}
@media (max-width: 780px) {
  .saved-locations {
    justify-content: start;
  }
}
.location-item {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--primary);
  gap: 10px;
  padding: 15px;
  width: 200px;
  height: 200px;
  border: 1px solid black;
  border-radius: 10px;
  overflow: hidden;
}
.location-item:hover {
  cursor: pointer;
  border: 1px solid black;
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.15),
    0 1.5px 6px 0 rgba(34, 197, 94, 0.12);
}
.location-item p {
  width: 100%;
  text-wrap-mode: wrap;
}
.location-item i {
  font-size: 1.1rem;
  background: var(--primary);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
}
.close {
  font-size: 25px;
  position: absolute;
  right: 15px;
  top: 5px;
}
.close:hover {
  color: red;
  cursor: pointer;
}
.locations-overlay {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100dvw;
  height: 100dvh;
  background: #00000030;
  z-index: -1;
  backdrop-filter: blur(2px);
}
/* Navbar Styles */
.navbar {
  font-size: 1rem;
  display: flex;
  margin-left: auto;
  gap: 30px;
  transition: transform 1s ease-in-out;
}

.navbar a {
  color: var(--text-color);
  transition: color 0.3s;
}

.navbar a.active {
  position: relative;
  font-weight: 600;
  color: var(--primary);
}

.navbar a.active::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 3px;
  left: 0;
  bottom: -20px;
  background-color: var(--primary);
}

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

.nav-overlay {
  position: absolute;
}

.navbar.active + .nav-overlay {
  z-index: 8;
  width: 100vw;
  height: 100vh;
  background: rgba(170, 170, 170, 0.1);
  backdrop-filter: blur(5px);
  left: 0;
  top: 100%;
}

[data-theme="dark"] .navbar.active + .nav-overlay {
  background-color: rgba(0, 0, 0, 0.15);
}

/* Actions Styles */
.actions {
  display: flex;
  align-items: center;
  gap: 30px;
}

.login-btn {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-inline: 20px !important;
}

#logout-anchor {
  color: red;
  display: none;
}

.login-btn:hover {
  background-color: var(--primary);
}

/* Dark Mode Toggle */
.dark-mode-toggle {
  position: relative;
  /* display: inline-block; */
  width: 50px;
  height: 25px;
}

.dark-mode-toggle input {
  display: none;
}

.dark-mode-toggle .slider {
  position: absolute;
  display: flex;
  justify-content: space-around;
  align-items: center;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #eee;
  box-shadow: 0 0 4px #ccc inset;
  border-radius: 20px;
  cursor: pointer;
  /* transition: var(--theme-transition); */
}

.slider i {
  font-size: 15px;
}

.dark-mode-toggle .slider:before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  background-color: #fff;
  box-shadow: 0 0 3px #aaa inset;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.3s;
}

.dark-mode-toggle input:checked + .slider {
  background-color: #333;
  box-shadow: 0 0 4px #000 inset;
}

.dark-mode-toggle input:checked + .slider:before {
  transform: translateX(25px);
}

/* Media Queries */
@media (max-width: 1200px) {
  .header {
    font-size: 16px;
    gap: 15px;
    height: 90px;
  }
  .navbar a.active::after {
    height: 2px;
  }
}

@media (max-width: 1000px) {
  .header {
    font-size: 13px;
  }
  nav.navbar {
    gap: 18px;
  }
}

@media (max-width: 900px) {
  .navbar {
    gap: 20px;
  }

  .actions {
    gap: 20px;
  }

  .cart-icon {
    font-size: 1.4rem;
  }
}

@media (max-width: 780px) {
  header {
    justify-content: space-between;
  }
  .header {
    height: 70px;
    padding: 10px;
    gap:7px;
  }
  .actions {
    gap: 8px;
  }

  /* .logo {
    width: 60px;
  } */

  .bottom-nav {
    display: flex;
  }

  .bottom-nav-conserver {
    height: 110px;
  }

  #menu {
    display: block;
    margin-right: 10px;
    /* transition: var(--theme-transition); */
  }

  .navbar {
    transform: translateX(100%);
    position: absolute;
    z-index: 9;
    background-color: white;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    border-left: var(--border-gray);
    right: -1px;
    top: 115px;
    gap: 0;
    width: 250px;
    height: 100vh;
    max-width: 60vw;
  }

  #logout-anchor {
    display: block;
  }

  .navbar.active {
    transform: translateX(0);
    visibility: visible;
  }

  .navbar a {
    position: relative;
    padding-block: 15px;
    width: 100%;
    text-align: center;
    color: var(--text-color);
  }

  .navbar a::after,
  .navbar a.active::after {
    content: "";
    position: absolute;
    width: 250px;
    max-width: 60vw;
    height: 1px;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(128, 128, 128, 0.2);
  }

  .navbar a:hover {
    font-weight: bold;
    font-size: 1.1rem;
  }

  header .login-btn,
  header .cart {
    display: none !important;
  }
}

@media (max-width: 450px) {
  .navbar {
    top: 115px;
  }
}

/* Container styling */
.custom-select {
  cursor: pointer;
  position: relative;
  display: inline-block;
  width: fit-content;
  transition: all 120ms;
}
.custom-select *,
.custom-select *::before,
.custom-select *::after {
  transition: all 120ms;
  border-width: 1px !important;
}
.custom-select button {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  width: 100%;
  width: 100%;
  min-width: 6em;
  text-align: left;
  border: unset;
  border-radius: 0.5em;
  background-color: unset;
  cursor: pointer;
  z-index: 40 !important;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  outline: unset;
  /* outline-offset: -3px; */
}
.custom-select button[aria-expanded="true"] {
  background-color: #f8fafc;
  border-radius: 0.5em 0.5em 0 0;
}
.custom-select ul {
  z-index: 8 !important;
  width: 200px;
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  background-color: var(--background);
  overflow: visible;
  overflow: hidden;
  left: 50%;
  transform: translateX(-50%);
  top: calc(100% + 5px);
  height: auto;
  display: none;
  border-radius: 0 0 0.5em 0.5em;
  gap: 0;
}
.custom-select ul li {
  font-size: 1rem;
  margin: 0;
  z-index: 1;
  padding: 8px 12px;
  height: auto;
  padding: 0;
  border: 1px solid #cad5e2;
  border-top: none;
  cursor: pointer;
}
.custom-select a:not(#customSelectButton) {
  display: block;
  padding: 1em 1.25em;
}
.custom-select ul li:first-child {
  margin-top: -2px;
  border-top: 1px solid #cad5e2 !important;
  border-radius: 0 !important;
}
.custom-select ul li:last-child {
  border-radius: 0 0 0.5em 0.5em;
  border-bottom-width: 1px;
}
.custom-select ul li:hover {
  background-color: #f1f5f9;
}
.custom-select ul li:focus {
  outline-color: #8ec5ff !important;
  outline-offset: 1px !important;
  z-index: 30 !important;
}

.custom-select.open ul {
  display: block;
}

@media (max-width: 780px) {
  .custom-select {
    width: 100%;
    /* height: min-content; */
    /* padding-block: 15px; */
    text-align: center;
    position: unset;
  }
  .custom-select a {
    width: 100%;
    display: block;
  }
  .custom-select .arrow {
    display: none;
  }
  .custom-select ul {
    width: 40vw;
    top: 0;
    left: 0;
    transform: translateX(-100%);
  }
  #customSelectList a {
    display: block;
    font-size: 0.7rem;
    padding: 0px;
  }

  .custom-select ul a::after {
    display: none;
  }
}

#lang span {
  color: var(--text-color2);
}
#lang span.active-lang {
  color: var(--text-color);
  font-weight: bold;
}
