/* ================================================================= */
/* 1) VARIABLES GLOBALES, RESET Y BOX-SIZING                        */
/* ================================================================= */
:root {
  --rojo: #e60026;
  --azul: #0056b3;
  --gris-claro: #f0f6ff;
  --gris-oscuro: #444;
  --blanco: #ffffff;
  --gris-sombra: rgba(0, 0, 0, 0.1);
  --separador-color: #0056b3;
}

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

/* ================================================================= */
/* 2) TIPOGRAFÍAS Y BODY                                             */
/* ================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Anton&display=swap');
html, body {
  font-family: 'Poppins', sans-serif;
  color: var(--gris-oscuro);
  background-color: var(--gris-claro);
  scroll-behavior: smooth;
  width: 100%;
  line-height: 1.6;
}

/* ================================================================= */
/* 3) HEADER Y NAVEGACIÓN                                            */
/* ================================================================= */
/* === HEADER: igual que el primer diseño === */
/* === OVERRIDE HEADER PARA QUE QUEDE COMO EL PRIMER DISEÑO === */
/* ==== HEADER: copiar del primer diseño ==== */
header {
  background: var(--azul);
  padding: 10px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 10px var(--gris-sombra);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo {
  height: 80px;               /* idéntico tamaño */
  width: auto;
  filter: drop-shadow(0 0 5px var(--blanco));
  transform: scale(2.2);      /* mismo “zoom” */
  transform-origin: left center;
}

.header-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--blanco);
}
nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
}
nav ul li a {
  text-decoration: none;
  color: var(--blanco);
  padding: 6px 10px;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}
nav ul li a:hover {
  background-color: rgba(255, 255, 255, 0.2);
}



/* ================================================================= */
/* 4) BOTONES, CTA, MAP-BTN, TESTIMONIOS                             */
/* ================================================================= */
.map-btn {
  margin-top: 10px;
  background-color: var(--azul);
  color: white;
  padding: 8px 15px;
  border-radius: 5px;
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.3s;
}
.map-btn:hover { background-color: #003e80; }

.cta-section {
  text-align: center;
  background-color: #fff3f3;
  padding: 30px;
  margin: 40px 20px;
  border-radius: 10px;
}
.cta-text {
  font-size: 18px;
  color: var(--rojo);
}
.cta-text a {
  color: var(--azul);
  font-weight: bold;
  text-decoration: none;
}

.testimonios .location-card p {
  font-style: italic;
  font-size: 15px;
}
.testimonios .location-card strong {
  display: block;
  margin-top: 10px;
  font-weight: 600;
  color: var(--azul);
}

/* ================================================================= */
/* 5) HERO CAROUSEL                                                  */
/* ================================================================= */
.hero-carousel {
  position: relative;
  height: 70vh;
  overflow: hidden;
  border-radius: 0;
}
.hero-slide {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  border-radius: 0;
}
.hero-slide.active {
  opacity: 1;
  z-index: 1;
}
.hero-text {
  position: absolute;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  text-shadow: 0 0 8px rgba(0,0,0,0.6);
}

/* ================================================================= */
/* 6) SECCIONES GENERALES                                            */
/* ================================================================= */
section {
  background: linear-gradient(135deg, rgba(0,86,179,0.1), rgba(0,86,179,0.3));
  padding: 60px 20px;
  margin-bottom: 50px;
  border-radius: 15px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}
section:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

/* ================================================================= */
/* 7) PRODUCTOS / GRID                                               */
/* ================================================================= */
.productos-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
  padding: 40px 20px;
}
.producto-card {
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 18px;
  backdrop-filter: blur(8px);
  padding: 20px;
  width: 280px;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
  transition: all 0.4s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.producto-card:hover {
  background: rgba(255,255,255,0.9);
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0,86,179,0.25);
}

.producto-id {
  background: linear-gradient(to right, #003c80, #007bff);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0,60,128,0.3);
}

.producto-nombre {
  font-size: 18px;
  font-weight: 800;
  color: #1e1e1e;
  font-family: 'Roboto Condensed', sans-serif;
  line-height: 1.3;
  margin-top: 6px;
}
.producto-card img {
  border: 2px solid #000;           /* negro total */
  border-radius: 8px;               /* coincide con el radio existente */
  box-shadow: 0 2px 6px rgba(0,0,0,0.15); /* refuerza la definición */
}
.producto-card h3 {
  text-transform: capitalize;
}

.card-body img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  border-radius: 10px;
  margin: 12px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* ================================================================= */
/* 8) INFO SECTIONS                                                  */
/* ================================================================= */
.info-section {
  display: none;
  font-size: 13px;
  line-height: 1.4;
  text-align: justify;
  color: #333;
  margin-top: 8px;
}
.info-section.active { display: block; }
.info-section.descripcion { min-height: 100px; }
.info-toggle {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}
.info-toggle button {
  padding: 6px 14px;
  background-color: var(--azul);
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font-size: 13px;
  transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
}
.info-toggle button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0,86,179,0.2);
}

