/* ================================================
   GUIAACTIVA V2 - SPEEDYRECTCORE CUSTOM STYLES
   Sistema optimizado para velocidad y UX móvil-first
   ================================================ */

/* RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* CUSTOM SCROLLBAR HIDE */
.custom-scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.custom-scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* SMOOTH SCROLL */
html {
    scroll-behavior: smooth;
}

/* ===============================
   BOTONES DE FILTRO
   =============================== */
.filter-btn {
    flex-shrink: 0;
    padding: 0.5rem 1.25rem;
    background-color: white;
    border: 2px solid #e5e7eb;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: #10b981;
    color: #10b981;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.filter-btn.active {
    background-color: #10b981;
    border-color: #10b981;
    color: white;
}

/* ===============================
   SWIPER SLIDER PRO
   =============================== */
.pro-slider {
    width: 100%;
    height: auto;
    padding-bottom: 2rem;
}

.pro-slider .swiper-slide {
    background-color: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.pro-slider .swiper-slide:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.pro-slider .swiper-pagination-bullet {
    background-color: #10b981;
}

.pro-slider .swiper-button-next,
.pro-slider .swiper-button-prev {
    color: #10b981;
    background-color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.pro-slider .swiper-button-next::after,
.pro-slider .swiper-button-prev::after {
    font-size: 1.25rem;
}

/* ===============================
   CARDS DE COMERCIOS
   =============================== */
.comercio-card {
    background-color: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.comercio-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.comercio-card .badge-pro {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.comercio-card .badge-distancia {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background-color: rgba(16, 185, 129, 0.95);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
}

.comercio-card img {
    width: 100%;
    height: 12rem;
    object-fit: cover;
}

.comercio-card .card-content {
    padding: 1rem;
}

.comercio-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.comercio-card .categoria {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: #f3f4f6;
    border-radius: 9999px;
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.comercio-card .descripcion {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.comercio-card .info-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
    margin-bottom: 0.5rem;
}

.comercio-card .info-row svg {
    width: 1rem;
    height: 1rem;
    color: #10b981;
}

.comercio-card .action-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.comercio-card .btn-primary {
    flex: 1;
    padding: 0.5rem 1rem;
    background-color: #10b981;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.comercio-card .btn-primary:hover {
    background-color: #059669;
}

.comercio-card .btn-secondary {
    padding: 0.5rem 1rem;
    background-color: white;
    color: #10b981;
    border: 2px solid #10b981;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.comercio-card .btn-secondary:hover {
    background-color: #10b981;
    color: white;
}

/* ===============================
   MAPA LEAFLET
   =============================== */
#map-container {
    z-index: 1;
}

#map-container:empty::before {
    content: '📍 Cargando mapa... Por favor, espere.';
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #6b7280;
    font-style: italic;
    font-size: 1rem;
}

.leaflet-popup-content-wrapper {
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

.popup-comercio {
    text-align: center;
}

.popup-comercio img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

.popup-comercio h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.popup-comercio p {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.popup-comercio button {
    width: 100%;
    padding: 0.5rem;
    background-color: #10b981;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.popup-comercio button:hover {
    background-color: #059669;
}

/* ===============================
   MODAL MINI-LANDING
   =============================== */
#comercio-modal {
    backdrop-filter: blur(4px);
}

.modal-header-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.modal-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 1rem;
    border: 4px solid white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-top: -40px;
}

.modal-tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    overflow-x: auto;
}

.modal-tab {
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.modal-tab:hover {
    color: #10b981;
}

.modal-tab.active {
    color: #10b981;
    border-bottom-color: #10b981;
}

.modal-tab-content {
    display: none;
    padding: 1.5rem;
    animation: fadeIn 0.3s ease;
}

.modal-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===============================
   GALERÍA DE IMÁGENES
   =============================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
}

.gallery-grid img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-grid img:hover {
    transform: scale(1.05);
}

/* ===============================
   HORARIOS
   =============================== */
.horario-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.horario-item:last-child {
    border-bottom: none;
}

.horario-dia {
    font-weight: 600;
    color: #374151;
}

.horario-horas {
    color: #6b7280;
}

.horario-item.hoy {
    background-color: #d1fae5;
    border-radius: 0.5rem;
}

.horario-item.hoy .horario-dia {
    color: #10b981;
}

/* ===============================
   ESTADÍSTICAS (ANALYTICS)
   =============================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-card {
    background-color: #f9fafb;
    padding: 1rem;
    border-radius: 0.75rem;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #10b981;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* ===============================
   RESPONSIVE OPTIMIZATIONS
   =============================== */
@media (max-width: 768px) {
    .pro-slider .swiper-button-next,
    .pro-slider .swiper-button-prev {
        display: none;
    }
    
    .modal-header-image {
        height: 200px;
    }
    
    .modal-logo {
        width: 60px;
        height: 60px;
        margin-top: -30px;
    }
}

/* ===============================
   LOADING STATES
   =============================== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===============================
   ACCESIBILIDAD
   =============================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ===============================
   PRINT STYLES
   =============================== */
@media print {
    nav, footer, .filter-btn, #map-container {
        display: none;
    }
}
