/* ==========================================================================
   ROAR Demos - Universal Cart & Drawer Stylesheet
   Optimizado para móviles, celulares iOS/Android y tablets
   ========================================================================== */

/* Floating Cart Pill (Bottom-Right / Mobile Friendly) */
.demo-floating-cart {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99990;
  transform: translateY(120px) scale(0.9);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.demo-floating-cart.is-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.cart-pill-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #0f172a;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 122, 0, 0.35);
  border: 1px solid rgba(255, 122, 0, 0.5);
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cart-pill-inner:hover,
.cart-pill-inner:active {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(255, 122, 0, 0.5);
}

.cart-pill-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff7a00;
}

.cart-badge-count {
  position: absolute;
  top: -8px;
  right: -10px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid #0f172a;
  animation: badgePop 0.3s ease;
}

@keyframes badgePop {
  0% { transform: scale(0.5); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.cart-pill-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.cart-pill-label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cart-pill-total {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
}

.cart-pill-btn {
  background: linear-gradient(135deg, #ff7a00, #ea580c);
  color: #fff;
  border: none;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.cart-pill-btn:hover {
  opacity: 0.95;
}

/* Backdrop */
.demo-cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 99995;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.demo-cart-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Slide Drawer */
.demo-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background: #0f172a;
  color: #f8fafc;
  z-index: 99996;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.demo-cart-drawer.is-open {
  transform: translateX(0);
}

.cart-drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1e293b;
  flex-shrink: 0;
}

.cart-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-header-title h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.cart-items-counter {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.cart-drawer-close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #cbd5e1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.cart-drawer-close:hover,
.cart-drawer-close:active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px;
}

/* Empty State */
.cart-empty-state {
  text-align: center;
  padding: 50px 16px;
}

.empty-icon {
  font-size: 46px;
  margin-bottom: 12px;
}

.empty-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px 0;
}

.empty-sub {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
}

/* Item Rows */
.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 14px;
  border-radius: 12px;
  gap: 10px;
}

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  margin: 0 0 4px 0;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 13px;
  color: #38bdf8;
  font-weight: 700;
}

.cart-item-price small {
  color: #94a3b8;
  font-size: 11px;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-qty {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  touch-action: manipulation;
}

.btn-qty:hover,
.btn-qty:active {
  background: rgba(255, 255, 255, 0.22);
}

.cart-item-qty {
  font-size: 14px;
  font-weight: 800;
  min-width: 20px;
  text-align: center;
}

.btn-item-remove {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 15px;
  opacity: 0.7;
  transition: opacity 0.2s;
  padding: 6px;
  touch-action: manipulation;
}

.btn-item-remove:hover,
.btn-item-remove:active {
  opacity: 1;
}

/* Form */
.cart-checkout-form {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 18px;
}

.form-title {
  margin: 0 0 12px 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #94a3b8;
  font-weight: 700;
}

.form-group-radio {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.radio-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 10px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  font-size: 12px;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.radio-option:has(input:checked) {
  border-color: #ff7a00;
  background: rgba(255, 122, 0, 0.14);
  color: #fff;
  font-weight: 700;
}

.radio-option input {
  display: none;
}

.form-field {
  margin-bottom: 12px;
}

.form-field label {
  display: block;
  font-size: 12px;
  color: #cbd5e1;
  margin-bottom: 5px;
  font-weight: 600;
}

/* 16px font-size prevents iOS Safari from automatically zooming into the page */
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  box-sizing: border-box;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: #ff7a00;
  box-shadow: 0 0 0 2px rgba(255, 122, 0, 0.2);
}

/* Footer & WhatsApp CTA */
.cart-drawer-footer {
  padding: 16px 20px max(18px, env(safe-area-inset-bottom, 18px));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #1e293b;
  flex-shrink: 0;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 6px;
}

.delivery-status {
  color: #10b981;
  font-weight: 600;
}

.total-row {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  margin-bottom: 14px;
}

.total-amount {
  color: #38bdf8;
  font-size: 19px;
}

.btn-send-whatsapp {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 13px 18px;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.btn-send-whatsapp:hover,
.btn-send-whatsapp:active {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(37, 211, 102, 0.5);
  filter: brightness(1.05);
}

.whatsapp-note {
  text-align: center;
  font-size: 11px;
  color: #64748b;
  margin: 8px 0 0 0;
}

/* Toast Notifications */
.demo-toast-container {
  position: fixed;
  bottom: 24px;
  left: 20px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100vw - 40px);
}

.demo-toast {
  background: rgba(15, 23, 42, 0.96);
  color: #fff;
  border: 1px solid rgba(34, 197, 94, 0.5);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.25s ease;
  backdrop-filter: blur(10px);
}

.demo-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #22c55e;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .demo-floating-cart {
    bottom: max(14px, env(safe-area-inset-bottom, 14px));
    right: 14px;
    left: 14px;
  }
  .cart-pill-inner {
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 14px;
  }
  .cart-pill-total {
    font-size: 15px;
  }
  .demo-cart-drawer {
    max-width: 100%;
  }
  .demo-toast-container {
    bottom: 80px; /* Above the floating cart */
    left: 14px;
    right: 14px;
  }
}
