/* ==================== RESET Y VARIABLES ==================== */
:root {
    --primary: #1FA36A;
    --primary-dark: #198754;
    --secondary: #F4C430;
    --gray-dark: #2E2E2E;
    --gray-light: #f8f9fa;
    --gray-border: #e9ecef;
    --text: #212529;
    --text-light: #6c757d;
    --white: #ffffff;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f5f7fa;
    color: var(--text);
    line-height: 1.5;
    padding-bottom: 70px; /* Espacio para bottom nav */
}

/* ==================== SPLASH SCREEN ==================== */
.splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.splash-content {
    text-align: center;
    color: white;
}

.splash .logo {
    font-family: 'Poppins', sans-serif;
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
}

.splash .logo span {
    color: var(--secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== HEADER ==================== */
.app-header {
    background: var(--white);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--gray-border);
}

.logo-header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.logo-header span {
    color: var(--secondary);
    font-size: 48px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
}

.icon-btn:active {
    background-color: var(--gray-light);
}

/* ==================== BÚSQUEDA ==================== */
.search-section {
    padding: 12px 16px;
    background: var(--white);
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--gray-border);
}

.search-box {
    flex: 1;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 18px;
}

.search-box input {
    width: 100%;
    padding: 14px 40px 14px 48px;
    border: 1px solid var(--gray-border);
    border-radius: 30px;
    font-size: 16px;
    background: var(--gray-light);
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
}

.clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 18px;
}

.location-btn {
    background: var(--gray-light);
    border: 1px solid var(--gray-border);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    font-size: 20px;
    color: var(--primary);
    transition: all 0.2s;
}

.location-btn:active {
    background: var(--gray-border);
}

/* ==================== CATEGORÍAS ==================== */
.categorias-section {
    padding: 20px 16px;
    background: var(--white);
    margin-top: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.link-btn, .filter-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.categorias-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.categorias-scroll::-webkit-scrollbar {
    display: none;
}

.categoria {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 70px;
    cursor: pointer;
    transition: transform 0.2s;
}

.categoria:active {
    transform: scale(0.95);
}

.categoria-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.categoria span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
}

/* ==================== RESULTADOS ==================== */
.resultados-section {
    padding: 0 16px;
    margin-top: 20px;
}

.resultados-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Card de servicio */
.card-servicio {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.2s;
    cursor: pointer;
}

.card-servicio:active {
    transform: scale(0.98);
}

.card-content {
    display: flex;
    padding: 12px;
    gap: 12px;
}

.card-imagen {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
}

.card-info {
    flex: 1;
}

