/* =========================================
   1. VARIABLES Y CONFIGURACIÓN BASE
   ========================================= */
:root {
  --primary-color: #ff002e;
  --bg-light: #f8f8f8;
  --bg-table-alt: #e9e9e9;
  --border-color: #d1d1d1;
  --text-dark: #333;
  --text-light: #fff;
  --font-main: 'Lato', sans-serif;
  --border-radius: 8px;
}

* { box-sizing: border-box; }

.seccion-locales {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  font-family: var(--font-main);
  color: var(--text-dark);
}

/* =========================================
   2. ESTRUCTURA Y TARJETAS (Mobile-First)
   ========================================= */
.galeria-locales {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin: 40px 0;
}
.galeria-locales img {
  width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.proyecto-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px; /* Un poco menos de padding en móvil */
  margin-bottom: 50px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.proyecto-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 15px;
  margin-bottom: 30px;
}
.proyecto-logo { max-width: 150px; }
.proyecto-logo img { width: 100%; height: auto; }

.proyecto-title-group h2 {
  font-size: 1.8em;
  font-weight: 700;
  margin: 0;
  color: var(--text-dark);
}
.proyecto-title-group p {
  font-size: 1.1em;
  color: #666;
  margin: 5px 0 0;
}

.proyecto-descripcion {
  background-color: var(--bg-light);
  padding: 15px 20px;
  border-left: 4px solid var(--primary-color);
  border-radius: 4px;
  margin: 0 auto 30px auto;
  line-height: 1.6;
  max-width: 1400px;
  font-size: 1em;
  text-align: center;
}

.proyecto-media {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 30px;
}
/* Estilo solo para la foto panorámica */
.proyecto-media img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: var(--border-radius);
}

/* La nueva "caja" que recortará la barra gris */
.mapa-contenedor {
  width: 100%;
  height: 250px; /* La altura que queremos ver */
  border-radius: var(--border-radius);
  overflow: hidden; /* Esto es la magia: esconde todo lo que se salga de la caja */
}

/* El mapa se empuja hacia arriba */
.mapa-contenedor iframe {
  width: 100%;
  height: 310px; /* 250px + 60px de la barra gris */
  margin-top: -60px; /* Empujamos el mapa hacia arriba para ocultar la barra */
  border: none;
}

/* =========================================
   3. ICONOS (Mobile-First)
   ========================================= */
.caracteristicas-locales {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 columnas en móvil */
  gap: 30px 10px;
  max-width: 400px;
  margin: 0 auto 40px auto; 
  justify-content: center;
}

.caracteristica-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* =========================================
   ANIMACIÓN DE ENTRADA (Aparecer desde abajo y latir)
   ========================================= */
@keyframes aparecerYLatir {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(1); /* Empieza transparente y 40px más abajo */
  }
  60% {
    opacity: 1;
    transform: translateY(0) scale(1); /* Llega a su posición final totalmente visible */
  }
  80% {
    opacity: 1;
    transform: translateY(0) scale(1.3); /* Hace el pequeño "rebote" creciendo un 10% */
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1); /* Vuelve a su tamaño normal y se queda ahí */
  }
}

.caracteristica-icono {
  width: 65px; 
  height: 65px;
  margin: 0 auto 12px auto; 
  color: var(--text-dark); 
  transform-origin: center center;
  
  opacity: 0; /* Lo empezamos invisible para que no parpadee antes de animarse */
  
  /* Se ejecuta en 1.2 segundos, con curva suave (ease-out), 1 sola vez y se queda fijo (forwards) */
  animation: aparecerYLatir 1.6s ease-out forwards; 
}

/* =========================================
   EFECTO CASCADA (Retraso entre iconos)
   ========================================= */
/* El primero arranca de inmediato */
.caracteristica-item:nth-child(1) .caracteristica-icono {
  animation-delay: 0s;
}

/* El segundo espera 0.2 segundos */
.caracteristica-item:nth-child(2) .caracteristica-icono {
  animation-delay: 0.2s;
}

/* El tercero espera 0.4 segundos */
.caracteristica-item:nth-child(3) .caracteristica-icono {
  animation-delay: 0.4s;
}

/* El cuarto es el último en aparecer */
.caracteristica-item:nth-child(4) .caracteristica-icono {
  animation-delay: 0.6s;
}

.caracteristica-icono svg,
.caracteristica-icono img {
  width: 100%;
  height: 100%;
}

.caracteristica-item p {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.8em; 
  margin: 0;
  text-transform: uppercase;
  color: var(--text-dark);
}

