/* ==================================================
   CART OVERLAY
================================================== */

.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;

  background: rgba(0,0,0,.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  z-index: 2147483647; /* 🔥 nivel máximo */

  display: flex;
  justify-content: flex-end;
}
/* ==================================================
   CART PANEL
================================================== */

.cart-panel {
  position: relative;
  z-index: 2147483648;

  width: 100%;
  max-width: 400px;
  height: 100dvh; 


  background: rgba(255,255,255,.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  border-left: 1px solid rgba(0,0,0,.05);
  border-top-left-radius: 22px;
  border-bottom-left-radius: 22px;

  box-shadow: -20px 0 60px rgba(0,0,0,.25);

  display: flex;
  flex-direction: column;

  animation: cartSlideIn .25s ease-out;
  overflow: hidden;
}

/* ==================================================
   HEADER
================================================== */

.cart-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0,0,0,.05);
}

.cart-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
}

.cart-subtitle {
  font-size: 12px;
  color: #64748b;
}

.cart-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.06);
  cursor: pointer;
  transition: .2s;
}

.cart-close:hover {
  background: rgba(0,0,0,.12);
}

/* ==================================================
   DELIVERY TOGGLE
================================================== */

.delivery-toggle {
  margin: 14px 18px;
  position: relative;
  display: flex;
  background: #f1f5f9;
  border-radius: 16px;
  padding: 4px;
}

.delivery-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: #16a34a;
  border-radius: 12px;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  z-index: 1;
}

.delivery-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 2;
  cursor: pointer;
  transition: .2s;
  color: #334155;
}

.delivery-btn.active {
  color: white;
}

/* ==================================================
   BODY
================================================== */

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 18px 12px;
}

/* ==================================================
   ITEM
================================================== */

.cart-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(0,0,0,.05);
  align-items: center;
}

.cart-item-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  padding: 6px;
}

.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cart-item-name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
}

.cart-item-price {
  font-size: 13px;
  color: #64748b;
}

.cart-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.qty-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: .2s;
}

.qty-minus {
  background: #f1f5f9;
}

.qty-plus {
  background: #16a34a;
  color: white;
}

.qty-btn:hover {
  transform: scale(1.05);
}

.qty-number {
  min-width: 22px;
  text-align: center;
  font-weight: 600;
}

.cart-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.cart-item-total {
  font-weight: 700;
  font-size: 14px;
}

.qty-delete {
  background: #fef2f2;
  color: #dc2626;
}

/* ==================================================
   FOOTER
================================================== */

.cart-footer {
  padding: 16px 18px;
  border-top: 1px solid rgba(0,0,0,.05);
  background: #ffffff;

  position: sticky;
  bottom: 0;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 6px;
}

.cart-summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 800;
  margin-top: 8px;
}

.checkout-btn {
  margin-top: 12px;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  font-weight: 700;
  font-size: 15px;
  background: linear-gradient(135deg,#16a34a,#15803d);
  color: white;
  cursor: pointer;
  transition: .25s;
  box-shadow: 0 8px 20px rgba(0,0,0,.15);
}

.checkout-btn:hover {
  transform: translateY(-2px);
}

/* ==================================================
   ANIMATION
================================================== */

@keyframes cartSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* ==================================================
   SWEETALERT STYLING
================================================== */

.swal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.swal-info-box {
  background: linear-gradient(135deg,#dcfce7,#bbf7d0);
  padding: 14px;
  border-radius: 16px;
  font-size: 13px;
  color: #166534;
  display: flex;
  gap: 10px;
}

.swal-custom-input {
  border-radius: 14px !important;
}

.swal-custom-input:focus {
  box-shadow: 0 0 0 2px rgba(34,197,94,.3) !important;
  border-color: #22c55e !important;
}

/* ==================================================
   CONFETTI
================================================== */

@keyframes fallConfetti {
  to {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Mantener solo esto */

.cart-panel {
  overflow: hidden;
}

.cart-body {
  overflow-y: auto;
}

/* ==============================
   PEEKSHOP DELIVERY MODAL
============================== */

.ps-delivery {
  text-align: center;
}

.ps-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 16px;
}

.ps-product {
  background: linear-gradient(135deg,#f8fafc,#eef2ff);
  padding: 14px;
  border-radius: 18px;
  margin-bottom: 18px;
  box-shadow: 0 6px 20px rgba(0,0,0,.06);
}

.ps-product-name {
  font-weight: 700;
  margin-bottom: 4px;
}

.ps-product-sub {
  font-size: 14px;
  color: #64748b;
}

.ps-toggle {
  position: relative;
  display: flex;
  background: #f1f5f9;
  border-radius: 20px;
  padding: 6px;
  margin-bottom: 18px;
}

.ps-indicator {
  position: absolute;
  top: 6px;
  left: 6px;
  width: calc(50% - 6px);
  height: calc(100% - 12px);
  background: linear-gradient(135deg,#16a34a,#15803d);
  border-radius: 16px;
  transition: all .3s cubic-bezier(.4,0,.2,1);
}

.ps-btn {
  flex: 1;
  border: none;
  background: transparent;
  font-weight: 700;
  padding: 12px;
  cursor: pointer;
  z-index: 2;
  color: #334155;
  transition: .2s;
}

.ps-btn.active {
  color: white;
}

.ps-cost-box {
  background: linear-gradient(135deg,#dcfce7,#bbf7d0);
  padding: 16px;
  border-radius: 20px;
  font-weight: 700;
  box-shadow: 0 8px 25px rgba(0,0,0,.08);
}

/* ===============================
   SWEET ALERT - IOS STYLE INPUTS
================================= */

.swal2-input,
.swal2-textarea {
  border-radius: 18px !important;
  border: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  padding: 14px 16px !important;
  font-size: 15px !important;
  transition: all .2s ease !important;
  box-shadow: none !important;
}

.swal2-input:focus,
.swal2-textarea:focus {
  border-color: #22c55e !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(34,197,94,.15) !important;
}

.swal2-textarea {
  min-height: 90px !important;
  resize: none !important;
}

/* Quitar espacio extra default SweetAlert */
.swal2-textarea {
  min-height: 70px !important;
  margin: 0 !important;
}

/* Espaciado más limpio entre campos */
.swal-form .swal2-input,
.swal-form .swal2-textarea {
  margin-top: 8px !important;
}