/* ============================================================
   ON TIME INTERNATIONAL — DESIGN SYSTEM (FLEET & DISPO PORTAL)
   ============================================================ */

/* ---------- Custom Properties ---------- */
:root {
  --red: #E30613;
  --red-dark: #B8050F;
  --red-glow: rgba(227, 6, 19, 0.25);
  --green: #39B54A;
  --green-dark: #2E9A3D;
  --dark: #1D1D1B;
  --dark-light: #2c2c2a;
  --dark-bg: #F8F9FA;
  --panel-bg: rgba(255, 255, 255, 0.85);
  --white: #FFFFFF;
  --gray-light: #F1F3F5;
  --gray: #E9ECEF;
  --gray-mid: #5E6975;
  
  --font: 'Chakra Petch', sans-serif;
  --nav-height: 80px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Shadows & Borders */
  --border-color: #E2E8F0;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 10px 30px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 45px rgba(0,0,0,0.15);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  color: var(--dark);
  background: var(--dark-bg);
  background-image: 
    radial-gradient(at 5% 5%, rgba(227, 6, 19, 0.05) 0px, transparent 40%),
    radial-gradient(at 95% 95%, rgba(57, 181, 74, 0.04) 0px, transparent 40%);
  background-attachment: fixed;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: inherit;
}

button, input, select, textarea {
  font-family: var(--font);
  outline: none;
}

/* Glassmorphism utility */
.glass-effect {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-md);
}

/* ---------- Layout Container ---------- */
.container {
  width: 94%;
  max-width: 1300px;
  margin: 0 auto;
}

/* ---------- 1. NAVBAR (CABECERA) ---------- */



.navbar {
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-menu{
    display:flex;
    align-items:center;
    gap:30px;
}

.nav-menu a{
    color:#333;
    text-decoration:none;
    font-weight:500;
    transition:.3s;
}

.nav-menu a:hover{
    color:#E30613; /* Color de tu marca */
}

.logo-container img {
  height: 38px;
  width: auto;
  transition: transform var(--transition);
}

.logo-container:hover img {
  transform: scale(1.03);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Admin Switch Toggle Button */
.admin-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--gray-mid);
  transition: all var(--transition);
  position: relative;
}

.switch-dot {
  width: 8px;
  height: 8px;
  background: var(--gray-mid);
  border-radius: 50%;
  transition: all var(--transition);
}

.admin-switch.active {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
  box-shadow: 0 4px 12px var(--red-glow);
}

.admin-switch.active .switch-dot {
  background: var(--white);
  box-shadow: 0 0 8px var(--white);
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

/* Language Toggle */
.lang-toggle {
  display: flex;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-color);
  padding: 2px;
  border-radius: 4px;
  gap: 2px;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--gray-mid);
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 3px;
  transition: var(--transition);
}

.lang-btn.active {
  background: var(--red);
  color: var(--white);
}

/* ---------- 2. HERO SECTION ---------- */
.hero-section {
  padding: 40px 0;
  text-align: center;
  position: relative;
}

.hero-section h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.1;
  color: var(--dark);
  margin-bottom: 8px;
}

.hero-section h1 span {
  color: var(--red);
  text-shadow: 0 0 20px rgba(227, 6, 19, 0.2);
}

.hero-desc {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--gray-mid);
  font-weight: 500;
  max-width: 700px;
  margin: 0 auto;
}

/* ---------- 3. MAP SECTION LAYOUT ---------- */
.map-section {
  margin-bottom: 40px;
}

.map-layout {
  display: grid;
  grid-template-columns: 390px 1fr;
  height: 680px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

@media (max-width: 900px) {
  .map-layout {
    grid-template-columns: 1fr;
    height: 850px;
  }
}

/* Sidebar of the Map */
.map-sidebar {
  border-right: 1px solid var(--border-color);
  padding: 20px 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(255, 255, 255, 0.95);
}

/* Los filtros/título siempre visibles y fijos; solo el listado/resumen
   inferior hace scroll internamente cuando el contenido no cabe. */
#sidebar-admin-view,
#sidebar-public-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--dark);
  margin-bottom: 14px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
}

.sidebar-title i {
  color: var(--red);
}

/* Admin list button */
.btn-action-add {
  background: var(--red);
  color: var(--white);
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition);
}

.btn-action-add:hover {
  background: var(--red-dark);
}

.admin-help-text {
  font-size: 0.75rem;
  color: var(--gray-mid);
  margin-bottom: 8px;
  line-height: 1.4;
}

/* Filter controls in Sidebar */
.filter-group {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--gray-mid);
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-mid);
  font-size: 0.85rem;
}

