* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ==== BASE ==== */
body {
  font-family: "Inter", "Segoe UI", "Roboto", sans-serif;
  background: #f7f9fb;
  color: #1f2937;
  padding-top: 80px;
}



/* ==== HEADER ==== */
header {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: white;
  color: #fff;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  height: 60px;
}

.app-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-info img {
  height: 40px;
  width: auto;
}

.app-info h2 {
  font-size: 20px;
  font-weight: 700;
  color: #38bdf8;
}

.cart-summary a {
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: #22c55e;
  padding: 8px 14px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.cart-summary a:hover {
  background: #16a34a;
}

/* ==== BARRA LATERAL ==== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100%;
  background-color: white;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  padding-top: 80px; /* espacio para el header */
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 999;
  transition: transform 0.3s ease;
}

.sidebar h2 {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar ul {
  list-style: none;
  margin-top: 10px;
}

.sidebar li {
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.sidebar li:hover {
  background-color: #334155;
}

.sidebar a {
  text-decoration: none;
  color: #e2e8f0;
  font-weight: 500;
  display: block;
}

.sidebar a:hover {
  color: #38bdf8;
}

/* ---------- SIDEBAR ---------- */



/* Cabecera de la barra */
.sidebar h3 {
  font-size: 16px;
  color: #0f172a;
  font-weight: 600;
  margin-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
}


/* Botón toggle (móvil) */
.sidebar-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  background: #0f172a;
  color: white;
  border: none;
  padding: 8px 12px;
  font-size: 18px;
  cursor: pointer;
  border-radius: 6px;
  z-index: 1100;
  display: none;
  transition: background 0.2s ease;
}

.sidebar-toggle:hover {
  background: #1e293b;
}

/* ==== CONTENIDO ==== */
.products {
  padding: 30px 20px;
  margin-left: 240px; /* espacio para la barra lateral */
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  transition: margin-left 0.3s ease;
}

.product {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
  padding: 16px;
  text-align: center;
  transition: transform 0.2s ease;
}

.product:hover {
  transform: translateY(-5px);
}

.product img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
}

.product h3 {
  margin-top: 12px;
  font-size: 18px;
  font-weight: 600;
}

.product p {
  margin: 8px 0;
  color: #6b7280;
  font-size: 14px;
}

.valores {
  display: inline-block;
  background-color: #dcfce7;
  color: #15803d;
  font-size: 18px;
  padding: 6px 12px;
  border-radius: 10px;
  font-weight: bold;
  margin-top: 4px;
}

.qty-input {
  width: 70px;
  padding: 6px;
  margin-top: 8px;
  text-align: center;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.btn {
  display: inline-block;
  padding: 10px 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-add {
    background-color: white;
    border: 1px solid silver;
    padding: 8px 14px;
    border-radius: 8px;
    color: black;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-add:hover {
    background-color: silver;
}

/* ==== PANEL DEL CARRITO ==== */
#cart-detail {
  position: fixed;
  top: 90px;
  right: 20px;
  width: 360px;
  max-width: 90%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  padding: 20px;
  transform: translateX(120%);
  transition: transform 0.3s ease;
  z-index: 9999;
}

#cart-detail.open {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cart-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.order-id {
  font-size: 13px;
  background: #e0f2fe;
  padding: 4px 8px;
  border-radius: 6px;
  color: #0c4a6e;
}

.cart-items {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 12px;
}

li.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  background: #f9fafb;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
}

.item-left {
  display: flex;
  flex-direction: column;
}

.item-sub {
  font-weight: 600;
}

.remove-small {
  background: #ef4444;
  color: white;
  border: none;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
}

.cart-footer {
  border-top: 1px solid #e5e7eb;
  padding-top: 12px;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 10px;
}

.buttons-row {
  display: flex;
  gap: 10px;
}

.btn-generate {
  background-color: #6366f1;
  color: white;
}

.btn-pay {
  background-color: #0ea5e9;
  color: white;
}

.btn-cancel {
  background-color: #ef4444;
  color: white;
}

.btn-clear {
  background-color: #6b7280;
  color: white;
  width: 100%;
  margin-top: 8px;
}

/* ==== FOOTER ==== */
footer {
  text-align: center;
  padding: 25px 20px;
  background-color: #f1f5f9;
  margin-top: 60px;
  color: #555;
  font-size: 14px;
  border-top: 1px solid #e5e7eb;
}

footer a {
  color: #4b5563;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* ==== RESPONSIVE ==== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: block;
  }

  .products {
    margin-left: 0;
    padding-top: 100px;
  }

  header {
    padding-left: 60px;
  }
}

@media (max-width: 480px) {
  .product img {
    height: 120px;
  }

  #cart-detail {
    right: 10px;
    width: 95%;
  }
}


/* Cada ítem de filtro */
.filter-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  padding: 4px 2px;
  margin-bottom: 2px; /* mínimo espaciado entre items */
  cursor: pointer;
  transition: background 0.2s ease;
}

/* Hover sutil */
.filter-item:hover {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

/* Checkbox + label */
.filter-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-left input[type="checkbox"] {
  accent-color: #111; /* gris oscuro elegante */
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.filter-left label {
  font-size: 14px;
  font-weight: 500;
  color: #222;
  cursor: pointer;
  letter-spacing: 0.2px;
  transition: color 0.2s ease;
}

.filter-left label:hover {
  color: #000;
}

/* Badge sobrio y cuadrado */
.badge-total {
  background: #D1D5DC; /* casi negro */
  color: #27272A;
  font-size: 16px;
  font-weight: 600;
  min-width: 22px;
  text-align: center;
  padding: 3px 6px;
  border-radius: 4px; /* cuadrado con esquinas suaves */
  display: inline-block;
  line-height: 1.2;
  letter-spacing: 0.3px;
}