/* ================================
   DELIVERY LOCATION MENU (HEADER DROPDOWN)
   ================================ */

/* Menu Overlay */
.delivery-location-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9998;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  /* Hidden by default */
  display: none;
}

.delivery-location-menu.is-active {
  display: flex;
}

/* Backdrop */
.delivery-location-menu__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(10, 10, 10, 0.5);
}

/* Menu Container */
.delivery-location-menu__container {
  position: relative;
  background-color: var(--pearl-white);
  border-radius: 8px;
  width: 100%;
  max-width: 420px;
  height: 680px;
  max-height: calc(100vh - 120px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: menu-fade-in 0.2s ease-out;
}

@keyframes menu-fade-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
.delivery-location-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid rgba(10, 10, 10, 0.1);
}

.delivery-location-menu__title {
  font-family: var(--font-headline);
  font-size: 24px;
  font-weight: var(--weight-regular);
  color: var(--velvet-black);
  margin: 0;
}

.delivery-location-menu__close-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--velvet-black);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.delivery-location-menu__close-btn:hover {
  background-color: var(--soft-gray);
}

.delivery-location-menu__close-btn:focus {
  outline: 2px solid var(--imperial-purple);
  outline-offset: 2px;
}

/* Search */
.delivery-location-menu__search {
  position: relative;
  padding: 24px 32px;
  border-bottom: 1px solid rgba(10, 10, 10, 0.1);
}

.delivery-location-menu__search-icon {
  position: absolute;
  left: 44px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(10, 10, 10, 0.4);
  pointer-events: none;
}

.delivery-location-menu__search-input {
  width: 100%;
  font-family: var(--font-body);
  font-weight: var(--weight-light);
  font-size: 16px;
  color: var(--velvet-black);
  background-color: var(--pearl-white);
  border: 1px solid rgba(10, 10, 10, 0.2);
  border-radius: 4px;
  padding: 12px 16px 12px 40px;
  transition: all 0.2s ease;
}

.delivery-location-menu__search-input::placeholder {
  color: rgba(10, 10, 10, 0.4);
}

.delivery-location-menu__search-input:focus {
  outline: none;
  border-color: var(--imperial-purple);
}

/* Location List */
.delivery-location-menu__list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 32px;
}

/* City Group */
.delivery-location-menu__city-group {
  margin-bottom: 0;
}

.delivery-location-menu__city-group:not(:last-child) {
  border-bottom: 1px solid rgba(10, 10, 10, 0.1);
}

/* City Header (with districts - accordion) */
.delivery-location-menu__city-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.delivery-location-menu__city-header:hover {
  opacity: 0.7;
}

.delivery-location-menu__city-name {
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  font-size: 16px;
  color: var(--velvet-black);
  text-align: left;
}

.delivery-location-menu__chevron {
  color: var(--velvet-black);
  transition: transform 0.2s ease;
}

.delivery-location-menu__city-header[aria-expanded="true"] .delivery-location-menu__chevron {
  transform: rotate(180deg);
}

/* Districts Container */
.delivery-location-menu__districts {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.delivery-location-menu__city-header[aria-expanded="true"] + .delivery-location-menu__districts {
  max-height: 500px;
}

/* District Item */
.delivery-location-menu__district {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 14px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.delivery-location-menu__district span {
  font-family: var(--font-body);
  font-weight: var(--weight-light);
  font-size: 15px;
  color: var(--velvet-black);
}

.delivery-location-menu__district:hover {
  opacity: 0.7;
}

/* City Simple (no districts) */
.delivery-location-menu__city-simple {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.delivery-location-menu__city-simple:hover {
  opacity: 0.7;
}

/* Checkmark */
.delivery-location-menu__checkmark {
  color: var(--imperial-purple);
  flex-shrink: 0;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.delivery-location-menu__district.is-selected .delivery-location-menu__checkmark,
.delivery-location-menu__city-simple.is-selected .delivery-location-menu__checkmark {
  opacity: 1;
  visibility: visible;
}

/* Confirm Button */
.delivery-location-menu__confirm-btn {
  width: 100%;
  font-family: var(--font-body);
  font-weight: var(--weight-light);
  font-size: 18px;
  color: var(--pearl-white);
  background-color: var(--imperial-purple);
  border: none;
  border-radius: 0;
  padding: 20px 32px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  margin-top: auto;
}

.delivery-location-menu__confirm-btn:hover {
  background-color: var(--deep-plum);
}

.delivery-location-menu__confirm-btn:focus {
  outline: 2px solid var(--imperial-purple);
  outline-offset: -2px;
}

/* Hidden State */
.delivery-location-menu__city-group.is-hidden {
  display: none;
}

.delivery-location-menu__district.is-hidden {
  display: none;
}

/* ================================
   RESPONSIVE STYLES
   ================================ */

/* Mobile */
@media (max-width: 768px) {
  .delivery-location-menu {
    padding-top: 60px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .delivery-location-menu__container {
    max-height: calc(100vh - 80px);
  }

  .delivery-location-menu__header {
    padding: 20px 24px;
  }

  .delivery-location-menu__title {
    font-size: 20px;
  }

  .delivery-location-menu__search {
    padding: 20px 24px;
  }

  .delivery-location-menu__search-icon {
    left: 36px;
  }

  .delivery-location-menu__list {
    padding: 12px 24px;
  }

  .delivery-location-menu__city-name {
    font-size: 15px;
  }

  .delivery-location-menu__district span {
    font-size: 14px;
  }

  .delivery-location-menu__confirm-btn {
    font-size: 16px;
    padding: 18px 24px;
  }
}
