@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap');

:root {
  --mercado-azul: #0056b3;       /* Azul Fuerte para el encabezado */
  --mercado-amarillo: #ffc107;   /* Amarillo para botones de acción */
  --mercado-amarillo-hover: #e0a800; /* Amarillo más oscuro al pasar mouse */
  --mercado-texto-azul: #003d80; /* Texto oscuro para contraste sobre amarillo */
  --mercado-fondo: #f4f7f6;      /* Gris muy suave para el fondo de la página */
}

/* =========================================
   ESTILOS GENERALES Y TARJETAS
   ========================================= */

/* Contenedor Principal */
#contenedor {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 10px;
  margin-top: 90px; /* Aumentado para que no lo tape el menú */
  background-color: var(--mercado-fondo); /* Fondo gris suave */
}


.card {
  width: 170px;
  background-color: #f0f0f0; /* Fondo blanco */
  border: none solid #e1e1e1;
  border-bottom: 4px solid var(--mercado-azul); /* Borde inferior AZUL */
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  font-family: 'Roboto', sans-serif;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Efecto al pasar el mouse por la tarjeta */
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 86, 179, 0.15); /* Sombra azulada */
  border-color: var(--mercado-azul);
}

.card img {
    width: 100%;
    height: 180px;       /* Mantenemos la altura fija */
    object-fit: contain; /* <--- ESTE ES EL CAMBIO: Muestra la foto entera */
    object-position: center;
    border-radius: 4px;
    background-color: #fff; /* Fondo blanco por si la foto es más angosta que el cuadro */
}

/* Botones de las tarjetas (AHORA AMARILLOS) */
.card button {
  margin-top: 8px;
  padding: 8px 12px;
  border: none;
  background: var(--mercado-amarillo); /* Fondo AMARILLO */
  color: var(--mercado-texto-azul);    /* Texto AZUL oscuro */
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
  transform-origin: center;
}

.card button:hover {
  background-color: var(--mercado-amarillo-hover);
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(255, 193, 7, 0.6); /* Resplandor amarillo */
}

.card input[type="number"] {
    text-align: center;       /* Número centrado */
    border: 1px solid #ddd;   /* Borde suave */
    border-radius: 20px;      /* Bordes redondos estilo pastilla */
    padding: 5px;             /* Espacio interno */
    font-size: 1rem;
    width: 60px;              /* Ancho fijo prolijo */
    margin-bottom: 10px;
    outline: none;            /* Quita el borde azul feo al hacer clic */
}

.card input[type="number"]:focus {
    border-color: var(--mercado-azul); /* Se pinta de azul al escribir */
}

.card p {
    margin: 4px 0;
}

/* 1. Estilo para el CÓDIGO (El primer párrafo) */
/* Lo hacemos gris y chico para que no distraiga */
.card p:nth-of-type(1) {
    color: #999;        /* Gris claro */
    font-size: 0.85rem; /* Letra más pequeña */
    font-weight: 400;
}

/* =========================================
   MENÚ FIJO (AHORA AZUL)
   ========================================= */

#menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--mercado-azul); /* Fondo AZUL */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  padding: 10px 24px;
  box-sizing: border-box;
  color: white; /* Texto general blanco */
}

/* Contenedor horizontal */
#menu .info {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  height: 90px;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
}

.acciones {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Subtotal */
.subtotal {
  min-width: 150px;
  text-align: right;
  white-space: nowrap;
  font-size: 1rem;
  color: #ecf0f1; /* Blanco hueso para que se lea sobre el azul */
  font-family: 'Roboto', sans-serif;
}

/* Precio destacado en el menú */
#subtotalDisplay {
  font-weight: 700;
  color: var(--mercado-amarillo); /* Precio en AMARILLO */
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
  display: inline-block;
  line-height: 1;
  font-family: 'Roboto', sans-serif;
}

/* BOTÓN del MENÚ (AHORA AMARILLO) */
#menu button {
  background-color: var(--mercado-amarillo);
  color: var(--mercado-texto-azul); /* Texto azul */
  border: 2px solid var(--mercado-amarillo);
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
  transform-origin: center;
}

#menu button:hover {
  background-color: #fff; /* Al pasar mouse se pone blanco */
  color: var(--mercado-azul);
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

/* =========================================
   WHATSAPP Y MODAL
   ========================================= */

/* Estilo del botón WhatsApp (Se mantiene verde por estándar, con borde blanco) */
.whatsapp-fijo {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  background-color: #25D366;
  color: white;
  padding: 12px 18px;
  border-radius: 30px;
  border: 2px solid white; /* Borde para separar del fondo */
  text-decoration: none;
  font-weight: bold;
  font-family: sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.whatsapp-fijo:hover {
  transform: scale(1.05);
}

.whatsapp-icon {
  width: 28px;
  height: 28px;
}

/* MODAL */
.modal-chat {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 50, 100, 0.5); /* Fondo azulado transparente */
  z-index: 1000;
}

/* Ventana flotante tipo chat */
.modal-contenido {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #fff;
  border-radius: 16px;
  border-top: 5px solid var(--mercado-azul); /* Decoración azul arriba */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  width: 320px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 15px 20px;
  animation: aparecer 0.2s ease-out;
  font-family: sans-serif;
}

/* Botón de cerrar (la X) */
.cerrar {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 22px;
  font-weight: bold;
  color: #999;
  cursor: pointer;
}

.cerrar:hover {
  color: var(--mercado-azul); /* X cambia a azul */
}

/* Botón de WhatsApp dentro del modal */
.btn-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #25D366;
  color: white;
  border: none;
  border-radius: 25px;
  padding: 10px 15px;
  cursor: pointer;
  width: 100%;
  font-weight: bold;
  margin-top: 10px;
  transition: transform 0.2s;
}

.btn-whatsapp:hover {
  transform: scale(1.05);
}

.btn-whatsapp img {
  width: 22px;
  height: 22px;
}

/* Animación de aparición */
@keyframes aparecer {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}