/*este es el actualizado*/
@font-face {
  font-family: 'gordo';
  src: url('../src/assets/fonts/DK LONGREACH.OTF') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'dimbo';
  src: url('../src/assets/fonts/DIMBO REGULAR.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Modelo de caja global para evitar desbordes inesperados */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  background: #EDEDED;
  background-image: url(../src/assets/images/background.png);
  background-repeat: repeat;
  background-position: top;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1 {
  font-size: clamp(1.5rem, 5vw, 50px);
  color: #fff;
  font-family: "gordo", "dimbo", Arial, sans-serif;
  font-weight: 300; /* menos grueso */
  text-align: center;
  letter-spacing: 2px;
  line-height: 1;
  text-transform: uppercase;
  background: #de0a17;
  width: 90%;
  max-width: 1090px;
  margin: 3% auto 1% auto;
  padding: 1rem 1.5rem;
  border: 7px solid white;
  border-radius: 30px;
  box-shadow: 2px 2px 16px 4px rgba(114, 56, 33, 0.2);
}

/* Contenedor de imágenes */
.images {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

/* Imagen de la torta (aún más grande y centrada en PC) */
.Cake {
  width: 95%;
  max-width: 900px;
  height: auto;
  border-radius: 60px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Imagen nutricional */
.nutricional {
  width: 90%;
  max-width: 900px;
  height: auto;
}

/* Fondo principal (más grande y centrado en PC) */
.background {
  background: white;
  padding: 1.7rem 1.2rem 3.5% 1.2rem;
  margin-top: 0.4rem;
  margin-bottom: 2%;
  margin-left: auto;
  margin-right: auto;
  width: 85%;
  max-width: 900px;
  border-radius: 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 1rem;
  overflow: hidden;
  box-shadow: 0 7px 14px 2px rgba(114, 56, 33, 0.09);
}

/* Estilos para azúcares, saturadas, sodio y trans (más grandes en PC) */
.azucares,
.saturadas,
.sodio,
.edulcorantes,
.trans {
  flex: 1 1 60%;
  max-width: 22%;
  min-width: 120px;
  padding: 3% 0;
  height: auto;
  text-align: center;
  font-size: 1.25rem;
}

/* Tamaño de los íconos individuales (azúcares, sodio, etc.) */
.azucares img,
.saturadas img,
.sodio img,
.edulcorantes img,
.trans img {
  width: clamp(80px, 10vw, 120px);
  height: auto;
  display: block;
  margin: 0 auto;
}

ol {
  font-family: "gordo", "dimbo", Arial, sans-serif;
  margin-left: -1.5rem; /* Corre la lista más a la izquierda */
}

/* Scrollbar para navegadores WebKit */
::-webkit-scrollbar {
  width: 15px;
}
::-webkit-scrollbar-track {
  background: #EDEDED;
}
::-webkit-scrollbar-thumb {
  background-color: red;
  border-radius: 10px;
  border: 2px solid #ffffff;
}
::-webkit-scrollbar-thumb:hover {
  background-color: #6a3623;
}

/* MEDIA QUERIES PARA RESPONSIVE */

/* Ajustes generales para tablets y móviles */
@media (max-width: 768px) {
  .background {
    padding: 2rem 1rem;
    flex-direction: column;
    align-items: center;
    margin-left: 0;
  }


  .azucares,
  .saturadas,
  .sodio,
  .edulcorantes,
  .trans {
    max-width: 10%;
    flex: 1 1 100%;
  }

  h1 {
    width: 95%;
    margin: 1.1rem auto -0.5rem;
    font-size: clamp(1.2rem, 6vw, 2rem);
  }
  .background {
    width: 95%;
    padding: 1.2rem 0.8rem 3.5% 0.8rem;
  }
}

/* Imágenes mucho más pequeñas en móviles */
@media (max-width: 400px) {
  .azucares img,
  .saturadas img,
  .sodio img,
  .edulcorantes img,
  .trans img {
    width: clamp(2px, 0.5vw, 6px); /* Mucho más pequeño */
    height: auto;
    display: block;
  }
  .background {
    margin-right: -10px;
    padding-left: -10px;
  }
}

@media (max-width: 600px) {
  .row {
    flex-direction: row;
    flex-wrap: nowrap;      /* ¡Importante! */
    gap: 0.2rem;            /* Menos espacio entre imágenes */
    overflow-x: auto;       /* Permite scroll si no cabe todo */
  }
  .azucares,
  .saturadas,
  .sodio,
  .edulcorantes,
  .trans {
    flex: 1 1 25%;
    max-width: 25%;
    min-width: 0;
    padding: 0;
  }
  .azucares img,
  .saturadas img,
  .sodio img,
  .edulcorantes img,
  .trans img {
    width: clamp(18px, 8vw, 32px); /* Ajusta según tu preferencia */
    height: auto;
    display: block;
    margin: 0 auto;
  }
}