/* ==========================================================================
   Herramienta: Estado de las playas, oleaje y previsión de surf en directo
   Fijate Tools • Estándares canónicos
   ========================================================================== */

:root {
  --bg-main: #0a0f1d;
  --bg-card: #111a2e;
  --bg-card-subtle: #16223b;
  --bg-input: #0e1626;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(14, 165, 233, 0.4);
  --border-active: #0ea5e9;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --color-primary: #0ea5e9;
  --color-primary-hover: #38bdf8;
  --color-ocean: #0284c7;
  --color-deep-ocean: #0369a1;

  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;

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

  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 25px -5px rgba(14, 165, 233, 0.3);

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-input: #f8fafc;
  --border-color: #e2e8f0;
  --border-color-hover: #93c5fd;
  --border-active: #0284c7;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --shadow-card: 0 4px 15px -2px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 20px -5px rgba(2, 132, 199, 0.2);
}

/* Reset y estructura básica */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-main);
}

button, input, select {
  font-family: inherit;
}

/* Layout principal */
.tool-layout {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  width: 100%;
  flex: 1 0 auto;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Barra lateral de publicidad (desktop >= 1536px) */
.tool-ad-sidebar {
  display: none;
  width: 300px;
  flex-shrink: 0;
}

@media (min-width: 1536px) {
  .tool-layout {
    max-width: 1520px;
  }
  .tool-ad-sidebar {
    display: block;
  }
  .ad-sticky-box {
    position: sticky;
    top: 5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
}

/* ==========================================================================
   Sección de búsqueda, geolocalización y filtros
   ========================================================================== */
.marine-search-bar-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-card);
}

.marine-search-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.search-input-wrapper {
  position: relative;
  flex: 1 1 280px;
  min-width: 240px;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
  opacity: 0.7;
}

.beach-input-control {
  width: 100%;
  height: 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 1rem 0 2.5rem;
  color: var(--text-main);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.beach-input-control:focus {
  outline: none;
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.beach-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color-hover);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  max-height: 280px;
  overflow-y: auto;
}

.search-result-item {
  padding: 0.65rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s ease;
}

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

.search-result-item:hover {
  background: var(--bg-card-subtle);
}

.search-result-item .result-name {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.92rem;
}

.search-result-item .result-loc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.search-remote-prompt {
  font-style: italic;
  color: var(--color-primary);
  font-size: 0.88rem;
}

