/* ===================================
   WIDGET COMBO RESTAURANTS + CARTE
   Layout 40% Liste / 60% Carte
   =================================== */

.restaurants-map-combo {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  background: #f8f9fa;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  height: 600px;
  max-height: 80vh; /* Maximum 80% de la hauteur d'écran */
  display: flex;
  flex-direction: column;
}

.combo-title {
  text-align: center;
  padding: 30px 20px 20px;
  margin: 0;
  font-size: 2.5em;
  color: #333;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.combo-header {
  background: white;
  border-bottom: 1px solid #e9ecef;
  flex-shrink: 0;
}

.combo-container {
  display: flex;
  flex: 1;
  min-height: 0; /* Important pour le flexbox */
}

/* ===================================
   PANNEAU LISTE (40%)
   =================================== */

.restaurants-list-panel {
  width: 40%;
  background-color: #005632;
  border-right: 1px solid #e9ecef;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.restaurants-list-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  height: 100%;
}

/* Scrollbar personnalisée */
.restaurants-list-content::-webkit-scrollbar {
  width: 8px;
}

.restaurants-list-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.restaurants-list-content::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #00854d 0%, #00854d 100%);
  border-radius: 4px;
}

.restaurants-list-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #00854d 0%, #00854d 100%);
}

/* ===================================
   BARRE DE RECHERCHE
   =================================== */

.search-container {
  padding: 20px;
  background: #005632;
  flex-shrink: 0;
}

.search-box {
  position: relative;
  max-width: 100%;
}

.restaurant-search-input {
  width: 100%;
  padding: 12px 45px 12px 15px;
  border: 2px solid #e9ecef;
  border-radius: 25px;
  font-family: "Dunbar tall", sans-serif;
  font-size: 1rem;
  background: #f4e9d7;
  transition: all 0.3s ease;
  outline: none;
}

.restaurant-search-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.1em;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.search-icon:hover {
  background-color: #f0f0f0;
  color: #333;
}

.search-icon.is-clear {
  background-color: #005632;
  color: white;
  font-size: 12px;
}

.search-icon.is-clear:hover {
  background-color: white;
  color: #005632;
}

/* Animation pour les résultats */
.restaurant-card.search-hidden {
  display: none !important;
}

.restaurant-card.search-highlight {
  animation: searchHighlight 0.5s ease;
}

@keyframes searchHighlight {
  0% {
    background-color: #fff3cd;
  }
  100% {
    background-color: white;
  }
}

/* Surlignage des termes de recherche */
mark {
  background-color: #ffeb3b;
  color: #333;
  padding: 1px 2px;
  border-radius: 2px;
  font-weight: 600;
}