.search-input {
  width: 100%;
  padding: 10px 12px 10px 34px;
  border: 1px solid var(--border-color);
  background: var(--gray-light);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--dark);
  transition: all var(--transition);
}

.search-input:focus {
  background: var(--white);
  border-color: var(--red);
  box-shadow: 0 0 8px var(--red-glow);
}

.select-filter {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  background: var(--gray-light);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--dark);
  cursor: pointer;
  transition: all var(--transition);
}

.select-filter:focus {
  background: var(--white);
  border-color: var(--red);
  box-shadow: 0 0 8px var(--red-glow);
}

/* Stats Panel inside sidebar */
.stats-panel {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.stats-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gray-mid);
  margin-bottom: 8px;
}

#fleet-stats-container {
  overflow-y: auto;
  max-height: 230px;
  padding-right: 4px;
}

/* Resumen de filtros activos + botón de limpiar (vista cliente) */
.filter-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -4px 0 12px 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gray-mid);
  text-transform: uppercase;
}

.btn-clear-filters {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--red);
  padding: 4px 9px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-clear-filters:hover {
  background: rgba(227, 6, 19, 0.06);
  border-color: var(--red);
}

.map-stat-card {
  background: rgba(227, 6, 19, 0.03);
  border: 1px solid rgba(227, 6, 19, 0.1);
  border-left: 3px solid var(--red);
  padding: 14px;
  border-radius: 6px;
}

.map-stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
  margin-bottom: 4px;
}

.map-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--dark);
  text-transform: uppercase;
}

/* Admin Unit Card inside sidebar list */
.admin-list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
  overflow-y: auto;
  min-height: 0;
  padding-right: 4px;
}

.admin-unit-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--red);
  border-radius: 6px;
  padding: 12px;
  transition: all var(--transition);
}

.admin-unit-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.admin-unit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.admin-unit-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.admin-unit-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.admin-unit-info {
  font-size: 0.72rem;
  color: var(--gray-mid);
  line-height: 1.4;
  margin-bottom: 10px;
}

.admin-unit-info b {
  color: var(--dark);
}

.admin-unit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--gray-light);
  padding-top: 8px;
}

.action-btn {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gray-mid);
  cursor: pointer;
  transition: color var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
}

.action-btn:hover {
  color: var(--red);
}

.action-btn-delete:hover {
  color: var(--red);
}

/* Custom switch button for status */
.switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--gray);
  transition: .3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: var(--white);
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--green);
}

input:checked + .slider:before {
  transform: translateX(14px);
}

/* ---------- MAP CANVAS CONTAINER & MAP SEARCH FLOATING ---------- */
.map-canvas-container {
  position: relative;
  width: 100%;
  height: 100%;
}

#live-map {
  width: 100%;
  height: 100%;
  z-index: 10;
}

/* Floating Google Maps search bar directly on the map */
.map-search-bar-floating {
  position: absolute;
  top: 16px;
  left: 50px;
  z-index: 100;
  width: 320px;
  max-width: calc(100% - 70px);
}

.floating-search-wrapper {
  display: flex;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: border-color var(--transition);
}

.floating-search-wrapper:focus-within {
  border-color: var(--red);
}

.floating-search-icon {
  color: var(--red);
  margin-right: 10px;
  font-size: 0.95rem;
}

#global-map-search {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 0.85rem;
  color: var(--dark);
  font-family: var(--font);
}

.floating-search-clear {
  background: transparent;
  border: none;
  color: var(--gray-mid);
  cursor: pointer;
  padding: 0 4px;
}

/* Search results suggestions dropdown list */
.floating-search-results,
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-top: 6px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  max-height: 200px;
  overflow-y: auto;
  z-index: 500;
}

.autocomplete-item {
  padding: 10px 14px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background var(--transition);
  color: var(--dark);
  border-bottom: 1px solid var(--gray-light);
}

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

.autocomplete-item:hover {
  background: var(--gray-light);
}

/* Instruction overlay in Admin Mode */
.map-instruction-overlay {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: rgba(29, 29, 27, 0.9);
  backdrop-filter: blur(4px);
  color: var(--white);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  border: 1px solid rgba(227, 6, 19, 0.3);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.map-instruction-overlay i {
  color: var(--red);
}

/* ---------- CUSTOM LEAFLET MARKERS STYLE ---------- */
.custom-map-marker-png {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.18));
  transition: transform var(--transition);
}

