/* ==========================================================================
   map.css (v2.0)
   Estilos para mapas Leaflet (Listados y Detalle)
   ========================================================================== */

/* ----------------------------------------------------------
   1. Contenedores de Mapa
   ---------------------------------------------------------- */

/* Contenedor para mapas de Listado (ej. productos.php, recetas.php) */
.mapa-productores,
.mapa-restaurantes,
.mapa-productos,
.mapa-recetas,
.mapa-rutas {
    width: 100%;
    height: 400px;
    border-radius: var(--radius-card);
    overflow: hidden;
    border: 1px solid var(--color-border-dim);
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    background: var(--color-bg-section); /* Color de fondo mientras carga */
}

/* Contenedor para mapas de Detalle (ej. producto.php, productor.php) */
.map-container-detalle {
    width: 100%;
    height: 400px;
    border-radius: var(--radius-card);
    overflow: hidden;
    border: 1px solid var(--color-border-dim);
    background: var(--color-bg-section);
    margin-top: 1.5rem;
}

/* ----------------------------------------------------------
   2. Estilos de Popups (Tema Oscuro)
   ---------------------------------------------------------- */

/* Contenedor principal del popup */
.leaflet-popup-content-wrapper {
    background: var(--color-bg-section, #1e253a);
    color: var(--color-text-main, #f8fafc);
    border-radius: var(--radius-card, 0.75rem);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
    border: 1px solid var(--color-border-dim, rgba(255, 255, 255, 0.15));
}

/* Flecha del popup */
.leaflet-popup-tip {
    background: var(--color-bg-section, #1e253a);
}

.leaflet-popup-content a {
    color: var(--color-accent, #d6a354);
    text-decoration: none;
}
.leaflet-popup-content a:hover {
    text-decoration: underline;
}

/* ----------------------------------------------------------
   3. POPUP ENRIQUECIDO (Ficha para Listados y Detalle)
   ---------------------------------------------------------- */

.leaflet-popup-content {
    margin: 1rem;
    min-width: 240px;
}

.custom-popup-ficha {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.custom-popup-ficha img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-card);
    border: 1px solid var(--color-border-dim);
}

.custom-popup-ficha h3 {
    color: var(--color-text-main);
    font-size: 1.1rem;
    margin: 0;
}

.custom-popup-ficha h3 a {
    color: var(--color-text-main);
}
.custom-popup-ficha h3 a:hover {
    color: var(--color-accent);
}

.custom-popup-ficha p {
    font-size: 0.9rem;
    color: var(--color-text-dim);
    margin: 0;
    line-height: 1.5;
}

.custom-popup-ficha .btn-ver-popup {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background-color: var(--color-accent);
    color: var(--color-bg-main);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-pill);
    padding: .4rem .9rem;
    font-size: .85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all .25s ease;
    margin-top: .5rem;
    justify-content: center;
}
.custom-popup-ficha .btn-ver-popup:hover {
    background: transparent;
    color: var(--color-accent);
    text-decoration: none;
}

/* ----------------------------------------------------------
   4. Botón "Cómo Llegar" (Páginas de Detalle)
   ---------------------------------------------------------- */

.mapa-como-llegar-wrapper {
    display: flex;
    justify-content: flex-end; /* Alinea el botón a la derecha */
    margin-top: 1rem;
}

.mapa-como-llegar {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: transparent;
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-pill);
    color: var(--color-accent);
    padding: .5rem 1rem;
    text-decoration: none;
    transition: all .25s ease;
}
.mapa-como-llegar:hover {
    background-color: var(--color-accent);
    color: var(--color-bg-main);
    text-decoration: none;
}
/* ========================================================================
 * ARCHIVO: public/assets/css/map.css
 * OBJETIVO: Estilos para los mapas Leaflet y popups enriquecidos.
 * ======================================================================== */

/* --- Contenedor del Mapa en Páginas de Detalle --- */
/* [cite: 148] */
.map-container-detalle {
    height: 350px;
    width: 100%;
    border-radius: 8px;
    background-color: #333;
    margin-bottom: 0.5rem; /* Reducimos el margen inferior para que el botón quede pegado */
    z-index: 1; /* Asegura que esté por debajo del header [cite: 65] */
}

/* --- Estilo del Botón "Cómo Llegar" --- */
/* [cite: 149, 155] */
.mapa-como-llegar-wrapper {
    text-align: right;
    margin-top: -10px; /* Solapa ligeramente sobre el mapa si hay espacio */
    margin-bottom: 1.5rem;
}

.mapa-como-llegar-btn { /* Renombrado para ser más genérico */
    display: inline-block;
    background-color: var(--color-acento, #d6a354);
    color: var(--color-fondo, #0f172a);
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.mapa-como-llegar-btn:hover {
    background-color: #fff;
    color: var(--color-fondo, #0f172a);
}

.mapa-como-llegar-btn i {
    margin-right: 8px;
}

/* --- Popup Enriquecido de Leaflet --- */
/*  */
.custom-popup-ficha {
    max-width: 250px;
}

.custom-popup-ficha img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    display: none; /* Oculta por defecto para la polilínea, pero disponible */
}

.custom-popup-ficha h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text-main, #fff);
    margin: 0 0 5px 0;
    padding: 0;
}

.custom-popup-ficha p {
    font-size: 0.9rem;
    color: var(--color-text-dim, #cbd5e1);
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.custom-popup-ficha .btn-link {
    font-weight: 600;
    color: var(--color-acento, #d6a354);
    text-decoration: none;
}

/* Icono de inicio de ruta */
.custom-map-icon-start {
    background-color: var(--color-acento, #d6a354);
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}
.custom-map-icon-start i {
    color: var(--color-fondo, #0f172a);
    font-size: 16px;
    /* Ajuste fino del icono dentro del círculo */
    margin-left: 2px;
    margin-top: 2px;
}