* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  background: linear-gradient(135deg, #f5f7fa 0%);
  display: flex;
  flex-direction: column;
  position: relative;
}

header {
  background-color: #0056b3;
  background: linear-gradient(to right, lightblue, lightgreen, violet);
  color: white;
  padding: 5px 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0.1);
}

.banner h1 {
  text-align: left;
  margin: 0;
  font-size: 2.2rem;
  line-height: 1.1;
  white-space: nowrap;
  width: 100%;
  letter-spacing: 0.08em;
  font-weight: 700;
  text-transform: uppercase;
  background: linear-gradient(90deg, #e5f6ff, #ffe6fb, #e7ffe8, #fff9d8, #e5f6ff);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.16),
    0 0 18px rgba(255, 255, 255, 0.32);
  animation: neonGlow 5s ease infinite;
}

@keyframes neonGlow {
  0% {
    background-position: 0% 50%;
    text-shadow:
      0 0 12px rgba(255, 255, 255, 0.8),
      0 0 30px rgba(77, 205, 255, 0.7),
      0 0 45px rgba(255, 190, 255, 0.6);
  }
  50% {
    background-position: 100% 50%;
    text-shadow:
      0 0 18px rgba(255, 255, 255, 0.9),
      0 0 40px rgba(56, 186, 255, 0.8),
      0 0 60px rgba(255, 145, 255, 0.7);
  }
  100% {
    background-position: 0% 50%;
    text-shadow:
      0 0 12px rgba(255, 255, 255, 0.8),
      0 0 30px rgba(77, 205, 255, 0.7),
      0 0 45px rgba(255, 190, 255, 0.6);
  }
}


nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  justify-content: center;
  font-size: large;
  text-decoration: underline;
  margin: 10px 0;
}

.menu-links {
  display: flex;
  list-style: none;
  text-align: center;
}

nav ul li a {
  color: white;
  text-decoration: none;
  padding: 12px 18px;
  display: block;
  border-radius: 25px;
  transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid transparent;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

nav ul li a:hover,
nav ul li a:focus {
  background-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.75);
  color: #001f4d;
}

nav ul li a:active {
  transform: translateY(0);
}

.search-bar {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 10px;
  transform: scale(1);
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
}

.search-bar input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.95rem;
  color: #003366;
}

.search-bar input::placeholder {
  color: rgba(0, 83, 143, 0.7);
}

.search-bar button {
  background-color: #0056b3;
  color: white;
  border: none;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: bold;
  transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
  border-radius: 0 999px 999px 0;
}

.search-bar button:hover {
  background-color: #00ff41;
  color: #003366;
  transform: translateX(2px);
  box-shadow: 0 8px 20px rgba(0, 94, 179, 0.18);
}

main {
  /*Acomodo interno*/
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: normal;
  gap: 20px;
  padding: 15px;
  width: 100%;

  /*propiedades con respecto al contenedor padre */
}

.categories,
.cart {
  flex: 0 0 250px;
  background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%);
  color: white;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 4px 8px rgba(0, 0, 0.1);
  align-self: flex-start;
  position: sticky;
  top: 20px;
}

.MenuOptions {
  list-style: none;
  padding: 0;
}

/*Como el section en este caso es la parte central, puedes poner un numero mas grande para que ocupe mas espacio*/

section {
  /*Con eso usted le esta diciendo cuantas porciones del espacio total va a ocupar cada aside o cada section*/
  background-color: #f4f4f4;
  border-radius: 8px;
  display: block;
  flex-direction: row;
  gap: 5px;
  flex-wrap: wrap;
  align-content: flex-start;
  /*propiedades con respecto al contenedor padre */
  flex: 5; /* el numero mas grande iria aqui, pongale 4 o 5 y ahi va ir viendo la diferencia.*/
}

.tituloProductos {
  min-width: 100%;
  height: fit-content;
}
.products {
  border: 2px solid black;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
  padding: 20px;
  flex-grow: 1;
}

.product {
  background-color: white;
  border: none;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 8px;
  min-height: 200px;
}

.product button {
  background-color: #004e92;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
}

.product button:hover {
  background-color: #00ff41;
  color: #003366;
}

.product h3 {
  font-size: 1.1rem;
  margin: 5px 0;
  color: #333;
}

.product p {
  font-weight: bold;
  color: #0056b3;
  font-size: 1.2rem;
}

.product a {
  background-color: #0056b3;
  color: white;
  padding: 10px 15px;
  text-decoration: none;
  border-radius: 25px;
  font-weight: bold;
  width: 100%;
  text-align: center;
  margin-top: auto;
}

.product:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0.2);
  transition: all 0.3s ease;
}

#contenedor-categorias {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 10px;
}

.categories h2 {
  text-align: center;
  color: white;
  text-decoration: underline;
  margin-bottom: 25px;
  font-weight: bold;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
  font-size: 28px;
  text-transform: capitalize;
}

