/* /home/bruno/Github/jardinamerica.net/style.css */

/* --- DISEÑO BASE --- */
:root {
    --primary: #2E7D32; 
    --accent: #ff6f00; 
    --bg-light: #f4f7f6;
    --text-dark: #333;
}
* { box-sizing: border-box; margin: 0; padding: 0; outline: none; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background-color: var(--bg-light); color: var(--text-dark); display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* --- HEADER --- */
.header {
    background-color: white;
    padding: 10px 15px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative; z-index: 1000;
    height: 65px;
}

.header h1, .header h3 { 
    font-weight: 800; font-size: 1.1rem; color: var(--primary); margin: 0; letter-spacing: -0.5px;
} 

.header i.fa-bars { color: #555; font-size: 1.4rem; }

/* --- LOGO Y MARCA --- */
.brand-box { display: flex; align-items: center; gap: 10px; }

.brand-text { display: flex; flex-direction: column; justify-content: center; line-height: 1.1; }
.brand-text small { font-size: 0.75rem; color: #888; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }

.logo-img {
    height: 50px; width: auto;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15)); 
    object-fit: contain; border: none; border-radius: 0;
}

/* --- INFO BAR --- */
.info-bar {
    display: flex;
    flex-wrap: wrap; 
    background: white;
    border-bottom: 1px solid #ddd;
}

/* Farmacia */
.pharmacy-alert {
    flex: 0 0 auto;
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    color: white;
    padding: 10px 15px;
    display: flex; align-items: center; gap: 15px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    height: auto;
    min-height: 80px;
    position: relative;
    overflow: hidden;
}
.pharmacy-alert:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(183, 28, 28, 0.4); }

.pharmacy-icon-box {
    background: rgba(255,255,255,0.2);
    width: 45px; height: 45px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.3);
}

.pharmacy-main-content {
    display: flex;
    align-items: center;
    flex: 1;
}

.pharmacy-label-col {
    display: flex;
    flex-direction: column;
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    min-width: auto;
}

.pharmacy-info-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.pharmacy-name { 
    font-size: 1.1rem; 
    font-weight: 800; 
    line-height: 1.1; 
    margin-bottom: 2px;
}
.pharmacy-address { font-size: 0.8rem; opacity: 0.9; }
.pharmacy-action-col { flex-shrink: 0; }
.btn-pharma-wa {
    background: #25D366; color: white;
    padding: 5px 12px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 700; text-decoration: none;
    display: inline-flex; align-items: center; gap: 5px;
    transition: background 0.2s;
}
.btn-pharma-wa:hover { background: #128C7E; color: white; }

/* Micros Alert */
.bus-alert {
    flex: 0 0 auto;
    background: linear-gradient(135deg, #3949AB 0%, #1A237E 100%);
    color: white;
    padding: 8px 15px;
    display: flex; align-items: center; gap: 15px;
    cursor: pointer;
    transition: transform 0.2s;
    min-height: 80px;
    border-left: 1px solid rgba(255,255,255,0.2);
}
.bus-alert:hover { transform: translateY(-2px); }
.bus-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
    font-weight: 800;
    margin-bottom: 5px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 2px;
}
.bus-icon-box {
    background: rgba(255,255,255,0.2);
    width: 45px; height: 45px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.3);
}
.bus-content-multi { flex: 1; display: flex; flex-direction: column; justify-content: center; line-height: 1.2; }
.bus-line { 
    font-size: 0.75rem; margin-bottom: 4px; line-height: 1.2; 
    border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 2px;
    display: flex; align-items: flex-start; gap: 8px;
}
.bus-line:last-child { border-bottom: none; margin-bottom: 0; }
.bus-line strong { font-weight: 800; white-space: nowrap; flex-shrink: 0; }
.bus-line .bus-divider { opacity: 0.6; flex-shrink: 0; }
.bus-line .bus-dest { flex: 1; }
.bus-line small { opacity: 0.8; font-weight: 400; }

