/* ==========================================================================
   RED LATINOAMERICANA DE POLIGRAFISTAS - MAIN CSS (MOBILE FIRST)
   ========================================================================== */

:root {
    --color-primary: #1e40af;
    --color-primary-hover: #1d4ed8;
    --color-primary-light: #eff6ff;
    --color-secondary: #0f172a;
    --color-text-main: #1e293b;
    --color-text-muted: #64748b;
    --color-bg-page: #f8fafc;
    --color-card-bg: #ffffff;
    --color-border: #e2e8f0;
    --color-success: #16a34a;
    --color-whatsapp: #25d366;
    --color-whatsapp-hover: #128c7e;
    --color-call: #0284c7;
    --color-mail: #475569;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;

    --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-float: 0 20px 25px -5px rgb(0 0 0 / 0.12), 0 8px 10px -6px rgb(0 0 0 / 0.08);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --header-height: 60px;
    --z-map: 1;
    --z-controls: 1000;
    --z-modal: 2000;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body, button, input, select, textarea, .leaflet-container, .leaflet-popup-content, .bottom-sheet {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
}

html, body {
    width: 100%;
    min-height: 100%;
    color: var(--color-text-main);
    background-color: var(--color-bg-page);
}

/* Buscador Flotante Minimalista Estilo Uber Eats */
.search-floating-bar {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 580px;
    z-index: var(--z-controls);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(226, 232, 240, 0.85);
    transition: all 0.2s ease;
    padding: 5px 6px 5px 18px;
    height: 54px;
}

.search-input-wrapper:focus-within {
    border-color: #cbd5e1;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.04);
}

.search-icon {
    width: 20px;
    height: 20px;
    color: #1e293b;
    flex-shrink: 0;
    margin-right: 10px;
}

.search-input {
    flex: 1;
    height: 100%;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    color: #0f172a;
    background: transparent;
    min-width: 60px;
}

.search-input::placeholder {
    color: #64748b;
    font-weight: 400;
}

.search-clear-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #94a3b8;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    margin-right: 6px;
    transition: all 0.15s ease;
}

.search-clear-btn:hover {
    color: #0f172a;
    background: #f1f5f9;
}

/* Pastilla de Filtro Especial Estilo Uber Eats */
.uber-type-pill {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* Pastilla Filtro Uber Eats con Switch Integrado */
.uber-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #f3f4f6;
    border: none;
    border-radius: var(--radius-full);
    height: 40px;
    padding: 0 14px;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
    outline: none;
    flex-shrink: 0;
}

.uber-filter-pill:hover {
    background: #e5e7eb;
}

.uber-filter-pill:active {
    transform: scale(0.97);
}

.filter-pill-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-pill-label {
    line-height: 1;
}

.filter-switch-track {
    width: 32px;
    height: 18px;
    background: #cbd5e1;
    border-radius: var(--radius-full);
    position: relative;
    display: inline-block;
    transition: background-color 0.22s ease;
    flex-shrink: 0;
    margin-left: 2px;
}

.filter-switch-thumb {
    position: absolute;
    top: 2px;
    left: 9px; /* Centro (Ambas) */
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
    transition: left 0.22s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.22s ease;
}

/* Estado: Persona (Apagado / Izquierda) */
.uber-filter-pill.state-individual {
    background: #eff6ff;
    color: #1d4ed8;
}
.uber-filter-pill.state-individual .filter-switch-track {
    background: #bfdbfe;
}
.uber-filter-pill.state-individual .filter-switch-thumb {
    left: 2px;
    background: #1d4ed8;
}

/* Estado: Empresa (Prendido / Derecha) */
.uber-filter-pill.state-company {
    background: #fef3c7;
    color: #b45309;
}
.uber-filter-pill.state-company .filter-switch-track {
    background: #fde68a;
}
.uber-filter-pill.state-company .filter-switch-thumb {
    left: 16px;
    background: #b45309;
}

@media (max-width: 539px) {
    .search-floating-bar {
        top: 16px;
        width: calc(100% - 20px);
    }
    .search-input-wrapper {
        height: 50px;
        padding-left: 14px;
    }
    .search-input {
        font-size: 0.88rem;
    }
    .uber-filter-pill {
        height: 38px;
        padding: 0 10px;
        font-size: 0.8rem;
        gap: 5px;
    }
}

/* Resultados sugeridos del buscador */
.search-suggestions-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-float);
    border: 1px solid var(--color-border);
    max-height: 280px;
    overflow-y: auto;
    display: none;
    list-style: none;
    z-index: 1005;
}

.search-suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}

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

.search-suggestion-item:hover,
.search-suggestion-item.active {
    background-color: var(--color-primary-light);
}

.suggestion-icon {
    width: 18px;
    height: 18px;
    color: var(--color-primary);
    flex-shrink: 0;
}

.suggestion-text {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-main);
}

.suggestion-subtext {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Contenedor de Controles Flotantes del Mapa */
.map-floating-controls {
    position: absolute;
    bottom: 24px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: var(--z-controls);
}

.btn-control-float {
    position: relative;
    background: #ffffff;
    color: #334155;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius-full);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-control-float:hover {
    background: #f8fafc;
    color: var(--color-primary);
    transform: scale(1.06);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
}

.btn-control-float svg {
    width: 20px;
    height: 20px;
}

/* Estado activo del botón de Mapa de Calor */
.btn-heat-float.active {
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: #ffffff;
    border-color: #f97316;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.btn-heat-float.active:hover {
    background: linear-gradient(135deg, #ea580c, #dc2626);
    color: #ffffff;
}

.control-tooltip {
    position: absolute;
    right: calc(100% + 8px);
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.btn-control-float:hover .control-tooltip {
    opacity: 1;
}

/* Botón genérico de acción */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-whatsapp {
    background-color: var(--color-whatsapp);
    color: #ffffff;
}

.btn-whatsapp:hover {
    background-color: var(--color-whatsapp-hover);
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.35);
}

.btn-call {
    background-color: var(--color-call);
    color: #ffffff;
}

.btn-call:hover {
    background-color: #0369a1;
}

.btn-email {
    background-color: var(--color-mail);
    color: #ffffff;
}

.btn-email:hover {
    background-color: #334155;
}

/* Indicador de carga sutil */
.loading-indicator {
    position: absolute;
    top: 86px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    display: none;
    align-items: center;
    gap: 8px;
    z-index: var(--z-controls);
    box-shadow: var(--shadow-md);
}

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Insignia Azul de Profesional / Empresa Verificada (Estrella con muchas puntas / Roseta Oficial) */
.badge-verified {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: -2px;
    margin-right: 6px;
    margin-left: 0;
    line-height: 1;
    cursor: help;
}

.badge-verified svg {
    display: block;
    filter: drop-shadow(0 1px 2px rgba(37, 99, 235, 0.35));
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.badge-verified:hover svg {
    transform: scale(1.2) rotate(6deg);
}

.filter-pill-icon i {
    font-size: 15px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Insignias de Certificación de Poligrafistas (APA / EPA / Ambas) - Solo iconos de 25px */
.badge-cert {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    vertical-align: -4px;
    margin-left: 6px;
    line-height: 1;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.badge-cert-img {
    width: 25px;
    height: 25px;
    object-fit: contain;
    border-radius: 4px;
    display: inline-block;
    vertical-align: middle;
    transition: transform 0.15s ease;
}

.badge-cert-img:hover {
    transform: scale(1.12);
}
