/* Definimos las variantes de Roboto */
@font-face {
    font-family: 'Roboto';
    src: url('../assets/fonts/roboto_regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Roboto';
    src: url('../assets/fonts/roboto_medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Roboto';
    src: url('../assets/fonts/roboto_bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

/* Aplicamos Roboto a TODO el documento */
body {
    font-family: 'Roboto', sans-serif;
}

/* ... Tus @font-face de Roboto aquí ... */

:root {
    /* Paleta de Colores Extraída de tu XML de Android */
    --colorBackground: #F8F9FA;
    /* Fondo cálido (@color/colorBackground) */
    --colorSurface: #FFFFFF;
    /* Fondo de Cards y EditTexts */
    --almitech: #192137;
    /* Color primario títulos */
    --color_azul: #3b82f6;
    /* Color acento botones */
    --color_azul_oscuro: #1e3a8a;
    /* Color botones principales */
    --colorTextPrimary: #192137;
    /* Texto principal */
    --colorTextSecondary: #6C757D;
    /* Texto secundario/hints */
    --rojo_almi: #ef4444;
    /* Color para eliminar/errores */
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    /* Evita el recuadro azul al tocar en móviles */
}

body {
    background-color: var(--colorBackground);
    color: var(--colorTextPrimary);
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

/* Réplica exacta de: MaterialCardView (Elevation 6dp, Radius 16dp) */
.card-almi {
    background-color: var(--colorSurface);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.02);
    /* Definición sutil */
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
}

.card-almi:active {
    transform: scale(0.98);
    /* Efecto de presión */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Réplica de: rounded_edittext_background */
.input-almi {
    background-color: var(--colorSurface);
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--colorTextPrimary);
    width: 100%;
    transition: all 0.2s ease;
}

.input-almi:focus {
    border-color: var(--color_azul);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* Estilo para botones tipo MaterialButton */
.btn-almi {
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn-almi-primary {
    background-color: var(--color_azul_oscuro);
    color: white;
}

.btn-almi-primary:active {
    background-color: #152a61;
    transform: scale(0.97);
}

/* Overlay de fondo oscuro (android:background="#CC000000") */
#menu-contextual-container {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 100;
}

/* El menú flotante (MaterialCardView arriba a la derecha) */
.floating-menu-card {
    position: absolute;
    right: 24px;
    bottom: 175px;

    /* Forzamos el ancho al contenido */
    width: max-content !important;
    min-width: 180px;
    max-width: 240px;

    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform-origin: bottom right;
    animation: zoomInAndroid 0.2s ease-out;

    /* Esto ayuda a que el contenedor blanco no se estire */
    display: inline-block;
}

.floating-menu-card .flex.items-center {
    padding: 12px 20px;
    white-space: nowrap;
    /* Evita que el texto salte de línea */
}

/* Línea divisoria (View 1dp) */
.menu-divider {
    height: 1px;
    background-color: #E0E0E0;
    margin: 0 8px;
}

@keyframes zoomInAndroid {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#selector-direccion {
    position: absolute;
    top: 70px;
    /* Ajustado para quedar debajo del header */
    left: 24px;
    width: 280px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    z-index: 60;
    overflow: hidden;
    animation: slideDownAndroid 0.2s ease-out;
}

@keyframes slideDownAndroid {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 1. Asegura que el mapa siempre tenga tamaño y un color de fondo mientras carga */
#map {
    height: 350px !important;
    width: 100% !important;
    background-color: #f0f0f0;
    z-index: 1;
    /* Evita que el mapa tape los menús desplegables */
}

/* 2. ELIMINA EL ENLACE AZUL (Atribución) de la esquina inferior derecha */
.leaflet-control-attribution {
    display: none !important;
}

/* 3. Estilo opcional para los botones de Zoom (+ y -) 
   para que combinen con tu color azul */
.leaflet-bar button {
    background-color: #FFFFFF !important;
    color: var(--color_azul) !important;
    border: none !important;
}

.leaflet-bar button:hover {
    background-color: #f4f4f4 !important;
}

/* Asegúrate de que esto esté en tu bloque de <style> */
.modal-map {
    display: none;
    /* Inicialmente oculto */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

#map {
    height: 300px;
    width: 100%;
    min-height: 300px;
    /* Asegura que siempre tenga altura */
    background: #e5e7eb;
}

/* ... Tus @font-face y variables se quedan igual ... */

/* UNIFICACIÓN: Para que coincida con tu HTML actual */
.rounded-edittext,
.input-almi {
    background-color: var(--colorSurface);
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--colorTextPrimary);
    width: 100%;
    transition: all 0.2s ease;
    font-family: 'Roboto', sans-serif;
    outline: none;
}

.rounded-edittext:focus,
.input-almi:focus {
    border-color: var(--color_azul);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Contenedor relativo para el input de password y el ojo */
.password-wrapper {
    position: relative;
    width: 100%;
}

/* Estilo para el botón del ojo (ajuste fino) */
#btn_toggle_password {
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    color: var(--colorTextSecondary);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Estilos de validación que usamos en el JS */
.text-green-600 {
    color: #16a34a !important;
    /* Verde Esmeralda */
}

.bg-green-600 {
    background-color: #16a34a !important;
}

/* Fix para el modal en móviles (Pantalla completa real) */
.modal-map {
    display: none;
    position: fixed;
    inset: 0;
    /* Cubre todo */
    z-index: 9999;
    background: rgba(0, 0, 0, 0.8);
    padding: 16px;
    /* Espacio para que no toque las orillas en el cel */
    align-items: center;
    justify-content: center;
}

/* Asegurar que el mapa no se vea gris al abrir */
#map {
    height: 350px;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    /* Evita que las esquinas del mapa se salgan del redondeo */
}

/* Badge de advertencia estilo Android */
.badge-cobertura {
    background-color: #fffaf0;
    color: #ed8936;
    border: 1px solid #fbd38d;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: bold;
    margin-bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Contenedor para un solo negocio (Vista destacada) */
.single-business-card {
    max-width: 320px;
    margin: 40px auto;
    text-align: center;
}

.single-business-card img {
    width: 200px;
    height: 200px;
    margin: 0 auto 16px;
}

/* Asegurar contraste en la tabla */
.comparison-table th {
    color: #1f2937 !important;
    /* gray-800 */
    font-weight: 700 !important;
}

.comparison-table td {
    color: #374151 !important;
    /* gray-700 */
}

/* Mejorar los badges */
.badge-success {
    background-color: #10b981;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
}

.badge-danger {
    background-color: #ef4444;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Agrega esto en la sección de estilos de ambas páginas */
.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
    /* Scroll suave en iOS */
    scrollbar-width: thin;
    /* Para Firefox */
    scrollbar-color: #cbd5e0 transparent;
    /* Color del scroll */
}

.overflow-x-auto::-webkit-scrollbar {
    height: 6px;
    /* Altura del scrollbar horizontal */
}

.overflow-x-auto::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.overflow-x-auto::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.overflow-x-auto::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Mejora el responsive para las tablas */
@media (max-width: 768px) {
    .comparison-table {
        margin-left: -16px;
        margin-right: -16px;
        border-radius: 0;
    }

    .comparison-table table {
        font-size: 0.875rem;
        /* Texto un poco más pequeño en móviles */
    }
}

/* Agrega en tu CSS */
.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Estados de progreso */
.estado-activo {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

/* Estilos para la barra de progreso */
.progress-container {
    position: relative;
    height: 4px;
    background-color: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    position: absolute;
    height: 100%;
    transition: width 0.5s ease, background-color 0.5s ease;
}

/* Estilos para los pasos */
.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    transition: all 0.3s ease;
}

.step-dot.active {
    border-color: #3b82f6;
    background-color: #3b82f6;
    color: white;
}

.step-dot.completed {
    border-color: #10b981;
    background-color: #10b981;
    color: white;
}

.step-dot.cancelled {
    border-color: #ef4444;
    background-color: #ef4444;
    color: white;
}

/* Banner tipo toast */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 400px;
    width: calc(100% - 40px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cookie-banner.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Modal centrado (mejorado) */
.cookie-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.cookie-modal.show {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ===== SISTEMA DE COOKIES (TOAST) ===== */
:root {
    --almitech: #192137;
    --color_azul: #3b82f6;
    --toast-bg: #ffffff;
    --toast-text: #1f2937;
    --toast-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Toast flotante */
.cookie-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    max-width: 360px;
    width: auto;
    min-width: 280px;
    background: var(--toast-bg);
    border-radius: 20px;
    box-shadow: var(--toast-shadow);
    z-index: 9999;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.cookie-toast.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.cookie-toast .toast-content {
    padding: 20px;
    position: relative;
}

.cookie-toast .toast-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cookie-toast .toast-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-toast .toast-title i {
    font-size: 22px;
    color: var(--color_azul);
}

.cookie-toast .toast-title h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--toast-text);
    margin: 0;
}

.cookie-toast .close-toast {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    line-height: 1;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.cookie-toast .close-toast:hover {
    background: #f3f4f6;
    color: #4b5563;
}

.cookie-toast p {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 16px;
    line-height: 1.5;
    padding-right: 20px;
}

.cookie-toast .toast-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.cookie-toast .toast-btn {
    padding: 8px 16px;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.cookie-toast .toast-btn-outline {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #4b5563;
}

.cookie-toast .toast-btn-outline:hover {
    background: #f9fafb;
}

.cookie-toast .toast-btn-primary {
    background: var(--almitech);
    color: white;
}

.cookie-toast .toast-btn-primary:hover {
    background: #2d3748;
}

/* Modal de configuración */
.cookie-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.cookie-modal.show {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.cookie-modal .modal-content {
    background: white;
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Toggles */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.cookie-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.cookie-slider {
    background-color: #10b981;
}

input:checked+.cookie-slider:before {
    transform: translateX(30px);
}

input:disabled+.cookie-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive: en móviles muy pequeños, el toast ocupa casi todo el ancho */
@media (max-width: 480px) {
    .cookie-toast {
        left: 16px;
        right: 16px;
        max-width: none;
        bottom: 16px;
    }
}

/* TOAST CENTRADO ARRIBA */
body .cookie-toast {
    position: fixed !important;
    top: 24px !important;
    /* Cambiado de bottom a top */
    left: 50% !important;
    transform: translateX(-50%) translateY(-20px) !important;
    /* Centrado horizontal */
    max-width: 450px !important;
    width: 90% !important;
    background: #ffffff !important;
    border-radius: 20px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
    z-index: 999999 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    display: block !important;
}

body .cookie-toast.show {
    transform: translateX(-50%) translateY(0) !important;
    /* Baja suavemente */
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ajuste para que el modal de configuración también se vea bien con el toast arriba */
.cookie-modal .modal-content {
    margin-top: 20px;
}