/* ===== CONFIGURACIÓN GLOBAL ===== */
body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  background: #000;
  color: #fff;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

/* Asegura correcta escala en todos los dispositivos */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* ===== HEADER ===== */
header {
  background: #000;
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  max-width: 600px;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-toggle,
.cart-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #ff6600;
  cursor: pointer;
}

#logo {
  width: 120px;
}

/* ===== MENÚ LATERAL ===== */
.side-menu {
  position: fixed;
  top: 0;
  left: -260px;
  width: 260px;
  height: 100%;
  background: #111;
  color: white;
  padding: 20px;
  transition: 0.3s;
  z-index: 1100;
}

.side-menu.active {
  left: 0;
}

.side-menu .close-btn {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: #ff6600;
  background: none;
  border: none;
  cursor: pointer;
}

.side-menu ul {
  list-style: none;
  padding: 0;
}

.side-menu li {
  margin: 15px 0;
}

.side-menu a {
  text-decoration: none;
  color: white;
  font-size: 1.1rem;
}

.side-menu a:hover {
  color: #ff6600;
}

/* ===== CONTENIDO PRINCIPAL ===== */
main {
  padding: 15px;
  width: 100%;
  max-width: 600px;
  background: #fff;
  color: #000;
  border-radius: 15px 15px 0 0;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.3);
}

.categoria {
  margin-bottom: 40px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 15px;
}

.categoria h2 {
  color: #ff6600;
  margin-bottom: 15px;
  text-align: center;
  border-bottom: 2px solid #ff6600;
  padding-bottom: 5px;
}

/* ===== PRODUCTOS ===== */
.productos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 15px;
  justify-items: center;
}

/* ===== TARJETAS ===== */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  padding: 15px;
  text-align: center;
  width: 100%;
  max-width: 240px;
  color: #000;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.2);
}

.card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
  transition: transform 0.3s;
}

.card img:hover {
  transform: scale(1.05);
}

.card h3 {
  margin: 8px 0 4px;
  font-size: 1rem;
  color: #222;
}

.card p {
  font-size: 0.85rem;
  color: #555;
  min-height: 36px;
}

.precio {
  display: block;
  margin-top: 8px;
  font-weight: bold;
  color: #ff6600;
  font-size: 1rem;
}

.add-cart-btn {
  background: #ff6600;
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 10px;
  width: 100%;
  transition: background 0.3s;
}

.add-cart-btn:hover {
  background: #e65c00;
}

/* ===== CARRITO ===== */
.cart {
  position: fixed;
  right: -100%;
  top: 0;
  width: 100%;
  max-width: 350px;
  height: 100%;
  background: #fff;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
  padding: 20px;
  z-index: 1500;
  transition: right 0.3s;
  overflow-y: auto;
  color: #000;
}

.cart.active {
  right: 0;
}

.cart h3 {
  margin-top: 40px;
  text-align: center;
  color: #ff6600;
}

#cart-items {
  list-style: none;
  padding: 0;
  font-size: 0.95rem;
}

#cart-total {
  font-weight: bold;
  margin: 15px 0;
  text-align: center;
  color: #ff6600;
}

.cart button {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  border: none;
  border-radius: 8px;
  background: #ff6600;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
}

.cart button:hover {
  background: #e65c00;
}

/* ===== MODAL ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  position: relative;
  color: #000;
}

/* ===== VISTA AMPLIADA ===== */
.view-modal {
  display: none;
  position: fixed;
  z-index: 2500;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  padding: 15px;
}

.view-modal-content {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  position: relative;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  color: #000;
}

/* ===== FOOTER ===== */
footer {
  background: #111;
  padding: 15px;
  color: #ccc;
  text-align: center;
  width: 100%;
  max-width: 600px;
  border-radius: 0 0 15px 15px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  body {
    max-width: 100%;
  }
  .productos {
    grid-template-columns: repeat(2, 1fr);
  }
  .card img {
    height: 140px;
  }
}

@media (max-width: 480px) {
  .productos {
    grid-template-columns: 1fr 1fr;
  }
  .card img {
    height: 130px;
  }
  .card {
    max-width: 180px;
  }
  .categoria {
    padding: 12px;
  }
}