/* Contador de unidades agrupadas en el mismo punto del mapa */
.cluster-count-badge {
  width: 22px;
  height: 22px;
  background: var(--dark);
  color: var(--white);
  border: 2px solid var(--red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  font-family: var(--font);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.custom-map-marker-png:hover {
  transform: scale(1.18);
}

/* circular Awesome Marker badge */
.leaflet-custom-marker-awesome-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.awesome-marker-badge {
  width: 38px;
  height: 38px;
  background: var(--white);
  border: 2px solid var(--red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  box-shadow: 0 0 10px rgba(227, 6, 19, 0.35);
  font-size: 0.9rem;
  transition: transform var(--transition);
}

.awesome-marker-badge:hover {
  transform: scale(1.2);
  box-shadow: 0 0 12px rgba(227, 6, 19, 0.5);
}

/* Popup style customization */
.custom-popup-content {
  font-family: var(--font);
  color: var(--dark);
  width: 260px;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--gray-light);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.popup-title {
  font-weight: 700;
  color: var(--red);
  font-size: 0.85rem;
}

.popup-info-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  font-size: 0.72rem;
  margin-bottom: 6px;
  align-items: start;
}

.popup-label {
  color: var(--gray-mid);
  text-align: left;
}

.popup-value {
  font-weight: 600;
  color: var(--dark);
  text-align: right;
  word-break: break-word;
}

/* ---------- 4. DASHBOARD SECTION (TABLE AT BOTTOM) ---------- */
.dashboard-table-section {
  margin-bottom: 60px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.dashboard-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--dark);
}

.dashboard-header h2 i {
  color: var(--red);
  margin-right: 6px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--green);
  background: rgba(57, 181, 74, 0.08);
  border: 1px solid rgba(57, 181, 74, 0.15);
  padding: 4px 10px;
  border-radius: 4px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: var(--green);
  border-radius: 50%;
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(57, 181, 74, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(57, 181, 74, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(57, 181, 74, 0); }
}

/* Control Panel of Filters */
.control-panel {
  border-left: 4px solid var(--red);
  padding: 20px;
  margin-bottom: 24px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-box input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-color);
  color: var(--dark);
  font-size: 0.95rem;
  border-radius: 6px;
  transition: all var(--transition);
}

.search-box input:focus {
  border-color: var(--red);
  box-shadow: 0 0 10px var(--red-glow);
  background: var(--white);
}

.search-icon-table {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-mid);
  font-size: 1rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.filter-btn {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-color);
  color: var(--gray-mid);
  padding: 6px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
  border-radius: 30px;
}

.filter-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--dark);
}

.filter-btn.active {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
  box-shadow: 0 4px 10px var(--red-glow);
}

/* Export Buttons */
.export-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

@media (max-width: 600px) {
  .export-actions {
    margin-left: 0;
    width: 100%;
    margin-top: 10px;
  }
}

.btn-export {
  background: var(--white);
  border: 1px solid var(--border-color);
  color: var(--dark);
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}

.btn-export:hover {
  background: var(--gray-light);
  border-color: var(--dark);
}

#export-png i { color: var(--green); }
#export-pdf i { color: var(--red); }

/* Table styling */
.table-container {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.availability-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.availability-table th {
  background: rgba(0, 0, 0, 0.02);
  padding: 16px 20px;
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--dark);
  border-bottom: 2px solid var(--border-color);
  letter-spacing: 0.5px;
}

.availability-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--dark);
  vertical-align: middle;
}

.availability-table tr:last-child td {
  border-bottom: none;
}

.availability-table tr:hover td {
  background: rgba(227, 6, 19, 0.01);
}

.unit-type-pill {
  background: rgba(0, 0, 0, 0.04);
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

/* Actions in Table */
.btn-table-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid var(--border-color);
  background: var(--white);
  color: var(--dark);
}

.btn-copy-details:hover {
  background: var(--gray-light);
  border-color: var(--dark);
}

.btn-whatsapp {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}

.btn-whatsapp:hover {
  background: var(--green-dark);
  box-shadow: 0 4px 8px rgba(57, 181, 74, 0.25);
}

/* ---------- 5. MODALES (GENERAL) ---------- */
.backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.admin-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 90%;
  max-width: 550px;
  background: var(--white);
  border-top: 4px solid var(--red);
  border-radius: 12px;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.admin-modal.active {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--dark);
}

.close-modal {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--gray-mid);
  transition: color var(--transition);
}

.close-modal:hover {
  color: var(--red);
}

.modal-body {
  padding: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 500px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.full-width {
  grid-column: 1 / -1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gray-mid);
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  background: var(--gray-light);
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--dark);
  transition: all var(--transition);
}