.card-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.card-categoria {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-confianza {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.badge-confianza.activo {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-confianza.confiable {
    background: #e8f5e9;
    color: #2e7d32;
}

.card-distancia {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 6px;
}

.card-distancia i {
    margin-right: 4px;
}

.card-rating {
    font-size: 12px;
    color: var(--secondary);
    margin-bottom: 6px;
}

.card-precio {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

/* Skeletons */
.card-skeleton {
    background: var(--white);
    border-radius: var(--radius);
    padding: 12px;
    display: flex;
    gap: 12px;
    animation: pulse 1.5s ease-in-out infinite;
}

.card-skeleton .img-skeleton {
    width: 80px;
    height: 80px;
    background: var(--gray-border);
    border-radius: var(--radius-sm);
}

.card-skeleton .text-skeleton {
    flex: 1;
}

.card-skeleton .line {
    height: 12px;
    background: var(--gray-border);
    border-radius: 6px;
    margin-bottom: 8px;
}

.card-skeleton .line.short {
    width: 60%;
}

.categoria-skeleton {
    width: 70px;
    height: 80px;
    background: var(--gray-border);
    border-radius: var(--radius);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ==================== BOTTOM NAVIGATION ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    padding: 10px 16px 20px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    border-top: 1px solid var(--gray-border);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-light);
    font-size: 12px;
    transition: color 0.2s;
}

.nav-item i {
    font-size: 22px;
}

.nav-item.active {
    color: var(--primary);
}

/* ==================== UTILIDADES ==================== */
.sin-resultados {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.sin-resultados i {
    font-size: 64px;
    margin-bottom: 16px;
}

.btn-secondary {
    background: var(--gray-light);
    border: 1px solid var(--gray-border);
    padding: 12px 24px;
    border-radius: 30px;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.ubicacion-mensaje {
    background: #fff3cd;
    color: #856404;
    padding: 10px 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ==================== RESPONSIVE (Tablets) ==================== */
@media (min-width: 768px) {
    .resultados-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    body {
        max-width: 500px;
        margin: 0 auto;
        background: var(--white);
    }
}



/* Filtros */
.filtros-section {
    padding: 8px 16px;
    background: white;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #e9ecef;
}

.filtro-btn {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filtro-btn i {
    color: #1FA36A;
}

.filtros-activos {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filtro-activo {
    background: #e8f5e9;
    color: #1FA36A;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filtro-activo i {
    cursor: pointer;
    font-size: 10px;
}

/* Panel de filtros */
.filtros-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.filtros-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #e9ecef;
}

.filtro-group {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.filtro-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 14px;
}

.filtro-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 14px;
}

.rating-filtro {
    display: flex;
    gap: 16px;
}

.rating-opcion {
    padding: 8px 16px;
    border-radius: 30px;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 14px;
}

.rating-opcion.active {
    background: #F4C430;
    color: #2E2E2E;
    font-weight: 600;
}

.filtros-actions {
    display: flex;
    gap: 12px;
    padding: 16px;
}

.btn-aplicar {
    flex: 2;
    background: #1FA36A;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
}

.btn-limpiar {
    flex: 1;
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 14px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
}

/* ==================== SKELETON LOADING MEJORADO ==================== */
.card-skeleton {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 12px;
}

.card-skeleton .img-skeleton {
    width: 100%;
    height: 120px;
    background: #eef2f6;
}

.card-skeleton .text-skeleton {
    padding: 12px;
}

.card-skeleton .line {
    height: 14px;
    background: #eef2f6;
    border-radius: 8px;
    margin-bottom: 10px;
}

.card-skeleton .line.short {
    width: 60%;
}

.card-skeleton .line.medium {
    width: 80%;
}

/* Efecto shimmer */
.shimmer {
    background: #eef2f6;
    background-image: linear-gradient(
        90deg,
        #eef2f6 0%,
        #e0e4e8 25%,
        #eef2f6 50%,
        #eef2f6 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Skeleton mejorado para el carrusel */
.destacado-skeleton {
    min-width: 150px;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.destacado-skeleton .img-skeleton {
    height: 100px;
    background: #eef2f6;
}

.destacado-skeleton .text-skeleton {
    padding: 10px;
}

.destacado-skeleton .line {
    height: 12px;
    background: #eef2f6;
    border-radius: 6px;
    margin-bottom: 8px;
}

.destacado-skeleton .line.short {
    width: 60%;
}

/* Badge para notificaciones y mensajes */
.icon-btn {
    position: relative;
}

.badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #dc2626;
    color: white;
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 0 0 2px white;
}

.badge.visible {
    display: flex;
}

.icon-btn {
    position: relative;
}

/* ==================== BOTONES DEL HEADER ==================== */
.icon-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
}

.icon-btn:hover, .icon-btn:active {
    background: #f5f5f5;
}

/* Badge para notificaciones y mensajes */
.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc2626;
    color: white;
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 0 0 2px white;
    z-index: 10;
}

.badge.visible {
    display: flex;
}

/* Botón de mensajes */
#btnMensajes {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #555;
}

/* Estilos para mensajes de ubicación dual */
.ubicacion-mensaje {
    padding: 10px 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 8px;
    margin: 8px 16px;
}

.ubicacion-local {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #1FA36A;
}

.ubicacion-exterior {
    background: #fff3e0;
    color: #e65100;
    border-left: 4px solid #F4C430;
}

.ubicacion-warning {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #dc2626;
}