/* ==== FIX PARA MENÚ LATERAL EN CELULARES ==== */
.side-menu {
  position: fixed;
  top: 0;
  left: -100%;
  width: 80%;
  max-width: 300px;
  height: 100vh;
  overflow-y: auto;
  background: #111;
  transition: left 0.3s ease;
  z-index: 2000;
  border-right: 2px solid #000000;
}

.side-menu.active {
  left: 0;
}

.side-menu ul {
  padding: 20px 10px;
  margin: 0;
  list-style: none;
}

.side-menu li {
  margin: 18px 0;
}

.side-menu a {
  color: #fff;
  font-size: 1.1rem;
  text-decoration: none;
  display: block;
  padding: 10px 15px;
  border-radius: 8px;
  transition: background 0.3s ease;
}

.side-menu a:hover {
  background: #ff6600;
  color: #fff;
}

.side-menu .close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 1.5rem;
  background: none;
  color: #ff6600;
  border: none;
  cursor: pointer;
}

/* ✅ Evita que el menú quede recortado al abrirse */
html, body {
  overflow-x: hidden;
}

/* ================================================
   🔧 ESTILO FIJO Y CENTRADO PARA TODOS LOS DISPOSITIVOS
   ================================================== */

/* Fuerza el mismo ancho visual tipo app */
html, body {
  max-width: 480px;       /* Tamaño tipo celular grande */
  margin: 0 auto;         /* Centra el contenido en pantallas grandes */
  background: #000;       /* Fondo negro del sitio */
  color: #fff;
  overflow-x: hidden;
  font-family: 'Roboto', sans-serif;
}

/* Evita que las imágenes o textos se salgan en móviles */
img, video, iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Centrado general de la estructura */
main, header, footer, section, .categoria, .index-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Reforzar el diseño del botón de menú en index */
.main-btn {
  background: linear-gradient(135deg, #ff6600, #ff9933);
  color: #fff;
  font-weight: bold;
  border-radius: 14px;
  padding: 16px 0;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 85%;
  max-width: 350px;
  font-size: 1.2rem;
  margin: 0 auto;
  box-shadow: 0 4px 10px rgba(255, 102, 0, 0.5);
  transition: all 0.3s ease-in-out;
}

.main-btn:hover {
  transform: scale(1.03);
  background: linear-gradient(135deg, #e65c00, #ff8000);
}

/* Logo principal responsivo y centrado */
#index-logo, #logo {
  display: block;
  margin: 0 auto 30px auto;
  width: 80%;
  max-width: 320px;
  height: auto;
  object-fit: contain;
}

/* Footer fijo, igual en todos los dispositivos */
footer {
  background: #111;
  text-align: center;
  padding: 20px 10px;
  border-top: 1px solid #222;
  position: relative;
  bottom: 0;
  left: 0;
  width: 100%;
}

footer p {
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.redes {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.redes a {
  color: #ff6600;
  font-size: 1.4rem;
  transition: color 0.3s;
}

.redes a:hover {
  color: #ff9933;
}

/* Tarjetas de productos */
.card {
  width: 100%;
  max-width: 200px;
  margin: 0 auto;
  border-radius: 12px;
  background: #fff;
  color: #000;
  padding: 12px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  text-align: center;
}

.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
}

.card img:hover {
  transform: scale(1.03);
}

/* Rejilla de productos uniforme */
.productos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  justify-items: center;
}

/* ===== Ajuste universal ===== */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent; /* elimina parpadeo azul en móviles */
}

/* ===== Ajuste visual para tablets ===== */
@media (min-width: 481px) and (max-width: 1024px) {
  html, body {
    max-width: 600px;
  }
  .card img {
    height: 200px;
  }
  .main-btn {
    font-size: 1.4rem;
  }
}

