/* ==========================================================================
   Gozili Delivery Location Modal (Zomato-style Map & Address Search)
   ========================================================================== */

:root {
  --dl-primary: #810100;
  --dl-primary-dark: #630100;
  --dl-primary-light: #fff2f2;
  --dl-success: #0b8a36;
  --dl-success-light: #e8f8ed;
  --dl-error: #c92a2a;
  --dl-error-light: #ffe8e8;
  --dl-text: #191c1f;
  --dl-text-muted: #6c757d;
  --dl-bg: #ffffff;
  --dl-border: #e9ecef;
  --dl-radius: 16px;
  --dl-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
}

/* Modal Overlay & Base */
.dl-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: opacity 0.25s ease;
}

.dl-modal[aria-hidden="true"] {
  opacity: 0;
  pointer-events: none;
}

.dl-modal[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.dl-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 18, 20, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Slide-up Sheet */
.dl-modal__sheet {
  position: relative;
  width: 100%;
  max-width: 580px;
  max-height: 94vh;
  background: var(--dl-bg);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--dl-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  animation: dlSlideUp 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dlSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@media (min-width: 768px) {
  .dl-modal {
    align-items: center;
    padding: 20px;
  }
  .dl-modal__sheet {
    border-radius: 20px;
    max-height: 90vh;
    animation: dlPopIn 0.26s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes dlPopIn {
    from { transform: scale(0.94); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
  }
}

.dl-modal__handle {
  width: 44px;
  height: 4px;
  background: #dee2e6;
  border-radius: 999px;
  margin: 10px auto 4px;
}

@media (min-width: 768px) {
  .dl-modal__handle {
    display: none;
  }
}

/* Header */
.dl-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 10px;
  border-bottom: 1px solid var(--dl-border);
}

.dl-modal__title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dl-modal__pin-icon {
  width: 38px;
  height: 38px;
  background: var(--dl-primary-light);
  color: var(--dl-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.dl-modal__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dl-text);
  line-height: 1.25;
}

.dl-modal__sub {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--dl-text-muted);
}

.dl-modal__close {
  background: #f1f3f5;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #495057;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.15s ease;
}

.dl-modal__close:hover {
  background: #e9ecef;
  color: #212529;
}

/* Search Bar (Top Zomato-style) */
.dl-search-section {
  position: relative;
  padding: 12px 20px 8px;
  background: #ffffff;
  z-index: 5000;
}

.dl-search-bar {
  display: flex;
  align-items: center;
  background: #f8f9fa;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 0 12px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.dl-search-bar:focus-within {
  border-color: var(--dl-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(129, 1, 0, 0.12);
}

.dl-search-bar__icon {
  color: var(--dl-primary);
  font-size: 1.05rem;
  margin-right: 10px;
  display: flex;
  align-items: center;
}

.dl-search-bar__input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 0;
  font-size: 0.92rem;
  color: var(--dl-text);
  outline: none;
}

.dl-search-bar__input::placeholder {
  color: #8c98a4;
  font-size: 0.86rem;
}

.dl-search-bar__clear {
  background: #e9ecef;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #495057;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
}

/* Search Results Autocomplete Dropdown - Always Floats Above Map */
.dl-search-results {
  position: absolute;
  top: calc(100% - 2px);
  left: 20px;
  right: 20px;
  background: #ffffff;
  border: 1.5px solid #dee2e6;
  border-radius: 14px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.24), 0 4px 14px rgba(0, 0, 0, 0.08);
  max-height: 270px;
  overflow-y: auto;
  z-index: 6000;
  -webkit-overflow-scrolling: touch;
}

.dl-search-results::-webkit-scrollbar {
  width: 6px;
}

.dl-search-results::-webkit-scrollbar-track {
  background: #f8f9fa;
  border-radius: 10px;
}

.dl-search-results::-webkit-scrollbar-thumb {
  background: #ced4da;
  border-radius: 10px;
}

.dl-search-item {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #f1f3f5;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
  background: #ffffff;
}

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

.dl-search-item:hover,
.dl-search-item:active {
  background: #fdf5f5;
}

.dl-search-item__icon {
  width: 34px;
  height: 34px;
  background: var(--dl-primary-light);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dl-primary);
  font-size: 0.95rem;
  margin-right: 12px;
  flex-shrink: 0;
}