.form-input:focus {
  background: var(--white);
  border-color: var(--red);
  box-shadow: 0 0 8px var(--red-glow);
}

/* Location input wrapper with icon */
.location-search-wrapper {
  position: relative;
  width: 100%;
}

.location-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--red);
  font-size: 0.95rem;
}

.location-search-wrapper .form-input {
  padding-left: 36px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--gray-light);
}

/* Standard Buttons inside form */
.btn {
  padding: 10px 24px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-red {
  background: var(--red);
  color: var(--white);
}

.btn-red:hover {
  background: var(--red-dark);
  box-shadow: 0 4px 12px var(--red-glow);
}

.btn-secondary {
  background: var(--white);
  border: 1px solid var(--border-color);
  color: var(--gray-mid);
}

.btn-secondary:hover {
  background: var(--gray-light);
  color: var(--dark);
}

/* ---------- 6. AUTH MODAL (ADMIN PASSWORD SCREEN) ---------- */
.auth-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: 90%;
  max-width: 400px;
  padding: 30px;
  border-top: 4px solid var(--red);
  border-radius: 12px;
  text-align: center;
}

.auth-header {
  margin-bottom: 24px;
}

.auth-logo {
  height: 38px;
  width: auto;
  margin-bottom: 16px;
}

.auth-lock-icon {
  width: 50px;
  height: 50px;
  background: rgba(227, 6, 19, 0.08);
  border: 1px solid rgba(227, 6, 19, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  font-size: 1.2rem;
  margin: 0 auto 12px;
}

.auth-card h3 {
  font-size: 1.2rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.auth-card p {
  font-size: 0.8rem;
  color: var(--gray-mid);
}

.password-input-wrapper {
  position: relative;
  width: 100%;
}

.password-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--gray-mid);
  cursor: pointer;
}

.password-toggle-btn:hover {
  color: var(--dark);
}

.auth-buttons {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

/* Shake Animation for Auth Failure */
.shake-animation {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}

/* ---------- 7. BOTÓN FLOTANTE WHATSAPP ---------- */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background-color: var(--green);
  color: var(--white);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 4px 15px rgba(57, 181, 74, 0.4);
  z-index: 1000;
  transition: all var(--transition);
}

.whatsapp-float:hover {
  transform: scale(1.1) rotate(8deg);
  background-color: var(--green-dark);
}

/* ---------- 8. PIE DE PÁGINA (FOOTER) ---------- */
.footer {
  background: var(--dark);
  color: rgba(255, 255, 255, 0.6);
  padding: 24px 0;
  margin-top: auto;
  border-top: 2px solid var(--red);
  font-size: 0.8rem;
  font-weight: 500;
}

/* Badges global styles */
.badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 3px;
  border: 1px solid transparent;
}

.badge-green {
  background: rgba(57, 181, 74, 0.1);
  color: #2E9A3D;
  border-color: rgba(57, 181, 74, 0.2);
}

.badge-gray {
  background: rgba(0, 0, 0, 0.05);
  color: var(--gray-mid);
  border-color: var(--border-color);
}

.badge-red {
  background: rgba(227, 6, 19, 0.1);
  color: var(--red);
  border-color: rgba(227, 6, 19, 0.2);
}

.badge-blue {
  background: rgba(37, 99, 235, 0.1);
  color: #2563EB;
  border-color: rgba(37, 99, 235, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   NUESTRA FLOTA SECTION (GALERÍA INTERACTIVA)
   ============================================================ */
.fleet-section {
  position: relative;
  background: var(--gray-light);
  padding: 60px 0;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--dark);
}

.section-subtitle {
  text-align: center;
  color: var(--gray-mid);
  max-width: 700px;
  margin: 0 auto 40px auto;
  font-size: 1rem;
}

.fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 30px;
}

.fleet-card {
  border-radius: 12px;
  overflow: hidden;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.fleet-card-img {
  height: 200px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
}

.fleet-card-img img {
  max-width: 90%;
  max-height: 85%;
  object-fit: contain;
  transition: var(--transition);
}

.fleet-card:hover .fleet-card-img img {
  transform: scale(1.08) translateY(-5px);
}

.fleet-card-body {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.fleet-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.fleet-card-title {
  font-family: var(--font);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
}

.fleet-card-description {
  font-size: 0.9rem;
  color: var(--gray-mid);
  margin-bottom: 20px;
  line-height: 1.5;
  flex-grow: 1;
}

.fleet-card-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.fleet-spec-item {
  display: flex;
  flex-direction: column;
}

.fleet-spec-label {
  font-size: 0.72rem;
  color: var(--gray-mid);
  text-transform: uppercase;
  font-weight: 600;
}

.fleet-spec-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--dark);
}

