/* Reset básico */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #000;
  color: #fff;
  line-height: 1.6;
  padding: 10px;
  min-width: 320px;
  overflow-x: hidden;
}

/* Reutilizable */
.input-estandar {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #555;
  border-radius: 6px;
  background: #222;
  color: #fff;
}

header {
  background: #111;
  color: white;
  padding: 25px 20px;
  text-align: center;
  border-bottom: 2px solid #ff6f61;
}

header h1 {
  font-size: 28px;
}

header p {
  font-size: 16px;
  opacity: 0.9;
}

.logo {
  display: block;
  width: 200px;
  margin: 10px auto;
  border-radius: 4px;
}

main {
  display: flex;
  flex-direction: column-reverse;
  gap: 20px;
  max-width: 1200px;
  margin: auto;
  padding: 10px;
}

#menu {
  background: #111;
  border-radius: 10px;
  padding: 20px;
  flex: 2;
}

.categoria {
  margin-bottom: 30px;
}

.categoria h3 {
  font-size: 20px;
  color: #ff6f61;
  border-left: 4px solid #ff6f61;
  padding-left: 10px;
  margin-bottom: 15px;
}

.producto {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 10px;
  border-bottom: 1px solid #333;
  cursor: pointer;
  transition: background 0.3s ease;
}

.producto:hover {
  background: #1c1c1c;
}

.producto img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.producto span {
  flex: 1;
  font-size: 14px;
  line-height: 1.3;
}

/* --- ESTILOS PARA EL SELECTOR DE CANTIDAD --- */
.producto .contenedor-cantidad {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  background: #1c1c1c;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 14px;
}

.producto .btn-cantidad {
  width: 30px;
  height: 30px;
  background-color: #ff4d4d;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.producto .input-cantidad {
  width: 40px;
  text-align: center;
  background: transparent;
  border: none;
  color: white;
  font-size: 14px;
  font-weight: bold;
  padding: 0;
}

.producto .btn-agregar {
  margin-left: auto;
  background-color: #27ae60;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s ease;
  width: auto;
}

.producto .btn-agregar:hover {
  background-color: #2ecc71;
}

#carrito {
  flex: 1;
  background: #111;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.05);
}

#carrito h2 {
  font-size: 20px;
  color: #ff6f61;
}

#carrito ul {
  list-style: none;
  margin: 15px 0;
  padding: 0;
}

#carrito li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #333;
  font-size: 15px;
}

#carrito button {
  background-color: #2ecc71;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s ease;
}

#carrito button:hover {
  background-color: #27ae60;
}

.info-pago {
  font-size: 0.9em;
  margin-top: 10px;
}

#agregar-producto {
  background: #222;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.05);
  color: #fff;
  margin-top: 20px;
}

footer {
  text-align: center;
  padding: 20px;
  background: #000;
  font-size: 14px;
  color: #777;
  margin-top: 20px;
  border-top: 1px solid #222;
}

/* Responsive para pantallas grandes */
@media (min-width: 768px) {
  main {
    flex-direction: row;
    align-items: flex-start;
  }

  #menu {
    flex: 2;
  }

  #carrito {
    flex: 1;
  }
}

/* Responsive para móviles pequeños */
@media (max-width: 400px) {
  .producto span {
    font-size: 13px;
  }

  .btn-cantidad {
    width: 26px;
    height: 26px;
    font-size: 14px;
  }

  .input-cantidad {
    width: 35px;
  }

  #carrito li {
    font-size: 14px;
  }
}

/* 📱 Diseño en móviles */
@media (max-width: 767px) {
  .producto {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 8px;
  }

  .producto img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    image-rendering: auto;
  }

  .producto span {
    flex: 1 1 auto;
    font-size: 15px;
    line-height: 1.2;
  }

  .producto span:nth-of-type(2) {
    font-weight: bold;
    color: #ddd;
    display: block;
    margin-top: 4px;
  }

  .producto .contenedor-cantidad {
    margin-left: auto;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateZ(0);
  }

  .producto .btn-cantidad {
    width: 26px;
    height: 26px;
    font-size: 14px;
  }

  .producto .input-cantidad {
    width: 35px;
    font-size: 14px;
  }

  .producto .btn-agregar {
    margin-left: auto;
    margin-top: 5px;
    font-size: 14px;
    padding: 6px 10px;
    display: block;
  }

  #carrito li {
    font-size: 16px;
  }
}

/* 🔍 Mejora de renderizado general */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img {
  image-rendering: auto;
  -webkit-transform: translateZ(0);
}


/* 🛒 Ubicar botón "Agregar" debajo del producto en móviles */
@media (max-width: 767px) {
  .producto {
    flex-wrap: wrap;
  }

  .producto .btn-agregar {
    width: 100%;
    margin-top: 8px;
    margin-left: 0;
    text-align: center;
    display: block;
  }
}
