/* ============================================
   VARIABLES Y RESET
   ============================================ */

:root {
  --primary-color: #4CAF50;
  --primary-dark: #45a049;
  --secondary-color: #2d5016;
  --text-color: #333;
  --text-light: #666;
  --bg-light: #f8f8f8;
  --border-color: #ddd;
  --shadow: 0 2px 10px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ============================================
   NAVBAR
   ============================================ */

.navbar {
  background: white;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 60px;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--secondary-color);
  font-size: 1.3rem;
  font-weight: 700;
  transition: transform 0.3s;
}

.nav-logo:hover {
  transform: scale(1.05);
}

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

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

.nav-menu a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.3s;
  font-size: 1rem;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--primary-color);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.3s;
}

.hamburger:hover {
  background: rgba(76, 175, 80, 0.1);
}

.hamburger span {
  width: 26px;
  height: 3px;
  background: var(--secondary-color);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-20px);
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

.nav-menu-mobile {
  display: none;
  position: fixed;
  top: 60px;
  right: -100%;
  width: 280px;
  max-width: 85vw;
  height: calc(100vh - 60px);
  background: linear-gradient(180deg, #ffffff 0%, #f9f9f9 100%);
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
  transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  list-style: none;
  padding: 20px 0;
  overflow-y: auto;
  z-index: 998;
}

.nav-menu-mobile.active {
  right: 0;
}

.nav-menu-mobile a {
  padding: 18px 22px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-color);
  border-left: 4px solid transparent;
  transition: all 0.3s;
}

.nav-menu-mobile a:hover,
.nav-menu-mobile a.active {
  background: linear-gradient(90deg, rgba(76, 175, 80, 0.1) 0%, transparent 100%);
  border-left-color: var(--primary-color);
  color: var(--primary-color);
  padding-left: 28px;
}

.nav-overlay {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 499;
  opacity: 0;
  transition: opacity 0.3s;
}

.nav-overlay.active {
  display: block;
  opacity: 1;
}

@media (max-width: 968px) {
  .nav-menu {
    display: none;
  }
  
  .hamburger,
  .nav-menu-mobile {
    display: flex;
  }
}

/* ============================================
   SECCIÓN DE SETAS - MÁS GRANDE Y VISIBLE
   ============================================ */

.section-setas {
  padding: 12px 0 15px 0;
  background: white;
  border-bottom: 1px solid var(--border-color);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 30px;
}

.setas-stories-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) transparent;
}

.setas-stories-scroll::-webkit-scrollbar {
  height: 8px;
}

.setas-stories-scroll::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 10px;
}

.setas-stories-scroll::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
}

.setas-stories-grid {
  display: flex;
  gap: 15px;
  padding: 8px 5px;
}

/* Instagram Story Card - TAMAÑO CÓMODO */
.seta-story-card {
  position: relative;
  flex: 0 0 auto;
  width: 60px;
  cursor: pointer;
  transition: transform 0.2s ease;
  text-align: center;
}

.seta-story-card:hover {
  transform: scale(1.05);
}

.seta-story-ring {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  padding: 2px;
  background: #e0e0e0;
  margin-bottom: 6px;
  transition: all 0.3s ease;
}

.seta-story-card.selected .seta-story-ring {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  box-shadow: 0 3px 15px rgba(76, 175, 80, 0.5);
  padding: 3px;
}

.seta-story-photo-container {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: white;
  position: relative;
}

.seta-story-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.seta-story-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.seta-story-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 3px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60px;
}

.seta-story-temporada {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 16px;
}

.seta-story-temporada svg {
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.2));
}

/* Tick de selección - FUERA DEL CÍRCULO */
.seta-story-card.selected::after {
  content: '✓';
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--primary-color);
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 10;
  animation: checkAppear 0.3s ease;
}