.fleet-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fleet-view-details {
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--red);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color var(--transition);
}

.fleet-view-details:hover {
  color: var(--red-dark);
}

.fleet-view-details i {
  transition: var(--transition);
}

.fleet-view-details:hover i {
  transform: translateX(4px);
}

/* ============================================================
   FICHA DE DETALLES LATERAL (SIDE DRAWER SPEC)
   ============================================================ */
.details-drawer {
  position: fixed;
  top: 0;
  right: -500px;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  z-index: 2000;
  background: var(--white);
  border-left: 1px solid var(--border-color);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.08);
  transition: var(--transition);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.details-drawer.active {
  right: 0;
}

.drawer-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--gray-light);
}

.drawer-title-group h3 {
  font-family: var(--font);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 4px;
}

.drawer-title-group p {
  font-size: 0.85rem;
  color: var(--gray-mid);
  margin: 0;
}

.close-drawer {
  font-size: 1.5rem;
  color: var(--gray-mid);
  cursor: pointer;
  transition: var(--transition);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
}

.close-drawer:hover {
  color: var(--red);
}

.drawer-content {
  padding: 24px;
  flex-grow: 1;
  overflow-y: auto;
}

.drawer-img-container {
  height: 200px;
  background: #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
}

.drawer-img-container img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.drawer-section-title {
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(227, 6, 19, 0.2);
  padding-bottom: 6px;
  margin-top: 16px;
}

.drawer-desc {
  font-size: 0.92rem;
  color: var(--gray-mid);
  margin-bottom: 24px;
  line-height: 1.6;
}

.drawer-specs-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 30px;
}

.drawer-table-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--gray-light);
  border: 1px solid var(--border-color);
}

.drawer-row-label {
  font-size: 0.85rem;
  color: var(--gray-mid);
  font-weight: 500;
}

.drawer-row-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--dark);
}

.drawer-footer {
  padding: 24px;
  border-top: 1px solid var(--border-color);
  background: var(--gray-light);
}

/* ============================================================
   NUESTROS SERVICIOS SECTION (ACORDEÓN EXPANDIBLE)
   ============================================================ */
.services-section {
  position: relative;
  padding: 60px 0;
}

.services-accordion {
  max-width: 850px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.accordion-item {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--white);
  transition: var(--transition);
}

.accordion-item.active {
  border-color: var(--red);
  box-shadow: var(--shadow-md);
}

.accordion-header {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.accordion-header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.accordion-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: rgba(227, 6, 19, 0.08);
  border: 1px solid rgba(227, 6, 19, 0.15);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: var(--transition);
}

.accordion-item.active .accordion-icon-box {
  background: var(--red);
  color: var(--white);
  box-shadow: 0 0 15px rgba(227, 6, 19, 0.35);
}

.accordion-header-text h3 {
  font-family: var(--font);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}

.accordion-header-text p {
  font-size: 0.88rem;
  color: var(--gray-mid);
}

.accordion-arrow {
  font-size: 1.1rem;
  color: var(--gray-mid);
  transition: var(--transition);
}

.accordion-item.active .accordion-arrow {
  transform: rotate(180deg);
  color: var(--red);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0 24px;
}

.accordion-content-inner {
  padding-bottom: 28px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
}

@media (max-width: 768px) {
  .accordion-content-inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.service-details-left p {
  font-size: 0.95rem;
  color: var(--gray-mid);
  line-height: 1.7;
  margin-bottom: 20px;
}

.service-features-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
}

.service-features-list li {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.service-features-list li i {
  color: var(--red);
  font-size: 0.85rem;
}

.service-details-right {
  background: var(--gray-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.transit-card {
  text-align: center;
}

.transit-icon {
  font-size: 1.8rem;
  color: var(--red);
  margin-bottom: 8px;
}

.transit-label {
  font-size: 0.75rem;
  color: var(--gray-mid);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.transit-time {
  font-family: var(--font);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--dark);
  margin-top: 4px;
}

/* ============================================================
   SECCIÓN DE COTIZACIÓN (FORMULARIO HUBSPOT)
   ============================================================ */
.quote-section {
  padding: 60px 0;
  background: var(--gray-light);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.quote-container {
  max-width: 600px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border-color);
  padding: 40px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

/* Hide global search container for clients */
.client-page-body #global-map-search-container {
  display: none !important;
}

/* Force white WhatsApp button text and icon in Leaflet popups */
.popup-driver-row a.btn-red,
.popup-driver-row a.btn-red i {
  color: #ffffff !important;
}
