/**
 * public/css/store-cart.css
 * Système de Panier par Boutique - Aura Store
 * Glassmorphism, animations fluides, responsive (Desktop Slide-over / Mobile Bottom-Sheet)
 */

/* ── VARIABLES & TOKENS ─────────────────────────────────────────────────── */
:root {
  --aura-cart-primary: var(--store-primary, #2563eb);
  --aura-cart-primary-hover: var(--store-primary-hover, #1d4ed8);
  --aura-cart-bg-glass: rgba(255, 255, 255, 0.88);
  --aura-cart-border-glass: rgba(255, 255, 255, 0.6);
  --aura-cart-shadow-glass: 0 20px 50px rgba(15, 23, 42, 0.15), 0 1px 3px rgba(15, 23, 42, 0.05);
  --aura-cart-text-main: #0f172a;
  --aura-cart-text-muted: #64748b;
  --aura-cart-radius: 20px;
  --aura-cart-radius-sm: 12px;
  --aura-cart-transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-dark="1"] {
  --aura-cart-bg-glass: rgba(15, 23, 42, 0.92);
  --aura-cart-border-glass: rgba(255, 255, 255, 0.1);
  --aura-cart-shadow-glass: 0 25px 60px rgba(0, 0, 0, 0.4);
  --aura-cart-text-main: #f8fafc;
  --aura-cart-text-muted: #94a3b8;
}

/* ── BOUTON FLOTTANT DU PANIER (FLOATING TRIGGER) ───────────────────────── */
.aura-cart-float-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--aura-cart-primary);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 9999px;
  box-shadow: 0 10px 25px -3px rgba(37, 99, 235, 0.4), 0 4px 10px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background-color 0.2s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  user-select: none;
}

.aura-cart-float-trigger:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 16px 32px -4px rgba(37, 99, 235, 0.5), 0 6px 14px rgba(0, 0, 0, 0.12);
}

.aura-cart-float-trigger:active {
  transform: translateY(1px) scale(0.98);
}

.aura-cart-float-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.aura-cart-float-icon-wrap svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.2;
}

/* Badge de compteur animé */
.aura-cart-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
  border: 2px solid #ffffff;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.aura-cart-badge.is-bumped {
  animation: auraCartBump 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes auraCartBump {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.5) rotate(-5deg); }
  100% { transform: scale(1); }
}

.aura-cart-float-total {
  font-size: 13.5px;
  font-weight: 800;
  padding-left: 6px;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
}

/* ── OVERLAY DU PANIER ──────────────────────────────────────────────────── */
.aura-cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.aura-cart-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* ── TIROIR DU PANIER (DRAWER / SLIDE-OVER / BOTTOM-SHEET) ──────────────── */
.aura-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  z-index: 10001;
  background: var(--aura-cart-bg-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-left: 1px solid var(--aura-cart-border-glass);
  box-shadow: var(--aura-cart-shadow-glass);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

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

/* Responsive Mobile : Bottom Sheet */
@media (max-width: 640px) {
  .aura-cart-float-trigger {
    bottom: 20px;
    right: 20px;
    padding: 10px 16px;
    font-size: 13.5px;
  }
  .aura-cart-float-label {
    display: none;
  }
  .aura-cart-drawer {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: 100%;
    height: 88vh;
    border-left: none;
    border-top: 1px solid var(--aura-cart-border-glass);
    border-radius: 28px 28px 0 0;
    transform: translateY(100%);
  }
  .aura-cart-overlay.is-open .aura-cart-drawer {
    transform: translateY(0);
  }
}

/* Tirette mobile (handle) */
.aura-cart-mobile-handle {
  display: none;
  width: 44px;
  height: 5px;
  background: #cbd5e1;
  border-radius: 999px;
  margin: 10px auto 4px;
}
@media (max-width: 640px) {
  .aura-cart-mobile-handle {
    display: block;
  }
}

/* ── HEADER DU PANIER ───────────────────────────────────────────────────── */
.aura-cart-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(255, 255, 255, 0.4);
}
[data-dark="1"] .aura-cart-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.4);
}

.aura-cart-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.aura-cart-store-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--aura-cart-primary), #6366f1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.aura-cart-store-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.aura-cart-title-text h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--aura-cart-text-main);
  letter-spacing: -0.01em;
}

.aura-cart-title-text p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--aura-cart-text-muted);
  font-weight: 600;
}

.aura-cart-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(203, 213, 225, 0.6);
  background: rgba(255, 255, 255, 0.7);
  color: var(--aura-cart-text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.aura-cart-close-btn:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  transform: rotate(90deg);
}

/* ── CORPS DU PANIER (ARTICLES) ─────────────────────────────────────────── */
.aura-cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  overscroll-behavior: contain;
}

/* État panier vide */
.aura-cart-empty {
  padding: 48px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.aura-cart-empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  margin-bottom: 16px;
  animation: floatUpDown 3s ease-in-out infinite;
}

@keyframes floatUpDown {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.aura-cart-empty h4 {
  font-size: 18px;
  font-weight: 800;
  color: var(--aura-cart-text-main);
  margin: 0 0 6px;
}

.aura-cart-empty p {
  font-size: 13.5px;
  color: var(--aura-cart-text-muted);
  max-width: 280px;
  margin: 0 0 20px;
  line-height: 1.45;
}

.aura-cart-empty-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--aura-cart-radius-sm);
  background: var(--aura-cart-primary);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--aura-cart-transition);
}
.aura-cart-empty-btn:hover {
  opacity: 0.95;
  transform: translateY(-2px);
}

/* Liste des articles */
.aura-cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aura-cart-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
[data-dark="1"] .aura-cart-item {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
}

