/* ==========================================================================
   Restaurant Map Leaflet - Frontend Styles (COLOR BEIGE APLICADO)
   - Marco cambiado al color solicitado: #c9b89c
   - Diseño unificado y listo para usar
   ========================================================================== */

/* ===========================
   Variables globales
   =========================== */
:root{
  --rml-primary: #182738;                 /* Color de botones y pines */
  --rml-ui: #182738;                      /* Color de textos */

  --rml-pin-size: 44px;

  --rml-card-radius: 18px;
  --rml-frame-radius: 24px;

  /* CAMBIO: Colores del Marco (Beige solicitado) */
  --rml-bg-frame-top: #c9b89c;
  --rml-bg-frame-bot: #c9b89c;

  --rml-panel: rgba(255,255,255,.30);     /* Paneles más claros para el fondo beige */
  --rml-panel-border: rgba(24,39,56,.10); /* Bordes oscuros sutiles */

  --rml-shadow-lg: 0 28px 90px rgba(0,0,0,.15);
  --rml-shadow-md: 0 18px 55px rgba(0,0,0,.10);
}

/* ===========================
   Wrapper / Frame (COLOR ACTUALIZADO)
   =========================== */
.rml-wrap{
  position: relative;
  width: 100% !important;
  max-width: 100% !important;
  display: block;
  margin: 0;
  color: var(--rml-ui);
}

.rml-wrap.rml-framed{
  /* Fondo Beige con un degradado muy suave */
  background: linear-gradient(180deg, var(--rml-bg-frame-top), var(--rml-bg-frame-bot)) !important;

  border: 1px solid rgba(24,39,56,.10) !important;
  border-radius: var(--rml-frame-radius) !important;
  box-shadow: var(--rml-shadow-lg) !important;

  padding: 16px !important;
  overflow: hidden;
}

/* ===========================
   Desktop layout: REPARADO (Mapa hasta abajo)
   =========================== */
@media (min-width: 900px){
  .rml-wrap.rml-framed{
    display: grid !important;
    grid-template-columns: 1fr 320px !important; /* Mantenemos tu ancho de 320px */
    grid-template-rows: 650px !important;        /* Definimos altura para que el mapa sepa cuánto medir */
    gap: 14px !important;
    align-items: stretch !important;            /* Cambiado a stretch para que el mapa baje hasta el fondo */
  }

  /* Forzamos al mapa y al motor Leaflet a ocupar todo el alto */
  .rml-wrap.rml-framed .rml-map,
  .rml-wrap.rml-framed .leaflet-container {
    grid-column: 1 !important;
    grid-row: 1 !important;
    height: 100% !important;     /* Obliga al mapa a llegar hasta abajo */
    min-height: 100% !important;
    margin: 0 !important;
    border-radius: 18px !important;
  }

  .rml-wrap.rml-framed .rml-list{
    grid-column: 2;
    grid-row: 1;
    height: 100% !important;
    overflow-y: auto !important; 
    
    padding-bottom: 30px !important; 
    
    margin: 0 !important;
  }
}

/* ===========================
   Map container
   =========================== */
.rml-map{
  width: 100% !important;
  max-width: 100% !important;
  border-radius: 18px;
  overflow: hidden;
}

.rml-wrap .leaflet-container{
  border-radius: 18px;
  overflow: hidden;
  line-height: 1 !important;
  background: #eee; 
  border: 1px solid rgba(24,39,56,.12) !important;
  box-shadow: var(--rml-shadow-md) !important;
}

/* ===========================
   Leaflet HARDENING (crítico)
   =========================== */
.rml-wrap .leaflet-container img,
.rml-wrap .leaflet-container .leaflet-tile{
  max-width: none !important;
  max-height: none !important;
}

.rml-wrap .leaflet-container,
.rml-wrap .leaflet-pane,
.rml-wrap .leaflet-map-pane,
.rml-wrap .leaflet-tile-pane,
.rml-wrap .leaflet-overlay-pane,
.rml-wrap .leaflet-shadow-pane,
.rml-wrap .leaflet-marker-pane,
.rml-wrap .leaflet-tooltip-pane,
.rml-wrap .leaflet-popup-pane,
.rml-wrap .leaflet-layer{
  box-sizing: content-box !important;
}

