/* Overlay */
.scqs-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 9997;
}

.scqs-drawer-overlay.scqs-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Drawer base */
.scqs-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 380px;
  height: 100%;
  background: #f9fafb;
  box-shadow: -12px 0 32px rgba(15, 23, 42, 0.38);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease;
  transform: translateX(100%);
}

/* RTL : drawer à gauche si le site est RTL */
html[dir="rtl"] .scqs-drawer {
  right: auto;
  left: 0;
  box-shadow: 12px 0 32px rgba(15, 23, 42, 0.38);
  transform: translateX(-100%);
}

.scqs-drawer.scqs-open {
  transform: translateX(0);
}

html[dir="rtl"] .scqs-drawer.scqs-open {
  transform: translateX(0);
}

/* Header */
.scqs-drawer-header {
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #e5e7eb;
  color: #f9fafb;
}

.scqs-drawer-header h3 {
  font-size: 15px;
  margin: 0;
}

.scqs-drawer-close {
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: #f97373;
  line-height: 1;
}

/* Body */
.scqs-drawer-body {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
}

/* Items */
.scqs-drawer-item {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #e5e7eb;
  padding: 8px 0;
}

.scqs-drawer-thumb img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 12px;
}

.scqs-drawer-info {
  flex: 1;
  min-width: 0;
}

.scqs-drawer-title {
  font-size: 13px;
  font-weight: 500;
  color: #111827;
}

.scqs-drawer-item-variation {
  font-size: 11px;
  color: #6b7280;
}

.scqs-drawer-meta {
  font-size: 12px;
  margin-top: 2px;
}

.scqs-drawer-price {
  font-weight: 600;
  color: #2563eb;
}

/* Qty + remove */
.scqs-drawer-qty {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.scqs-drawer-qty button {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #e5e7eb;
  width: 22px;
  height: 22px;
  font-size: 13px;
  cursor: pointer;
}

.scqs-drawer-qty .scqs-qty-input {
  width: 40px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  font-size: 12px;
  padding: 2px 4px;
  text-align: center;
  background: #fff;
}

.scqs-drawer-remove {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  color: #f97373;
  line-height: 1;
}

/* Total + boutons */
.scqs-drawer-total {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
}

.scqs-drawer-confirm-btn {
  margin-top: 12px;
  width: 100%;
  border-radius: 999px;
  border: none;
  padding: 9px 14px;
  background: linear-gradient(135deg, #2563eb, #22c1c3);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.scqs-drawer-confirm-btn::before {
  content: "🧾";
}

.scqs-empty-cart {
  font-size: 13px;
  color: #6b7280;
  padding: 10px 4px;
}

/* Mobile tweaks */
@media (max-width: 640px) {
  .scqs-drawer {
    max-width: 100%;
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.45);
  }

  .scqs-drawer-header {
    padding: 12px 16px;
  }

  .scqs-drawer-header h3 {
    font-size: 16px;
  }

  .scqs-drawer-body {
    padding: 10px 12px 14px;
  }

  .scqs-drawer-thumb img {
    width: 56px;
    height: 56px;
  }

  .scqs-drawer-qty button {
    width: 26px;
    height: 26px;
    font-size: 14px;
  }

  .scqs-drawer-qty .scqs-qty-input {
    width: 48px;
    font-size: 13px;
  }

  .scqs-drawer-confirm-btn {
    padding: 11px 16px;
    font-size: 15px;
  }
}
