/* --- RESET --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
  font-family: 'Segoe UI', sans-serif;
}

body {
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

/* --- NAVBAR --- */
header {
  background: #111;
  color: #fff;
  padding: 15px 20px;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 3.5rem;
  color: #e50914;
}

nav ul {
  font-size: 1.5rem;
  list-style: none;
  display: flex;
  gap: 20px;
}

nav a {
  text-decoration: none;
  color: #fff;
  font-weight: bold;
  transition: color 0.3s;
}

nav a:hover {
  color: #e50914;
}

/* --- SECTIONS --- */
section {
  padding: 100px 20px;
  min-height: 100vh;
}

#inicio {
  background: url('https://www.hdcarwallpapers.com/download/2021_bmw_m3_competition_4k-2560x1440.jpg') no-repeat center center/cover;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

#inicio h2 {
  font-size: 3rem;
  margin-bottom: 20px;
  text-shadow: 2px 2px 6px #000;
}

#inicio p {
  font-size: 1.3rem;
  max-width: 700px;
  background: rgba(0, 0, 0, 0.5);
  padding: 15px;
  border-radius: 15px;
}

/* --- TITULOS DE SECCION --- */
#catalogo h2,
#agregar h2,
#contacto h2 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 40px;
  color: #111;
}

/* --- CATALOGO --- */
.catalogo-container {
  position: relative;
  max-height: 600px;
  overflow: hidden;
}

.catalogo-container::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 150px;
  background: linear-gradient(to top, #f5f5f5, rgba(245, 245, 245, 0));
  pointer-events: none;
  z-index: 5;
}

.catalogo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid #ccc;
  border-radius: 8px;
  overflow: hidden;
  background-color: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
}

.card:hover {
  transform: translateY(-5px);
}

.card img {
  width: 100%;         /* ocupa todo el ancho de la tarjeta */
  height: 200px;       /* alto fijo para todas las imágenes */
  object-fit: cover;   /* recorta la imagen manteniendo proporción */
  display: block;
}

.card-body {
  padding: 10px;
  flex: 1;
}

.card-body h3 {
  margin-bottom: 10px;
  color: #e50914;
}

.card-body p {
  font-size: 0.9rem;
  margin-bottom: 5px;
}

/* --- BOTON VER MÁS --- */
.ver-mas-btn {
  display: block;
  margin: 20px auto;
  padding: 12px 20px;
  background: #e50914;
  color: #fff;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
}

.ver-mas-btn:hover {
  background: #b0060f;
}

/* --- FORMULARIOS --- */
form {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

input,
textarea,
button,
select {
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
}

button {
  background: #e50914;
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: 0.3s;
}

button:hover {
  background: #b0060f;
}

/* --- FOOTER --- */
footer {
  background: #111;
  color: #fff;
  text-align: center;
  padding: 20px;
}

footer a {
  color: #e50914;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* --- ESTILOS ADICIONALES --- */
.titulo-agregar {
  margin-top: 80px;
}

.estado {
  height: 40px;
}
/* --- MEDIA QUERIES --- */

/* Tablets y pantallas medianas */
@media (max-width: 1024px) {
  header h1 {
    font-size: 2.5rem;
  }

  nav ul {
    font-size: 1.2rem;
    gap: 15px;
  }

  #inicio h2 {
    font-size: 2.5rem;
  }

  #inicio p {
    font-size: 1.1rem;
    max-width: 600px;
  }

  .card img {
    height: 180px;
  }
}

/* Móviles y pantallas pequeñas */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }

  nav ul {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  #inicio h2 {
    font-size: 2rem;
  }

  #inicio p {
    font-size: 1rem;
    max-width: 90%;
    padding: 10px;
  }

  .catalogo-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .card img {
    height: 150px;
  }

  form {
    width: 90%;
  }
}

/* Móviles muy pequeños */
@media (max-width: 480px) {
  header h1 {
    font-size: 2rem;
  }

  nav ul {
    font-size: 1rem;
  }

  #inicio h2 {
    font-size: 1.5rem;
  }

  #inicio p {
    font-size: 0.9rem;
  }

  .ver-mas-btn,
  button {
    width: 100%;
    padding: 10px;
  }

  .card img {
    height: 120px;
  }
}