.btn-categoria {
  background: transparent;
  border: none;
  color: white;
  font-size: 22px;
  text-align: left;
  cursor: pointer;
  padding: 8px 15px;
  transition: all 0.3s ease;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.btn-categoria:hover {
  text-decoration: underline;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding-left: 25px;
}

.cart {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 20px;
  border-radius: 15px;
  background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%) !important;
  color: white;
  position: sticky;
  top: 20px;
  align-self: flex-start;
}

.cart ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cart li,
.cart p {
  font-size: 22px;
  padding: 10px 15px;
  transition: all 0.3s;
}

.cart li:hover,
.cart p:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding-left: 30px;
  text-decoration: underline;
}

.cart h2 {
  text-align: center;
  text-decoration: underline;
  font-weight: bold;
  font-size: 28px;
}

.cart p {
  background-color: rgba(0, 0, 0, 0.3);
  border-top: 3px solid #ffffff;
  border-bottom: 3px solid #ffffff;
  padding: 15px 10px;
  margin: 20px 0;
  font-size: 24px;
  font-weight: 900;
  text-align: center;
  color: #ffffff;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
}

.product img {
  width: 100%;
  height: 100px;
  object-fit: contain;
  background-color: #f9f9f9;
  display: block;
  margin-bottom: 10px;
}

/*.cart-items {
  list-style: none;
  text-align: left;
  margin: 23px;
  padding: 10px;
  font-size: 25px;
  text-shadow: 0 0 8px;
  margin-bottom: 35px;
}
/*.cart ul li {
  margin-bottom: 25px;
  font-size: 25px;
}*/

/*.cart p {
  font-size: 24px;
  font-weight: bold;
  margin-top: 30px;
  text-align: center;
  color: #ffffff;
}*/

.cart button {
  display: block;
  width: 100%;
  padding: 15px;
  font-size: 18px;
  font-weight: bold;
  background-color: #ffffff;
  color: #004e92;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 15px;
  transition: transform 0.2s;
}

.cart button:hover {
  background-color: #e0e0e0;
  transform: scale(1.02);
}

.categories {
  display: flex;
  flex-direction: column;
  position: sticky; /* Restaurado: mantener la barra lateral fija en pantallas grandes */
  top: 20px;
  padding-bottom: 30px; /* Reducimos el padding exagerado */
  gap: 20px;            /* Separa los elementos internos automáticamente */
  align-self: flex-start;
}

.seccionTipoCambio {
    margin-top: auto;     /* ¡Este es el truco! Empuja la caja al fondo de la tarjeta */
    padding: 18px 12px;
    background: linear-gradient(135deg, #005f73, #0a9396); /* Un degradado sutil */
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-align: center;
}

#listaTipoCambio {
    list-style-type: none; /* Quita los puntitos */
    padding: 0;            /* Centra el texto eliminando el espacio izquierdo */
    margin: 5px 0 0 0;     /* Separa la lista un toque hacia abajo del botón */
}

.seccionTipoCambio h3{
  font-size: 12px;
  color: #e0f7fa;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5;
  font-weight: 600;
}

.btnActualizar{
  background-color: #ffffff;
  color: #0a9396;
  border: none;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: bold;
  border-radius: 50px;
  cursor: pointer;
  width: 85%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btnActualizar:hover{
  background-color: #e0f7fa;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

/* Estilos para la página de mantenimiento de productos */
.product-form {
  max-width: 900px;
  margin: 24px auto;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.product-form h2 {
  color: #004e92;
  margin-bottom: 12px;
  font-size: 1.4rem;
}

#form-producto > div {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
}

#form-producto label {
  font-weight: 700;
  color: #0056b3;
  margin-bottom: 6px;
}

#form-producto input[type="text"],
#form-producto input[type="number"],
#form-producto select,
#form-producto input[type="file"] {
  padding: 10px;
  border: 2px solid #e6f3ff;
  border-radius: 8px;
  background: #ffffff;
  outline: none;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

#form-producto input:focus,
#form-producto select:focus {
  box-shadow: 0 6px 18px rgba(0,94,179,0.08);
  border-color: #a8ddff;
}

#form-producto button[type="submit"],
#form-producto button[type="button"] {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 700;
}

#form-producto button[type="submit"] {
  background-color: #0056b3;
  color: #ffffff;
}

#form-producto button[type="submit"]:hover {
  background-color: #00ff41;
  color: #003366;
}

#form-producto #limpiar {
  background-color: #eeeeee;
  color: #004e92;
  margin-left: 8px;
}

#preview {
  margin-top: 18px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(2,136,209,0.03), rgba(170,225,255,0.03));
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.04);
}

#preview h3 {
  color: #004e92;
  margin-bottom: 10px;
}

#img-preview {
  max-width: 220px;
  max-height: 180px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  margin-bottom: 8px;
  border: 1px solid #e6eef8;
}

#preview p {
  color: #003366;
  font-weight: 600;
  margin: 4px 0;
}

/* Responsive */
@media (max-width: 800px) {
  .product-form { padding: 14px; margin: 12px; }
  #img-preview { max-width: 160px; }
}