.rml-wrap .leaflet-tile{
  position: absolute !important;
  display: block !important;
}

.rml-wrap .leaflet-div-icon{
  background: transparent !important;
  border: 0 !important;
}

.rml-wrap .leaflet-marker-icon{
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

/* ===========================
   Controles Leaflet
   =========================== */
.rml-wrap.rml-framed .leaflet-control-zoom.leaflet-bar{
  border: 1px solid rgba(24,39,56,.14) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  background: rgba(255,255,255,.80) !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 40px rgba(0,0,0,.10) !important;
}

.rml-wrap.rml-framed .leaflet-control-zoom a{
  width: 44px !important;
  height: 44px !important;
  line-height: 44px !important;
  color: var(--rml-primary) !important;
  background: transparent !important;
  border: 0 !important;
}

.rml-wrap .leaflet-control-attribution{
  background: rgba(255,255,255,.50);
  color: var(--rml-ui);
  border-radius: 10px;
  padding: 4px 8px;
  margin: 0 10px 10px 0;
  border: 1px solid rgba(0,0,0,.05);
}

/* ===========================
   Card overlay (blanca)
   =========================== */
.rml-card{
  position: absolute;
  right: 16px;
  top: 16px;
  width: min(440px, calc(100% - 32px));

  background: #fff !important;
  color: var(--rml-ui);
  border-radius: var(--rml-card-radius);
  border: 1px solid rgba(24,39,56,.10);
  box-shadow: 0 24px 70px rgba(0,0,0,.22);
  overflow: hidden;
  z-index: 1000;
}
.rml-card[hidden]{ display:none; }

.rml-card-close{
  position: absolute;
  top: 10px;
  right: 10px;
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  color: var(--rml-ui);
  font-size: 22px;
  cursor: pointer;
}

.rml-card-header{
  width: 100%;
  height: 160px;
  background: #f3f4f6;
}
.rml-card-header-img{
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.rml-card-title-row{
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: start;
  margin-top: 0;
  padding-top: 12px;
}

.rml-card-logo{
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(0,0,0,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.rml-card-body { 
  padding: 24px !important; /* Más "aire" para el diseño */
  display: flex;
  flex-direction: column;
  gap: 12px; 
}

.rml-card-name {
  margin: 0 0 4px 0 !important;
  font: 800 24px/1.2 system-ui, sans-serif !important; /* Nombre mucho más visible */
  color: #182738;
}

/* Añadimos mejor estilo a la dirección y teléfono */
.rml-card-address, .rml-card-phone {
  font-size: 15px !important;
  line-height: 1.6 !important;
  color: rgba(24, 39, 56, 0.7);
}

/* ===========================
   Buttons (Card)
   =========================== */
.rml-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:11px 12px;
  border-radius:12px;
  text-decoration:none !important;
  font:800 14px/1 system-ui, sans-serif;
  cursor:pointer;
  border:1px solid transparent;
  flex:1;
  min-height:44px;
  color: var(--rml-ui);
}

.rml-btn-primary {
  background: #182738 !important; 
  color: #fff !important;
  padding: 16px 20px !important;  /* Botón mucho más alto y cómodo */
  font-size: 16px !important;     /* Texto más legible */
  border-radius: 14px !important;
  box-shadow: 0 10px 25px rgba(24, 39, 56, 0.25) !important; /* Efecto flotante */
  flex: 2 !important;             /* Le da prioridad sobre el botón secundario */
}

.rml-btn-secondary{
  background:#fff !important;
  color: var(--rml-ui) !important;
  border-color: rgba(24,39,56,.22) !important;
}

/* ===========================
   Social + "Cómo llegar"
   =========================== */
.rml-card-social {
  margin-top: 20px !important;
  padding-top: 15px !important;
  border-top: 1px solid rgba(0,0,0,0.05); /* Línea de separación sutil */
  display: flex;
  gap: 12px !important;
  align-items: center;
  flex-wrap: wrap;
}

.rml-social{
  width:40px;
  height:40px;
  border-radius:12px;
  border:1px solid rgba(24,39,56,.18);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#fff;
}

.rml-social::before{
  content:"";
  width:18px;
  height:18px;
  display:block;
  background-color: var(--rml-ui);
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}

.rml-social-facebook::before{
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M13.5 22v-8h2.8l.4-3H13.5V9.2c0-.9.3-1.5 1.6-1.5H16.8V5.1c-.3 0-1.4-.1-2.7-.1c-2.7 0-4.6 1.7-4.6 4.8V11H7v3h2.5v8h4z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M13.5 22v-8h2.8l.4-3H13.5V9.2c0-.9.3-1.5 1.6-1.5H16.8V5.1c-.3 0-1.4-.1-2.7-.1c-2.7 0-4.6 1.7-4.6 4.8V11H7v3h2.5v8h4z'/%3E%3C/svg%3E");
}

.rml-social-instagram::before{
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M7 2h10a5 5 0 0 1 5 5v10a5 5 0 0 1-5 5H7a5 5 0 0 1-5-5V7a5 5 0 0 1 5-5Zm10 2H7a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3Zm-5 4a5 5 0 1 1 0 10a5 5 0 0 1 0-10Zm0 2a3 3 0 1 0 0 6a3 3 0 0 0 0-6Zm5.3-2.4a1.1 1.1 0 1 1 0 2.2a1.1 1.1 0 0 1 0-2.2Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M7 2h10a5 5 0 0 1 5 5v10a5 5 0 0 1-5 5H7a5 5 0 0 1-5-5V7a5 5 0 0 1 5-5Zm10 2H7a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3Zm-5 4a5 5 0 1 1 0 10a5 5 0 0 1 0-10Zm0 2a3 3 0 1 0 0 6a3 3 0 0 0 0-6Zm5.3-2.4a1.1 1.1 0 1 1 0 2.2a1.1 1.1 0 0 1 0-2.2Z'/%3E%3C/svg%3E");
}

/* ===========================
   Móvil: modal
   =========================== */
@media (max-width: 768px){
  .rml-wrap.rml-card-open .rml-backdrop{
    background: rgba(0,0,0,.60) !important;
    opacity: 1 !important;
  }

  .rml-wrap .rml-card{
    position: fixed;
    left: 50%;
    top: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: min(440px, calc(100% - 32px));
    max-height: calc(100vh - 32px);
    overflow: auto;
    z-index: 9999;
  }
}

/* ===========================
   Marker: gota + logo
   =========================== */
.rml-pin{
  width: var(--rml-pin-size);
  height: var(--rml-pin-size);
  position: relative;
  display:block;
}

/* Busca este bloque y cámbialo para que quede así: */
.rml-pin::before{
  content:"";
  position:absolute;
  inset:0;
  
  background: #c9b89c !important; 

  border-radius: 999px 999px 999px 0;
  transform: rotate(-45deg);
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
  opacity: .96;
  border: 1px solid rgba(24,39,56,0.2) !important;
}

.rml-pin-badge{
  position:absolute;
  left:50%;
  top:50%;
  transform: translate(-50%, -50%);
  width: calc(var(--rml-pin-size) * 0.90);
  height: calc(var(--rml-pin-size) * 0.90);
  border-radius:999px;
  background:#fff;
  overflow:hidden;
  display:block;
}
.rml-pin-badge img{
  width:100%;
  height:100%;
  object-fit: cover;
}

/* ===========================
   Lista (sidebar / dock)
   =========================== */
.rml-list {
  margin-top: 14px;
  display: flex !important;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  /* Fondo menos agresivo y con profundidad */
  background: #fdfcfb !important; 
  border: 1px solid rgba(24,39,56,.08) !important;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.03) !important;
  flex-wrap: wrap;
}

@media (min-width: 900px){
  .rml-wrap.rml-framed .rml-list{
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    max-height: calc(100vh - 220px);
    overflow: auto !important;
  }
}

.rml-list-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  
  /* Forzamos la altura real y evitamos el aplastamiento */
  height: 58px !important;
  min-height: 58px !important;
  flex-shrink: 0 !important; /* <--- ESTO EVITA QUE SE VEAN ESTRECHOS */

  padding: 0 24px !important;
  border-radius: 14px;
  border: 1px solid rgba(24,39,56,.14) !important;
  background: #ffffff !important;
  color: #182738 !important;
  font: 700 15px/1 system-ui, sans-serif;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

/* Efecto "Wow": Al pasar el ratón */
@media (hover:hover) and (pointer:fine) {
  .rml-list-btn:hover:not(.is-active) {
    transform: translateY(-3px); /* El botón sube */
    border-color: #c9b89c !important; /* Borde beige */
    box-shadow: 0 10px 20px rgba(24,39,56,0.08) !important; /* Sombra de elevación */
  }

  /* El destello de luz (Shine) */
  .rml-list-btn::after {
    content: "";
    position: absolute;
    top: 0; left: -150%;
    width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(201, 184, 156, 0.2), transparent);
    transform: skewX(-20deg);
    transition: 0.6s;
  }

  .rml-list-btn:hover::after {
    left: 150%; /* El brillo cruza el botón */
  }
}

/* Botón del listado cuando está seleccionado */
.rml-list-btn.is-active {
  background: #c9b89c !important; /* Tu color beige solicitado */
  border-color: rgba(255,255,255,0.3) !important;
  color: #ffffff !important;
  
  /* Sombra elegante para que destaque que está activo */
  box-shadow: 
    0 12px 28px rgba(201, 184, 156, 0.4), 
    0 0 0 1px rgba(255,255,255,0.1) inset !important;
  
  transform: translateY(-2px);
}

.rml-card-reservas{
  background: #182738 !important;
  color: #ffffff !important;
}

/* Definición del salto elástico */
@keyframes rml-pin-jump {
  0%, 100% { transform: translateY(0) scale(1); }
  30%      { transform: translateY(-15px) scale(1.05); } /* El pin sube y se agranda un poco */
  50%      { transform: translateY(0) scale(0.95); }    /* Al caer se "aplasta" sutilmente */
  70%      { transform: translateY(-5px) scale(1.02); }  /* Pequeño rebote final */
}

/* Aplicación de la animación cuando el plugin detecta el hover */
.rml-wrap .leaflet-marker-icon.rml-bounce .rml-pin {
  animation: rml-pin-jump 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 9999 !important; /* Asegura que el pin que salta esté por encima de los demás */
}

/* ===========================
   NUEVO: Arreglo Lista Vertical Móvil
   =========================== */
@media (max-width: 899px) {
  /* Forzamos que la lista sea vertical */
  .rml-list {
    flex-direction: column !important; 
    flex-wrap: nowrap !important;
    gap: 10px !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  /* Los botones ocupan todo el ancho y se alinean a la izquierda */
  .rml-list-btn {
    width: 100% !important;        
    max-width: 100% !important;
    min-height: 58px !important;   
    padding: 0 20px !important;
    justify-content: flex-start !important; /* Texto al principio */
    text-align: left !important;
    margin-bottom: 4px;
  }

  /* Quitamos el check de activo en móvil para que no estorbe */
  .rml-list-btn.is-active::after {
    display: none !important;
  }
}

/* ===========================
   EFECTO BACKDROP (Oscurecimiento)
   =========================== */

/* 1. Definición de la capa oscura */
.rml-wrap .rml-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7) !important; /* Oscurece al 70% */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9998; /* Se coloca justo debajo de la ficha móvil */
}

/* 2. Activación del efecto SOLO en móviles */
@media (max-width: 899px) {
  /* Cuando la ficha está abierta (.rml-card-open), mostramos el fondo */
  .rml-wrap.rml-card-open .rml-backdrop {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  
  /* Aseguramos que la ficha esté por encima de la capa oscura */
  .rml-wrap .rml-card {
    z-index: 9999 !important;
  }
}