* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-image: url(../img/background.webp);
  font-family: 'Segoe UI', sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.cart-header {
  background: black;
  color: white;
  display: flex;
  align-items: center;
  padding: 16px;
  justify-content: space-between;
}

.cart-header .back-button {
  background: none;
  border: none;
  color: #FF1E1E;
  font-size: 1.5rem;
  margin-right: 16px;
  cursor: pointer;
  text-decoration: none;
}

.cart-header h2 {
  font-size: 1rem;
  letter-spacing: 1px;
}

/* Categorías */
.categorias-container {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 16px;
  background-image: url(../img/background.webp);
  justify-content: center;
}

.categoria-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: none;
  color: black;
  background-color: #F5f5f5;
  border-radius: 16px;
  padding: 8px 12px;
  min-width: 80px;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.categoria-btn img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  margin-bottom: 6px;
  filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.1));
}

.categoria-btn span {
  font-size: 13px;
  font-weight: 600;
  color: black;
  text-align: center;
}

/* Activo */
.categoria-btn.active {
  background-color: #FF1E1E;
  color: #2a2f47;
  box-shadow: 0 0 10px rgba(255, 213, 79, 0.6);
  transform: scale(1.05);
}

.categoria-btn.active span {
  color: #2a2f47;
}

.categoria-btn.active img {
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.3));
}

/* Items */
.cart-items {
  background-image: url(../img/background.webp);
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-item {
  display: flex;
  background: #F5f5f5;
  padding: 12px;
  border-radius: 16px;
  gap: 12px;
  color: black;
  border: black;
}

.cart-item img {
  width: 150px;
  height: 165px;
  border-radius: 12px;
  object-fit: cover;
}

.info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 170px;
}


.info h3 {
  font-size: 1rem;
  font-weight: 600;
}

.info p {
  font-size: 0.75rem;
  color: black;
}

.bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.bottom span {
  font-weight: bold;
}

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

.qty button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 1rem;
  background: #FF1E1E;
  color: white;
  cursor: pointer;
  border: none;
}

/* Footer */
.cart-footer {
  background: #F5f5f5;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  color: black;
  border-radius: 0;
  position: sticky;
  bottom: 0;
}

.cart-footer .pay {
  background: #FF1E1E ;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
}


/* Responsive */
@media (min-width: 768px) {
  body {
    flex-direction: column;
    align-items: stretch;
  }

  .cart-header,
  .cart-items,
  .cart-footer {
    width: 100%;
    max-width: 100%;
  }

  .cart-items {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: flex-start;
    padding: 32px;
  }

  .cart-item {
    flex: 0 0 calc(33.333% - 32px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    height: auto;
  }

  .cart-item img {
    width: 100%;
    height: 180px;
    border-radius: 16px;
    object-fit: cover;
  }

  .bottom {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    margin-top: 10px;
  }

  .qty {
    justify-content: flex-end;
  }

  .cart-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0;
    padding: 24px 48px;
    justify-content: space-between;
  }

  .info {
    height: auto;     /* 👈 quitar altura fija en PC */
    /* 👈 opcional: asegura equilibrio visual */
  }

  .bottom {
    margin-top: auto;     /* 👈 empuja precio+botones hacia abajo */
  }
}
