body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: #fff0f5;
  color: #333;
}

header {
  background-color: #ffc1e3;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid #f8bbd0;
}

.volver {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #880e4f;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.volver:hover {
  transform: translateX(-5px);
}

@keyframes pliegue {
  0% { transform: rotateY(0); opacity: 1; }
  100% { transform: rotateY(90deg); opacity: 0; }
}

body.pliegue {
  animation: pliegue 0.4s ease forwards;
  transform-origin: left;
  perspective: 1000px;
}


header img {
    width: 100px;
    height: auto;
}

main {
  padding: 2rem;
}

.buscador-seccion {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  transition: margin-top 0.6s ease;
}

.buscador-wrapper {
  display: flex;
  gap: 1rem;
  align-items: center;
  transform: scale(1);
  transition: all 0.5s ease;
}

.buscador-wrapper.mini {
  transform: scale(0.7);
  margin-top: -200px; /* antes estaba en -60px */
}


#input-ingrediente {
  padding: 1rem 1.4rem;
  font-size: 1.6rem;
  border-radius: 12px;
  border: 2px solid #ccc;
  width: 350px;
  transition: 0.3s ease;
}

#btn-buscar {
  padding: 1rem 1.4rem;
  background-color: #f06292;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.3s;
}

#btn-buscar:hover {
  background-color: #ec407a;
}

.ingredientes-lista {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.ingrediente-tag {
  background-color: #e0e0e0;
  color: #333;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  font-size: 1rem;
  animation: fadeIn 0.3s ease-in;
}

.ingrediente-tag span {
  margin-right: 8px;
}

.ingrediente-tag button {
  background: none;
  border: none;
  color: #555;
  font-size: 1.1rem;
  cursor: pointer;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.resultados {
  margin-top: 4rem;
  text-align: center;
}

#titulo-recetas {
  color: #ad1457;
  margin-bottom: 2rem;
}

.recetas-contenedor {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  justify-content: center;
}

.card {
  background-color: #ffe4ec;
  border-radius: 16px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  width: 280px;
  padding: 1rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
}

.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.card h3 {
  font-size: 1.4rem;
  color: #ad1457;
  margin-bottom: 0.5rem;
  text-align: center;
}

.card p {
  font-size: 1rem;
  color: #555;
  text-align: center;
}

.card {
  background-color: #ffe4ec;
  border-radius: 16px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  width: 260px;
  padding: 1rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeSlideUp 0.4s ease-in-out;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
}

.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.card h3 {
  font-size: 1.4rem;
  color: #ad1457;
  margin-bottom: 0.5rem;
  text-align: center;
}

.card p {
  font-size: 1rem;
  color: #555;
  text-align: center;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ------------------------------
   RESPONSIVE DESIGN PARA MÓVILES
--------------------------------- */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  header img {
    width: 70px;
  }

  .buscador-wrapper {
    flex-direction: column;
    width: 100%;
  }

  #input-ingrediente,
  #btn-buscar {
    width: 90%;
    font-size: 1.2rem;
  }

  .ingredientes-lista {
    flex-direction: column;
    align-items: center;
  }

  .card {
    width: 90%;
  }

  .recetas-contenedor {
    flex-direction: column;
    align-items: center;
  }

  main {
    padding: 1rem;
  }

  .buscador-wrapper.mini {
    margin-top: -100px; /* ajustado para móviles */
  }

  .card img {
    height: 160px;
  }
}