/* =========================================
   4. TABLA RESPONSIVA (MÓVIL)
   (Aquí apilamos los datos y ocultamos la cabecera)
   ========================================= */
.table-container { width: 100%; }
.r-table { width: 100%; font-size: clamp(0.85em, 1vw, 15px); }

/* OCULTAMOS LA FRANJA ROJA EN MÓVIL */
.r-header-group { display: none; } 

.r-cell-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.r-cell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border-color);
  text-align: right;
  background: #fff; /* Aseguramos fondo blanco en móvil */
}
.r-cell:last-child { border-bottom: none; }

/* ETIQUETAS ROJAS (Visibles en móvil) */
.r-label {
  display: block;
  font-weight: bold;
  color: var(--text-light);
  background: #7A7A7A; /* <-- Aquí cambiaste el rojo por el gris en móvil */
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.85em;
  margin-right: 10px;
}

.btn-contacto-ejecutivo {
  display: block;
  width: fit-content; /* Evita que el botón ocupe el 100% del ancho */
  margin: 30px auto; /* Lo centra horizontalmente */
  background-color: var(--primary-color);
  color: var(--text-light);
  padding: 12px 30px;
  border: none;
  border-radius: 4px;
  font-size: 0.90em;
  font-weight: bold;
  text-transform: uppercase;
  text-decoration: none; /* Elimina la línea de abajo típica de los enlaces */
  text-align: center;
  transition: background-color 0.3s ease;
}

.btn-contacto-ejecutivo:hover { 
  background-color: #d00025; 
  color: #fff; /* Asegura que siga siendo blanco al pasar el mouse */
}

/* =========================================
   5. MEDIA QUERIES (ESCRITORIO > 768px)
   ========================================= */
@media screen and (min-width: 769px) {
  
  .proyecto-card { padding: 40px; }
  .proyecto-logo { max-width: 220px; }
  .proyecto-title-group h2 { font-size: 2em; }
  .galeria-locales { grid-template-columns: repeat(4, 1fr); }
  
  .proyecto-media {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
  .proyecto-media img { order: 1; }
  .proyecto-media iframe { order: 2; }
  
  /* --- ICONOS ESCRITORIO --- */
  .caracteristicas-locales {
    grid-template-columns: repeat(4, 1fr); /* 4 en línea */
    max-width: 900px; 
    margin: 0 auto 50px auto;
    gap: 40px; 
  }
  .caracteristica-icono { width: 75px; height: 75px; }
  .caracteristica-item p { font-size: 0.9em; }

  /* --- TABLA ESCRITORIO (Diseño clásico) --- */
  .r-table {
    display: table;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden; 
  }

  .r-header-group { display: table-row; } /* Mostramos la franja roja */
  
  .r-header {
    display: table-cell;
    background: #7A7A7A; /* <-- Aquí cambiaste el rojo por el gris */
    color: var(--text-light);
    padding: 15px 10px;
    font-weight: 700;
    text-align: center;
    vertical-align: middle;
    border-right: 1px solid #383838; 
    border-bottom: 1px solid #383838;
  }
  .r-header:last-child { border-right: none; }

  .r-cell-group { 
    display: table-row; 
    margin-bottom: 0;
    border: none;
    border-radius: 0;
  }
  
  /* Filas intercaladas en PC */
  .r-cell-group:nth-child(even) { background: #fff; }
  .r-cell-group:nth-child(odd) { background: var(--bg-table-alt); }

  .r-cell {
    display: table-cell;
    padding: 15px 10px;
    text-align: center;
    vertical-align: middle;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background: transparent; /* Quitamos el fondo forzado del móvil */
    /* --- NUEVAS LÍNEAS PARA TAMAÑO Y GROSOR --- */
    font-size: 0.95em; /* Aumenta el tamaño de la letra (puedes subirlo a 1.2em si quieres más) */
    font-weight: 600; /* Hace la letra más gruesa (Semi-Bold). Usa 500 para Medio o 700 para Bold */
    color: #222; /* Un gris casi negro para que contraste perfecto y se lea impecable */
  }
  /* Restauramos la línea inferior para la última columna en PC */
  .r-cell:last-child { 
    border-right: none; 
    border-bottom: 1px solid var(--border-color); 
  }
  
  /* Aseguramos que solo la ÚLTIMA FILA de toda la tabla pierda el borde inferior */
  .r-table .r-cell-group:last-child .r-cell { 
    border-bottom: none; 
  }

  /* Ocultamos las etiquetas rojas pequeñas en PC */
  .r-label { display: none; } 
}