/* ===== PC modo centrado (igual que móvil) ===== */
@media (min-width: 1025px) {
  html, body {
    max-width: 480px;
    margin: 0 auto;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

/* ===========================================
   🔧 AJUSTE UNIVERSAL DE IMÁGENES EN TARJETAS
   =========================================== */

/* Contenedor de tarjeta */
.card {
  width: 100%;
  max-width: 220px;
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  text-align: center;
  transition: transform 0.2s ease;
  overflow: hidden; /* evita que las imágenes sobresalgan */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Imagen dentro de la tarjeta (ajustada a cada pantalla) */
.card img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1; /* mantiene la proporción cuadrada perfecta */
  object-fit: contain; /* 🔹 muestra toda la imagen sin recortarla */
  border-radius: 12px;
  background-color: #fff;
  margin-bottom: 8px;
  transition: transform 0.3s ease;
}

/* Efecto visual al tocar/pasar el dedo */
.card img:hover {
  transform: scale(1.05);
}

/* Texto dentro de las tarjetas */
.card h3 {
  font-size: 1rem;
  margin: 6px 0 3px 0;
  color: #222;
  font-weight: 600;
}

.card p {
  font-size: 0.85rem;
  color: #555;
  margin: 0;
}

/* Precio */
.precio {
  display: block;
  margin-top: 5px;
  font-weight: bold;
  color: #ff6600;
  font-size: 1rem;
}

/* Botón */
.add-cart-btn {
  background: linear-gradient(135deg, #ff6600, #ff9933);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  margin-top: 8px;
  width: 100%;
  font-size: 0.95rem;
  font-weight: bold;
  transition: all 0.2s ease-in-out;
}

.add-cart-btn:hover {
  background: linear-gradient(135deg, #e65c00, #ff8000);
  transform: scale(1.02);
}

/* ===== REJILLA DE PRODUCTOS ===== */
.productos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  justify-items: center;
  align-items: start;
}

/* ===== AJUSTES RESPONSIVOS ===== */

/* Pantallas pequeñas (Android, iPhone) */
@media (max-width: 480px) {
  .card {
    max-width: 180px;
  }

  .card img {
    aspect-ratio: 1 / 1;
    height: auto;
  }

  .productos {
    gap: 12px;
  }
}

/* Tablets (pantallas medianas) */
@media (min-width: 481px) and (max-width: 1024px) {
  .card {
    max-width: 200px;
  }

  .card img {
    aspect-ratio: 4 / 3; /* un poco más rectangular */
  }
}

/* PC centrado (mantiene formato de app móvil) */
@media (min-width: 1025px) {
  body {
    max-width: 480px;
    margin: 0 auto;
  }

  .card {
    max-width: 220px;
  }

  .card img {
    aspect-ratio: 1 / 1;
  }
}

/* Submenús dentro del menú lateral */
.side-menu ul li.has-submenu > a {
  font-weight: bold;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.side-menu ul li.has-submenu .submenu {
  display: none;
  list-style: none;
  padding-left: 20px;
  background-color: rgba(0,0,0,0.1);
  border-left: 3px solid #ffcc00;
  margin-top: 5px;
  border-radius: 6px;
}

.side-menu ul li.has-submenu:hover .submenu {
  display: block;
}

.side-menu ul li.has-submenu .submenu li {
  margin: 5px 0;
}

.side-menu ul li.has-submenu .submenu li a {
  color: #fff;
  font-size: 0.9em;
  text-decoration: none;
  display: block;
  padding: 6px 0;
  transition: color 0.3s ease;
}

.side-menu ul li.has-submenu .submenu li a:hover {
  color: #ffcc00;
}

#cart-items li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  font-size: 15px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.delete-item-btn {
  background: #ff3b30;
  color: white;
  border: none;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
}

.delete-item-btn:hover {
  background: #d32f2f;
}

/* ===== HEADER ===== */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 9999;
    background: #000;
    color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.25s ease;
}

header.show {
    transform: translateY(0);
}

header.hide {
    transform: translateY(-100%);
}

/* ===== AJUSTE GLOBAL PARA QUE NO TAPE TARJETAS ===== */
body {
    margin: 0;
    padding-top: 0; /* Se ajusta automáticamente por JS */
}

/* ===== TARJETAS ===== */
.card {
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    margin: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* MÁS ESTILOS QUE TUYA TENGAS AQUÍ… */

/* Centrar botón Añadir en el modal */
.modal-actions {
    margin-top: 20px;          /* Separación respecto al último elemento (salsas) */
    display: flex;
    justify-content: center;   /* Centra horizontalmente */
    width: 100%;
}

.modal-actions button {
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 8px;
    background: #ff7b00;
    color: white;
    border: none;
    cursor: pointer;
}

.modal-actions button:hover {
    background: #e56e00;
}

/* Botón de cerrar (X) */
.close-cart-btn {
    position: absolute;
    top: 12px;     /* 🔥 Baja el botón para que no choque con el header */
    right: 12px;
    z-index: 10000;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
}









