:root {
  --color-primary: #d4aa00; /* rojo vibrante */
  --color-secondary: #000000; /* fondo oscuro */
  --color-text: #eee; /* texto claro */
  --color-white: #000000; /* bloques */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, Arial, sans-serif;
}

body {
  background: var(--color-secondary);
  color: var(--color-text);
  max-width: 600px;
  margin: auto;
  padding: 1rem;
}

h1,
h2,
h3 {
  color: #fff;
  margin: 1rem 0 0.5rem;
}

p {
  color: #ccc;
}

/* ============================
   Inputs y Botones
============================ */
input,
button,
select {
  width: 100%;
  padding: 0.7rem;
  margin: 0.3rem 0;
  border: 1px solid #333;
  border-radius: 6px;
  font-size: 1rem;
  background: var(--color-white);
  color: var(--color-text);
}

button {
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
  border: none;
}

button:hover {
  background: #d4aa00;
}

/* ============================
   Contenedores
============================ */
#menu div,
#carrito,
.carrito-item,
.pedido-resumen,
#misPuntos,
.card,
.carousel-item {
  background: var(--color-white);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 0.7rem;
  margin: 0.5rem 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.alert {
  background: #442222;
  border: 1px solid #663333;
  color: #ffb3b3;
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

/* ============================
   Barra inferior
============================ */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #1c1c1c;
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid #333;
}

.bottom-bar a {
  flex: 1;
  text-align: center;
  color: #aaa;
  text-decoration: none;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.bottom-bar a.active {
  color: var(--color-primary);
}

.bottom-bar i {
  font-size: 1.2rem;
  margin-bottom: 2px;
}

/* ============================
   Carrusel Destacados
============================ */
.carousel-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin: 15px 0;
}

.carousel {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.carousel-item {
  min-width: 200px;
  margin: 0 10px;
  text-align: center;
  flex-shrink: 0;
}

.carousel-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
}

.carousel-item p {
  color: #ddd;
  margin-top: 0.5rem;
}

/* Botones del carrusel */
.carousel-container button {
  all: unset;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #d4aa00;
  color: white;
  font-size: 20px;
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  border-radius: 50%;
  cursor: pointer;
  z-index: 5;
}

.carousel-container button:hover {
  background: rgba(230, 57, 70, 1);
}

.carousel-btn.prev {
  left: 5px;
}
.carousel-btn.next {
  right: 5px;
}

/* Centrar el logo principal en el home */
#home img.logo {
  display: block;
  margin: 0 auto 1rem auto; /* centra horizontalmente y da espacio abajo */
  max-width: 200px; /* límite opcional de ancho */
}

/* ============================
   Responsive
============================ */
@media (max-width: 600px) {
  body {
    padding: 0.5rem;
  }
  input,
  button,
  select {
    font-size: 0.9rem;
    padding: 0.6rem;
  }
}
/* Botón arriba a la derecha */
.btn-menu-usuario {
  position: fixed;
  top: 10px;
  right: 10px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1101; /* más alto que overlay */
}

.btn-menu-usuario i {
  font-size: 18px;
}

/* Overlay al abrir menú */
/*.menu-usuario::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out;
  z-index: -1;
}*/

.menu-usuario.active::before {
  opacity: 1;
  visibility: visible;
  z-index: 1000; /* debajo del panel pero encima del contenido */
}

/* Menú lateral */
/* Estado inicial: menú oculto */
/* Menú lateral */
.menu-usuario {
  position: fixed;
  top: 0;
  right: -260px; /* oculto */
  width: 250px;
  height: 100%;
  background: #222;
  color: #fff;
  transition: right 0.3s ease;
  z-index: 200; /* más alto que el overlay */
  overflow-y: auto;
}
.menu-usuario.active {
  right: 0;
}

/* Overlay */
#menuOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 100; /* más bajo que el menú */
}
#menuOverlay.active {
  display: block;
}

.menu-usuario.active {
  right: 0; /* se muestra */
}

.menu-usuario .menu-content {
  padding: 15px;
  overflow-y: auto; /* scroll si es necesario */
  height: 100%;
}

.menu-usuario h3 {
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.menu-usuario button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: #eee;
  padding: 10px 0;
  font-size: 1rem;
  cursor: pointer;
  border-bottom: 1px solid #333;
}

.menu-usuario button:hover {
  color: var(--color-primary);
}

/* Contenedor de cada platillo */
.platillo {
  display: grid;
  grid-template-columns: 80px 1fr auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #444; /* 🔹 ÚNICO borde */
  border-radius: 8px;
  background: #000;
}

/* Imagen */
.platillo img.foto {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 6px;
}

/* Texto */
.platillo .info {
  font-size: 14px;
  color: #fff;
  border: none !important;
  background: transparent !important;
}

/* Precio y total */
.platillo .precio,
.platillo .total {
  color: #fff;
  font-weight: bold;
  border: none !important;
  background: transparent !important;
}

/* Acciones (botones + cantidad en línea) */
.platillo .acciones {
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent !important;
  border: none !important;
}

/* Botones de cantidad */
.platillo button {
  background: #d4aa00;
  border: none;
  color: #000;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
}
.platillo button:hover {
  background: #b89200;
}

/* Número de cantidad */
.platillo span {
  color: #fff;
  font-weight: bold;
  min-width: 25px;
  text-align: center;
  display: inline-block;
}

/* 📱 Platillo en pantallas chicas */
.platillo-sm {
  border: 1px solid #444;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
  background: #000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.platillo-sm .row1 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.platillo-sm .row1 img {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
}

