/* Estilos generales */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f0f6fa;
  color: #333;
}

/* Encabezado */
.encabezado {
  text-align: center;
  background: #003366;
  color: #fff;
  padding: 20px;
}

.encabezado h1 {
  margin: 0;
  font-size: 2em;
}

.encabezado p {
  margin: 5px 0 0;
  font-size: 1.2em;
}

/* Sección catálogo */
#catalogo-motores {
  padding: 40px 20px;
}

.grid-motores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

/* Tarjeta de motor */
.motor {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-align: center;
  padding: 15px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.motor:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.motor img {
  max-width: 160px;
  height: auto;
  margin-bottom: 10px;
}

.motor h3 {
  margin: 10px 0 5px;
  font-size: 1.1em;
  color: #003366;
}

.motor p {
  margin: 0 0 10px;
  font-size: 0.95em;
  color: #555;
}

/* Botón dentro de tarjeta */
.motor .btn {
  display: inline-block;
  background: #0077cc;
  color: #fff;
  padding: 8px 15px;
  text-decoration: none;
  font-weight: bold;
  border-radius: 5px;
  transition: background 0.3s ease, transform 0.2s ease;
}

.motor .btn:hover {
  background: #005599;
  transform: scale(1.05);
}

/* Tarjetas con promoción */
.motor.promo {
  position: relative;
}

.motor .descuento {
  display: inline-block;
  background: #cc0000;
  color: #fff;
  font-weight: bold;
  padding: 5px 10px;
  border-radius: 4px;
  margin-top: 10px;
}

/* Botón de regresar */
.regresar {
  text-align: center;
  margin: 30px 0;
}

.regresar .btn {
  background: #0077cc;
  color: #fff;
  padding: 10px 20px;
  text-decoration: none;
  font-weight: bold;
  border-radius: 5px;
  transition: background 0.3s ease, transform 0.2s ease;
}

.regresar .btn:hover {
  background: #005599;
  transform: scale(1.05);
}

/* Footer */
footer {
  background: #003366;
  color: #fff;
  text-align: center;
  padding: 15px;
}

.filtros {
  text-align: center;
  margin: 20px 0;
}

.filtros button {
  background: #0077cc;
  color: #fff;
  border: none;
  padding: 10px 15px;
  margin: 0 5px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s ease, transform 0.2s ease;
}

.filtros button:hover {
  background: #005599;
  transform: scale(1.05);
}

.alerta-precios {
  background: #ffcc00;
  color: #000;
  font-weight: bold;
  text-align: center;
  padding: 10px;
  margin: 20px auto;
  border-radius: 5px;
  max-width: 800px;
}

.alerta-precios a {
  color: #003366;
  text-decoration: underline;
  font-weight: bold;
}

.alerta-precios a:hover {
  color: #005599;
}

/* Barra de navegación */
nav {
  background: #005599; /* azul intermedio */
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
}

nav ul li {
  position: relative;
}

nav a {
  display: block;
  padding: 15px;
  color: #fff;
  text-decoration: none;
  font-weight: bold;
}

nav a:hover,
nav a.active {
  background: #003366;
}


/* Menú responsivo */
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;   /* apila los elementos */
    align-items: stretch;     /* que ocupen todo el ancho */
  }

  nav ul li {
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.2); /* separador */
  }

  nav a {
    text-align: center;
    padding: 14px;
    font-size: 1.1em;
    display: block;
  }
}


/* Fondo del modal */
/* Estilo general */
.motor {
  flex: 1 1 300px;
  margin: 10px;
  text-align: center;
}

.motor img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background-color: rgba(0,0,0,0.7);
}

.modal-contenido {
  background: #fff;
  margin: 5% auto;
  padding: 20px;
  border-radius: 8px;
  width: 90%; /* ocupa casi toda la pantalla en móvil */
  max-width: 600px; /* límite en escritorio */
}

.cerrar {
  float: right;
  font-size: 28px;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
  .motor {
    flex: 1 1 100%;
    margin: 5px 0;
  }

  .modal-contenido {
    width: 95%;
    margin: 10% auto;
    font-size: 0.9rem;
  }

  .modal-contenido ul {
    padding-left: 20px;
  }
}

/* Encabezado */
.encabezado {
  text-align: center;
  background: #003366;
  color: #fff;
  padding: 20px;
}

.logo img {
  max-width: 180px;   /* tamaño en escritorio */
  height: auto;
  cursor: pointer;
  transition: transform 0.2s ease-in-out;
  margin-bottom: 10px; /* separación con el título */
}

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

.titulo h1 {
  margin: 10px 0 5px;
  font-size: 1.8rem;
}

.titulo p {
  margin: 0;
  font-size: 1rem;
  color: #ddd; /* contraste sobre fondo oscuro */
}

/* Responsive para móvil */
@media (max-width: 768px) {
  .logo img {
    max-width: 140px; /* más pequeño en pantallas chicas */
  }

  .titulo h1 {
    font-size: 1.4rem;
  }

  .titulo p {
    font-size: 0.9rem;
  }
}

footer {
  background-color: #003366; /* Azul marino */
  color: #eee;
  padding: 20px;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.footer-info {
  flex: 1 100%;
  text-align: center;
}

.footer-links {
  flex: 1 100%;
  text-align: center;
  margin-top: 10px;
}

.footer-links a {
  color: #eee;
  margin: 0 12px;
  text-decoration: none;
  font-weight: bold;
}

.footer-links a:hover {
  color: #00aaff; /* Azul claro al pasar el mouse */
}

.footer-social {
  flex: 1 100%;
  text-align: center;
  margin-top: 10px;
}

.footer-social a {
  font-size: 1.5em;
  margin: 0 10px;
  color: #eee;
}

.footer-social a:hover {
  color: #00aaff;
}

.footer-legal {
  margin-top: 15px;
  text-align: center;
  font-size: 0.9em;
}

.footer-legal a {
  color: #eee;
  text-decoration: none;
}

.footer-legal a:hover {
  color: #00aaff;
}

@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    align-items: center;
  }
}