body.modal-open {
  overflow: hidden; /* Bloquea el scroll */
}
/* Fondo del modal */
.cart-modal {
  display: none;
  position: fixed;
  z-index: 100; /* Encima de todo */
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;

  backdrop-filter: blur(3px);
  background-color: rgba(0, 0, 0, 0.4);
}

/* Contenedor del carrito */
.cart-modal-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 30%;
  height: 100%;
  background: white;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.3s ease-out;
}

.cart-header {
  padding: 20px;
  background: #2c2c2c;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative; /* para posicionar la X */
  letter-spacing: 3px;
}

.carrito-close {
  background: none;
  border: 0;
  cursor: pointer;
}

.cart-header span {
  margin: 0 auto;
  font-size: 1.5rem;
}

.cart-header .close {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 4rem;
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #2c2c2c;
  font-family: "Inter", sans-serif;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #c6a15b #0f0f12;
}

/* WebKit */
.cart-body::-webkit-scrollbar {
  width: 10px;
}
.cart-body::-webkit-scrollbar-track {
  background: #0f0f12;
}
.cart-body::-webkit-scrollbar-thumb {
  background: #c6a15b;
  border-radius: 999px;
  border: 2px solid #0f0f12;
}

.carrito-vacio {
  color: rgb(163, 163, 163);
}

/* Productos */
.cart-item {
  display: flex;
  align-items: center;
  color: white;
  margin-bottom: 15px;
  border-bottom: 1px solid #222222;
}

.cart-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.cart-item-details-1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 1rem;
}

.cart-item img {
  width: 100px;
  height: auto;
  object-fit: cover;
  margin-right: 10px;
}

.cart-item-talla {
  color: #aaaaaa;
}

.cart-item-price {
  color: #aaaaaa;
}

/* Para los controles de +-*/
.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
}

.controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #222222;
}

.controls button {
  background: transparent;
  border: none;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  font-size: 1.2rem;
  color: rgb(109, 109, 109);
  transition: background 0.4s ease;
}

.controls button:hover {
  background: #474747;
}

.btn-quitar {
  background: none;
  border: none;
  padding: 0.5rem;
  font-size: 1rem;
  color: #aaaaaa;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.4s ease;
}

.btn-quitar:hover {
  color: rgb(255, 255, 255);
}

.cantidad-carrito {
  border: none;
}

/* Footer */
.cart-footer {
  padding: 15px;
  background: #2c2c2c;
}

.cart-footer .total {
  font-size: 1.3rem;
  color: rgb(163, 163, 163);
  font-family: "Inter", sans-serif;
}

#bt-compra-content a {
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-comprar {
  letter-spacing: 2px;
  font-family: "Inter", sans-serif;
}

/* Animación */
@keyframes slideIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

/* Botón cerrar */
.close {
  cursor: pointer;
  font-size: 4rem;
}
/*  (máx 1024px) */
@media (max-width: 1024px) {
  .cart-modal-content {
    width: 50%; /* un poco más angosto */
  }

  .cart-header {
    padding: 18px;
  }

  .cart-header span {
    font-size: 1.4rem;
  }

  .cart-item img {
    width: 90px;
  }

  .cart-item-details-1 {
    margin-bottom: 0.8rem;
  }

  .controls button {
    padding: 0.3rem 0.6rem;
  }

  .cart-footer {
    padding: 1rem;
  }

  .cart-footer .total {
    font-size: 1.2rem;
  }

  .close {
    font-size: 3.2rem;
    right: 12px;
  }
}


/* (máx 768px) */
@media (max-width: 768px) {
  .cart-modal-content {
    width: 50%; 
  }

  .cart-header span {
    font-size: 1.2rem;
  }

  .cart-item img {
    width: 80px;
  }

  .cart-footer .total {
    font-size: 1.1rem;
  }

  .close {
    font-size: 3rem;
  }
}

/* Móviles (máx 480px) */
@media (max-width: 480px) {
  .cart-modal-content {
    width: 100%; /* ocupa todo el ancho */
    border-radius: 0;
    animation: slideInMobile 0.3s ease-out;
  }

  .cart-item {
    flex-direction: column; /* apila imagen y texto */
    align-items: center;
    text-align: center;
  }

  .cart-item img {
    width: 120px;
    margin: 0 0 10px 0;
  }

  .cart-item-details-1 {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .cart-item-controls {
    justify-content: center;
  }

  .controls button {
    padding: 0.4rem 0.8rem;
  }

  .btn-quitar {
    font-size: 0.9rem;
  }

  .cart-header {
    padding: 15px;
  }

  .cart-header span {
    font-size: 1.1rem;
  }

  .close {
    right: 10px;
    font-size: 2.5rem;
  }

  .cart-footer {
    padding: 1rem;
  }

  .cart-footer .total {
    font-size: 1rem;
  }
}

/* Animación especial para móviles (desde abajo) */
@keyframes slideInMobile {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}
