/* ==========================================================================
   DELIVERY ZONES & INTERACTIVE MAP MODULE (КОЛОМНА)
   Сити-ферма «САВА» — Выращено с душой
   ========================================================================== */

.delivery-section {
  padding: 60px 0 80px;
  position: relative;
  z-index: 2;
}

.delivery-card-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 36px;
  position: relative;
  overflow: hidden;
}

/* Header */
.delivery-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 32px;
}

.delivery-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-light);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.delivery-title {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0 0 12px;
  line-height: 1.25;
}

.delivery-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* Zone Tariffs Cards */
.delivery-zones-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.zone-tariff-card {
  background: var(--bg-main);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 22px 20px;
  transition: all var(--transition-smooth);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.zone-tariff-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.zone-tariff-card.active {
  box-shadow: var(--shadow-lg);
}

.zone-tariff-card.zone-green {
  border-color: rgba(34, 197, 94, 0.4);
}
.zone-tariff-card.zone-green.active,
.zone-tariff-card.zone-green:hover {
  border-color: #16a34a;
  background: #f0fdf4;
}

.zone-tariff-card.zone-yellow {
  border-color: rgba(245, 158, 11, 0.4);
}
.zone-tariff-card.zone-yellow.active,
.zone-tariff-card.zone-yellow:hover {
  border-color: #d97706;
  background: #fffbeb;
}

.zone-tariff-card.zone-red {
  border-color: rgba(239, 68, 68, 0.4);
}
.zone-tariff-card.zone-red.active,
.zone-tariff-card.zone-red:hover {
  border-color: #dc2626;
  background: #fef2f2;
}

.zone-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.zone-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.zone-badge-green {
  background: #dcfce7;
  color: #15803d;
}

.zone-badge-yellow {
  background: #fef3c7;
  color: #b45309;
}

.zone-badge-red {
  background: #fee2e2;
  color: #b91c1c;
}

.zone-time-tag {
  font-size: 0.75rem;
  color: var(--text-subtle);
  font-weight: 600;
}

.zone-price-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.zone-price-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 10px;
}

.zone-desc-text {
  font-size: 0.82rem;
  color: var(--text-subtle);
  line-height: 1.4;
  border-top: 1px dashed var(--border-color);
  padding-top: 10px;
}

/* Interactive Search Bar */
.delivery-search-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
  z-index: 100;
}

.delivery-search-input-wrap {
  flex: 1;
  position: relative;
}

.delivery-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.15rem;
  color: var(--text-subtle);
  pointer-events: none;
}

.delivery-search-input {
  width: 100%;
  height: 52px;
  padding: 0 46px 0 48px;
  background: var(--bg-main);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-main);
  transition: all var(--transition-fast);
  outline: none;
}

.delivery-search-input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.delivery-search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 4px;
  display: none;
}

.delivery-search-clear:hover {
  color: var(--text-main);
}

.btn-locate-me {
  height: 52px;
  padding: 0 20px;
  background: var(--bg-main);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.btn-locate-me:hover {
  background: var(--accent-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

/* Autocomplete Dropdown */
.delivery-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 280px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.delivery-autocomplete-dropdown.open {
  display: block;
}

.autocomplete-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: background var(--transition-fast);
}

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

.autocomplete-item:hover,
.autocomplete-item.highlighted {
  background: var(--accent-light);
}

.autocomplete-main-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.autocomplete-sub-text {
  font-size: 0.8rem;
  color: var(--text-subtle);
  margin-top: 2px;
}

/* Map Wrapper & Container */
.delivery-map-wrapper {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  background: #e5e7eb;
}

#delivery-kolomna-map {
  width: 100%;
  height: 480px;
  z-index: 10;
  cursor: pointer;
}

#delivery-kolomna-map ymaps,
#checkout-mini-map ymaps {
  cursor: pointer;
}

/* Floating Result Card on Map */
.delivery-floating-card {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: slideUpFade 250ms ease-out;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.delivery-floating-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.floating-address-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
}

.floating-tariff-info {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.floating-card-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.btn-order-to-zone {
  flex: 1;
  height: 40px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.btn-order-to-zone:hover {
  background: var(--primary-hover);
}

/* Map Pin Pulse Effect */
.custom-pin-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(44, 62, 22, 0.35);
  border: 3px solid #fff;
  font-size: 18px;
  position: relative;
  cursor: pointer;
}

.custom-pin-pulse {
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: pinPulse 2s infinite ease-out;
}

@keyframes pinPulse {
  0% {
    transform: scale(0.6);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* Checkout Modal Zone Component */
.checkout-zone-indicator {
  margin-top: 8px;
  margin-bottom: 12px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: all var(--transition-fast);
}

.checkout-zone-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}

.checkout-zone-tag {
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.82rem;
  display: inline-block;
}

.checkout-zone-text {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.btn-checkout-show-map {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.btn-checkout-show-map:hover {
  background: var(--accent-light);
  border-color: var(--primary);
}

/* Inline Mini Map for Checkout */
.checkout-mini-map-wrap {
  margin-top: 8px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  height: 220px;
  position: relative;
  display: none;
}

.checkout-mini-map-wrap.open {
  display: block;
}

#checkout-mini-map {
  width: 100%;
  height: 100%;
}

/* Address Autocomplete in Checkout */
.checkout-address-wrap {
  position: relative;
}

.checkout-autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 220px;
  overflow-y: auto;
  z-index: 1200;
  display: none;
}

.checkout-autocomplete-dropdown.open {
  display: block;
}

/* Responsive */
@media (max-width: 900px) {
  .delivery-zones-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .delivery-card-wrap {
    padding: 24px 16px;
  }

  .delivery-title {
    font-size: 1.7rem;
  }

  #delivery-kolomna-map {
    height: 380px;
  }

  .delivery-search-bar {
    flex-direction: column;
  }

  .btn-locate-me {
    width: 100%;
    justify-content: center;
  }

  .delivery-floating-card {
    left: 10px;
    right: 10px;
    bottom: 10px;
    max-width: none;
  }
}