.aura-cart-item:hover {
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.aura-cart-item.is-removing {
  transform: translateX(40px);
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
  border: none;
  transition: all 0.3s ease;
}

.aura-cart-item-img {
  width: 68px;
  height: 68px;
  border-radius: 12px;
  object-fit: cover;
  background: #f1f5f9;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.aura-cart-item-fallback {
  width: 68px;
  height: 68px;
  border-radius: 12px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

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

.aura-cart-item-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--aura-cart-text-main);
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aura-cart-item-prices {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.aura-cart-item-price {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--aura-cart-primary);
}

.aura-cart-item-old-price {
  font-size: 11.5px;
  color: var(--aura-cart-text-muted);
  text-decoration: line-through;
}

/* Contrôles de quantité (+ / -) */
.aura-cart-qty-ctrl {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}
[data-dark="1"] .aura-cart-qty-ctrl {
  background: #0f172a;
  border-color: #334155;
}

.aura-cart-qty-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--aura-cart-text-main);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
}
.aura-cart-qty-btn:hover:not(:disabled) {
  background: rgba(37, 99, 235, 0.15);
  color: var(--aura-cart-primary);
}
.aura-cart-qty-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.aura-cart-qty-val {
  min-width: 28px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--aura-cart-text-main);
}

.aura-cart-item-del-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.aura-cart-item-del-btn:hover {
  color: #ef4444;
  background: #fee2e2;
  transform: scale(1.1);
}

/* ── ACCORDION / ÉTAPE COMMANDE DIRECTE ──────────────────────────────────── */
.aura-cart-checkout-section {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(226, 232, 240, 0.8);
}
[data-dark="1"] .aura-cart-checkout-section {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(255, 255, 255, 0.08);
}

.aura-cart-checkout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.aura-cart-checkout-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--aura-cart-text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.aura-cart-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.aura-cart-form-col-2 {
  grid-column: span 2;
}

.aura-cart-input-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--aura-cart-text-muted);
  margin-bottom: 4px;
}

.aura-cart-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
[data-dark="1"] .aura-cart-input {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

.aura-cart-input:focus {
  outline: none;
  border-color: var(--aura-cart-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.aura-cart-textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
  resize: vertical;
  min-height: 54px;
  line-height: 1.4;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
[data-dark="1"] .aura-cart-textarea {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}
.aura-cart-textarea:focus {
  outline: none;
  border-color: var(--aura-cart-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Cases à cocher harmonisées avec la commande directe */
.aura-cart-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.03);
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: background 0.2s ease, border-color 0.2s ease;
}
[data-dark="1"] .aura-cart-checkbox-row {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}
.aura-cart-checkbox-row.is-push {
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.22);
  margin-top: 8px;
}
[data-dark="1"] .aura-cart-checkbox-row.is-push {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
}
.aura-cart-checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--aura-cart-primary);
}
.aura-cart-checkbox-row label {
  font-size: 12.5px;
  cursor: pointer;
  color: var(--aura-cart-text-main);
  font-weight: 500;
  line-height: 1.4;
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
}
.aura-cart-checkbox-row.is-push label {
  color: #1e293b;
  font-weight: 700;
}
[data-dark="1"] .aura-cart-checkbox-row.is-push label {
  color: #f1f5f9;
}

/* ── FOOTER DU PANIER (RÉSUMÉ & ACTION) ─────────────────────────────────── */
.aura-cart-footer {
  padding: 18px 24px 24px;
  border-top: 1px solid rgba(226, 232, 240, 0.6);
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
[data-dark="1"] .aura-cart-footer {
  border-top-color: rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.6);
}

.aura-cart-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--aura-cart-text-muted);
}

.aura-cart-summary-row.is-total {
  font-size: 16px;
  font-weight: 800;
  color: var(--aura-cart-text-main);
  padding-top: 8px;
  border-top: 1px dashed #cbd5e1;
}

.aura-cart-total-amount {
  font-size: 19px;
  color: var(--aura-cart-primary);
  font-weight: 900;
}

.aura-cart-delivery-note {
  font-size: 11.5px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 5px;
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: 8px;
}

.aura-cart-confirm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  border-radius: 14px;
  background: var(--aura-cart-primary);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}
.aura-cart-confirm-btn:hover:not(:disabled) {
  background: var(--aura-cart-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.45);
}
.aura-cart-confirm-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ── OVERLAY DE SUCCÈS COMMANDE ─────────────────────────────────────────── */
.aura-cart-success-view {
  padding: 32px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.aura-cart-success-badge {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  margin-bottom: 16px;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.35);
  animation: auraCartSuccessPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes auraCartSuccessPop {
  0%   { transform: scale(0.3) rotate(-30deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.aura-cart-success-code {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-family: monospace;
  font-weight: 800;
  font-size: 15px;
  margin: 8px 0 16px;
}

.aura-cart-wa-direct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  border-radius: 12px;
  background: #25D366;
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
  transition: all 0.2s ease;
  margin-top: 10px;
}
.aura-cart-wa-direct-btn:hover {
  background: #20bd5a;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4);
}

/* ── BOUTON RAPIDE AJOUTER AU PANIER SUR LES CARTES ─────────────────────── */
.btn-aura-add-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--aura-cart-radius-sm);
  background: rgba(37, 99, 235, 0.09);
  color: var(--aura-cart-primary);
  border: 1px solid rgba(37, 99, 235, 0.2);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}
.btn-aura-add-cart:hover {
  background: var(--aura-cart-primary);
  color: #ffffff;
  border-color: var(--aura-cart-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.btn-aura-add-cart svg {
  width: 15px;
  height: 15px;
}
