/* custom_styles.css - v15.0 Clean Architecture & Soft UI */

/* ==========================================================================
   1. VARIABLES GLOBALES Y RESET
   ========================================================================== */
:root {
  --bg-body: #f3f4f6;
  --bg-card: #ffffff;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --primary: #2563eb;
  --accent: #f59e0b;
  --danger: #ef4444;
  --success: #10b981;
  --header-bg: #ffffff;
  --nav-bg: #ffffff;
  --app-width: 600px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

html, body {
  overscroll-behavior-y: none;
}

body {
  font-family: 'Roboto', sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  margin: 0;
  display: flex;
  justify-content: center;
  padding-bottom: 90px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

input, select, textarea, button {
  font-family: 'Roboto', sans-serif !important;
}

input, textarea {
  -webkit-user-select: auto;
  user-select: auto;
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
}

/* ==========================================================================
   2. ESTRUCTURA PRINCIPAL Y CABECERA
   ========================================================================== */
#main-wrapper {
  width: 100%;
  max-width: var(--app-width);
  min-height: 100vh;
  position: relative;
  padding-top: 60px;
}

header {
  background: var(--header-bg);
  padding: 10px 15px;
  position: fixed;
  top: 0;
  width: 100%;
  max-width: var(--app-width);
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header img {
  height: 45px;
  object-fit: contain;
}

.header-brand { display: flex; align-items: center; gap: 10px; }
.header-actions { display: flex; align-items: center; gap: 10px; }

.container {
  padding: 15px;
  width: 100%;
}

.pb-30 { padding-bottom: 30px; }
.pb-50 { padding-bottom: 50px; }

/* ==========================================================================
   3. BUSCADOR PREMIUM Y FILTROS
   ========================================================================== */
.search-widget { margin-bottom: 20px; overflow: hidden; border: none; border-radius: 16px; background: white; box-shadow: 0 4px 15px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.02); }
.search-widget-header { padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: background 0.2s; }
.search-widget-title-group { display: flex; align-items: center; gap: 14px; }
.search-icon-wrapper { width: 42px; height: 42px; border-radius: 12px; background: #eff6ff; color: #2563eb; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.search-title { display: block; font-weight: 800; color: #1e293b; font-size: 1.05rem; line-height: 1.2; }
.search-subtitle { display: block; font-weight: 600; color: #94a3b8; font-size: 0.8rem; margin-top: 2px; }
.search-toggle-btn { width: 32px; height: 32px; border-radius: 50%; background: #f8fafc; border: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: center; color: #64748b; flex-shrink: 0; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.search-toggle-icon { transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); font-size: 0.85rem; }
.search-body { padding: 20px; background: #f8fafc; border-top: 1px solid #f1f5f9; animation: fadeIn 0.3s; }
.search-input-main { background: white !important; border: 1px solid #e2e8f0 !important; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02) !important; width: 100% !important; padding: 12px !important; margin-bottom: 15px !important; border-radius: 8px !important; }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 15px; }
.filter-input { background: white !important; border: 1px solid #e2e8f0 !important; margin-bottom: 0 !important; }
.btn-show-cal { width: 100%; border: 1px solid #bfdbfe; background: #eff6ff; color: #1e40af; font-weight: bold; margin-bottom: 0; }
.cal-widget-container { padding: 15px; margin-top: 15px; border: 1px solid #e2e8f0; border-radius: 12px; background: white; box-shadow: 0 4px 6px rgba(0,0,0,0.02); }
.cal-widget-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cal-nav-btn { background: #f1f5f9; color: #475569; width: 34px; height: 34px; border: none; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center;}
.cal-month-title { margin: 0; color: #1e293b; text-transform: capitalize; font-size: 1.05rem; font-weight: 800; }
.btn-hide-cal { width: 100%; margin-top: 15px; border: none; background: #f1f5f9; color: #475569; }
.btn-clear-filter { width: 100%; margin-bottom: 15px; font-weight: bold; }

/* Selector Personalizado */
.custom-select { width: 100%; padding: 12px; border: 1px solid #d1d5db; border-radius: 8px; box-sizing: border-box; font-size: 1rem; background: white; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.custom-select span { color: var(--text-main); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.custom-select span.placeholder { color: #9ca3af; font-weight: normal; }
.form-select-wrapper { flex: 1; position: relative; }
.custom-select-modal { margin-bottom: 15px; padding: 12px; }
.select-text { font-size: 0.9rem; }
.select-icon { color: #9ca3af; font-size: 0.8rem; }

/* ==========================================================================
   4. TARJETAS DE RUTAS Y MIS RUTAS
   ========================================================================== */
.card { background: var(--bg-card); border-radius: 16px; margin-bottom: 15px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); overflow: hidden; border: 1px solid #e5e7eb; position: relative; }
.card-header { padding: 12px 15px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.card-body { padding: 15px; }
.card-footer { padding: 10px 15px; background: #f9fafb; display: flex; gap: 8px; border-top: 1px solid #f3f4f6; flex-wrap: wrap; }
.card-details { display: none; padding-top: 10px; border-top: 1px dashed #eee; margin-top: 10px; animation: fadeIn 0.3s; }
.expanded-icon { transform: rotate(180deg); }
.club-logo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.event-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.meta-item { background: #f3f4f6; padding: 10px; border-radius: 10px; font-size: 0.85rem; display: flex; align-items: center; gap: 8px; font-weight: 600; color: #4b5563; }

.ruta-mis-card { margin-bottom: 16px; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 16px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); overflow: hidden; }
.ruta-mis-header { padding: 18px 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ruta-mis-title-box { flex: 1; min-width: 0; }
.ruta-mis-title { margin: 0 0 6px 0; font-size: 1.15rem; color: #1e293b; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ruta-mis-meta { display: flex; gap: 12px; font-size: 0.8rem; color: #64748b; font-weight: 500; }
.ruta-mis-meta-item { display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ruta-mis-stats { display: flex; flex-direction: column; align-items: center; justify-content: center; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; padding: 10px 14px; min-width: 65px; flex-shrink: 0; }
.ruta-mis-stats-num { font-size: 1.5rem; font-weight: 900; color: #16a34a; line-height: 1; }
.ruta-mis-stats-lbl { font-size: 0.65rem; font-weight: 800; color: #15803d; text-transform: uppercase; margin-top: 4px; letter-spacing: 0.5px; }
.ruta-mis-actions { padding: 12px 16px; background: #f8fafc; border-top: 1px solid #f1f5f9; display: flex; gap: 8px; }

.ruta-pub-price { grid-column: span 2; background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.ruta-pub-footer-priv-pen { width: 100%; display: flex; align-items: center; justify-content: space-between; background: #fef3c7; padding: 10px 15px; border-radius: 0 0 16px 16px; border-top: 1px solid #fde68a; }
.ruta-pub-priv-txt { display: flex; align-items: center; gap: 8px; color: #b45309; font-weight: bold; font-size: 0.85rem; }
.ruta-pub-btn-cancel { background: #f59e0b; color: white; border: none; width: auto; padding: 8px 15px; font-size: 0.85rem; margin: 0; flex: none; box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3); }
.ruta-pub-footer-priv-req { width: 100%; display: flex; align-items: center; justify-content: space-between; background: #d1d5db; padding: 10px 15px; border-radius: 0 0 16px 16px; border-top: 1px solid #9ca3af; }
.ruta-pub-priv-req-txt { display: flex; align-items: center; gap: 8px; color: #374151; font-weight: bold; font-size: 0.85rem; }
.ruta-pub-btn-req { background: #1f2937; color: white; border: none; width: auto; padding: 8px 15px; font-size: 0.85rem; margin: 0; flex: none; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.ruta-pub-club-name { display: flex; align-items: center; gap: 5px; }
.ruta-pub-badges-row { display: flex; gap: 5px; margin-top: 3px; align-items: center; }
.ruta-pub-right-icons { display: flex; align-items: center; }
    
.ruta-pub-dest-sum { font-weight: bold; color: #4b5563; margin-top: 3px; }
.ruta-pub-date-badge { position: absolute; top: 15px; right: 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid rgba(0,0,0,0.08); border-radius: 10px; padding: 6px 0; width: 55px; box-shadow: 0 3px 6px rgba(0,0,0,0.15); }
.ruta-pub-date-day { font-size: 1.3rem; font-weight: 900; line-height: 1; }
.ruta-pub-date-mon { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; margin-top: 2px; opacity: 0.9; }
.ruta-pub-aviso-box { background: #fef2f2; border: 1px solid #fecaca; padding: 10px; border-radius: 8px; color: #dc2626; font-size: 0.85rem; margin-bottom: 12px; }

/* ==========================================================================
   5. BOTONES DE ACCIÓN
   ========================================================================== */
.btn { border: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; cursor: pointer; flex: 1; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 45px; }
.btn-main { background: #475569; color: white; }
.btn-sec { background: white; border: 1px solid #d1d5db; color: var(--text-main); }
.btn-del { background: #fee2e2 !important; color: #dc2626 !important; border: 1px solid #fecaca !important; }

.ruta-btn { flex: 1; height: 42px; border: none; border-radius: 10px; font-size: 1.15rem; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; position: relative; }
.ruta-btn-aviso { background: #ffedd5; color: #ea580c; }
.ruta-btn-part { background: #dbeafe; color: #2563eb; }
.ruta-btn-chat { background: #f3e8ff; color: #9333ea; }
.ruta-btn-edit { background: #e2e8f0; color: #475569; }
.ruta-btn-del { background: #fee2e2; color: #dc2626; }

.btn-apoyo { background: #fef08a; color: #854d0e; border: 1px solid #fde047; border-radius: 20px; padding: 6px 12px; font-size: 0.85rem; font-weight: bold; cursor: pointer; box-shadow: 0 2px 4px rgba(0,0,0,0.05); display: flex; align-items: center; gap: 6px; transition: transform 0.2s; }
.btn-apoyo:hover { transform: scale(1.05); }

.sos-btn-header { background: #dc2626; color: white; border: none; border-radius: 50%; width: 40px; height: 40px; font-weight: bold; font-size: 0.8rem; cursor: pointer; animation: pulse 2s infinite; }
.btn-sos-sq { aspect-ratio: 1 / 1 !important; border-radius: 14px !important; display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important; gap: 12px !important; color: white !important; border: none !important; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15) !important; padding: 15px !important; }
.btn-sos-sq i { font-size: 2.8rem !important; }
.btn-help-red { background: #dc2626 !important; }
.btn-call-green { background: #10b981 !important; }

.btn-fab { position: fixed !important; bottom: 75px !important; right: 20px !important; width: 46px !important; height: 46px !important; border-radius: 50% !important; background: #475569 !important; color: white !important; border: none !important; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3) !important; display: none; align-items: center !important; justify-content: center !important; font-size: 1.3rem !important; cursor: pointer !important; z-index: 99 !important; opacity: 0.95; transition: transform 0.2s !important; }
.btn-fab:active { transform: scale(0.9) !important; }
.btn-scroll-top { display: none; position: fixed; bottom: 80px; right: 20px; width: 46px; height: 46px; background: #475569; color: white; border-radius: 50%; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,0.3); z-index: 998; cursor: pointer; border: none; opacity: 0.95; }
.btn-scroll-icon { font-size: 1.1rem; }
/* Ajustes Estructurales Modal SOS */
.sos-modal-body { text-align: center; padding: 25px 15px; }
.sos-modal-title { color: #dc2626; margin-bottom: 20px; }
.sos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.btn-close-sos { margin-top: 20px; width: 100%; height: 45px; font-weight: bold; }

/* ==========================================================================
   6. BADGES, ETIQUETAS Y NOTIFICACIONES
   ========================================================================== */
.ruta-pub-badge { font-size: 0.65rem; padding: 2px 6px; border-radius: 4px; font-weight: bold; letter-spacing: 0.5px; display: inline-flex; align-items: center; height: 18px; line-height: 1; white-space: nowrap; }
.ruta-pub-badge-new { background: #f97316; color: white; }
.ruta-pub-badge-pen { background: #f59e0b; color: white; }
.ruta-pub-badge-ok { background: #10b981; color: white; }
.badge-solicitudes { margin-top: 8px; }
.badge-sol-inner { display: inline-flex; align-items: center; gap: 4px; background: #fffbeb; color: #d97706; border: 1px solid #fde68a; padding: 4px 10px; border-radius: 12px; font-size: 0.7rem; font-weight: bold; }
.notif-dot { position: absolute; top: -5px; right: -5px; background: #ef4444; color: white; border-radius: 50%; width: 18px; height: 18px; font-size: 0.65rem; display: flex; align-items: center; justify-content: center; font-weight: bold; border: 2px solid white; box-shadow: 0 2px 4px rgba(0,0,0,0.1); z-index: 10; }
/* Campana de Avisos: Fondo Blanco, Icono Rojo y Vibración Seca */
/* Campana de Avisos: Fondo Blanco Limpio con Vibración Intermitente */
.bell-icon {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: #ffffff !important; /* Fondo blanco sólido */
    width: 32px;
    height: 32px;
    border: none !important; /* 🔥 Quitamos el borde por completo */
    border-radius: 50%; 
    color: #ef4444 !important; /* Icono rojo seco */
    cursor: pointer;
    margin-left: 10px;
    box-shadow: none !important; /* Sin brillos */
    
    /* Animación de 3 segundos: vibra un poco y se detiene el resto del tiempo */
    animation: vibra-y-pausa 3s infinite ease-in-out; 
}

.bell-icon i {
    font-size: 0.9rem !important; /* Icono un poco más nítido */
}

/* Definición de la Vibración Intermitente */
@keyframes vibra-y-pausa {
    0% { transform: rotate(0); }
    2% { transform: rotate(15deg); }  /* Antes era 5% */
    4% { transform: rotate(-15deg); } /* Antes era 10% */
    6% { transform: rotate(10deg); }  /* Antes era 15% */
    8% { transform: rotate(-10deg); } /* Antes era 20% */
    10% { transform: rotate(0); }     /* Antes era 25% */
    100% { transform: rotate(0); }
}

/* ==========================================================================
   7. LISTAS SOCIALES Y CLUBES
   ========================================================================== */
.soc-gestion-title { margin-bottom: 15px; color: var(--text-main); }
.soc-search-wrapper { position: relative; margin-bottom: 20px; }
.soc-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9ca3af; }
.soc-search-input { width: 100%; padding: 12px 12px 12px 40px; border-radius: 12px; border: 1px solid #e5e7eb; font-size: 0.95rem; outline: none; box-shadow: 0 2px 4px rgba(0,0,0,0.02); margin-bottom: 0; }
.soc-mem-card { background: white; border-radius: 12px; padding: 12px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); border: 1px solid #e5e7eb; }
.soc-mem-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; cursor: pointer; }
.soc-mem-img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary); flex-shrink: 0; }
.soc-mem-info { flex: 1; min-width: 0; }
.soc-mem-name { color: var(--text-main); font-size: 0.95rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-mem-loc { color: #6b7280; font-size: 0.75rem; display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.soc-mem-loc-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-mem-moto { color: #9ca3af; font-size: 0.75rem; font-weight: 500; }
.soc-mem-right { flex-shrink: 0; }
.soc-btn-req { background: #fff7ed; color: #ea580c; border: 1px solid #fdba74; border-radius: 6px; padding: 6px 10px; font-size: 0.8rem; font-weight: 700; cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: 1.2; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.soc-actions-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.soc-btn-wa { background: #25D366; color: white; border: none; border-radius: 6px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; cursor: pointer; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.soc-btn-call { background: #475569; color: white; border: none; border-radius: 6px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; cursor: pointer; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.soc-btn-sos { background: #dc2626; color: white; border: none; border-radius: 6px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; cursor: pointer; box-shadow: 0 2px 4px rgba(220,38,38,0.3); }
.soc-btn-del { background: white; color: #9ca3af; border: 1px solid #d1d5db; border-radius: 6px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; cursor: pointer; }
.soc-badge-new { background: #fef3c7; color: #b45309; font-size: 0.65rem; padding: 2px 6px; border-radius: 4px; font-weight: bold; margin-left: 5px; vertical-align: middle; }

.soc-club-title { margin-top: 5px; margin-bottom: 20px; color: var(--text-main); }
.soc-club-card-inner { padding: 15px; display: flex; align-items: center; justify-content: space-between; }
.soc-club-left { display: flex; align-items: center; gap: 12px; }
.soc-club-logo { width: 50px; height: 50px; }
.soc-club-name { font-size: 1.05rem; }
.soc-club-btn { flex: none; width: auto; margin: 0; padding: 8px 15px; }
.soc-club-prov { font-size: 0.75rem; margin-top: 2px; opacity: 0.9; }

/* ==========================================================================
   8. MODALS & FORMS
   ========================================================================== */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); z-index: 2000; padding: 20px; overflow-y: auto; }
.modal-content { background: white; border-radius: 16px; width: 100%; max-width: 500px; margin: 40px auto; padding: 20px; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2); }
.form-row { display: flex; gap: 10px; }
.form-col { flex: 1; min-width: 0; }
.form-row-mb { display: flex; gap: 10px; margin-bottom: 15px; }
.input-maps { margin-bottom: 0; flex: 1; }
.btn-maps { width: auto; margin: 0; padding: 0 15px; }
.cost-section { display: flex; gap: 10px; margin-top: 5px; margin-bottom: 15px; padding: 10px; background: #f0fdf4; border-radius: 8px; border: 1px solid #bbf7d0; }
.cost-label { color: #166534; font-size: 0.8rem; }
.cost-input { margin-bottom: 0; }
.cost-select { margin-bottom: 0; padding: 12px; border-color: #bbf7d0; background: white; }
.cost-select-text { font-size: 0.8rem; }
.req-label { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 5px; }
.req-hint { font-size: 0.75rem; color: var(--primary); font-weight: 600; }
.modal-header-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.btn-pdf { flex: none; width: auto; padding: 0 15px; height: 35px; margin: 0; font-size: 0.8rem; }
.btn-close-full { width: 100%; margin-top: 15px; }

/* Modal Rider */
.rider-modal-body { text-align: center; padding: 30px 20px; }
.modal-close-icon { position: absolute; right: 20px; top: 15px; font-size: 1.8rem; cursor: pointer; color: #9ca3af; }
.rider-profile-img { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; margin-bottom: 15px; border: 3px solid var(--primary); box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.rider-name-title { margin: 0 0 5px 0; color: var(--text-main); }
.rider-contact-info { margin: 0 0 15px 0; color: var(--text-muted); font-size: 0.9rem; }
.medical-info-box { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; padding: 12px; border-radius: 8px; margin-bottom: 15px; font-size: 0.85rem; text-align: left; }
.garage-section { text-align: left; }
.garage-title { margin: 0 0 10px 0; color: var(--text-main); font-size: 0.95rem; }
.garage-info-box { background: #f9fafb; padding: 12px; border-radius: 8px; font-size: 0.85rem; border: 1px solid #e5e7eb; }

/* Modal Aviso */
.aviso-title { color: var(--danger); margin-top: 0; }
.aviso-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 15px; }
.aviso-textarea { border: 1px solid #fca5a5; background: #fff5f5; }
.modal-action-row { display: flex; gap: 10px; margin-top: 15px; }
.btn-send-aviso { background: var(--danger); }
.aviso-urgent-modal { border-top: none !important; }
.aviso-urgent-body { background: #fef2f2; padding: 20px; border-radius: 12px; font-weight: 700; color: #991b1b; white-space: pre-wrap; }
.btn-aviso-ok { background: var(--danger); margin-top: 15px; width: 100%; }

/* Modal Chat & Reqs */
.reqs-body-box { background: #f9fafb; padding: 15px; border-radius: 10px; font-weight: 600; color: #4b5563; min-height: 100px; }
.req-list { margin: 0; padding-left: 20px; list-style-type: disc; }
.req-item { margin-bottom: 8px; }
.chat-box { max-height: 300px; overflow-y: auto; margin-bottom: 15px; background: #f9fafb; padding: 10px; border-radius: 8px; }
.chat-input-row { display: flex; gap: 5px; }
.chat-input { margin: 0; }
.btn-close-chat { width: 100%; margin-top: 10px; }
.chat-msg-row { margin-bottom: 10px; padding: 8px; border-radius: 8px; background: white; border: 1px solid #eee; }
.chat-msg-del { float: right; color: #dc2626; cursor: pointer; padding: 2px 5px; }
.chat-msg-author { color: var(--primary); font-weight: bold; display: block; }

/* Modal Join Moto */
.moto-join-modal { text-align: center; }
.moto-join-title { margin-top: 0; }
.moto-select-label { display: block; text-align: left; font-weight: 600; margin-bottom: 5px; color: #4b5563; }
.moto-select-box { margin-bottom: 15px; padding: 12px; }
.moto-join-hr { margin: 15px 0; border: 0; border-top: 1px dashed #cbd5e1; }
.copiloto-check-label { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: bold; cursor: pointer; color: var(--primary); background: #eff6ff; padding: 10px; border-radius: 8px; }
.copiloto-check { width: auto; margin: 0; transform: scale(1.3); }
.copiloto-form { margin-top: 15px; text-align: left; background: #f8fafc; padding: 15px; border-radius: 8px; border: 1px solid #e2e8f0; }
.copiloto-label { font-size: 0.85rem; font-weight: bold; color: #4b5563; }
.copiloto-input { margin-bottom: 10px; }
.copiloto-select { margin-bottom: 0; padding: 12px; background: white; }
.copiloto-input-mb0 { margin-bottom: 0; }
.btn-confirm-join { width: 100%; margin-top: 20px; background: #2563eb; padding: 16px; font-size: 1.05rem; font-weight: 800; border-radius: 10px; box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2); letter-spacing: 0.5px; }
.btn-cancel-join { width: 100%; margin-top: 12px; padding: 14px; border-radius: 10px; font-weight: 600; }

/* Modal Map & Picker */
.map-modal-wrapper { padding: 0; overflow: hidden; display: flex; flex-direction: column; height: 75vh; max-height: 600px; }
.map-modal-header { padding: 12px 20px; background: var(--bg-card); display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; }
.map-modal-title { margin: 0; color: var(--text-main); font-size: 1.1rem; }
.map-close-btn { font-size: 2.2rem; cursor: pointer; color: var(--text-muted); padding: 5px 10px; line-height: 0.8; transition: 0.2s; }
.map-frame-wrapper { flex: 1; position: relative; background: #eee; }
.map-frame { width: 100%; height: 100%; border: none; }
.map-modal-footer { padding: 15px; background: white; border-top: 1px solid #eee; }
.map-ext-link { text-decoration: none; width: 100%; justify-content: center; margin: 0; display: flex; align-items: center; gap: 8px; }
.picker-header { padding: 15px; background: var(--bg-card); display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; }
.picker-title { margin: 0; color: var(--text-main); }
.picker-close { font-size: 1.8rem; cursor: pointer; color: var(--text-muted); }
.picker-search-area { padding: 10px; background: #fff; border-bottom: 1px solid #eee; display: flex; flex-direction: column; gap: 8px; position: relative; }
.picker-search-row { display: flex; gap: 8px; }
.picker-input { margin: 0; flex: 1; padding: 10px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 0.9rem; }
.picker-btn-search { flex: none; width: 45px; height: 45px; margin: 0; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.picker-results { background: white; border: 1px solid #d1d5db; border-radius: 8px; max-height: 200px; overflow-y: auto; position: absolute; top: 55px; left: 10px; right: 10px; z-index: 1000; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.picker-controls { padding: 8px 10px; background: #eff6ff; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #dbeafe; }
.picker-hint { font-size: 0.8rem; color: var(--primary); font-weight: bold; }
.picker-btn-group { display: flex; gap: 8px; }
.picker-btn-small { padding: 6px 10px; font-size: 0.8rem; margin: 0; border-radius: 6px; }
.picker-map-area { flex: 1; width: 100%; z-index: 1; }
.picker-footer { padding: 15px; background: white; display: flex; gap: 10px; }

/* Modal PDF */
.pdf-modal-overlay { align-items: center; justify-content: center; backdrop-filter: blur(8px); padding: 15px; z-index: 9999; }
.pdf-modal-wrapper { padding: 0; overflow: hidden; display: flex; flex-direction: column; height: 85vh; max-height: 900px; width: 100%; max-width: 1100px; border-radius: 20px; box-shadow: 0 20px 40px rgba(0,0,0,0.4); margin: 0 auto; background: #e2e8f0; border: 1px solid rgba(255,255,255,0.2); }
.pdf-header { padding: 14px 20px; background: #0f172a; display: flex; justify-content: space-between; align-items: center; border-radius: 20px 20px 0 0; border-bottom: 2px solid #1e293b; }
.pdf-title-group { display: flex; align-items: center; gap: 12px; }
.pdf-icon { color: #ef4444; font-size: 1.8rem; filter: drop-shadow(0 2px 6px rgba(239,68,68,0.4)); }
.pdf-title-texts { display: flex; flex-direction: column; }
.pdf-title-main { color: white; font-size: 1.15rem; font-weight: 900; letter-spacing: 0.5px; margin-bottom: 2px; line-height: 1; }
.pdf-title-sub { color: #38bdf8; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; }
.pdf-actions { display: flex; gap: 8px; align-items: center; }
.pdf-btn-print { background: transparent; color: #94a3b8; padding: 0; width: 38px; height: 38px; margin: 0; border: 1px solid #334155; border-radius: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; }
.pdf-btn-close { background: rgba(239, 68, 68, 0.1); color: #ef4444; width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1.2rem; border: 1px solid rgba(239, 68, 68, 0.2); transition: 0.2s; }
.pdf-body-area { flex: 1; position: relative; background: #525659; display: flex; justify-content: center; align-items: center; }
.pdf-loader-box { display: flex; flex-direction: column; align-items: center; color: white; gap: 15px; }
.pdf-loader-icon { font-size: 3.5rem; color: #38bdf8; }
.pdf-loader-text { font-weight: 500; letter-spacing: 1px; font-size: 1.1rem; }
.pdf-iframe { width: 100%; height: 100%; border: none; background: #525659; display: none; }

/* Modal Opciones */
.opciones-modal-overlay { align-items: flex-end; z-index: 3000; padding: 0; }
.opciones-modal-wrapper { max-height: 60vh; height: auto; display: flex; flex-direction: column; margin: 0 auto 25px auto; width: calc(90% - 40px); max-width: 500px; border-radius: 20px; padding: 20px; overflow: hidden; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
.opciones-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.opciones-title { margin: 0; font-size: 1.2rem; color: var(--text-main); }
.opciones-close { font-size: 1.8rem; cursor: pointer; color: #9ca3af; line-height: 1; }
.opciones-search-box { margin-bottom: 15px; }
.opciones-search-inner { display: flex; align-items: center; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 12px; padding: 0 12px; }
.opciones-search-icon { color: #9ca3af; }
.opciones-search-input { border: none; background: transparent; margin: 0; padding: 12px 10px; outline: none; flex: 1; box-shadow: none; }
.opciones-list-area { flex: 1; overflow-y: auto; padding-right: 5px; }
.opcion-item { margin: 0 15px 8px 15px; padding: 12px 16px; border-radius: 10px; border: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: center; cursor: pointer; background: white; box-shadow: 0 1px 2px rgba(0,0,0,0.02); }
.opcion-item.selected { border-color: #bfdbfe; background: #eff6ff; }
.opcion-text { font-weight: 500; color: var(--text-main); font-size: 1rem; }
.opcion-text.selected { font-weight: bold; color: var(--primary); }
.opcion-check { color:var(--primary); font-size:1.1rem; }

/* Modal Donacion */
.donacion-modal-overlay { align-items: center; z-index: 4000; padding: 25px; }
.donacion-modal-content { max-width: 380px; text-align: center; padding: 35px 25px 25px 25px; border-radius: 24px; position: relative; overflow: hidden; background: white; }
.donacion-bg-shape { position: absolute; top: -50px; left: 50%; transform: translateX(-50%); width: 120px; height: 120px; background: #f0f9ff; border-radius: 50%; z-index: 0; }
.donacion-icon { font-size: 3.5rem; color: #00457C; margin-bottom: 15px; position: relative; z-index: 1; }
.donacion-title { margin: 0 0 15px 0; font-size: 1.4rem; font-weight: 900; position: relative; z-index: 1; line-height: 1.2; color: #1e293b; }
.donacion-title-gradient { background: linear-gradient(90deg, #0079C1, #00457C); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-size: 1.9rem; text-transform: uppercase; letter-spacing: 1px; }
.donacion-text { color: #64748b; font-size: 0.95rem; line-height: 1.5; margin-bottom: 25px; position: relative; z-index: 1; }
.donacion-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 15px; position: relative; z-index: 1; }
.btn-donate-amount { background: white; border: 2px solid #e2e8f0; border-radius: 12px; padding: 10px 0; font-weight: bold; color: #475569; font-size: 1rem; cursor: pointer; transition: 0.2s; }
.btn-donate-amount:hover { border-color: #0079C1; color: #0079C1; }
.btn-donate-amount-primary { background: #0079C1; border: 2px solid #0079C1; border-radius: 12px; padding: 10px 0; font-weight: bold; color: white; font-size: 1rem; cursor: pointer; box-shadow: 0 4px 10px rgba(0, 121, 193, 0.3); transition: 0.2s; transform: scale(1.05); }
.btn-donate-free { width: 100%; background: transparent; border: 1px dashed #cbd5e1; border-radius: 12px; padding: 12px; font-weight: bold; color: #64748b; cursor: pointer; margin-bottom: 20px; transition: 0.2s; position: relative; z-index: 1; }
.btn-donate-free:hover { background: #f8fafc; }
.btn-donate-close { width: 100%; margin: 0; background: #f1f5f9; border: none; color: #94a3b8; font-weight: bold; position: relative; z-index: 1; }

/* ==========================================================================
   9. NAVEGACIÓN Y CALENDARIO
   ========================================================================== */
.nav-bar { position: fixed; bottom: 0; left: 0; width: 100%; background: #ffffff; border-top: 1px solid #e5e7eb; display: flex; justify-content: space-around; padding: 8px 0; z-index: 1000; }
@media (min-width: 601px) { .nav-bar { left: 50%; transform: translateX(-50%); width: var(--app-width); } }
.nav-item { color: #9ca3af; text-align: center; font-size: 0.75rem; cursor: pointer; flex: 1; text-decoration: none; }
.nav-item i { display: block; font-size: 1.2rem; margin-bottom: 2px; }
.nav-item.active { color: var(--primary); font-weight: bold; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; }
.cal-day { 
    aspect-ratio: 1 / 1; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    border-radius: 12px; 
    font-size: 0.95rem; 
    cursor: pointer; 
    transition: background 0.2s, transform 0.1s; 
    border: 1px solid transparent; 
    margin: auto; 
    width: 100%; 
    max-width: 42px; 
}
.cal-day:active { transform: scale(0.9); }
.cal-day.empty { visibility: hidden; }
.cal-day.has-event { background: #eff6ff !important; color: #2563eb !important; font-weight: bold; border: 1px solid #bfdbfe; }

/* El puntito indicador de ruta */
.cal-day.has-event::after { 
    content: ""; 
    display: block; 
    width: 4px; 
    height: 4px; 
    background: #2563eb; 
    border-radius: 50%; 
    margin-top: 3px; 
}

/* ==========================================================================
   10. UTILIDADES GLOBALES (EXTRAÍDAS DE JS Y HTML)
   ========================================================================== */
.hidden { display: none !important; }
.swal2-container { z-index: 9999 !important; }
.color-blue { color: #3b82f6; }
.color-green { color: #16a34a; }
.color-red { color: #ef4444; }
.text-center { text-align: center; }
.p-40 { padding: 40px; }
.p-20 { padding: 20px; }
.color-muted { color: #9ca3af; }
.fw-500 { font-weight: 500; }
.w-100 { width: 100%; }

/* Fix Selectores Flatpickr Nativos */
input[type="date"], input[type="time"] { display: none !important; }
.flatpickr-input.form-control { background-color: #ffffff !important; cursor: pointer !important; }

/* ==========================================================================
   11. SELECTOR TIPO RODILLO (WHEEL PICKER)
   ========================================================================== */
.roller-modal-overlay { 
    align-items: center; 
    justify-content: center; 
    padding: 20px; 
    z-index: 4000; 
    display: none; 
    position: fixed; /* Asegura que cubra toda la pantalla */
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
}

.roller-modal-content { 
    width: 100%; 
    border-radius: 24px; 
    background: white; 
    margin: 0 auto; 
    padding: 25px 20px; 
    box-shadow: 0 15px 35px rgba(0,0,0,0.25); 
    animation: popModalCenter 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    max-width: 380px; 
}

.roller-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.roller-title { margin: 0; font-size: 1.15rem; color: #1e293b; font-weight: 800; }

/* Estilos para los números (Valores del Rodillo) */
.roller-val {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px !important; /* 🔥 Tamaño solicitado */
    font-weight: 400 !important; /* 🔥 Peso solicitado */
    color: #334155;
    scroll-snap-align: center;
}

.roller-wrapper { 
    position: relative; 
    display: flex; 
    height: 150px; 
    background: #f8fafc; 
    border-radius: 12px; 
    overflow: hidden; 
    margin-bottom: 20px; 
    border: 1px solid #e2e8f0; 
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.02); 
}

.roller-overlay { 
    position: absolute; 
    top: 50px; 
    left: 0; 
    width: 100%; 
    height: 50px; 
    background: rgba(37, 99, 235, 0.1); 
    border-top: 1px solid rgba(37, 99, 235, 0.3); 
    border-bottom: 1px solid rgba(37, 99, 235, 0.3); 
    pointer-events: none; 
    z-index: 2; 
}

.roller-col { 
    flex: 1; 
    height: 100%; 
    overflow-y: scroll; 
    scroll-snap-type: y mandatory; 
    scrollbar-width: none; 
    -ms-overflow-style: none; 
    z-index: 1; 
}

.roller-col::-webkit-scrollbar { display: none; }

/* Animación de entrada desde el centro */
@keyframes popModalCenter {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   12. DISEÑO PREMIUM PARA EL CALENDARIO (FLATPICKR)
   ========================================================================== */

/* Animación especial para mantener el centro exacto */
@keyframes popInCenter {
    from { transform: translate(-50%, -50%) scale(0.9); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Forzar al calendario a comportarse como un Modal Centrado */
.flatpickr-calendar.open {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(1) !important;
    z-index: 9999 !important;
    background: #ffffff !important;
    border-radius: 24px !important;
    padding: 15px 10px !important;
    /* 🔥 EL TRUCO MAGICO: Una sombra gigante que sirve de fondo oscuro 🔥 */
    box-shadow: 0 15px 35px rgba(0,0,0,0.2), 0 0 0 2000px rgba(0,0,0,0.6) !important; 
    border: none !important;
    width: calc(100% - 40px) !important;
    max-width: 360px !important;
    animation: popInCenter 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-family: 'Roboto', sans-serif !important;
}

/* 🔥 Elimina la flecha del globo (tooltip) por defecto 🔥 */
.flatpickr-calendar:before,
.flatpickr-calendar:after {
    display: none !important;
}

/* Ajustes de la cabecera (Mes y flechas) */
.flatpickr-months .flatpickr-prev-month, 
.flatpickr-months .flatpickr-next-month {
    padding: 15px !important;
    fill: #475569 !important; /* Color de las flechas */
    transform: translateY(8px);
}

.flatpickr-months .flatpickr-month {
    color: #1e293b !important;
    font-size: 1.15rem !important;
    font-weight: 800 !important;
}

/* Días de la semana (L, M, M, J, V...) */
span.flatpickr-weekday {
    color: #9ca3af !important;
    font-weight: 800 !important;
    font-size: 0.8rem !important;
}

/* Los números de los días */
.flatpickr-day {
    border-radius: 12px !important; /* Cuadritos más modernos */
    font-weight: 400 !important;
    color: #334155 !important;
    margin: 2px !important; /* Espacio para que respiren */
}

/* Día seleccionado (Azul intenso con sombra) */
.flatpickr-day.selected, 
.flatpickr-day.selected:hover {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3) !important;
}

/* Día actual (Hoy) */
.flatpickr-day.today {
    border-color: #cbd5e1 !important;
    background: #f8fafc !important;
}

/* ==========================================
   AJUSTE DE BOTONES EN RUTAS PRIVADAS
   ========================================== */
.ruta-pub-btn-req, 
.ruta-pub-btn-cancel {
    width: fit-content !important; /* Obliga al botón a ajustarse solo al texto */
    flex: none !important; /* Evita que el botón se estire como chicle */
    padding: 8px 16px !important; /* Lo hace un poco más compacto */
    white-space: nowrap !important; /* Mantiene el texto en una sola línea */
}

/* Añade una separación de seguridad para que el botón y el candado nunca choquen */
.ruta-pub-footer-priv-req,
.ruta-pub-footer-priv-pen {
    gap: 15px !important; 
}

/* ==========================================
   CORRECCIÓN DEFINITIVA DE MODALES DE MAPA
   ========================================== */

.picker-modal-wrapper,
.map-modal-wrapper {
    display: flex !important;
    flex-direction: column !important;
    height: 80vh !important; /* Un poco más alto para que luzca mejor */
    background-color: #fff !important;
    overflow: hidden !important; /* Evita que el contenido "escape" de las esquinas redondeadas */
}

/* El área donde están los textos y botones (fuera del mapa) */
.picker-modal-content, 
.map-modal-content {
    padding: 20px !important;
    overflow-y: auto !important; /* Si hay mucho texto, permite scroll interno */
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* El mapa propiamente dicho */
#picker-map, 
.picker-map-area,
.map-frame-wrapper {
    flex: 1 !important; /* Esto es lo que "empuja" y rellena el fondo blanco */
    width: 100% !important;
    min-height: 300px !important; 
    background-color: #f3f4f6 !important;
    border-radius: 0px; /* Opcional: para que el mapa se vea más moderno */
}

/* ==========================================
   FIX BUSCADOR DE MAPAS (RESULTADOS)
   ========================================== */

/* Asegura que la lista de resultados flote sobre el mapa */
#picker-search-results {
    position: absolute !important;
    top: 55px !important; /* Justo debajo del input de búsqueda */
    left: 10px !important;
    right: 10px !important;
    background: white !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2) !important;
    z-index: 5000 !important; /* Por encima de todo el contenido del modal */
    max-height: 200px !important;
    overflow-y: auto !important;
}

/* Estilo para cada dirección encontrada en la lista */
.picker-result-item {
    padding: 12px !important;
    border-bottom: 1px solid #eee !important;
    cursor: pointer !important;
    font-size: 0.9rem !important;
    color: #1e293b !important;
}

.picker-result-item:hover {
    background-color: #f1f5f9 !important;
}

.picker-input {
    padding-right: 40px !important; /* Espacio para que el texto no choque con la X */
}

#btn-limpiar-mapa:active {
    color: #94a3b8 !important; /* Se oscurece un poco al tocarlo */
    transform: scale(0.9);
}

.search-input-main {
    padding-right: 45px !important; /* Espacio extra para la X en el buscador principal */
}

#btn-limpiar-eventos:active {
    color: #94a3b8 !important;
    transform: scale(0.9);
}

#btn-limpiar-eventos {
    /* Forzamos el centrado sobre la altura real del input sin márgenes */
    top: 50% !important;
    transform: translateY(-50%) !important;
    right: 15px !important;
    margin: 0 !important;
    display: none; /* Se controla por JS */
}

/* ==========================================
   OPTIMIZACIÓN SUPREMA MODAL DONACIÓN
   ========================================== */

/* Forzamos a que este modal específico sea más ancho */
.donacion-modal-content.modal-content {
    width: 98% !important; /* Casi todo el ancho de la pantalla en móvil */
    max-width: 480px !important;
    padding: 40px 20px !important; /* Mucho más aire interno */
    border-radius: 22px !important; /* Bordes más modernos */
    height:auto !important;
}

/* Ajuste del Título */
.donacion-title {
    font-size: 1.6rem !important;
    margin-bottom: 10px !important;
}

/* Ajuste del Texto */
.donacion-text {
    font-size: 1rem !important;
    line-height: 1.6 !important;
    margin-bottom: 20px !important;
}

/* REPARACIÓN DE BOTONES: Ahora caben perfectamente uno al lado del otro */
.donacion-grid {
    display: flex !important;
    flex-direction: row !important; /* Asegura que estén en fila */
    gap: 18px !important;
    width: 100% !important;
    margin-bottom: 25px !important;
}

.donacion-grid button {
    flex: 1 !important; /* Obliga a los 3 botones a medir exactamente lo mismo */
    height: 55px !important; /* Más altos para que sea imposible no verlos */
    font-size: 1.2rem !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

/* Botón de donación libre más elegante */
.btn-donate-free {
    font-size: 0.95rem !important;
    color: #64748b !important;
    text-decoration: underline !important;
    background: transparent !important;
    margin-bottom: 10px !important;
}

/* ==========================================
   ELIMINAR SOMBRAS Y RESPLANDORES AZULES
   ========================================== */

/* 1. Quitamos la sombra de la tarjeta activa en el registro */
.tipo-card.active {
    box-shadow: none !important;
    transform: none !important; /* También quitamos el pequeño salto si prefieres que sea estático */
}

/* 2. Eliminamos el contorno azul de enfoque en todos los botones e inputs */
button:focus,
input:focus,
select:focus,
textarea:focus,
.btn:focus,
.tipo-card:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* 3. Evitamos el "flash" azul/gris al tocar en celulares (Android/iOS) */
* {
    -webkit-tap-highlight-color: transparent !important;
}

/* 4. Si quieres un efecto de presión más sutil y limpio (sin sombras) */
.tipo-card:active, .btn:active {
    transform: scale(0.98) !important; /* Solo se hunde un poquito, sin colores raros */
    background-color: rgba(0, 0, 0, 0.05) !important;
}

/* ==========================================
   POSICIONAMIENTO ESPECÍFICO: MODAL MOTOS/OPCIONES
   ========================================== */

/* Solo afecta al contenedor del selector de motos */
#modal-opciones {
    align-items: flex-start !important;
    padding-top: 80px !important; /* Lo alinea a la altura del de Unirse a la Ruta */
}

/* Solo afecta a la caja blanca dentro de ese modal */
#modal-opciones .modal-content {
    margin-top: 0 !important;
    border-radius: 24px !important; /* Bordes redondeados en todas las esquinas */
    width: calc(100% - 40px) !important;
    max-width: 450px !important;
    
    /* Anulamos el estilo de "Bottom Sheet" */
    height: auto !important;
    max-height: 70vh !important;
    transform: none !important;
    animation: slideFromTop 0.3s ease-out !important;
}

/* Animación exclusiva para este modal */
@keyframes slideFromTop {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.ruta-mis-actions {
    display: flex !important;
    flex-wrap: wrap !important; /* Permite que los botones bajen si no caben */
    gap: 8px !important;
    justify-content: space-between !important;
}

.ruta-btn {
    flex: 1 !important; /* Todos los botones miden lo mismo */
    min-width: 40px !important;
    height: 40px !important;
}

/* ==========================================
           ESTILOS EXTRAÍDOS DE INDEX.PHP
           ========================================== */
        html,
        body {
            overscroll-behavior-y: none;
        }

        body {
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
        }

        input,
        textarea {
            -webkit-user-select: auto;
            user-select: auto;
        }

        /* Oculta los controles de fecha/hora nativos que flatpickr reemplaza */
        input[type="date"], input[type="time"] {
            display: none !important;
        }
        
        .flatpickr-input.form-control {
            background-color: #ffffff !important;
            cursor: pointer !important;
        }

        /* Selector Personalizado Tipo-Card (Si se llega a usar en index) */
        .tipo-selector-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
            margin-bottom: 20px;
        }

        .tipo-card {
            background: #f8fafc;
            border: 2px solid #e2e8f0;
            border-radius: 12px;
            padding: 12px 5px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .tipo-card i {
            font-size: 1.3rem;
            color: #94a3b8;
            margin-bottom: 6px;
        }

        .tipo-card span {
            font-size: 0.7rem;
            font-weight: 700;
            color: #64748b;
            text-transform: uppercase;
        }

        /* Estado Activo */
        .tipo-card.active {
            background: #eff6ff;
            border-color: var(--primary);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
        }

        .tipo-card.active i, .tipo-card.active span {
            color: var(--primary);
        }
        
        /* ==========================================
   EXTRACCIÓN DE ESTILOS EN LÍNEA DE INDEX.PHP
   ========================================== */
.search-input-wrapper { position: relative; display: flex; align-items: center; width: 100%; margin-bottom: 15px; }
.search-input-main { margin-bottom: 0 !important; }
.btn-clear-search-icon { position: absolute; right: 15px; color: #cbd5e1; cursor: pointer; font-size: 1.2rem; z-index: 5; }

#modal-rider-profile { z-index: 2050; }
#modal-enviar-aviso { z-index: 2100; }
#modal-reqs-sugeridos { z-index: 2200; }

.reqs-container { background: #eff6ff; border: 1px solid #bfdbfe; padding: 15px; border-radius: 12px; margin-bottom: 20px; }
.req-header-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.req-title { font-weight: bold; color: #2563eb; }
.req-hint-blue { color: #1e40af; font-size: 0.75rem; }
.btn-add-req { margin-bottom: 12px; width: 100%; border: 1px solid #bfdbfe; color: #2563eb; background: #ffffff; height: 40px; font-size: 0.9rem; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; }
#ev-reqs { margin-bottom: 0; border: 1px solid #93c5fd; background: #ffffff; }

#zona-reciclar-evento { background: #fff7ed; border: 1px solid #fdba74; padding: 15px; border-radius: 12px; margin-bottom: 15px; text-align: center; }
.reciclar-title { margin: 0 0 10px 0; color: #ea580c; }
.reciclar-desc { font-size: 0.85rem; color: #9a3412; margin: 0 0 10px 0; }
.btn-full-width { width: 100%; }

.btn-pdf-export { display: flex; align-items: center; gap: 5px; width: auto; padding: 5px 15px; }

.picker-search-container { position: relative; flex: 1; display: flex; align-items: center; }
.btn-clear-mapa { position: absolute; right: 12px; color: #cbd5e1; cursor: pointer; font-size: 1.2rem; z-index: 10; }
.picker-btn-search { margin-left: 8px; }

.modal-sugeridos-content { max-height: 80vh; display: flex; flex-direction: column; }
.sugeridos-title { margin-top: 0; color: #1e293b; }
.sugeridos-desc { font-size: 0.85rem; color: #6b7280; margin-top: 0; margin-bottom: 15px; }
#lista-reqs-sugeridos { overflow-y: auto; flex: 1; margin-bottom: 15px; border: 1px solid #e5e7eb; border-radius: 8px; background: #f9fafb; padding: 5px; }

#modal-rodillo .roller-title { font-size: 1.05rem; margin: 0; }
.btn-rodillo-listo { flex: none; width: auto; margin: 0; height: 38px; padding: 0 20px; border-radius: 10px; font-size: 0.9rem; }
.btn-rodillo-cancel { width: 100%; height: 45px; border-radius: 12px; margin-top: 10px; font-size: 0.95rem; }

/* ==========================================
   ESTILOS EXTRAÍDOS DE LOGIN.PHP (Completos)
   ========================================== */
.auth-container { padding: 20px; width: 100%; max-width: 400px; }
.auth-tabs { display: flex; border-bottom: 2px solid #e2e8f0; margin-bottom: 20px; }
.auth-tab { flex: 1; text-align: center; padding: 10px; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: 0.2s; }
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.auth-btn-link { background: transparent; color: var(--text-muted); padding: 10px; font-size: 0.9rem; margin-top: 5px; border: none; cursor: pointer; }
.auth-pass-wrap { position: relative; }
.auth-pass-wrap input { padding-right: 40px; }
.auth-pass-wrap i { position: absolute; right: 12px; top: 15px; color: #94a3b8; cursor: pointer; }
.auth-select-arrow { appearance: none; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; background-color: white; }

/* Estilos extraídos de las etiquetas HTML (Inline) */
.login-header-box { text-align: center; margin-bottom: 20px; }
.login-logo-img { width: 150px; height: auto; margin-bottom: -10px !important; border-radius: 24px; filter: drop-shadow(0px 4px 6px rgba(0,0,0,0.1)); }
.login-title { color: var(--primary); margin: 0; font-size: 1.6rem; letter-spacing: 0.5px; }
.login-remember-label { display: flex; align-items: center; gap: 8px; margin-bottom: 15px; color: var(--text-muted); font-size: 0.9rem; }
.login-checkbox { width: auto; margin: 0; }
.login-center-text { text-align: center; }
.login-section-label { display: block; margin-bottom: 10px; font-weight: 600; color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; }
.login-info-box { background: #eff6ff; color: var(--primary); padding: 12px; border-radius: 8px; font-size: 0.85rem; margin-bottom: 15px; border: 1px solid #bfdbfe; }
.login-info-text { color: #1e40af; margin-top: 5px; display: block; }
.login-rec-title { margin-top: 0; text-align: center; }
.login-rec-desc { font-size: 0.9rem; text-align: center; color: var(--text-muted); }
.auth-card { padding: 25px !important; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important; border: none !important; }
/* ==========================================
   ESTILOS EXTRAÍDOS DE PERFIL.PHP
   ========================================== */
/* Protegemos el contenedor y la tarjeta para que no choquen con la app principal */
#main-wrapper.perfil-main-wrapper { padding: 80px 20px 0px 20px !important; }
.card.perfil-card { padding: 25px !important; position: relative; }

.profile-wrapper { position: relative; display: inline-block; margin: 0 auto 15px; width: 120px; height: 120px; left: 50%; transform: translateX(-50%); }
.profile-pic { width: 100%; height: 100%; border-radius: 50%; border: 3px solid var(--primary); object-fit: cover; display: block; }

.loading-ring { position: absolute; top: -5px; left: -5px; right: -5px; bottom: -5px; border-radius: 50%; border: 5px solid transparent; border-top-color: var(--success); border-right-color: var(--success); animation: spin 1s linear infinite; display: none; z-index: 10; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: #6b7280; margin-bottom: 5px; }

.btn-save-green { background: #10b981 !important; color: white !important; box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2); border: none; height: 55px; font-size: 1.1rem; }
.btn-save-green:active { transform: scale(0.98); }

/* --- Estilos extraídos de las etiquetas HTML (Inline CSS) --- */
.perfil-top-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; margin-top: 30px; }
.btn-volver { background: #ffffff; border: 1px solid #d1d5db; border-radius: 8px; font-size: 0.9rem; font-weight: 600; padding: 8px 14px; cursor: pointer; color: #475569; display: flex; align-items: center; gap: 6px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.perfil-title { margin: 0; flex: 1; text-align: center; color: var(--text-main); }
.perfil-garaje-title { color: #475569; text-align: left; font-size: 1.15rem; margin-bottom: 15px; display: flex; align-items: center; gap: 8px; }
.perfil-garaje-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 15px; margin-top: 15px; margin-bottom: 25px; }
.perfil-garaje-label { display: block; font-size: 0.85rem; font-weight: bold; color: var(--primary); margin-bottom: 10px; }
.perfil-garaje-inputs { display: flex; gap: 8px; margin-bottom: 12px; }
.perfil-input-flex { flex: 1; margin: 0; }
.perfil-input-small { width: 80px; margin: 0; }
.btn-add-moto { background: #475569; color: white; border: none; }
.perfil-negocio-title { color: var(--primary); text-align: left; }
.perfil-map-row { display: flex; gap: 10px; margin-bottom: 15px; }
.btn-vista-previa { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; margin-bottom: 20px; }
/* Fix para recuperar los espacios perdidos en el formulario de Perfil */
.perfil-card .custom-select { margin-bottom: 18px !important; }
.perfil-card .btn-sec { margin-bottom: 25px !important; }
/* Fix para que los botones del perfil recuperen su tamaño y ancho completo */
.perfil-card .btn { 
    width: 100% !important; 
    padding: 12px !important; 
    font-size: 1rem;
}

/* ==========================================
   ESTILOS EXCLUSIVOS DE LOGIN Y REGISTRO
   ========================================== */
.auth-container { padding: 20px; width: 100%; max-width: 400px; margin: auto; }
.auth-tabs { display: flex; border-bottom: 2px solid #e2e8f0; margin-bottom: 20px; }
.auth-tab { flex: 1; text-align: center; padding: 10px; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: 0.2s; }
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.auth-btn-link { background: transparent; color: var(--text-muted); padding: 10px; font-size: 0.9rem; margin-top: 5px; border: none; cursor: pointer; }
.auth-pass-wrap { position: relative; }
.auth-pass-wrap input { padding-right: 40px; }
.auth-pass-wrap i { position: absolute; right: 12px; top: 15px; color: #94a3b8; cursor: pointer; }
.login-header-box { text-align: center; margin-bottom: 20px; }
.login-logo-img { width: 150px; height: auto; margin-bottom: 10px; border-radius: 24px; filter: drop-shadow(0px 4px 6px rgba(0,0,0,0.1)); }
.login-title { color: var(--primary); margin: 0; font-size: 1.6rem; letter-spacing: 0.5px; }
.login-remember-label { display: flex; align-items: center; gap: 8px; margin-bottom: 15px; color: var(--text-muted); font-size: 0.9rem; }
.login-checkbox { width: auto; margin: 0; }
.login-center-text { text-align: center; }
.login-section-label { display: block; margin-bottom: 10px; font-weight: 600; color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; }
.login-info-box { background: #eff6ff; color: var(--primary); padding: 12px; border-radius: 8px; font-size: 0.85rem; margin-bottom: 15px; border: 1px solid #bfdbfe; }
.login-info-text { color: #1e40af; margin-top: 5px; display: block; }
.login-rec-title { margin-top: 0; text-align: center; }
.login-rec-desc { font-size: 0.9rem; text-align: center; color: var(--text-muted); }
.auth-card { padding: 25px !important; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important; border: none !important; }

/* ==========================================
   ESTILOS EXCLUSIVOS DE PERFIL
   ========================================== */
#main-wrapper.perfil-main-wrapper { padding: 80px 20px 0px 20px !important; }
.card.perfil-card { padding: 25px !important; position: relative; }
.profile-wrapper { position: relative; display: inline-block; margin: 0 auto 15px; width: 120px; height: 120px; left: 50%; transform: translateX(-50%); }
.profile-pic { width: 100%; height: 100%; border-radius: 50%; border: 3px solid var(--primary); object-fit: cover; display: block; }
.loading-ring { position: absolute; top: -5px; left: -5px; right: -5px; bottom: -5px; border-radius: 50%; border: 5px solid transparent; border-top-color: var(--success); border-right-color: var(--success); animation: spin 1s linear infinite; display: none; z-index: 10; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: #6b7280; margin-bottom: 5px; }
.btn-save-green { background: #10b981 !important; color: white !important; box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2); border: none; height: 55px; font-size: 1.1rem; }
.btn-save-green:active { transform: scale(0.98); }
.perfil-top-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; margin-top: 30px; }
.btn-volver { background: #ffffff; border: 1px solid #d1d5db; border-radius: 8px; font-size: 0.9rem; font-weight: 600; padding: 8px 14px; cursor: pointer; color: #475569; display: flex; align-items: center; gap: 6px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.perfil-title { margin: 0; flex: 1; text-align: center; color: var(--text-main); }
.perfil-garaje-title { color: #475569; text-align: left; font-size: 1.15rem; margin-bottom: 15px; display: flex; align-items: center; gap: 8px; }
.perfil-garaje-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 15px; margin-top: 15px; margin-bottom: 25px; }
.perfil-garaje-label { display: block; font-size: 0.85rem; font-weight: bold; color: var(--primary); margin-bottom: 10px; }
.perfil-garaje-inputs { display: flex; gap: 8px; margin-bottom: 12px; }
.perfil-input-flex { flex: 1; margin: 0; }
.perfil-input-small { width: 80px; margin: 0; }
.btn-add-moto { background: #475569; color: white; border: none; }
.perfil-negocio-title { color: var(--primary); text-align: left; }
.perfil-map-row { display: flex; gap: 10px; margin-bottom: 15px; }
.btn-vista-previa { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; margin-bottom: 20px; }
.perfil-card .custom-select { margin-bottom: 18px !important; }
.perfil-card .btn-sec { margin-bottom: 25px !important; }
.perfil-card .btn { width: 100% !important; padding: 12px !important; font-size: 1rem; }

/* ==========================================
   ESTILOS EXCLUSIVOS DE LA GUÍA MOTERA
   ========================================== */
#main-wrapper.guia-main-wrapper { padding-top: 70px !important; position: relative; }
.guia-header { background: #ffffff; color: var(--text-main); padding: 15px; position: fixed; top: 0; width: 100%; max-width: var(--app-width); z-index: 1000; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); display: flex; align-items: center; justify-content: center; font-weight: 700; left: 50%; transform: translateX(-50%); } 
.guia-header-icon { margin-right: 8px; color: var(--primary); }
.guia-filter-card { background: white; padding: 15px; border-radius: 16px; margin-bottom: 20px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); border: 1px solid #e5e7eb; }
.guia-search-input { width: 100%; padding: 12px; margin-bottom: 12px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 1rem; background: #f9fafb; outline: none; }
.guia-filters-row { display: flex; gap: 8px; }
.guia-lista-negocios { padding-bottom: 60px; }
.guia-biz-card { background: white; border-radius: 16px; padding: 12px; margin-bottom: 12px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04); border: 1px solid #e5e7eb; display: flex; align-items: center; gap: 12px; }
.guia-biz-logo { width: 65px; height: 65px; border-radius: 12px; object-fit: cover; border: 1px solid #f1f5f9; background: #f9fafb; flex-shrink: 0; }
.guia-biz-info { flex: 1; min-width: 0; }
.guia-biz-name { margin: 0 0 3px 0; font-size: 1rem; font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guia-biz-cat-badge { font-size: 0.65rem; font-weight: 800; color: var(--primary); background: #eff6ff; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; width: fit-content; margin-bottom: 3px; }
.guia-biz-loc { color: var(--text-muted); font-size: 0.75rem; display: flex; align-items: center; gap: 4px; }
.guia-biz-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; flex-shrink: 0; }
.guia-btn-act { width: 36px; height: 36px; border: none; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 0.95rem; cursor: pointer; transition: transform 0.1s; outline: none; }
.guia-btn-act:active { transform: scale(0.9); }
.guia-btn-wa { background: #dcfce7; color: #166534; }
.guia-btn-tel { background: #eff6ff; color: #1e40af; }
.guia-btn-map { background: #fef2f2; color: #991b1b; }
.guia-btn-share { background: #f3f4f6; color: #475569; border: 1px solid #e2e8f0; }
.guia-btn-subir { display: none !important; position: fixed !important; right: 20px !important; bottom: 85px !important; width: 60px !important; height: 60px !important; border-radius: 50% !important; background-color: var(--primary) !important; color: white !important; border: none !important; box-shadow: 0 4px 15px rgba(0,0,0,0.3) !important; z-index: 9999 !important; cursor: pointer !important; align-items: center !important; justify-content: center !important; }
.guia-btn-subir-icon { font-size: 24px !important; }
.guia-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); z-index: 3000; align-items: flex-end; }
.guia-modal-content { background: white; border-radius: 20px 20px 0 0; width: 100%; max-width: var(--app-width); margin: 0 auto; overflow: hidden; display: flex; flex-direction: column; height: 55vh; animation: guiaSlideUp 0.3s ease-out; }
@keyframes guiaSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.guia-modal-full { align-items: center; padding: 20px; }
.guia-modal-full .guia-modal-content { border-radius: 16px; height: 75vh; }
.guia-modal-header { padding: 15px; background: white; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f1f5f9; }
.guia-modal-title { margin: 0; font-size: 1rem; }
.guia-modal-close { font-size: 1.8rem; cursor: pointer; color: #94a3b8; line-height: 1; }
.guia-map-container { flex: 1; background: #eee; }
.guia-map-frame { width: 100%; height: 100%; border: none; }
.guia-modal-footer { padding: 15px; }
.guia-btn-map-ext { background: #1e293b; color: white; width: 100%; border-radius: 12px; font-size: 0.9rem; font-weight: bold; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 10px; height: 45px; }
.guia-opt-header { padding: 18px 20px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.guia-opt-title { margin: 0; font-size: 1.1rem; }
.guia-opt-close { font-size: 1.8rem; cursor: pointer; color: #9ca3af; }
.guia-opt-search-box { padding: 12px 15px; background: #f9fafb; border-bottom: 1px solid #eee; display: none; }
.guia-opt-search-inner { display: flex; align-items: center; background: white; border: 1px solid #d1d5db; border-radius: 10px; padding: 0 12px; }
.guia-opt-search-icon { color: #9ca3af; }
.guia-opt-search-input { border: none; margin: 0; padding: 12px 10px; outline: none; flex: 1; background: transparent; }
.guia-opt-list { flex: 1; overflow-y: auto; padding-bottom: 20px; }
.guia-option-item { padding: 16px 20px; border-bottom: 1px solid #f3f4f6; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.guia-empty-state { text-align: center; padding: 50px; color: #9ca3af; }
.guia-empty-icon { margin-bottom: 15px; opacity: 0.3; }

/* ==========================================
   FIX DEFINITIVO: MODALES FLOTANTES EN LA GUÍA
   ========================================== */
.guia-modal {
    padding: 0 !important;
    justify-content: center !important;
    align-items: flex-end !important;
}

.guia-modal-content {
    /* Le restamos 30px al ancho total para separarlo de las paredes */
    width: calc(100% - 30px) !important; 
    max-width: 450px !important;
    /* Centrado a los lados y 30px separado del fondo */
    margin: 0 auto 30px auto !important; 
    border-radius: 24px !important; 
    box-shadow: 0 15px 35px rgba(0,0,0,0.25) !important;
}

/* Forzamos que la cabecera del modal no tape las esquinas redondeadas */
.guia-modal-header,
.guia-opt-header {
    border-radius: 24px 24px 0 0 !important;
}

/* ==========================================
   ANIMACIÓN BOTÓN AÑADIR MOTO (UX)
   ========================================== */
.btn-add-moto {
    transition: all 0.3s ease !important; /* Movimiento suave */
}

.btn-add-moto-ready {
    background-color: #ea580c !important; /* Naranja Fuego */
    color: white !important;
    transform: scale(1.02);
    font-weight: 800 !important;
}

/* ==========================================
   MODAL DE CONTACTO CLUB (SOCIAL)
   ========================================== */
.cc-modal-content { height: auto !important; position: relative !important; display: block !important; text-align: center; padding: 30px 20px !important; border-radius: 24px !important; max-width: 320px !important; margin: auto !important; }
.cc-close-btn { position: absolute; right: 20px; top: 15px; font-size: 1.8rem; color: #94a3b8; cursor: pointer; line-height: 1; }
.cc-logo { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; margin: 0 auto 15px auto; border: 4px solid #f8fafc; box-shadow: 0 4px 10px rgba(0,0,0,0.08); display: block; }
.cc-title { font-size: 1.25rem; color: var(--text-main); margin: 0 0 5px 0; font-weight: 800; }
.cc-prov { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 25px; }
.cc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.cc-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 15px 10px; border-radius: 16px; font-weight: bold; font-size: 0.85rem; transition: transform 0.1s; border: none; cursor: pointer; outline: none; }
.cc-btn:active { transform: scale(0.95); }
.cc-btn i { font-size: 1.8rem; margin-bottom: 8px; }

/* Colores de los botones */
.cc-btn-wa { background: #dcfce7; color: #166534; }
.cc-btn-email { background: #eff6ff; color: #1e40af; }
.cc-btn-disabled { background: #f1f5f9; color: #94a3b8; cursor: not-allowed; }

/* Para que la zona izquierda del club indique que se puede tocar */
.soc-club-clickable { cursor: pointer; }

/* Color para el nuevo botón de Email */
.btn-rider-email { 
    background: #f5f3ff !important; 
    color: #5b21b6 !important; 
    border: 1px solid #ddd6fe !important; 
}

/* Ajuste para que los 3 botones quepan bien en una fila */
.rider-action-bar {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 15px;
    padding: 0 15px;
}

.btn-rider-action {
    flex: 1; /* Esto hace que los 3 midan lo mismo */
    height: 42px;
    border-radius: 10px;
    display: flex;
    flex-direction: column; /* Icono arriba, texto abajo para ahorrar espacio ancho */
    align-items: center;
    justify-content: center;
    font-size: 0.65rem; /* Texto un poco más pequeño para que no se corte */
    text-transform: uppercase;
    font-weight: 800;
}

.btn-rider-action i {
    font-size: 1rem;
    margin-bottom: 2px;
}

/* ==========================================
   ESTILOS COMPLETOS: MODAL RIDER PREMIUM
   ========================================== */

/* 1. Contenedor Principal del Modal */
.rider-modal-body {
    padding: 0 !important;
    border-radius: 24px !important;
    overflow: hidden !important;
    background: #fff !important;
}

/* 2. Cabecera (Foto y Nombre) */
.rider-profile-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 40px 20px 25px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.rider-profile-img {
    width: 100px !important;
    height: 100px !important;
    border-radius: 50% !important;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin: 0 auto 15px !important;
    display: block;
}

.rider-name-title {
    font-size: 1.3rem !important;
    color: #1e293b !important;
    font-weight: 800 !important;
    margin: 0 0 5px 0 !important;
}

.rider-location {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 5px; /* Espacio para que no choque con el correo */
}

/* 3. Barra de Acciones (WhatsApp, Llamar, Correo) */
.rider-action-bar {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 20px;
    padding: 0 10px;
}

.btn-rider-action {
    flex: 1;
    height: 44px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.65rem;
    text-transform: uppercase;
    transition: all 0.2s;
}

.btn-rider-action i { font-size: 1.1rem; margin-bottom: 2px; }

/* Colores de los botones */
.btn-rider-wa { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.btn-rider-call { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.btn-rider-email { background: #f5f3ff; color: #5b21b6; border: 1px solid #ddd6fe; }

/* 4. Información Médica (La cajita rosada) */
.medical-info-card {
    background: #fff1f2;
    margin: 20px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid #ffe4e6;
}

.medical-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.medical-item-label {
    font-size: 0.7rem;
    color: #9f1239;
    text-transform: uppercase;
    font-weight: 800;
    display: block;
    margin-bottom: 2px;
}

.medical-item-val {
    font-size: 1rem;
    color: #1e293b;
    font-weight: 700;
}

/* 5. Garaje Personal */
.garage-section-new {
    padding: 0 20px 20px;
}

.garage-title-new {
    font-size: 0.85rem;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Estilo de la tarjeta de la moto */
.garage-moto-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Botón de Llamada de Emergencia SOS */
.btn-sos-medical {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fb7185; /* Rosa intenso */
    color: white !important;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
    margin-top: 4px;
    box-shadow: 0 2px 4px rgba(225, 29, 72, 0.2);
}

.btn-sos-medical:active {
    transform: scale(0.96);
    background: #e11d48;
}

.btn-sos-medical i {
    font-size: 0.8rem;
}

/* ==========================================
   FORMULARIOS DE ACCESO (LOGIN / REGISTRO)
   ========================================== */

/* Centrado total de los contenedores */
#form-log, #form-reg {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centrado horizontal */
    width: 100%;
    max-width: 420px; /* Evita que se vea muy ancho en tablets */
    margin: 0 auto;
    padding: 10px;
}

/* Inputs al 100% de su contenedor */
#form-log input, 
#form-reg input, 
.auth-pass-wrap {
    width: 100% !important;
    box-sizing: border-box;
}

/* BOTONES GRANDES Y CENTRALIZADOS */
#form-log .btn-main, 
#form-reg .btn-main {
    width: 100% !important;
    height: 80px !important; /* Altura ideal para móviles */
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    border-radius: 8px !important;
    margin-top: 20px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: normal;
    border: none !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08) !important;
    transition: transform 0.2s;
}

#form-log .btn-main:active, 
#form-reg .btn-main:active {
    transform: scale(0.97);
}

/* ==========================================
   CARNET DIGITAL BIKERHUB (QR)
   ========================================== */
.btn-carnet {
    background-color: #1e293b !important; /* Color corporativo oscuro */
    color: #ffffff !important;
    margin-top: 15px !important;
    margin-bottom: 25px !important; /* Separa el botón del formulario de abajo */
    border: none !important;
    box-shadow: 0 4px 10px rgba(30, 41, 59, 0.2) !important;
    transition: transform 0.2s, background-color 0.2s;
}

.btn-carnet:active {
    transform: scale(0.97);
    background-color: #0f172a !important;
}

.carnet-modal-content {
    text-align: center; 
    padding: 30px 20px 20px 20px !important; 
    max-width: 320px;
    border-radius: 20px;
    
    height: max-content !important; 
    min-height: unset !important; /* Anula cualquier altura mínima de móviles */
    margin: auto !important; /* Lo centra perfectamente en la pantalla */
}

.carnet-title {
    margin-top: 0; 
    color: var(--text-main);
    font-size: 1.3rem;
}

.carnet-desc {
    font-size: 0.85rem; 
    color: #64748b; 
    margin-bottom: 20px;
    line-height: 1.4;
}

.carnet-qr-box {
    display: flex; 
    justify-content: center; 
    align-items: center;
    margin: 0 auto 20px auto; 
    padding: 15px; 
    background: white; 
    border-radius: 12px; 
    border: 2px solid #e5e7eb; 
    width: 200px; 
    height: 200px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.carnet-name {
    margin: 0; 
    color: var(--text-main);
    font-size: 1.4rem;
    font-weight: 800;
}

.carnet-user {
    margin: 5px 0 15px 0 !important; /* Cambiamos el 20px por 15px */
    font-weight: 700; 
    color: var(--primary);
    font-size: 1rem;
}

/* ==========================================
   ESCÁNER Y ASISTENCIA (QR)
   ========================================== */

/* Botón de Escanear Asistencia */
.btn-escaner {
    width: 100% !important;
    margin-bottom: 15px !important;
    background-color: #10b981 !important; /* Verde Biker */
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2) !important;
    transition: transform 0.2s, background-color 0.2s;
}

.btn-escaner:active {
    transform: scale(0.98);
    background-color: #059669 !important; /* Verde un poco más oscuro al presionar */
}

/* Medalla (Badge) de "Presente" en la lista */
.badge-presente {
    background-color: #10b981;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: bold;
    vertical-align: middle;
    margin-left: 5px;
    display: inline-block;
}

/* Contenedor del nombre en la lista */
.rider-name-box {
    font-size: 1rem; 
    color: var(--text-main); 
    font-weight: 900; 
    line-height: 1.2; 
    margin-bottom: 2px; 
    word-break: break-word;
}

/* Medalla azul de Copiloto (+1) */
.badge-copiloto {
    background-color: #3b82f6; 
    color: white; 
    padding: 1px 5px; 
    border-radius: 4px; 
    font-size: 0.65rem; 
    font-weight: bold; 
    vertical-align: middle;
    margin-left: 5px; /* Pequeño espacio para separarlo del nombre */
}

/* ==========================================
   ESTILOS PREMIUM PARA LA CÁMARA (Librería)
   ========================================== */
#lector-qr {
    border: none !important;
}

/* 1. Ocultar el texto "Select Camera" y el link de archivo */
#lector-qr span, 
#lector-qr a { 
    display: none !important; 
}

/* 2. Traducir y embellecer los botones (Magia CSS) */
#html5-qrcode-button-camera-permission,
#html5-qrcode-button-camera-start,
#html5-qrcode-button-camera-stop {
    font-size: 0 !important; /* Oculta el texto en inglés */
    background-color: #2563eb !important; /* Azul BikerHub */
    color: white !important;
    border: none !important;
    padding: 14px 15px !important;
    border-radius: 8px !important;
    font-weight: bold !important;
    margin: 10px auto !important;
    cursor: pointer !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
    width: 100% !important;
    display: block !important;
}

#html5-qrcode-button-camera-permission::after {
    content: "DAR PERMISO A LA CÁMARA";
    font-size: 0.95rem !important;
}

#html5-qrcode-button-camera-start::after {
    content: "INICIAR ESCÁNER";
    font-size: 0.95rem !important;
}

#html5-qrcode-button-camera-stop {
    background-color: #ef4444 !important; /* Botón rojo para detener */
}

#html5-qrcode-button-camera-stop::after {
    content: "DETENER ESCÁNER";
    font-size: 0.95rem !important;
}

/* 3. Arreglar el selector de cámaras para que se vea premium */
#html5-qrcode-select-camera {
    padding: 12px !important;
    border-radius: 8px !important;
    border: 2px solid #cbd5e1 !important;
    font-size: 0.95rem !important;
    margin: 10px auto 15px auto !important;
    width: 100% !important;
    background-color: #f8fafc !important;
    color: var(--text-main) !important;
}

/* 4. Forzar que el modal no se salga de la pantalla (Arregla el botón de cerrar) */
#modal-escaner .modal-content {
    max-height: 85vh !important;
    overflow-y: auto !important;
}

/* ==========================================
   ALERTAS SIEMPRE AL FRENTE (SweetAlert2)
   ========================================== */
.swal2-container {
    z-index: 999999 !important; /* Un nivel más alto que el escáner */
}