/* === RESET === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* === BODY === */
body {
  background: linear-gradient(180deg, #eff4ff 0%, #f2f7fc 100%);
  color: #1c1c1e;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
}

/* === HEADER === */
header {
  text-align: center;
  margin-bottom: 50px;
}

.title {
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.6px;
  color: #0a0a0a;
  margin-bottom: 14px;
}

/* Contenedor slogan + logo */
.slogan-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.slogan {
  font-size: 1.05rem;
  color: #555;
  font-weight: 500;
  letter-spacing: -0.3px;
  max-width: 400px;
}

/* LOGO al lado del slogan */
.logo-img {
  width: 46px;
  height: 46px;
  background-image: url(./Assets/groceries_4162923.png);
  /* ← reemplaza por la ruta real */
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.1));
  transition: transform 0.3s ease;
}

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

/* === SEARCH BOX === */
#searchSection {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.search-box input {
  border: none;
  outline: none;
  font-size: 15px;
  font-weight: 500;
}

.search-box {
  background: #ffffffd9;
  padding: 14px 22px;
  width: 100%;
  max-width: 460px;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
  margin-bottom: 45px;
  transition: all 0.3s ease;
}

.search-box:focus-within {
  border-color: #a7f7c8;
  box-shadow: 0 6px 18px rgba(120, 200, 160, 0.25);
}

/* === PRODUCT LIST === */
.product-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  max-width: 900px;
  gap: 25px;
}

/* === CARD === */
.card {
  background: #f8fbfe;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  padding: 25px 22px;
  border-radius: 22px;
  text-align: center;
  display: flex;
  align-items: center;
  flex-direction: column;
  border: 1px solid rgba(235, 235, 235, 0.9);
  transition: all 0.25s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  background-color: #f1efefe6;
}

.card h3 {
  margin-top: 7px;
}

.card p {
  margin-top: 7px;
}

/* === HEALTH STATUS === */
.card h4:has-text("Healthy"),
.card h4:contains("Healthy") {
  background: #e8f9ef;
  color: #207f54;
}

.card h4:has-text("Unhealthy"),
.card h4:contains("Unhealthy") {
  background: #fdecec;
  color: #7b1313;
}

/* === FOOD DETAILS=== */
.container-infoProduct {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 70px;
  padding: 40px;
  border-radius: 20px;
  width: 75%;
}

#detailSection {
  position: relative;
  background-color: #e7eefe;
  border-radius: 20px;
  width: 100%;
  padding: 40px;
  justify-content: center;
  align-items: center;
}

.back-btn {
  position: absolute;
  top: 20px;
  left: 30px;
  margin-top: 26px;
  background-color: #fff;
  color: #333;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 500;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.back-btn:hover {
  background-color: #dce4ff;
  transform: scale(1.05);
}


.product-info {
  flex: 1;
  max-width: 400px;
}

.img-product {
  flex: 1;
  display: flex;
  justify-content: center;
}

.img_product {
  max-width: 150%;
  height: 350px;
  border-radius: 5px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

#product_name {
  font-size: 50px;
  margin-bottom: 10px;
}

#product_details {
  font-size: 25px;
  font-weight: 300;
}

/* FAVOURITE BTN */

.open-fav-btn {
  position: absolute;
  top: -30;
  right: 60px;
  border: none;
  padding: 15px;
  background-color: #b6c6f9;
  border-radius: 10px;
  color: white;
  font-weight: 600;
  transition: 0.3s all ease-in-out;
}

.open-fav-btn:hover {
  background-color: #d1dcff;
}

/* FAVOURITE SECTION */
#favoriteList {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.title-favoritos {
  margin-bottom: 15px;
}

/* === FOOTER === */
footer {
  margin-top: 50px;
  text-align: center;
  font-size: 0.9rem;
  color: #777;
}

footer p:first-child {
  font-weight: 500;
  color: #555;
  margin-bottom: 6px;
}

/* RESPONSIVE MODE */

@media (max-width: 768px) {
  .product-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .card {
    height: 200px;
  }

  /* DETAILS FOOD SECTION */
  #detailSection {
    flex-direction: column-reverse;
    padding: 100px;
  }

  .img_product {
    width: 120%;
    height: 230px;
    object-fit: cover;
  }

  #product_name {
    font-size: 35px;
    margin-top: 15px;
  }

  #product_details {
    font-size: 21px;
  }

  .back-btn {
    position: absolute;
    top: -2px;
    background-color: transparent;
    border: none;
    box-shadow: none;
    background-color: transparent;
    font-size: 25px;
  }

  /* FAVOURITE SECTION */
  #favoriteList {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .back-btn {
    font-size: 20px;
  }

}