/* ---------- GLOBAL ---------- */
body {
  font-family: "Segoe UI", sans-serif;
  background: #f8f8f8;
  margin: 0;
  padding: 0;
  color: #222;
}
html,
body {
  overflow-x: hidden;
}

/* ---------- TITRE PRINCIPAL ---------- */
h1 {
  font-size: clamp(22px, 4vw, 28px);
  text-align: center;
  margin: 20px 0;
  font-weight: 600;
  color: #222;
}

/* ---------- LAYOUT DESKTOP : carte à droite, sidebar à gauche ---------- */
.vendor-map-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  /* sidebar + carte */
  gap: 20px;
  padding: 20px;
  max-width: 100vw;
  box-sizing: border-box;
  align-items: flex-start;
}

/* ---------- SIDEBAR ---------- */
.vendor-sidebar {
  flex: 0 0 320px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  padding: 15px;
  height: calc(100vh - 40px);
  overflow-y: auto;
  border: 1px solid #eee;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.vendor-sidebar h1 {
  font-size: 22px;
  margin-bottom: 20px;
}

/* ---------- SEARCH INPUT ---------- */
#vendor-search {
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid #ccc;
  font-size: 15px;
  margin-bottom: 16px;
  transition: border 0.3s ease;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

#vendor-search:focus {
  border-color: #ff9900;
  outline: none;
}

/* ---------- LOCATE ME BUTTON ---------- */
#locate-me {
  background-color: #ff9900;
  color: white;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 20px;
  transition: background-color 0.3s ease, transform 0.2s;
}

#locate-me:hover {
  background-color: #e28500;
  transform: translateY(-1px);
}

/* ---------- VENDOR LIST ---------- */
#vendor-list {
  flex-grow: 1;
  overflow-y: auto;
  border: 1px solid #eee;
  padding: 12px;
  border-radius: 14px;
  background: #fafafa;
}

.vendor-item {
  border-bottom: 1px solid #f1f1f1;
  padding: 10px 0;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-radius: 10px;
}

.vendor-item:hover {
  background-color: #fff7ef;
  border-radius: 10px;
  padding: 10px;
}

.vendor-item img {
  transition: transform 0.2s ease;
  transform: scale(1.06);
}

.vendor-item:hover img {
  transform: scale(1.06);
}

/* ---------- MAP WRAPPER ---------- */
.map-wrapper {
  flex: 1;
  height: calc(100vh - 40px);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
  background-color: #eee;
}

#vendors-map {
  width: 100%;
  height: 100%;
}

/* ---------- COUNTER ---------- */
#vendor-counter {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.95);
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  font-size: 1.8em;
  font-weight: 500;
  color: #333;
  border: 1px solid #ddd;
  z-index: 999;
}

/* ---------- MARKER ---------- */
.vendor-marker-wrapper {
  width: clamp(34px, 6vw, 44px);
  height: clamp(34px, 6vw, 44px);
  border-radius: 50%;
  border: 2px solid #ff9900;
  background: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.vendor-marker-wrapper img {
  width: 100% !important;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- POPUP VENDOR ---------- */
.popup-content {
  padding: 10px;
  border-radius: 14px;
  background: #fff;
  max-width: 220px;
  text-align: center;
}

.popup-content img.profile {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #ff9900;
  margin-bottom: 8px;
}

.popup-content .vendor-name {
  font-weight: bold;
  font-size: 15px;
  color: #222;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.popup-content .vendor-address {
  font-size: 13px;
  color: #666;
  margin-top: 6px;
}

.popup-content .view-shop {
  margin-top: 8px;
  padding: 6px 14px;
  background-color: #ff9900;
  color: white;
  font-size: 13px;
  text-decoration: none;
  border-radius: 999px;
  display: inline-block;
  transition: background-color 0.2s ease;
}

.popup-content .view-shop:hover {
  background-color: #e28500;
}

/* ---------- AUTRES ---------- */
.country-flag {
  width: 18px;
  height: 12px;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.2);
}

.goto-map {
  display: inline-block;
  font-size: 12px;
  color: #ff9900;
  text-decoration: none;
  margin-top: 4px;
}

#global-spinner {
  margin-top: 20px;
  font-size: 14px;
  text-align: center;
  color: #999;
}

.country-flag {
  width: 20px;
  height: 14px;
  object-fit: contain;
  border-radius: 2px;
  margin-left: 6px;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

/* ---------- MOBILE LAYOUT POUR .vendor-map-layout ---------- */
@media (max-width: 992px) {
  .vendor-map-layout {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    /* carte puis sidebar */
    gap: 20px;
    padding: 16px;
    box-sizing: border-box;
  }

  .map-wrapper {
    order: 1;
    width: 100%;
    height: 440px;
    border-radius: 16px;
    background: #eee;
    animation: fadeInUp 0.5s ease forwards;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  }

  .vendor-sidebar {
    order: 2;
    width: 100%;
    overflow-x: hidden;
    height: auto;
    padding: 24px 10px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.06);
    border: 1px solid #eee;
    animation: fadeInUp 0.5s ease 0.1s forwards;
    box-sizing: border-box;
  }

  .vendor-sidebar * {
    max-width: 100%;
    box-sizing: border-box;
  }

  #vendor-search {
    width: 100%;
    padding: 10px;
    border-radius: 999px;
    border: 1px solid #ccc;
    font-size: 17px;
    margin-bottom: 18px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
  }

  #vendor-search::placeholder {
    font-size: 15px;
    color: #999;
  }

  #locate-me {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 999px;
    background-color: #ff9900;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
  }

  #locate-me:hover {
    background-color: #e28500;
    transform: translateY(-1px);
  }

  #vendor-list {
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid #eee;
    padding: 16px;
    border-radius: 14px;
    background: #fafafa;
  }

  .popup-content {
    max-width: 100%;
    padding: 12px;
    border-radius: 14px;
  }

  .popup-content .vendor-name {
    font-size: 16px;
  }

  .popup-content .view-shop {
    font-size: 14px;
    padding: 8px 14px;
  }

  #vendor-counter {
    font-size: 14px;
    padding: 8px 12px;
  }

  .vendor-item img[style*="images/pays"] {
    width: 28px !important;
    height: 20px !important;
    object-fit: contain;
    border-radius: 3px;
    margin-left: 6px;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
    vertical-align: middle;
  }

  .country-flag {
    width: 28px;
    height: 28px;
    margin-left: 8px;
  }
}

/* ---------- ANIMATIONS ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.4s ease-in-out both;
}

.page-title {
  font-size: clamp(24px, 5vw, 32px);
  text-align: center;
  margin: 24px 0 12px 0;
  font-weight: 700;
  color: #222;
  line-height: 1.2;
}