.platillo-sm .row1 .info {
  font-weight: bold;
  color: #fff;
}

.platillo-sm .row2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.platillo-sm .row2 .precio {
  color: #d4aa00;
  font-weight: bold;
}

.platillo-sm .row2 .acciones {
  display: flex;
  align-items: center;
  gap: 6px;
}

.platillo-sm .row2 .acciones button {
  background: #d4aa00;
  border: none;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
}

.platillo-sm .row2 .total {
  font-weight: bold;
  color: #fff;
}

/* Responsive: pantallas chicas (iPhone) */
@media (max-width: 600px) {
  .platillo {
    grid-template-columns: 80px 1fr;
    grid-template-rows: auto auto;
  }

  .platillo .precio,
  .platillo .acciones,
  .platillo .total {
    grid-column: 1 / span 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
  }
}

.bottom-bar a {
  position: relative; /* para que el badge se posicione relativo al link */
}

.badge {
  position: absolute;
  top: -4px; /* 🔹 súbelo encima del ícono */
  right: 12px; /* 🔹 ajústalo para que quede en la esquina del ícono */
  background: #d4aa00;
  color: #000;
  font-weight: bold;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 12px;
  min-width: 18px;
  text-align: center;
  line-height: 1.2;
  display: none; /* oculto por defecto */
}

/* ============================
   Estilos generales de items (Carrito + Menú)
============================ */
.carrito-item,
.platillo {
  border: 1px solid #444;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 12px;
  background: #000;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 📱 Pantallas chicas */
@media (max-width: 767px) {
  .carrito-item,
  .platillo {
    flex-direction: column;
    align-items: flex-start;
  }

  .carrito-item .row1,
  .carrito-item .row2,
  .platillo .row1,
  .platillo .row2 {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: transparent;
  }

  .carrito-item .row1,
  .platillo .row1 {
    margin-bottom: 6px;
  }
}

/* Imagen */
.carrito-item .foto,
.platillo .foto {
  width: 60px;
  height: 60px;
  border-radius: 4px;
  object-fit: cover;
}

/* Texto */
.carrito-item .info,
.platillo .info {
  flex: 1;
  color: #fff;
  font-weight: bold;
}

/* Precios y totales */
.carrito-item .precio,
.carrito-item .subtotal,
.platillo .precio,
.platillo .subtotal {
  color: #fff;
  font-weight: bold;
  white-space: nowrap;
}

/* Acciones */
.carrito-item .acciones,
.platillo .acciones {
  display: flex;
  align-items: center;
  gap: 6px;
}

.carrito-item .acciones button,
.platillo .acciones button {
  background: #d4aa00;
  border: none;
  padding: 4px 10px;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
}

.carrito-item .acciones span,
.platillo .acciones span {
  min-width: 20px;
  text-align: center;
  color: #fff;
}

/* ============================
   Recompensas
============================ */
.tarjeta-recompensas {
  background: linear-gradient(135deg, #d4aa00, #b38f00);
  color: #000;
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.tarjeta-recompensas h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: bold;
}

.tarjeta-recompensas .saldo {
  font-size: 2rem;
  font-weight: bold;
  margin: 8px 0;
}

.tarjeta-recompensas small {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
  color: #222;
}

/* ============================
   Estilos Recompensas
============================ */
#misRecompensas {
  padding: 15px;
  color: #fff;
  font-family: Arial, sans-serif;
}

.tarjeta-recompensas {
  background: #111;
  border: 2px solid #d4aa00;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.tarjeta-recompensas h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #d4aa00;
}

.tarjeta-recompensas .saldo {
  font-size: 2rem;
  font-weight: bold;
  margin: 10px 0;
  color: #fff;
}

.tarjeta-recompensas small {
  font-size: 0.9rem;
  color: #aaa;
}

.historial-recompensas h4 {
  margin-bottom: 10px;
  color: #d4aa00;
  font-size: 1.1rem;
}

.historial-recompensas ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.historial-recompensas li {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.historial-recompensas li:hover {
  transform: translateY(-2px);
  background: #222;
}

.historial-recompensas li .fecha {
  font-size: 0.8rem;
  color: #aaa;
}

.historial-recompensas li .desc {
  font-weight: bold;
  color: #fff;
}

.historial-recompensas li .saldo {
  font-size: 0.9rem;
  color: #d4aa00;
}

/* ============================
   Menú - Pantallas chicas (3 renglones)
============================ */
@media (max-width: 768px) {
  .platillo {
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
    background: #000;
    width: 100%;
    box-sizing: border-box;
  }

  /* 🔹 Renglón 1: Imagen + nombre */
  .platillo .row1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
  }

  .platillo .row1 .foto {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #333;
    flex-shrink: 0;
  }

  .platillo .row1 .info {
    flex: 1;
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
    line-height: 1.2rem;
    white-space: normal;
    word-break: break-word;
  }

  /* 🔹 Renglón 2: precio */
  .platillo .row2 {
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: bold;
    color: #d4aa00;
  }

  /* 🔹 Renglón 3: botones + total */
  .platillo .row3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
  }

  .platillo .row3 .acciones {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .platillo .row3 .acciones button {
    background: #d4aa00;
    border: none;
    padding: 6px 12px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    color: #000;
  }

  .platillo .row3 .acciones span {
    min-width: 20px;
    text-align: center;
    color: #fff;
    font-weight: bold;
  }

  .platillo .row3 .total {
    font-weight: bold;
    color: #fff;
    text-align: right;
    flex-shrink: 0;
  }
}