/* Weather Alert */
.weather-alert {
    flex: 0 0 auto;
    background: linear-gradient(135deg, #0097A7 0%, #006064 100%);
    color: white;
    padding: 8px 15px;
    display: flex; align-items: center; gap: 15px;
    min-height: 80px;
    border-left: 1px solid rgba(255,255,255,0.2);
}
.weather-icon-box {
    background: rgba(255, 255, 255, 0.15);
    width: 50px; height: 50px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.weather-content { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.weather-header { 
    display: flex; justify-content: space-between; align-items: center; 
    border-bottom: 1px solid rgba(255,255,255,0.15);
    padding-bottom: 3px; margin-bottom: 3px;
}
.weather-label {
    font-size: 0.6rem; text-transform: uppercase; letter-spacing: 1px;
    font-weight: 800; color: white;
    display: flex; align-items: center; gap: 5px;
}
.weather-footer { font-size: 0.55rem; opacity: 0.6; text-transform: uppercase; font-weight: 600; margin-top: 2px; text-align: right; letter-spacing: 0.5px; }
.weather-body { display: flex; align-items: center; gap: 15px; }
.weather-item.temp { display: flex; align-items: flex-start; }
.weather-value { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.weather-unit { font-size: 0.8rem; font-weight: 600; margin-top: 2px; margin-left: 1px; opacity: 0.9; }
.weather-details { display: flex; gap: 12px; }
.weather-sub-item { display: flex; flex-direction: column; line-height: 1; }
.weather-sub-label { font-size: 0.5rem; font-weight: 700; opacity: 0.7; letter-spacing: 0.5px; margin-bottom: 2px; }
.weather-sub-value { font-size: 0.85rem; font-weight: 700; }
.weather-sub-item.st .weather-sub-value { color: #fff176; }

.weather-alert-msg {
    font-size: 0.65rem;
    font-weight: 700;
    margin-top: 4px;
    line-height: 1.2;
}

.live-indicator {
    width: 8px; height: 8px; background: #ff3b30; border-radius: 50%;
    box-shadow: 0 0 8px #ff3b30;
    animation: pulse-weather 2s infinite;
}

@media (min-width: 769px) {
    .weather-alert {
        padding: 10px 25px;
    }
}
@keyframes pulse-weather {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* --- MUNICIPAL ALERTS --- */
.municipal-alert {
    flex: 0 0 auto;
    color: white;
    padding: 10px 15px;
    display: flex; align-items: center; gap: 15px;
    min-height: 80px;
    position: relative;
    overflow: hidden;
    border-left: 1px solid rgba(255,255,255,0.2);
}
/* Variantes de color */
.municipal-alert.info { background: linear-gradient(135deg, #1976D2 0%, #0D47A1 100%); }
.municipal-alert.warning { background: linear-gradient(135deg, #F57C00 0%, #E65100 100%); }
.municipal-alert.danger { background: linear-gradient(135deg, #D32F2F 0%, #B71C1C 100%); }

.municipal-icon-box {
    background: rgba(255,255,255,0.2);
    width: 45px; height: 45px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.3);
    animation: pulse-icon 2s infinite;
}
@keyframes pulse-icon {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.municipal-content {
    flex: 1; display: flex; flex-direction: column; justify-content: center;
}
.municipal-label {
    display: flex; gap: 5px;
    font-size: 0.65rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.5px;
    opacity: 0.9; margin-bottom: 3px;
}
.municipal-message {
    font-size: 1rem; font-weight: 700; line-height: 1.2;
}
@media (min-width: 1300px) {
    .municipal-alert { padding: 10px 25px; box-shadow: 2px 2px 10px rgba(0,0,0,0.15); }
}


/* Ticker Promos */
.ticker-container {
    flex: 1; 
    overflow: hidden;
    position: relative;
    background: white;
    display: flex; align-items: center;
    height: 45px; 
}

.ticker-wrapper { 
    white-space: nowrap; 
    position: absolute; 
    animation: scroll 30s linear infinite; 
    animation-delay: -10s; 
    padding-left: 20px;
}

.ticker-item { display: inline-block; padding: 0 20px; color: #d81b60; font-weight: 500; font-size: 0.9rem; cursor: pointer; }

@keyframes scroll { 
    0% { transform: translateX(100vw); } 
    100% { transform: translateX(-100%); } 
}

/* --- MAPA --- */
.map-wrapper {
    position: relative; width: 100%;
    flex: 1;
    z-index: 1;
}
#map { width: 100%; height: 100%; }

/* --- BUSCADOR --- */
.floating-search {
    position: absolute; top: 15px; left: 50%; transform: translateX(-50%);
    width: 90%; max-width: 400px; z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}
.search-box {
    width: 100%;
    background: white; border-radius: 50px; display: flex; align-items: center; padding: 10px 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15); transition: transform 0.2s;
}
.search-box input { border: none; width: 100%; font-size: 1rem; margin-left: 10px; background: transparent; }
.search-box i { color: #888; }
.clear-btn { color: #999; cursor: pointer; display: none; padding: 5px; }

.filters-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.open-now-filter input[type="checkbox"] {
    display: none;
}
.open-now-filter label {
    background: white;
    padding: 8px 15px;
    border-radius: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-user-select: none;
    user-select: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
    gap: 8px;
}
.open-now-filter input[type="checkbox"]:checked + label {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.4);
}
.open-now-filter label:hover {
    transform: scale(1.05);
}

.favorites-filter input[type="checkbox"] {
    display: none;
}
.favorites-filter label {
    background: white;
    padding: 8px 15px;
    border-radius: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-user-select: none;
    user-select: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
    gap: 8px;
}
.favorites-filter input[type="checkbox"]:checked + label {
    background-color: #ff3b30;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.4);
}
.favorites-filter label:hover {
    transform: scale(1.05);
}

/* --- MENÚ LATERAL --- */
.sidebar {
    height: 100%; width: 260px; position: fixed; top: 0; left: -260px;
    background-color: white; z-index: 2000; transition: 0.3s;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1); display: flex; flex-direction: column;
}
.sidebar-header { padding: 20px; background: #f5f5f5; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #ddd; }
.sidebar-content { overflow-y: auto; flex: 1; padding: 10px 0; }

.sidebar-content a { 
    padding: 15px 25px; 
    display: flex; align-items: center; gap: 15px;
    color: #444; text-decoration: none; border-left: 4px solid transparent; 
    font-size: 1rem;
}
.sidebar-content a i { width: 20px; text-align: center; color: var(--primary); }
.sidebar-content a:hover { background: #e8f5e9; color: var(--primary); border-left-color: var(--primary); }

.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1500; display: none; backdrop-filter: blur(2px); }

/* --- MARCADORES --- */
.custom-div-icon {
    background: white; border-radius: 50%; border: 2px solid var(--primary);
    display: flex !important; align-items: center; justify-content: center;
    color: var(--primary); box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}
.custom-div-icon.premium { border-color: var(--accent); color: var(--accent); background: #fff8e1; z-index: 1000 !important; }

.custom-div-icon.ad-marker {
    border-color: #0d6efd; /* Azul para publicidad */
    border-width: 3px;
    padding: 0;
    overflow: hidden;
    background: white;
    z-index: 1100 !important;
}

.custom-div-icon.ad-marker-vip {
    border-color: #ffc107; /* Dorado para VIP */
    border-width: 4px;
    padding: 0;
    overflow: hidden;
    background: white;
    z-index: 1200 !important;
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.5);
}

.custom-div-icon.ad-marker-social {
    border-color: #9c27b0; /* Violeta para Social */
    border-width: 3px;
    padding: 0;
    overflow: hidden;
    background: white;
    z-index: 1100 !important;
}

/* --- ESTILOS MÓVIL --- */
@media (max-width: 1299px) {
    .info-bar { 
        display: block;
        position: relative;
        height: 115px; /* Altura suficiente para el contenido y botones */
        overflow: hidden;
        background: transparent;
    }
    .ticker-wrapper { animation-duration: 25s; animation-delay: -8s; }
    @keyframes scroll { 
        0% { transform: translateX(100vw); }
        100% { transform: translateX(-150%); } 
    }
    .municipal-alert, .pharmacy-alert, .bus-alert, .weather-alert { 
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 1 !important;
        transition: opacity 1s ease-in-out;
        pointer-events: none;
        z-index: 1;
        border: none;
        flex: none;
    }
    .pharmacy-alert, .municipal-alert {
        padding: 5px 15px;
        align-items: center;
    }
    .pharmacy-main-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    .pharmacy-label-col {
        font-size: 0.8rem;
        opacity: 1;
        margin-bottom: 2px;
        flex-direction: row;
        gap: 5px;
    }
    .pharmacy-name {
        font-size: 1.2rem;
    }
    .municipal-alert.active, .pharmacy-alert.active, .bus-alert.active, .weather-alert.active {
        opacity: 1 !important;
        pointer-events: auto;
        z-index: 2;
        display: flex !important;
    }
    .ticker-container { width: 100%; border-left: none; height: 45px; flex: none; }
    .floating-search { width: 95%; top: 10px; }

    /* Subimos los controles de zoom para que no se corten en pantallas chicas */
    .leaflet-bottom { bottom: 70px !important; }
}

/* Icono especial Farmacia de Turno */
.custom-div-icon.duty-pharmacy {
    background: #d32f2f; border-color: white; color: white;
    box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(211, 47, 47, 0); }
    100% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0); }
}

.popup-img-header {
    width: 100%; height: 120px; object-fit: cover;
    border-radius: 6px 6px 0 0; display: block; margin-bottom: 8px;
}

.leaflet-popup-content-wrapper { padding: 0; overflow: hidden; }
.leaflet-popup-content { margin: 0; width: 220px !important; }
.popup-body { padding: 10px 15px 15px 15px; text-align: center; }

/* --- BOTÓN FLOTANTE WHATSAPP --- */
.btn-whatsapp {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    color: #FFF;
    border-radius: 50%;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 9999; 
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.btn-whatsapp:hover {
    transform: scale(1.1); 
    color: #FFF;
}

/* Ajuste para móvil así no queda gigante en la pantallita */
@media (max-width: 768px) {
    .btn-whatsapp {
        width: 50px;
        height: 50px;
        font-size: 30px;
        bottom: 20px;
        right: 20px;
    }
}

/* --- CONTENEDOR PRINCIPAL (Base) --- */
.main-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    height: 100vh;
    position: relative;
    z-index: 0; /* Asegura un contexto de apilamiento por debajo de los botones flotantes. */
}

/* --- SLIM SIDEBAR (PC) --- */
.desktop-slim-sidebar {
    display: none; 
    width: 60px;
    background-color: #f4f7f6;
    border-right: 1px solid #ddd;
    flex-direction: column;
    z-index: 2000;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    transition: width 0.3s ease;
    overflow-x: hidden; /* Para que el texto no se vea al colapsar */
}
.desktop-slim-sidebar.expanded {
    width: 240px;
}

.slim-top {
    padding: 15px 0;
    width: 60px;
    text-align: center;
    cursor: pointer;
    flex-shrink: 0;
}
.slim-top i {
    font-size: 1.5rem;
    color: #555;
    padding: 5px;
    transition: color 0.2s;
}
.slim-top:hover i {
    color: var(--primary);
}

.slim-menu {
    padding-top: 15px;
}

.slim-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #444;
    text-decoration: none;
    white-space: nowrap;
    font-size: 0.95rem;
    transition: background-color 0.2s, color 0.2s;
}
.slim-menu a i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    margin-right: 20px;
    color: var(--primary);
    flex-shrink: 0;
}
.slim-menu a:hover {
    background-color: #e8f5e9;
    color: var(--primary);
}
.desktop-slim-sidebar:not(.expanded) .slim-menu a span {
    display: none;
}

.slim-bottom {
    margin-top: auto;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-top: 1px solid #ddd;
    min-height: 70px;
}
.desktop-slim-sidebar.expanded .slim-bottom {
    padding: 15px 20px;
    justify-content: flex-start;
}
.slim-bottom img {
    width: 40px; height: auto; flex-shrink: 0;
}
.desktop-slim-sidebar.expanded .slim-bottom img {
    margin-right: 12px;
}
.desktop-slim-sidebar:not(.expanded) .slim-bottom .brand-text {
    display: none;
}
.slim-bottom .brand-name { 
    font-weight: 800; font-size: 1.1rem; color: var(--primary); letter-spacing: -0.5px;
}
.slim-footer {
    padding: 0 20px 20px 20px;
    font-size: 0.75rem;
    color: #999;
    display: none;
    line-height: 1.5;
}
.desktop-slim-sidebar.expanded .slim-footer {
    display: block;
}
/* =========================================
   MEDIA QUERY: DISEÑO DE ESCRITORIO (PC)
   ========================================= */
@media (min-width: 769px) {
    body {
        flex-direction: row; /* Cambio de eje: sidebar a la izquierda, contenido a la derecha */
    }
    
    .desktop-slim-sidebar {
        display: flex; /* Mostramos la barra lateral finita */
    }
    
    .header, .sidebar, .overlay {
        display: none !important; /* Escondemos el header, sidebar y overlay de celulares */
    }
    
    .ticker-container {
        display: none; /* Ocultamos las promos pasantes en PC, igual que en tu imagen */
    }
}

/* Layout extra ancho para que la farmacia se vea en una sola línea y no ocupe tanto alto */
@media (min-width: 1300px) {
    .info-bar {
        position: absolute; /* Hacemos que la franja flote sobre el mapa */
        top: 0;
        left: 0;
        width: auto;
        flex-wrap: nowrap;
        z-index: 1000;
        background: transparent;
        border: none;
        pointer-events: none;
    }

    .municipal-alert, .pharmacy-alert, .bus-alert, .weather-alert {
        position: relative;
        opacity: 1 !important;
        pointer-events: auto;
        height: auto;
        min-height: 90px; /* Aumentamos un poco para dar aire al contenido */
        flex: 0 1 auto; /* Permitimos que se encojan si el espacio es crítico */
        border-radius: 0 0 15px 15px;
        margin-left: 10px;
        display: flex !important;
    }

    /* El primer elemento visible se pega al borde, los siguientes mantienen el margen */
    .info-bar > div:first-child {
        margin-left: 0;
    }

    .pharmacy-alert, .municipal-alert {
        width: auto;
        max-width: 600px; /* Limitamos el ancho máximo en PC para proteger el espacio de las otras alertas */
        padding: 10px 25px;
        gap: 10px;
        box-shadow: 2px 2px 10px rgba(0,0,0,0.15);
    }

    .bus-alert, .weather-alert {
        padding: 10px 20px;
        box-shadow: 2px 2px 10px rgba(0,0,0,0.1);
    }

    .floating-search {
        top: 140px;
        bottom: auto;
        left: 20px;
        transform: none;
        width: 350px;
        z-index: 1001;
    }

    .pharmacy-label-col {
        padding-right: 15px;
    }
    
    .pharmacy-info-col {
        border-left: 1px solid rgba(255,255,255,0.4);
        padding-left: 15px;
        margin-right: 15px;
    }
}

/* --- PANEL LATERAL DE INFORMACIÓN (Side Panel) --- */
.info-panel {
    position: fixed;
    top: 0;
    right: -450px; /* Oculto por defecto */
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 25px rgba(0,0,0,0.15);
    z-index: 3500; /* Por encima de todo */
    transition: right 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.info-panel.open {
    right: 0;
}

.panel-header {
    position: relative;
    min-height: 220px;
    background-color: #f0f0f0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.panel-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    transition: background 0.2s;
    z-index: 10;
}
.panel-close-btn:hover { background: rgba(0,0,0,0.9); }

/* Botón de Favoritos en el Panel */
.panel-fav-btn {
    position: absolute;
    top: 15px;
    right: 65px; /* A la izquierda del botón cerrar */
    background: rgba(255, 255, 255, 0.9);
    color: #ccc;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    transition: all 0.2s;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.panel-fav-btn:hover { transform: scale(1.1); }
.panel-fav-btn.active { color: #ff3b30; } /* Rojo corazón */

/* Flechas del Carrusel */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.3);
    color: white;
    border: none;
    width: 40px; height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    transition: background 0.2s;
    z-index: 15;
}
.nav-btn:hover { background: rgba(0,0,0,0.7); }
.prev-btn { left: 10px; }
.next-btn { right: 10px; }

.panel-body {
    padding: 30px;
    flex: 1;
}

.panel-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 5px;
    line-height: 1.1;
}

.panel-category {
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 15px;
    display: block;
}

.panel-description {
    color: #444;
    line-height: 1.6;
    margin-bottom: 25px;
    font-size: 1rem;
}

.panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.btn-panel {
    flex: 1 0 40%;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: transform 0.2s, opacity 0.2s;
    border: none;
}
.btn-panel:hover { transform: translateY(-2px); opacity: 0.95; color: white; }

/* Mobile adjustments */
@media (max-width: 768px) {
    .info-panel {
        width: 100%;
        right: -100%;
    }
}

/* --- DIFERENCIACIÓN DE NIVELES EN EL PANEL --- */
.info-panel.premium-2 {
    border-left: 6px solid #0d6efd;
}
.info-panel.premium-2 .panel-logo {
    border-color: #0d6efd;
}

.info-panel.premium-3 {
    border-left: 6px solid #ffc107;
    background: linear-gradient(to bottom, #fffdf5 0%, #ffffff 100%);
}
.info-panel.premium-3 .panel-title {
    color: #856404; /* Dorado oscuro para legibilidad */
}
.info-panel.premium-3 .panel-logo {
    border-color: #ffc107;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}
.info-panel.premium-3 .panel-title a:hover {
    color: #ff6f00;
}

.info-panel.premium-4 {
    border-left: 6px solid #9c27b0;
}
.info-panel.premium-4 .panel-logo {
    border-color: #9c27b0;
}

/* --- LOGO Y GALERÍA EN PANEL --- */
.panel-logo {
    position: absolute;
    bottom: -30px;
    right: 20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    object-fit: cover;
    background: white;
    z-index: 20;
}

.panel-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px 0;
    margin-top: 15px;
}

.panel-gallery img {
    height: 70px;
    width: 70px;
    object-fit: contain;
    background-color: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

/* --- PROMOCIONES (Side Panel & Modal) --- */
.promo-section {
    margin-bottom: 20px;
    background: #fff8e1; /* Fondo amarillento suave */
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 10px;
}
.promo-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-bottom: 5px;
    width: 100%;
}

/* Wrapper para la miniatura y el overlay */
.promo-thumb-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #ffc107;
    flex-shrink: 0;
    transform: translateZ(0); /* Fix para Safari/iOS rendering */
}
.promo-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.promo-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s;
}
.promo-overlay i { color: white; font-size: 1.5rem; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.promo-thumb-wrapper:hover .promo-overlay { opacity: 1; }
.promo-thumb-wrapper:hover .promo-thumb { transform: scale(1.1); }

/* Modal Promoción */
.promo-modal {
    display: none; 
    position: fixed; z-index: 5000; 
    left: 0; top: 0; width: 100%; height: 100%; 
    background-color: rgba(0,0,0,0.85); 
    align-items: center; justify-content: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px); /* Soporte Safari */
}
.promo-modal-content {
    max-width: 90%; max-height: 90%;
    border-radius: 8px; box-shadow: 0 0 20px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s;
    object-fit: contain;
}
@keyframes zoomIn { from {transform:scale(0.8); opacity:0;} to {transform:scale(1); opacity:1;} }

/* Estilos para Pestañas de Micros */
.bus-tab-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.bus-tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.bus-tab-content {
    animation: fadeIn 0.3s ease;
}

/* Agrupación por Empresa */
.bus-company-group {
    margin-bottom: 15px;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
}
.bus-company-name {
    font-weight: 800;
    color: var(--primary);
    font-size: 0.85rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
}
.bus-time-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.bus-time-item {
    background: white;
    border: 1px solid #ddd;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}
.bus-time-item.is-absolute-next {
    background: var(--accent);
    color: white;
    border-color: #e65100;
    font-weight: 800;
    box-shadow: 0 2px 4px rgba(255, 111, 0, 0.3);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.panel-gallery img:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* --- LIGHTBOX MODAL (Galería) --- */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 6000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    backdrop-filter: blur(5px);
}

.lightbox-content {
    max-width: 95%;
    max-height: 85vh;
    object-fit: contain;
    animation: zoomIn 0.3s;
    user-select: none;
}

.close-lightbox {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 6002;
    transition: 0.3s;
}
.close-lightbox:hover { color: #bbb; }

.lightbox-nav {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 25px;
    transition: 0.3s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0,0,0,0.1);
    border: none;
    z-index: 6001;
    outline: none;
}
.lightbox-nav:hover { background-color: rgba(0,0,0,0.6); }
.lightbox-nav.prev { left: 0; border-radius: 3px 0 0 3px; }
.lightbox-nav.next { right: 0; border-radius: 3px 0 0 3px; }

.lightbox-counter {
    color: #ccc;
    font-size: 0.9rem;
    margin-top: 10px;
    font-weight: 500;
}