.dl-search-item__info {
  flex: 1;
  min-width: 0;
}

.dl-search-item__title {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--dl-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dl-search-item__sub {
  display: block;
  font-size: 0.76rem;
  color: var(--dl-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.dl-search-item__badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--dl-success-light);
  color: var(--dl-success);
  margin-left: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.dl-search-item__badge--no {
  background: #f1f3f5;
  color: #868e96;
}

/* Quick Actions & Active Cities Section */
.dl-quick-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 20px 12px;
  position: relative;
  z-index: 2;
}

.dl-quick-gps-wrap {
  display: flex;
  align-items: center;
}

.dl-quick-gps-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--dl-primary-light);
  color: var(--dl-primary);
  border: 1.5px solid rgba(129, 1, 0, 0.22);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(129, 1, 0, 0.08);
}

.dl-quick-gps-btn:hover {
  background: #ffe3e3;
  border-color: var(--dl-primary);
  transform: translateY(-1px);
}

.dl-quick-gps-btn__pulse {
  width: 8px;
  height: 8px;
  background: var(--dl-primary);
  border-radius: 50%;
  animation: dlGpsPulse 1.6s infinite ease-out;
}

@keyframes dlGpsPulse {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(129, 1, 0, 0.6); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(129, 1, 0, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(129, 1, 0, 0); }
}

.dl-city-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.dl-city-chips__label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  color: var(--dl-text-muted);
  font-weight: 700;
  white-space: nowrap;
  margin-right: 2px;
}

.dl-city-chips__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.dl-city-chip {
  background: #f1f3f5;
  border: 1px solid #dee2e6;
  color: #495057;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
}

.dl-city-chip:hover,
.dl-city-chip.is-active {
  background: var(--dl-primary);
  border-color: var(--dl-primary);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(129, 1, 0, 0.2);
}

/* Fixed Modal Footer with Submit Button */
.dl-modal__footer {
  padding: 12px 20px 14px;
  background: #ffffff;
  border-top: 1px solid var(--dl-border);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

/* Scroll Body (Map) */
.dl-scroll-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 12px;
  position: relative;
  z-index: 1;
}

/* Map Card */
.dl-map-card {
  background: #ffffff;
  border: 1.5px solid #e9ecef;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  margin-bottom: 0;
}

.dl-map-container {
  position: relative;
  width: 100%;
  background: #e9ecef;
}

#dlLeafletMap {
  width: 100%;
  height: 230px;
}

@media (min-width: 768px) {
  #dlLeafletMap {
    height: 250px;
  }
}

/* Zomato-style Floating Center Marker */
.dl-map-center-pin {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -100%);
  pointer-events: none;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dl-map-pin-bubble {
  background: #212529;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
  margin-bottom: 4px;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  animation: dlFloatBubble 2.4s infinite ease-in-out;
}

@keyframes dlFloatBubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.dl-map-pin-icon {
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.35));
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dl-map-center-pin.is-dragging .dl-map-pin-icon {
  transform: translateY(-12px) scale(1.1);
}

.dl-map-center-pin.is-dropped .dl-map-pin-icon {
  animation: dlPinDrop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes dlPinDrop {
  0% { transform: translateY(-24px) scale(1.18); }
  60% { transform: translateY(3px) scale(0.95); }
  100% { transform: translateY(0) scale(1); }
}

.dl-map-pin-pulse {
  width: 14px;
  height: 6px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 50%;
  margin-top: -2px;
}

.dl-map-float-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 990;
  background: #ffffff;
  border: 1px solid #dee2e6;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--dl-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.dl-map-float-btn:hover {
  background: var(--dl-primary-light);
  transform: scale(1.05);
}

.dl-map-hint-pill {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(33, 37, 41, 0.75);
  color: #ffffff;
  font-size: 0.68rem;
  padding: 3px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  pointer-events: none;
  z-index: 990;
}

/* Pinned Address Details Bar */
.dl-pinned-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: #fdfdfd;
  border-top: 1px solid var(--dl-border);
}

.dl-pinned-bar__icon {
  color: var(--dl-primary);
  font-size: 1.15rem;
  margin-top: 2px;
}