.btnActualizar:active{
  transform: translateY(1px);
}

#resultadoTipoCambio{
  margin-top: 14px;
  color: #ffffff;
  font-size: 15px;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ----------------------------
   Responsive improvements
   Cada bloque explica por qué se añadió y qué efecto tiene.
   ---------------------------- */

/* Ajuste: hacer las imágenes de producto fluidas
   - Evita recortes en pantallas pequeñas.
   - `height: auto` permite mantener la proporción.
*/
.product img {
  width: 100%;
  height: auto; /* mantener proporción */
  max-height: 220px; /* límite razonable en desktop */
  object-fit: contain;
}

/* Breakpoint: tablets y pantallas medianas (<= 1024px)
   - Reduce el ancho fijo de las barras laterales para ganar espacio al contenido.
   - Ajusta el grid de productos para mostrar columnas más anchas.
   - Reduce el tamaño del título para evitar solapamientos.
*/
@media (max-width: 1024px) {
  .categories,
  .cart {
    flex: 0 0 200px; /* menos espacio lateral */
  }

  .products {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .banner h1 {
    font-size: 1.8rem;
  }
}

/* Breakpoint: móviles grandes / tablets pequeñas (<= 800px)
   - Apila el layout (main) en columna para que los asides queden encima/abajo.
   - Hace que `.categories` y `.cart` sean full-width y no estén fijos.
   - Ajusta la rejilla de productos y reduce espacios/paddings.
   - Centra y envuelve el título para mejorar legibilidad.
*/
@media (max-width: 800px) {
  main {
    flex-direction: column;
    gap: 12px;
    padding: 12px;
  }

  .categories,
  .cart {
    position: relative; /* ya no los pegamos arriba con sticky */
    top: 0;
    width: 100%;
    flex: 0 0 auto;
    align-self: stretch;
    margin-bottom: 8px;
  }

  .products {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    padding: 12px;
    gap: 12px;
  }

  .banner h1 {
    font-size: 1.4rem;
    text-align: center;
    white-space: normal; /* permitir wrap del texto */
  }

  nav ul {
    flex-wrap: wrap; /* que los items del menú se ajusten en varias líneas */
    justify-content: center;
  }

  .search-bar {
    max-width: 100%;
    margin: 10px 0;
    border-radius: 12px;
  }

  .product img {
    max-height: 160px; /* más pequeño en móviles */
  }
}

/* Breakpoint: móviles pequeños (<= 480px)
   - Simplifica el layout: columnas más estrechas, letras y paddings reducidos.
   - Mejora la densidad de información en pantallas pequeñas.
*/
@media (max-width: 480px) {
  .products {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    padding: 8px;
  }

  .product {
    padding: 10px;
    min-height: 140px;
  }

  .banner h1 {
    font-size: 1.1rem;
  }

  nav ul li a {
    padding: 8px 10px;
    font-size: 0.95rem;
    border-radius: 10px;
  }

  .cart p,
  .cart li {
    font-size: 18px;
    padding: 8px 10px;
  }

  .search-bar input {
    font-size: 0.95rem;
    padding: 8px;
  }
}

/* Footer */
/* DEV: Estilos añadidos para el footer dinámico y el modal.
  Buscar las clases `.site-footer`, `.footer-modal` y `.dev-note` para identificar los bloques modificados. */
.site-footer {
  background: linear-gradient(90deg, #003366 0%, #0056b3 50%, #002b4f 100%);
  color: #f1f7ff;
  padding: 20px 16px;
  margin-top: 24px;
}
.site-footer .footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.site-footer h3 { margin: 0 0 6px 0; font-size: 1.1rem; }
.site-footer .muted { opacity: 0.9; font-size: 0.95rem; }
.footer-links { display: flex; gap: 14px; align-items: center; }
.footer-links a { color: #eaf6ff; text-decoration: none; padding: 8px 10px; border-radius: 8px; font-weight: 700; }
.footer-links a:hover { background: rgba(255,255,255,0.06); color: #ffffff; transform: translateY(-2px); }
.footer-legal { opacity: 0.95; font-weight: 600; }

/* Modal */
.footer-modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(2,6,23,0.6); z-index: 1200; }
.footer-modal.open { display: flex; }
.footer-modal .modal-card { background: linear-gradient(180deg,#ffffff,#f7fbff); width: min(780px, 92%); border-radius: 12px; padding: 20px; box-shadow: 0 12px 40px rgba(0,0,0,0.4); color: #003366; position: relative; }
.footer-modal .modal-title { margin: 0 0 12px 0; }
.footer-modal .modal-body { color: #06324a; line-height: 1.45; }
.modal-close { position: absolute; right: 12px; top: 8px; background: transparent; border: none; font-size: 22px; cursor: pointer; color: #00334d; }

@media (max-width: 640px) {
  .site-footer .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-links { width: 100%; justify-content: space-between; }
  .footer-legal { margin-top: 12px; }
}

/* Nota visible del desarrollador eliminada: la información de cambios permanece en comentarios del código pero sin renderizarse en la página. */
