/* ── أماكن قريبة من المركز ── */
#nearby.nearby-block {
  --nb-blue: #1b355b;
  --nb-blue-light: #254a7a;
  --nb-brown: #a0874c;
  --nb-gold: #c9a96e;
  padding: 0 !important;
  background: linear-gradient(165deg, var(--nb-blue) 0%, #142a49 55%, #1a3358 100%) !important;
  position: relative;
  overflow: hidden;
}

.nearby-block__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.nearby-block__bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 40% at 15% 20%, rgba(160, 135, 76, 0.15), transparent),
    radial-gradient(ellipse 45% 35% at 90% 80%, rgba(45, 176, 138, 0.08), transparent);
}
.nearby-block__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("/assets/img/%D8%B4%D8%B9%D8%A7%D8%B1%20%D8%A7%D9%84%D9%88%D9%82%D9%81%20%D8%B4%D9%81%D8%A7%D9%81%D8%A7.png");
  background-size: 120px;
  background-repeat: repeat;
  animation: nb-watermark 55s linear infinite;
}
@keyframes nb-watermark {
  0% { background-position: 0 0; }
  100% { background-position: 240px 180px; }
}

.nearby-block__inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 72px 28px 28px;
  position: relative;
  z-index: 2;
}

/* ── العنوان ── */
.nearby-header {
  text-align: center;
  margin-bottom: 40px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.nearby-block.is-visible .nearby-header {
  opacity: 1;
  transform: translateY(0);
}
.nearby-header__icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--nb-brown), #7a5a2a);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 8px 28px rgba(160, 135, 76, 0.45);
  animation: nb-pin-bounce 3s ease-in-out infinite;
}
@keyframes nb-pin-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.nearby-header h2 {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  font-weight: 800;
  color: #fff;
}
.nearby-header__sub {
  margin: 0 auto;
  max-width: 520px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.02rem;
  line-height: 1.7;
}
.nearby-header__line {
  width: 90px;
  height: 4px;
  margin: 18px auto 0;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--nb-brown), var(--nb-gold), var(--nb-brown));
  background-size: 200% 100%;
  animation: nb-line-flow 3.5s linear infinite;
}
@keyframes nb-line-flow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ── اللوحة الرئيسية ── */
.nearby-panel {
  display: flex;
  align-items: stretch;
  gap: 32px;
  background: #fff;
  border-radius: 24px;
  padding: 28px;
  margin-bottom: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.75s 0.15s ease, transform 0.75s 0.15s ease;
}
.nearby-block.is-visible .nearby-panel {
  opacity: 1;
  transform: translateY(0);
}

/* ── قائمة الأماكن ── */
.nearby-places {
  flex: 0 0 42%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 540px;
  overflow-y: auto;
  padding-inline-end: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--nb-brown) transparent;
}

.place-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  background: #fafbfc;
  border: 2px solid rgba(27, 53, 91, 0.12);
  border-radius: 14px;
  color: var(--nb-blue);
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  text-align: start;
  cursor: pointer;
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.35s cubic-bezier(0.34, 1.3, 0.64, 1), box-shadow 0.35s;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateX(20px);
}
[dir="ltr"] .place-item { transform: translateX(-20px); }
.nearby-block.is-visible .place-item {
  animation: nb-place-enter 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.place-item:nth-child(1) { animation-delay: 0.2s; }
.place-item:nth-child(2) { animation-delay: 0.28s; }
.place-item:nth-child(3) { animation-delay: 0.36s; }
.place-item:nth-child(4) { animation-delay: 0.44s; }
.place-item:nth-child(5) { animation-delay: 0.52s; }
.place-item:nth-child(6) { animation-delay: 0.6s; }
.place-item:nth-child(7) { animation-delay: 0.68s; }
@keyframes nb-place-enter {
  to { opacity: 1; transform: translateX(0); }
}

.place-item::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--nb-brown);
  transform: scaleY(0);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 14px 0 0 14px;
}
[dir="ltr"] .place-item::before {
  inset-inline-start: auto;
  inset-inline-end: 0;
  border-radius: 0 14px 14px 0;
}

