body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: #333;
  background-color: #ffffff;
}

header {
  background-color: #003366;
  color: white;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0; /* elimina cualquier margen extra */
}

header img {
  height: 50px;
}

nav a {
  color: white;
  margin: 0 10px;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease, transform 0.2s ease;
}

nav a:hover {
  color: #FFD700;
  transform: scale(1.05);
}

/* --- HERO --- */
.hero {
  background-color: #003366;
  color: white;
  text-align: center;
  padding: 30px 15px; /* REDUCIDO para menos espacio */
  margin: 0;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeSlideIn 1s ease-out forwards;
}

.hero h1 {
  font-size: 2rem;
  margin: 10px 0;
}

.hero p {
  margin: 0;
}

/* --- SECTIONS --- */
.section {
  padding: 40px 20px;
  max-width: 1200px;
  margin: auto;
}

/* --- QUIENES SOMOS BLOCK --- */
.quienes-block {
  background: #f9f9f9;
  border-left: 5px solid #003366;
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* --- PRODUCTOS --- */
.productos {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.producto {
  background-color: #f4f4f4;
  border-radius: 10px;
  padding: 20px;
  flex: 1 1 250px;
  text-align: center;
  border-top: 5px solid #003366;
}

.producto:nth-child(2) { border-top-color: #ff6600; }
.producto:nth-child(3) { border-top-color: #339933; }
.producto:nth-child(4) { border-top-color: #FFD966; } /* Gestión Logística */

/* --- ANIMACIÓN HERO --- */
@keyframes fadeSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- FOOTER --- */
footer {
  background-color: #003366;
  color: white;
  text-align: center;
  padding: 15px;
  font-size: 0.9rem;
}

/* --- CONTACTO --- */
#contacto {
  text-align: left;
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

#contacto h2 {
  font-size: 2em;
  margin-bottom: 20px;
  text-align: center;
}

.contact-card {
  background: #f9f9f9;
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.contact-card h3 {
  margin-bottom: 10px;
  color: #003366;
}

.contact-card a {
  color: #0066cc;
  text-decoration: none;
}

.contact-card a:hover {
  text-decoration: underline;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    padding: 15px;
  }
  nav a {
    margin: 5px;
  }
  .hero {
    padding: 20px 10px; /* menos espacio en móvil */
  }
  .hero h1 {
    font-size: 1.6rem;
  }
}

/* --- GALER\u00cdA DE FOTOS --- */
.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.gallery-item {
  position: relative;
  flex: 1 1 250px;
  overflow: hidden;
  border-radius: 8px;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

.gallery-item figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 10px;
  font-size: 0.9rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.gallery-item:hover figcaption {
  transform: translateY(0);
}

@media (max-width: 768px) {
  .gallery-item {
    flex: 1 1 100%;
  }
}

/* --- ACADEMIA --- */
.academia {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.card {
  background: #f4f4f4;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
}

.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.card h3 {
  margin: 15px;
  color: #003366;
}

.subtitulo {
  margin: 0 15px;
  font-weight: bold;
  color: #555;
}

.card p {
  margin: 0 15px 15px;
}

.toggle-btn {
  background: #003366;
  color: #fff;
  border: none;
  padding: 10px;
  margin: 0 15px 15px;
  cursor: pointer;
  border-radius: 4px;
}

.extra-content {
  display: none;
  margin: 0 15px 15px;
}
/* --- CAROUSEL --- */
.carousel {
  position: relative;
  width: 100%;
  max-width: 600px;
  aspect-ratio: 16/9;       /* altura automática según el ancho */
  margin: 20px auto;
  overflow: hidden;
  border: 5px solid #003366;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.carousel-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(1);
  transition: opacity 1s ease, transform 3s ease;
}

.carousel-image.active {
  opacity: 1;
  animation: zoom 3s ease-in-out;
}

@keyframes zoom {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 768px) {
  .carousel {
    aspect-ratio: 1/1;   /* carrusel cuadrado en móvil */
  }
}