/* Message "Aucun résultat" */
.no-results {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.no-results p {
  font-size: 1.1em;
  margin: 0;
}

/* ===================================
   CARTES RESTAURANTS DANS LA LISTE
   =================================== */

.restaurants-list-content .restaurant-card {
  border-radius: 12px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
  margin-bottom: 15px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: #f4e9d7;
  border: solid 4px #00804a;
  border-left: 4px solid #ffc107;
  align-items: center;
  width: 340px;
  height: 100%;
  padding: 1.5rem;
}

.restaurant-image img {
  border-radius: 12px !important;
  border: solid 4px #005632 !important;
}

.restaurant-info {
  display: flex;
  gap: 12px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: "Dunbar tall", sans-serif;
}

.restaurant-info h3 {
  color: black !important;
  font-size: 18px !important;
  font-weight: 550 !important;
}

.restaurant-address {
  text-align: center;
  font-size: 14px;
  font-weight: 400;
}

.restaurants-list-content .restaurant-card.no-coordinates {
  opacity: 0.7;
  border-left: 4px solid #ffc107;
}

.restaurants-list-content .restaurant-card.no-coordinates::after {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.8em;
  opacity: 0.6;
}

.restaurants-list-content .restaurant-name {
  font-size: 1.2em;
  margin-bottom: 10px;
}

.restaurants-list-content .restaurant-address {
  color: #666;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
}

.restaurants-list-content .restaurant-address::before {
  margin-right: 6px;
  flex-shrink: 0;
}

.restaurants-list-content .restaurant-services {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.restaurants-list-content .service-badge {
  background-color: #efdfc4;
  border: 1px solid #005632;
  color: #005632;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: 500;
  text-transform: capitalize;
}

/* ===================================
   BOUTONS PAGE RESTAURANT
   =================================== */

.restaurant-actions {
  margin-top: 15px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.restaurant-page-btn {
  background-color: #efdfc4;
  border: 1px solid #005632;
  box-shadow: 4px 4px 0px 0px #005632 !important;
  border-radius: 4px;
  width: 184px;
  padding: 10px 15px;
  font-family: "Dunbar tall", sans-serif;
  font-size: 14px;
  color: #005632;
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 800;
  text-align: center;
  transition: all 0.5s cubic-bezier(0.35, 0, 0.35, 1);
}

.restaurant-page-btn:hover {
  color: #005632;
  transform: translateY(3px);
  box-shadow: 0px 0px 0px 0px #005632 !important;
}

/* Éviter que le clic sur le bouton déclenche la sélection de la carte */
.restaurant-page-btn {
  z-index: 10;
  position: relative;
}

/* ===================================
   PANNEAU CARTE (60%)
   =================================== */

.map-panel {
  width: 60%;
  position: relative;
  height: 100%;
}

.combo-map {
  width: 100%;
  height: 100%;
}

/* ===================================
   ÉTATS DE CHARGEMENT ET ERREUR
   =================================== */

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #f4e9d7;
  background-color: #005632;
  display: none;
}

.error-message {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  background: #f8d7da;
  color: #721c24;
  margin: 20px;
  border-radius: 8px;
  text-align: center;
}

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

@media (max-width: 1024px) {
  .combo-container {
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }

  .restaurants-list-panel {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e9ecef;
    height: 50%;
    min-height: 250px;
  }

  .map-panel {
    width: 100%;
    height: 50%;
    min-height: 250px;
  }

  .combo-title {
    font-size: 2em;
    padding: 20px 20px 15px;
  }

  .search-container {
    padding: 15px;
  }

  .restaurant-search-input {
    padding: 10px 40px 10px 15px;
    font-size: 0.9em;
  }

  .restaurants-list-content .restaurant-card {
    width: 300px;
    height: 350px;
  }
}

@media (max-width: 768px) {
  .restaurants-map-combo {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    border-radius: 0;
    height: 500px;
    max-height: 70vh;
  }

  .combo-title {
    font-size: 1.8em;
    padding: 15px 20px 10px;
  }

  .search-container {
    padding: 10px 15px;
  }

  .restaurant-search-input {
    padding: 8px 35px 8px 15px;
    font-size: 0.85em;
  }

  .search-icon {
    right: 12px;
    font-size: 0.9em;
    width: 16px;
    height: 16px;
  }

  .restaurants-list-content .restaurant-card {
    padding: 15px;
    margin-bottom: 10px;
    width: 280px;
    height: 320px;
  }

  .restaurants-list-content .restaurant-name {
    font-size: 1.1em;
  }

  .restaurants-list-content .service-badge {
    font-size: 0.7em;
    padding: 3px 6px;
  }

  .restaurant-page-btn {
    padding: 8px 16px;
    font-size: 12px;
  }
}

/* ===================================
   MARQUEURS PERSONNALISÉS
   =================================== */

.custom-marker {
  cursor: pointer;
  transition: transform 0.2s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-marker:hover {
  transform: scale(1.1);
  z-index: 1000;
}

.custom-marker img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: filter 0.2s ease;
  pointer-events: none; /* Évite les conflits de clic */
}

.custom-marker:hover img {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

/* ===================================
   POPUPS MAPBOX PERSONNALISÉS
   =================================== */

.mapboxgl-popup {
  max-width: 320px;
}

.mapboxgl-popup-content {
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.restaurant-popup {
  padding: 20px;
}

.restaurant-popup .popup-image {
  margin-bottom: 15px;
}

.restaurant-popup .popup-image img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
}

.restaurant-popup .popup-name {
  font-size: 1.2em;
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 10px;
  line-height: 1.3;
}

.restaurant-popup .popup-address {
  color: #666;
  font-size: 0.95em;
  line-height: 1.4;
  margin-bottom: 15px;
  display: flex;
  align-items: flex-start;
}

.restaurant-popup .popup-address::before {
  content: "📍";
  margin-right: 6px;
  flex-shrink: 0;
}

.restaurant-popup .popup-services {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 15px;
}

.restaurant-popup .service-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 500;
  text-transform: capitalize;
}

.restaurant-popup .service-badge.surplace {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.restaurant-popup .service-badge.clickcollect {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.restaurant-popup .service-badge.livraison {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* ===================================
   BOUTONS POPUP CARTE
   =================================== */

.popup-actions {
  margin-top: 15px;
  text-align: center;
}

.popup-page-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background-color: #005632;
  color: white;
  text-decoration: none;
  border-radius: 20px;
  font-family: "Dunbar tall", sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  border: 1px solid #005632;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 86, 50, 0.2);
}

.popup-page-btn:hover {
  background-color: #f4e9d7;
  color: #005632;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 86, 50, 0.3);
  text-decoration: none;
}

.popup-page-btn .btn-icon {
  font-size: 14px;
}
