/* ===== PANEL ===== */

.cart-panel {
  position: fixed;
  right: -420px;
  top: 0;
  width: 400px;
  height: 100%;
  background: #ffffff;
  box-shadow: -15px 0 40px rgba(0, 0, 0, 0.15);
  transition: 0.3s ease;
  display: flex;
  flex-direction: column;
  z-index: 9999;
}

.cart-panel.active {
  right: 0;
}

/* ===== HEADER ===== */

.cart-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
}

.cart-header > span {
  cursor: pointer;
}

/* ===== BODY ===== */

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* ===== ITEM ===== */

/* ===== ESTADO VACÍO ===== */
.cart-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 250px;
  text-align: center;
  color: #94a3b8;
}

.cart-empty-state i {
  font-size: 3rem;
  margin-bottom: 12px;
  color: #cbd5e1;
}

.cart-empty-state p {
  font-size: 1rem;
  font-weight: 600;
  color: #334155;
  margin: 0 0 4px 0;
}

.cart-empty-state span {
  font-size: 0.85rem;
  color: #64748b;
}

/* ===== ITEM DEL CARRITO ===== */
.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid #f1f5f9;
}

.cart-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 4px;
  flex-shrink: 0;
}

.cart-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0; /* Previene desbordamiento de texto */
}

.cart-info-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.cart-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== CANTIDAD ===== */

.cart-quantity {
  display: flex;
  align-items: center;
  margin-top: 8px;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fafafa;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s;
}

.qty-btn:hover {
  background: #111;
  color: white;
}

.qty-number {
  width: 35px;
  text-align: center;
  font-weight: 600;
}

/* ===== ELIMINAR ===== */

.cart-delete {
  background: none;
  border: none;
  padding: 4px;
  font-size: 0.95rem;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.2s ease;
  line-height: 1;
  flex-shrink: 0;
}

.cart-delete:hover {
  color: #ef4444;
}

.cart-info-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ===== FOOTER ===== */

.cart-footer {
  padding: 20px;
  border-top: 1px solid #eee;
  background: #fff;
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  margin-bottom: 15px;
}

/* ===== BOTON ===== */

.btn-checkout {
  display: block;
  width: 100%;
  padding: 16px;
  text-align: center;
  background: #d87093;
  color: white;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: 0.3s;
}

.btn-checkout:hover {
  background: #111;
}

/* ===== OVERLAY ===== */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ===== PANEL ===== */
.cart-panel {
  position: fixed;
  right: -100%;
  top: 0;
  width: 400px;
  max-width: 100%;
  height: 100vh;
  height: 100dvh; /* Para navegadores móviles modernos */
  background: #ffffff;
  box-shadow: -15px 0 40px rgba(0, 0, 0, 0.15);
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  z-index: 9999;
}

.cart-panel.active {
  right: 0;
}

/* ===== HEADER ===== */
.cart-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-header > span {
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
}

/* ===== BODY ===== */
.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* ===== ITEM ===== */
.cart-item {
  display: flex;
  gap: 15px;
  padding: 18px 0;
  border-bottom: 1px solid #f0f0f0;
}

.cart-img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  background: #f7f7f7;
  border-radius: 12px;
  padding: 8px;
  flex-shrink: 0;
}

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

.cart-title {
  font-size: 15px;
  font-weight: 600;
}

/* ===== CANTIDAD ===== */
.cart-quantity {
  display: inline-flex;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 2px;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
}

.qty-btn:hover {
  background: #d87093;
  color: #ffffff;
}

.qty-number {
  width: 28px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
}

.cart-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: #d87093;
}
/* ===== ELIMINAR ===== */
.cart-delete {
  background: none;
  border: none;
  font-size: 18px;
  color: #bbb;
  cursor: pointer;
  transition: 0.2s;
}

.cart-delete:hover {
  color: #e53935;
}

/* ===== FOOTER ===== */
.cart-footer {
  padding: 20px;
  border-top: 1px solid #eee;
  background: #fff;
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  margin-bottom: 15px;
}

/* ===== BOTÓN ===== */
.btn-checkout {
  display: block;
  width: 100%;
  padding: 16px;
  text-align: center;
  background: #d87093;
  color: white;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: 0.3s;
}

.btn-checkout:hover {
  background: #111;
}

/* ===== AJUSTES RESPONSIVOS PARA CELULARES ===== */
@media (max-width: 480px) {
  .cart-panel {
    width: 100%;
  }

  .cart-header,
  .cart-body,
  .cart-footer {
    padding: 15px;
  }

  .cart-img {
    width: 60px;
    height: 60px;
  }

  .cart-title {
    font-size: 14px;
  }

  .qty-btn {
    width: 28px;
    height: 28px;
  }

  .btn-checkout {
    padding: 14px;
  }
}