.dl-pinned-bar__info {
  flex: 1;
  min-width: 0;
}

.dl-pinned-bar__title {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--dl-text);
  line-height: 1.25;
}

.dl-pinned-bar__sub {
  display: block;
  font-size: 0.76rem;
  color: var(--dl-text-muted);
  margin-top: 2px;
  line-height: 1.3;
}

/* Serviceability Status Badges */
.dl-service-status {
  padding: 0 14px 12px;
}

.dl-service-badge {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
}

.dl-service-badge--ok {
  background: var(--dl-success-light);
  color: var(--dl-success);
  border: 1px solid rgba(11, 138, 54, 0.2);
  font-weight: 600;
}

.dl-service-badge--ok i {
  font-size: 1.1rem;
}

.dl-service-badge--no {
  background: var(--dl-error-light);
  color: var(--dl-error);
  border: 1px solid rgba(201, 42, 42, 0.25);
}

.dl-service-badge--no i {
  font-size: 1.15rem;
  margin-top: 2px;
}

.dl-service-badge__cities {
  margin-top: 6px;
  font-size: 0.76rem;
}

.dl-service-badge__cities span {
  display: block;
  color: #495057;
  font-weight: 600;
  margin-bottom: 4px;
}

.dl-service-badge__city-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.dl-service-badge__city-btn {
  background: #ffffff;
  border: 1px solid var(--dl-primary);
  color: var(--dl-primary);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dl-service-badge__city-btn:hover {
  background: var(--dl-primary);
  color: #ffffff;
}

/* Detailed Address Form */
.dl-address-form {
  background: #fbfbfc;
  border: 1.5px solid #edf2f7;
  border-radius: 16px;
  padding: 16px;
}

.dl-form-head {
  margin-bottom: 14px;
}

.dl-form-head__label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dl-text);
}

.dl-form-head__hint {
  display: block;
  font-size: 0.76rem;
  color: var(--dl-text-muted);
}

.dl-input-group {
  margin-bottom: 12px;
}

.dl-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 4px;
}

.dl-input-wrap {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid #dee2e6;
  border-radius: 10px;
  padding: 0 12px;
  transition: all 0.2s ease;
}

.dl-input-wrap:focus-within {
  border-color: var(--dl-primary);
  box-shadow: 0 0 0 3px rgba(129, 1, 0, 0.08);
}

.dl-input-icon {
  color: #8c98a4;
  font-size: 0.95rem;
  margin-right: 10px;
}

.dl-input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 10px 0;
  font-size: 0.88rem;
  color: var(--dl-text);
  outline: none;
}

.dl-input::placeholder {
  color: #adb5bd;
  font-size: 0.82rem;
}

/* Save Address As Tag Pills */
.dl-tag-group {
  margin: 14px 0 16px;
}

.dl-tag-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 6px;
}

.dl-tag-pills {
  display: flex;
  gap: 8px;
}

.dl-tag-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #ffffff;
  border: 1.5px solid #dee2e6;
  color: #495057;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dl-tag-pill:hover {
  background: #f8f9fa;
  border-color: #ced4da;
}

.dl-tag-pill.is-active {
  background: var(--dl-primary-light);
  border-color: var(--dl-primary);
  color: var(--dl-primary);
}

/* Submit Button */
.dl-submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--dl-primary);
  color: #ffffff;
  border: none;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(129, 1, 0, 0.32);
  transition: all 0.2s ease;
}

.dl-submit-btn:hover:not(:disabled) {
  background: var(--dl-primary-dark);
  box-shadow: 0 6px 18px rgba(129, 1, 0, 0.42);
  transform: translateY(-1px);
}

.dl-submit-btn:disabled {
  background: #ced4da;
  color: #ffffff;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* Loading Overlay */
.dl-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 1100;
}

.dl-loading-spinner {
  width: 38px;
  height: 38px;
  border: 3.5px solid #f1f3f5;
  border-top-color: var(--dl-primary);
  border-radius: 50%;
  animation: dlSpin 0.75s linear infinite;
}

@keyframes dlSpin {
  to { transform: rotate(360deg); }
}

.dl-loading-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dl-primary);
}