@keyframes checkAppear {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* ============================================
   ELEMENTOS FLOTANTES
   ============================================ */

/* Contador flotante */
.contador-setas-floating {
  position: fixed;
  top: 80px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  border-radius: 20px;
  box-shadow: 0 3px 15px rgba(76, 175, 80, 0.4);
  z-index: 1002;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
}

.contador-setas-floating.show {
  opacity: 1;
  transform: scale(1);
}

.contador-setas-floating .contador-icon {
  font-size: 1.2rem;
  animation: pulse 2s ease-in-out infinite;
}

.contador-setas-floating .contador-texto {
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Botón limpiar flotante - 5px ANTES DEL MAPA */
.clear-seta-btn-floating {
  position: fixed;
  top: calc(60px + 122px - 36px - 5px);
  right: 20px;
  display: none;
  padding: 8px 18px;
  background: #f44336;
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 3px 12px rgba(244, 67, 54, 0.4);
  z-index: 1002;
}

.clear-seta-btn-floating:hover {
  background: #d32f2f;
  transform: translateY(-2px);
  box-shadow: 0 5px 16px rgba(244, 67, 54, 0.5);
}

.clear-seta-btn-floating.show {
  display: block;
}

/* ============================================
   PANEL DE UBICACIÓN FLOTANTE (CENTRADO EN MAPA)
   ============================================ */

.ubicacion-floating {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  width: 90%;
  max-width: 700px;
  pointer-events: auto;
}

.ubicacion-toggle-floating {
  width: 100%;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.98);
  border: none;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--secondary-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.ubicacion-toggle-floating:hover {
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.toggle-icon {
  font-size: 1.2rem;
}

.toggle-text {
  flex: 1;
  text-align: left;
}

.toggle-arrow {
  transition: transform 0.3s;
  color: var(--primary-color);
  font-size: 1rem;
}

.ubicacion-toggle-floating.active .toggle-arrow {
  transform: rotate(180deg);
}

.ubicacion-content-floating {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 12px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.ubicacion-content-floating.open {
  max-height: 400px;
  padding: 20px;
  margin-top: 8px;
}

.ubicacion-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 15px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.input-group label {
  font-weight: 600;
  color: var(--secondary-color);
  font-size: 0.85rem;
}

.input-group input {
  padding: 8px 10px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.ubicacion-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary,
.btn-outline {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  flex: 1;
}

.btn-small {
  padding: 7px 14px;
  font-size: 0.85rem;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

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

.btn-secondary:hover {
  background: #234012;
  transform: translateY(-2px);
}

.btn-secondary.active {
  background: #f44336;
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
}

/* ============================================
   MAPA (GIGANTE)
   ============================================ */

.section-mapa {
  padding: 0;
  background: white;
  height: calc(100vh - 60px - 122px);
  min-height: 500px;
  position: relative;
}

#map {
  height: 100%;
  width: 100%;
  position: relative;
}

.mapa-vacio-mensaje {
  background: rgba(255, 255, 255, 0.98);
  padding: 35px 45px;
  border-radius: 18px;
  box-shadow: 0 8px 35px rgba(0, 0, 0, 0.15);
  text-align: center;
  max-width: 550px;
  pointer-events: none;
}

.mapa-vacio-mensaje .icono-grande {
  font-size: 3.5rem;
  margin-bottom: 18px;
  animation: float 3s ease-in-out infinite;
}

.mapa-vacio-mensaje h3 {
  margin: 0 0 12px 0;
  color: var(--secondary-color);
  font-size: 1.6rem;
}

.mapa-vacio-mensaje p {
  margin: 8px 0;
  color: #555;
  font-size: 1rem;
  line-height: 1.5;
}

.mapa-vacio-mensaje .mensaje-secundario {
  margin-top: 18px;
  padding: 12px;
  background: #f0f7f0;
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--secondary-color);
  line-height: 1.7;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ============================================
   INDICADOR DE CARGA
   ============================================ */

.filter-loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.98);
  padding: 25px 40px;
  border-radius: 18px;
  box-shadow: 0 8px 35px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  display: none;
  text-align: center;
  animation: fadeIn 0.3s;
}

.filter-loading.show {
  display: block;
}

.filter-loading-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.filter-loading-text {
  font-size: 1.1rem;
  color: #333;
  font-weight: 600;
  margin-bottom: 6px;
}

.filter-loading-subtext {
  font-size: 0.9rem;
  color: #666;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  background: var(--secondary-color);
  color: white;
  padding: 40px 0 20px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 35px;
  margin-bottom: 25px;
}

.footer-col h4 {
  margin-bottom: 18px;
  font-size: 1.2rem;
}

.footer-col p {
  color: rgba(255,255,255,0.8);
  line-height: 1.7;
  font-size: 0.95rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: color 0.3s;
  font-size: 0.95rem;
}

.footer-col ul a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .navbar {
    height: 55px;
  }
  
  .section-setas {
    padding: 8px 0 12px 0;
  }
  
  .setas-stories-scroll {
    padding: 5px 0;
  }
  
  .setas-stories-grid {
    gap: 10px;
    padding: 3px;
  }
  
  .seta-story-card {
    width: 65px;
  }
  
  .seta-story-ring {
    width: 65px;
    height: 65px;
    margin-bottom: 5px;
  }
  
  .seta-story-name {
    font-size: 0.7rem;
    max-width: 65px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 3px;
    color: #222;
    text-shadow: 0 0 3px rgba(255,255,255,0.8);
  }
  
  .seta-story-fallback {
    font-size: 2rem;
  }
  
  .seta-story-temporada {
    height: 16px;
  }
  
  .seta-story-temporada svg {
    width: 15px;
    height: 15px;
  }
  
  .seta-story-card.selected::after {
    width: 18px;
    height: 18px;
    font-size: 0.75rem;
    top: -1px;
    right: -1px;
  }
  
  .ubicacion-floating {
    top: 15px;
    width: 95%;
    max-width: 90%;
  }
  
  .ubicacion-toggle-floating {
    padding: 10px 15px;
    font-size: 0.9rem;
  }
  
  .ubicacion-content-floating.open {
    padding: 15px;
  }
  
  .ubicacion-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .input-group label {
    font-size: 0.8rem;
  }
  
  .input-group input {
    padding: 7px 9px;
    font-size: 0.85rem;
  }
  
  .btn-small {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
  
  .ubicacion-actions {
    flex-direction: column;
  }
  
  /* ELEMENTOS FLOTANTES - DEBAJO EN MÓVIL */
  .contador-setas-floating {
    top: auto;
    bottom: 15px;
    right: 12px;
    left: auto;
    padding: 5px 11px;
    border-radius: 15px;
    font-size: 0.75rem;
  }
  
  .contador-setas-floating .contador-icon {
    font-size: 1rem;
  }
  
  .contador-setas-floating .contador-texto {
    font-size: 0.75rem;
  }
  
  .clear-seta-btn-floating {
    top: auto;
    bottom: 50px;
    right: 12px;
    left: auto;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.7rem;
  }
  
  .section-mapa {
    height: calc(100vh - 55px - 105px);
    min-height: 350px;
  }
  
  .mapa-vacio-mensaje {
    padding: 25px 30px;
    max-width: 90%;
  }
  
  .mapa-vacio-mensaje h3 {
    font-size: 1.3rem;
  }
  
  .mapa-vacio-mensaje p {
    font-size: 0.9rem;
  }
}