.btn-action-marine {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 44px;
  padding: 0 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-locate {
  background: var(--bg-card-subtle);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-locate:hover {
  background: rgba(14, 165, 233, 0.15);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.units-controls-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.unit-select-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 0.5rem;
  height: 44px;
}

.unit-select-item label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.marine-select-control {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  max-width: 110px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.marine-select-control option {
  background: var(--bg-card);
  color: var(--text-main);
}

/* Chips de regiones (sin scrollbar horizontal según Lección 168) */
.regions-chips-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.regions-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.regions-buttons-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.btn-region-filter {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.85rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 32px;
}

.btn-region-filter:hover {
  background: var(--bg-card-subtle);
  color: var(--text-main);
  border-color: var(--border-color-hover);
}

.btn-region-filter.active {
  background: rgba(14, 165, 233, 0.15);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
}

/* Barra de favoritos */
.favorites-bar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.favorites-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.favorites-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.empty-fav-msg {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
}

.favorite-chip {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.75rem;
  color: var(--text-main);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.favorite-chip:hover {
  border-color: var(--color-warning);
  color: var(--color-warning);
}

/* ==========================================================================
   Tarjeta del mapa interactivo
   ========================================================================== */
.card-main {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.map-view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.spot-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.spot-heading {
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.spot-category-badge {
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.3);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.btn-favorite-star {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.75rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-favorite-star:hover,
.btn-favorite-star.is-favorite {
  border-color: var(--color-warning);
  color: var(--color-warning);
  background: rgba(245, 158, 11, 0.1);
}

/* Popups del mapa Leaflet */
.leaflet-popup-content-wrapper {
  background: var(--bg-card) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-color-hover) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45) !important;
  padding: 0 !important;
}

.leaflet-popup-tip {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color-hover) !important;
}

.spot-popup-card {
  padding: 0.85rem 1rem;
}

.spot-popup-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.15rem;
}

.spot-popup-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.spot-popup-desc {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-dim);
  margin: 0.35rem 0 0.75rem;
}

.btn-select-spot {
  width: 100%;
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
  transition: all 0.15s ease;
  display: block;
  text-align: center;
}

.btn-select-spot:hover {
  background: var(--color-primary-hover);
}

.spot-location-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.map-hint-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.map-wrapper-box {
  position: relative;
  width: 100%;
  height: 380px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.leaflet-marine-canvas {
  width: 100%;
  height: 100%;
  background: #020617;
}

/* En vista satelital y por defecto se preserva el color fotográfico natural de la costa */
.leaflet-marine-canvas .leaflet-tile-pane {
  filter: none !important;
}

/* Adaptación náutica de OpenStreetMap a tema oscuro únicamente en la capa callejera */
[data-theme="dark"] .leaflet-marine-canvas.is-streets-layer .leaflet-tile-pane {
  filter: brightness(0.65) invert(100%) contrast(120%) hue-rotate(195deg) saturate(35%) !important;
}

/* Conmutador flotante Satélite / Mapa callejero */
.leaflet-layer-switch-box {
  display: flex;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 3px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  margin-top: 10px !important;
  margin-left: 10px !important;
}

.btn-map-layer-switch {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-map-layer-switch:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-map-layer-switch.active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.4);
}

.marine-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 29, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  z-index: 1000;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.spinner-ocean {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(14, 165, 233, 0.2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spinOcean 0.8s linear infinite;
}

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

.spot-description-text {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 1rem;
}

/* Iconos de pines Leaflet */
.custom-leaflet-pin {
  background: transparent;
  border: none;
}

.custom-spot-pin {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0f172a;
  border: 2px solid #38bdf8;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.custom-spot-pin:hover {
  transform: scale(1.2);
  border-color: #fff;
}

.pin-surf { border-color: #0ea5e9; }
.pin-kite { border-color: #10b981; }
.pin-beach { border-color: #f59e0b; }

.custom-active-pin {
  background: transparent;
  border: none;
}

.active-spot-pulse {
  position: relative;
  width: 28px;
  height: 28px;
}

.pulse-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #38bdf8;
  border: 2px solid #fff;
  box-shadow: 0 0 10px #38bdf8;
}

.pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #38bdf8;
  animation: pulseAnimation 1.6s cubic-bezier(0.25, 1, 0.5, 1) infinite;
}

@keyframes pulseAnimation {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Popups de Leaflet personalizados */
.fijate-popup .leaflet-popup-content-wrapper {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 0;
}

.fijate-popup .leaflet-popup-content {
  margin: 0.85rem;
  line-height: 1.4;
}

.spot-popup-card .spot-popup-title {
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.spot-popup-card .spot-popup-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.spot-popup-card .spot-popup-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.spot-popup-card .btn-select-spot {
  width: 100%;
  padding: 0.4rem;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}

/* ==========================================================================
   Hero Cards de Estado (Puntuación de Surf y Bandera de playa)
   ========================================================================== */
.hero-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.hero-tag {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.hero-subtag {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.score-badge {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
}

.score-epic { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid #c084fc; }
.score-great { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid #34d399; }
.score-good { background: rgba(14, 165, 233, 0.2); color: #38bdf8; border: 1px solid #38bdf8; }
.score-fair { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid #fbbf24; }
.score-flat { background: rgba(100, 116, 139, 0.2); color: #94a3b8; border: 1px solid #94a3b8; }
.score-choppy { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid #f87171; }

.hero-score-main {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.score-number-box {
  display: flex;
  align-items: baseline;
}

.score-number {
  font-family: var(--font-mono);
  font-size: 3.4rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
}

.score-scale {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-left: 0.25rem;
}

.score-details-box {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.factor-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.factor-value {
  color: var(--text-main);
  font-size: 0.95rem;
}

.factor-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Bandera de playa */
.beach-flag-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}

.beach-flag-box .flag-icon {
  font-size: 2.2rem;
}

.beach-flag-box .flag-label {
  font-size: 1.05rem;
  font-weight: 700;
}

.beach-flag-box .flag-desc {
  font-size: 0.85rem;
  line-height: 1.35;
  margin-top: 0.2rem;
}

.flag-green {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.flag-yellow {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.flag-red {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* ==========================================================================
   Cuadrícula de KPIs principales
   ========================================================================== */
.marine-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.marine-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.marine-kpi-card:hover {
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
}

.kpi-icon-wrap {
  font-size: 1.6rem;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
}

.compass-indicator-wrap {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
}

.compass-arrow-needle {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-primary);
  display: inline-block;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.wind-needle {
  color: #38bdf8;
}

.current-needle {
  color: #a855f7;
}

.kpi-data-wrap {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-width: 0;
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.kpi-main-val {
  font-family: var(--font-mono);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.kpi-unit {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-subtext {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.kpi-subtext-light {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.kpi-secondary-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.kpi-direction-inline {
  font-size: 1rem;
  color: var(--text-muted);
  margin-left: 0.4rem;
}

.kpi-wind-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.2rem;
}

.badge-effect {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.badge-offshore { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid #34d399; }
.badge-cross-offshore { background: rgba(14, 165, 233, 0.2); color: #38bdf8; border: 1px solid #38bdf8; }
.badge-cross-shore { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid #fbbf24; }
.badge-cross-onshore { background: rgba(249, 115, 22, 0.2); color: #fb923c; border: 1px solid #fb923c; }
.badge-onshore { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid #f87171; }

.wetsuit-recommendation {
  color: var(--color-primary);
  font-weight: 600;
}

.kpi-dual-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* ==========================================================================
   Semáforos por actividad náutica
   ========================================================================== */
.section-title-wrap {
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.activities-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.activity-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  border-left: 4px solid var(--border-color);
}

.activity-card.status-ideal,
.activity-card.status-good {
  border-left-color: var(--color-success);
}

.activity-card.status-fair,
.activity-card.status-neutral {
  border-left-color: var(--color-warning);
}

.activity-card.status-poor,
.activity-card.status-bad,
.activity-card.status-danger,
.activity-card.status-challenging {
  border-left-color: var(--color-danger);
}

.act-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.act-icon {
  font-size: 1.6rem;
}

.act-name {
  font-size: 1rem;
}

.act-status-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.act-desc-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ==========================================================================
   Línea de tiempo interactiva (Gráfico SVG)
   ========================================================================== */
.title-with-badge {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.badge-timeline-mode {
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.25);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.timeline-chart-container {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 0.5rem;
  overflow-x: auto;
}

.timeline-svg {
  width: 100%;
  height: 200px;
  display: block;
}

/* ==========================================================================
   Previsión horaria detallada
   ========================================================================== */
.hourly-table-wrapper {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.hourly-table-header {
  display: grid;
  grid-template-columns: 85px 50px 1.5fr 1.5fr 70px;
  background: var(--bg-card-subtle);
  padding: 0.65rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.hourly-rows-container {
  max-height: 380px;
  overflow-y: auto;
}

.hourly-row {
  display: grid;
  grid-template-columns: 85px 50px 1.5fr 1.5fr 70px;
  align-items: center;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.88rem;
  transition: background 0.15s ease;
}

.hourly-row:hover {
  background: var(--bg-card-subtle);
}

.h-col {
  display: flex;
  flex-direction: column;
}

.h-time .h-day {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.h-time .h-hour {
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.h-weather-icon {
  font-size: 1.3rem;
}

.h-wave-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--color-primary);
}

.h-wave-period {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.h-wind-speed {
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

.wind-arrow {
  display: inline-block;
  color: var(--color-primary);
  font-weight: 800;
}

.h-wind-tag {
  font-size: 0.72rem;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  margin-top: 0.15rem;
  display: inline-block;
  width: fit-content;
}

.h-score-badge {
  font-family: var(--font-mono);
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 0.85rem;
}

/* ==========================================================================
   Pronóstico semanal a 7 días
   ========================================================================== */
.daily-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.daily-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  transition: transform 0.15s ease;
}

.daily-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-color-hover);
}

.daily-day-name {
  font-size: 0.95rem;
  font-weight: 700;
}

.daily-day-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.daily-icon {
  font-size: 1.8rem;
  margin: 0.2rem 0;
}

.daily-stat {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.daily-stat .stat-label {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.daily-stat .stat-val {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
}

.stat-wave {
  color: var(--color-primary);
}

.daily-temp-range {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  margin-top: 0.3rem;
  color: var(--text-muted);
}

.temp-max { color: var(--text-main); font-weight: 700; }
.temp-min { color: var(--text-dim); }

/* ==========================================================================
   Calibrador de orientación de playa (Brújula interactiva)
   ========================================================================== */
.compass-tuning-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  align-items: center;
}

.compass-visual-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.compass-rose-container {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 3px solid var(--border-color);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4);
}

.compass-dial-ring {
  position: absolute;
  inset: 0;
}

.cardinal-mark {
  position: absolute;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.mark-n { top: 6px; left: 50%; transform: translateX(-50%); color: var(--color-danger); }
.mark-e { right: 8px; top: 50%; transform: translateY(-50%); }
.mark-s { bottom: 6px; left: 50%; transform: translateX(-50%); }
.mark-w { left: 8px; top: 50%; transform: translateY(-50%); }

.compass-interactive-needle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 120px;
  margin-top: -60px;
  margin-left: -3px;
  transition: transform 0.2s ease;
  pointer-events: none;
}

.needle-tip {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 60px solid var(--color-primary);
}

.needle-tail {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 60px solid var(--text-dim);
}

.compass-readout {
  text-align: center;
}

.readout-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
}

.readout-value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: var(--color-primary);
}

.compass-controls-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.control-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.slider-with-number {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.marine-range-slider {
  flex: 1 1 0%;
  accent-color: var(--color-primary);
  height: 8px;
  cursor: pointer;
}

.marine-number-input {
  width: 75px;
  height: 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
}

.compass-presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.presets-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.btn-compass-preset {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-compass-preset:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-apply-compass {
  background: var(--color-primary);
  color: #fff;
  align-self: flex-start;
}

.btn-apply-compass:hover {
  background: var(--color-primary-hover);
}

/* ==========================================================================
   Guías didácticas y modales
   ========================================================================== */
.guide-buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.guide-trigger-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.guide-trigger-card:hover {
  background: var(--bg-card);
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.guide-icon {
  font-size: 1.8rem;
}

.guide-name {
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.guide-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Modal nativo */
.marine-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.marine-modal-backdrop.is-active {
  display: flex;
}

.marine-modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color-hover);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  padding: 1.5rem;
}

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

.marine-modal-title {
  font-size: 1.25rem;
}

.marine-modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}

.marine-modal-close-btn:hover {
  color: var(--text-main);
}

.marine-modal-body {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.marine-modal-body p {
  margin-bottom: 0.75rem;
}

.marine-modal-body ul {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.marine-modal-body li {
  margin-bottom: 0.4rem;
}

.marine-modal-body strong {
  color: var(--text-main);
}

/* Toast de notificación flotante */
.marine-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--color-primary);
  color: var(--text-main);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  font-size: 0.88rem;
  font-weight: 500;
  z-index: 2500;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.marine-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Responsive móvil (Reglas canónicas de fijate.com)
   ========================================================================== */
@media (max-width: 768px) {
  .tool-layout {
    margin-top: 1rem;
    padding: 0 0.75rem;
  }

  .card-main {
    padding: 1.15rem;
  }

  .spot-heading {
    font-size: 1.35rem;
  }

  .map-wrapper-box {
    height: 280px;
  }

  .hero-score-main {
    gap: 1rem;
  }

  .score-number {
    font-size: 2.8rem;
  }

  .compass-tuning-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .hourly-table-header,
  .hourly-row {
    grid-template-columns: 65px 40px 1.2fr 1.2fr 55px;
    padding: 0.5rem;
    font-size: 0.8rem;
  }

  .btn-locate,
  .btn-apply-compass {
    width: 100%;
    height: 44px;
  }
}