.place-item__icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(27, 53, 91, 0.08);
  color: var(--nb-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background 0.3s, color 0.3s, transform 0.35s;
}
.place-item__label {
  flex: 1;
  line-height: 1.5;
}

.place-item:hover {
  transform: translateX(-4px);
  border-color: rgba(160, 135, 76, 0.45);
  box-shadow: 0 8px 24px rgba(27, 53, 91, 0.1);
}
[dir="ltr"] .place-item:hover { transform: translateX(4px); }

.place-item:hover .place-item__icon,
.place-item.active .place-item__icon {
  background: linear-gradient(145deg, var(--nb-brown), #7a5a2a);
  color: #fff;
  transform: scale(1.08);
}

.place-item.active,
.place-item:hover.active {
  background: var(--nb-blue);
  color: #fff;
  border-color: var(--nb-blue);
  box-shadow: 0 10px 28px rgba(27, 53, 91, 0.25);
}
.place-item.active::before { transform: scaleY(1); }

/* المركز الرئيسي */
.place-item.main-center {
  background: linear-gradient(135deg, var(--nb-blue) 0%, var(--nb-blue-light) 100%);
  color: #fff;
  border-color: var(--nb-brown);
  margin-bottom: 8px;
  box-shadow: 0 8px 24px rgba(27, 53, 91, 0.2);
}
.place-item.main-center .place-item__icon {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.place-item.main-center.active,
.place-item.main-center:hover {
  background: linear-gradient(135deg, #142a49, var(--nb-blue));
  border-color: var(--nb-gold);
}

/* شارة الوقت */
.place-item .duration {
  color: #6b4e22;
  font-weight: 800;
  background: #fff6e4;
  border: 1px solid rgba(160, 135, 76, 0.35);
  padding: 3px 10px;
  border-radius: 999px;
  margin-inline-start: 6px;
  white-space: nowrap;
  transition: background 0.25s, color 0.25s, transform 0.25s;
  display: inline-block;
}
.place-item:hover .duration,
.place-item.active .duration,
.place-item.main-center .duration {
  background: #fff8ec;
  color: #6b4e22;
}
@keyframes pingBrown {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
.place-item .duration.ping { animation: pingBrown 0.8s ease; }

/* ── منطقة الخريطة / الصورة ── */
.nearby-visual {
  flex: 1 1 auto;
  align-self: stretch;
  min-height: 500px;
  height: 100%;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 3px solid rgba(27, 53, 91, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.nearby-visual__hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(27, 53, 91, 0.88);
  color: #fff;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
  backdrop-filter: blur(6px);
}
.nearby-visual.map-active .nearby-visual__hint { opacity: 1; }

#map-container,
#center-image-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 15px;
  transition: opacity 0.55s ease, transform 0.55s ease;
}
#map-container {
  opacity: 0;
  z-index: 1;
  cursor: pointer;
}
#center-image-container {
  opacity: 1;
  z-index: 2;
  background: linear-gradient(180deg, #f4f6f9 0%, #e8ecf2 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#center-main-image {
  width: 92%;
  max-height: 85%;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(27, 53, 91, 0.15);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.nearby-block.is-visible #center-main-image {
  animation: nb-img-float 5s ease-in-out infinite;
}
@keyframes nb-img-float {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}
.image-caption {
  margin-top: 14px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--nb-blue);
}

/* Leaflet marker */
.custom-center-icon {
  background: transparent !important;
  border: none !important;
}

/* ── استجابة ── */
@media (max-width: 992px) {
  .nearby-panel { flex-direction: column; }
  .nearby-places {
    flex: none;
    max-height: none;
    overflow: visible;
  }
  .nearby-visual { min-height: 400px; }
}

#nearby.nearby-block + #clients.clients-block {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

@media (max-width: 560px) {
  .nearby-block__inner { padding: 52px 16px 24px; }
  .nearby-panel { padding: 18px; gap: 20px; }
  .place-item { padding: 12px 14px; font-size: 0.92rem; }
  .place-item__icon { width: 40px; height: 40px; font-size: 1rem; }
}

/* LTR */
.lang-en .nearby-header { text-align: center; }
.lang-en .place-item { text-align: start; }