/* ================================================================= */
/* 9) UBICACIONES                                                    */
/* ================================================================= */
.ubicaciones-grid {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 30px;
  margin-top: 40px;
}
.ubicacion-card {
  background: var(--blanco);
  border: 2px solid var(--rojo);
  border-radius: 10px;
  width: 280px;
  padding: 20px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
}
.ubicacion-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}
.ubicacion-card i {
  font-size: 40px;
  color: var(--azul);
  margin-bottom: 10px;
}
.ubicacion-card h3 {
  font-size: 20px;
  color: var(--azul);
  margin-bottom: 15px;
}
.ubicacion-card .map-container {
  width: 100%;
  height: 300px;
  border-radius: 10px;
  overflow: hidden;
}
.ubicacion-card iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ================================================================= */
/* 10) MISIÓN & VISIÓN                                               */
/* ================================================================= */
.mision-vision-section {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding: 80px 20px;
  background: var(--gris-claro);
  border: 5px solid #8B0000;
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  margin-bottom: 50px;
}
.mision-vision-content {
  flex: 1 1 50%;
  padding-right: 20px;
}
.mision-vision-content h2 {
  font-size: 36px;
  font-weight: 700;
  color: var(--azul);
  margin-bottom: 20px;
}
.mision-vision-content p {
  font-size: 18px;
  color: var(--gris-oscuro);
  margin-bottom: 20px;
}
.btn-mision-vision {
  background: var(--rojo);
  color: var(--blanco);
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: 600;
  text-decoration: none;
  margin-right: 20px;
  display: inline-block;
}
.btn-mision-vision:hover {
  background: var(--blanco);
  color: var(--azul);
}
.mision-vision-image {
  flex: 1 1 40%;
  text-align: center;
}
.mision-vision-image img {
  width: 90%;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* ================================================================= */
/* 11) MATERIALES & ESPECIALIDADES                                   */
/* ================================================================= */
@keyframes fadeInZoom {
  0% { opacity: 0; transform: scale(0.7) translateY(30px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.materiales-section,
.especialidades-section {
  background: var(--gris-claro);
  padding: 60px 20px;
  margin-bottom: 20px;
  border: 5px solid #8B0000;
  border-radius: 15px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  opacity: 0;
  animation: fadeInZoom 1.5s ease-in-out forwards;
}
.materiales-section h2,
.especialidades-section h2 {
  color: var(--azul);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 40px;
}
.materiales-grid,
.especialidades-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: space-around;
}
.material-card,
.especialidad-card {
  background: var(--blanco);
  border: 2px solid var(--rojo);
  border-radius: 10px;
  width: 280px;
  padding: 20px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
  transition: transform 0.4s, box-shadow 0.4s;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInZoom 1s ease-in-out forwards;
}
.material-card:hover,
.especialidad-card:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.material-img,
.especialidad-img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 20px;
}
.material-card p,
.especialidad-card p {
  font-size: 14px;
  color: #555;
}

/* ================================================================= */
/* 12) SOCIAL MEDIA FLOAT                                            */
/* ================================================================= */
.social-media-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 1000;
}
.social-media-float a {
  background: white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: transform 0.3s, border 0.3s;
}
.social-media-float a:hover {
  transform: scale(1.1);
  border: 2px solid var(--rojo);
}
.social-media-float img {
  max-width: 60%;
  height: auto;
}

/* ================================================================= */
/* 13) FOOTER                                                        */
/* ================================================================= */
footer {
  background-color: var(--azul);
  color: var(--blanco);
  padding: 40px 100px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
footer .contact-info {
  flex: 1 1 40%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-right: 20px;
}
footer .contact-info h3 {
  margin-left: 30px;
}
footer .contact-info p {
  margin-left: 20px;
}
footer .social-media,
footer .app-buttons {
  display: flex;
  gap: 15px;
}
footer .social-media a,
footer .app-buttons a {
  color: var(--blanco);
  text-decoration: none;
  font-size: 20px;
}
footer .social-media a:hover {
  color: var(--rojo);
}
footer .app-buttons a {
  background-color: var(--blanco);
  color: var(--azul);
  padding: 10px 15px;
  border-radius: 5px;
  transition: background-color 0.3s;
}
footer .app-buttons a:hover {
  background-color: var(--rojo);
  color: var(--blanco);
}
footer p {
  text-align: center;
  width: 100%;
}
footer .conocenos-btn {
  background-color: var(--rojo);
  color: var(--blanco);
  padding: 12px 25px;
  border-radius: 50%;
  text-decoration: none;
  text-align: center;
  font-weight: 600;
  margin-top: 10px;
}
footer .conocenos-btn:hover {
  background-color: var(--azul);
}
footer .footer-main {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}
footer .footer-main .contact-info {
  position: absolute;
  left: 0;
}
footer .footer-main .conocenos-btn {
  text-align: center;
}
footer .footer-main .social-media {
  justify-content: flex-end;
}
.social-media-float a {
  background: white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: transform 0.3s, border 0.3s;
}

/* Font Awesome icon style */
.social-media-float a .fa-phone {
  font-size: 1.2rem;
  color: var(--azul);
}

.social-media-float a:hover {
  transform: scale(1.1);
  border: 2px solid var(--rojo);
}


/* ================================================================= */
/* 14) MEDIA QUERIES                                                 */
/* ================================================================= */
@media (max-width: 1024px) {
  .info-section { flex-direction: column; }
}

/* ================================================================= */
/* 15) CAROUSEL KEYFRAMES                                             */
/* ================================================================= */
@keyframes carousel {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
/* Bordes rojos en todas las tarjetas */
.producto-card,
.ubicacion-card,
.material-card,
.especialidad-card {
  border: 2px solid var(--rojo);
}
/* Justificar el texto de las tarjetas */
.producto-card p,
.ubicacion-card p,
.material-card p,
.especialidad-card p {
  text-align: justify;
  text-justify: inter-word; /* mejora el espaciado entre palabras en navegadores que lo soportan */
}
/* Centrar los títulos de las tarjetas */
.producto-card h3,
.producto-card .producto-nombre,
.ubicacion-card h3,
.material-card h3,
.especialidad-card h3 {
  text-align: center;
}
/* === HAMBURGUESA OCULTA EN DESKTOP === */
.menu-toggle {
  display: none;
}

/* === HEADER POR DEFECTO MÁS ALTO (desktop) === */
header {
  padding: 1.5rem 2.5rem; /* más “alto” verticalmente */
  height: 100px;         /* altura fija */
}

/* ===== TABLETAS (≤1024px) ===== */
@media (max-width: 1024px) {
  /* Mostrar hamburguesa */
  .menu-toggle {
    display: block !important;
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 2.5rem;
    color: #fff;
    z-index: 1002;
    cursor: pointer;
  }
  .menu-toggle i {
    font-size: 2.5rem; /* ajusta tamaño del icono */
    line-height: 1;
  }

  /* Nav deslizable */
  nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100%;
    background: var(--azul);
    padding: 4rem 1.5rem;
    transition: right .3s ease;
    z-index: 1001;
  }
  nav.open {
    right: 0;
  }

  /* Menú en columna */
  nav ul {
    flex-direction: column;
    gap: 1.5rem;
  }

  /* Centrar título y escalar logo */
  .header-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
  .logo {
    transform: scale(1.8);
  }
}

/* ===== MÓVIL (≤768px) ===== */
@media (max-width: 768px) {
  /* Header más alto y adaptativo */
  header {
    padding: 2rem 1rem;
    height: auto;
    position: relative;
    justify-content: center;
  }

  /* Logo compacto a la izquierda */
  .logo {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%) scale(1.2);
  }

  /* Título perfectamente centrado */
  .header-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  /* Botón hamburguesa grande y grueso */
  .menu-toggle {
    display: block;
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 2.5rem;
    color: #fff;
    cursor: pointer;
  }
  .menu-toggle i {
    font-size: inherit;
    line-height: 1;
  }

  /* Grid de categorías dos por fila */
  .category-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 1rem;
    padding: 1rem 5%;
  }
  .category-box {
    flex: 1 1 45%;
    max-width: 45%;
    height: auto;
    padding: 1rem;
  }

  /* Footer ocupa su espacio natural */
  footer {
    position: relative !important;
    padding: 1.5rem 1rem !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    width: 100% !important;
  }
  footer .footer-main,
  footer .footer-main .contact-info {
    position: static !important;
  }

  /* Asegura espacio abajo para barras de gesto en iOS */
  body {
    padding-bottom: calc(20px + env(safe-area-inset-bottom)) !important;
    /* para Safari más antiguo: */
    padding-bottom: calc(20px + constant(safe-area-inset-bottom)) !important;
  }
}
