/* ============================================================
   BEAUTY 4 ALL — WhatsApp Order Modal
   assets/css/whatsapp-modal.css
   ============================================================ */

/* ── BOUTON FLOTTANT WHATSAPP ── */
.b4a-wa-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 8000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.b4a-wa-fab-btn {
  width: 60px;
  height: 60px;
  background: #25d366;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.b4a-wa-fab-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(37, 211, 102, 0.55);
}

.b4a-wa-fab-btn svg {
  width: 32px;
  height: 32px;
  fill: #fff;
}

.b4a-wa-fab-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: rgba(37, 211, 102, 0.3);
  animation: wa-pulse 2s infinite;
}

@keyframes wa-pulse {
  0%   { transform: scale(1); opacity: 0.7; }
  70%  { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

.b4a-wa-fab-tooltip {
  background: #1a1a1a;
  color: #fff;
  font-family: var(--b4a-font-body, 'Jost', sans-serif);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(8px);
  transition: all 0.2s ease;
  pointer-events: none;
  position: absolute;
  right: 72px;
  bottom: 12px;
}

.b4a-wa-fab-tooltip::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right: none;
  border-left-color: #1a1a1a;
}

.b4a-wa-fab-btn:hover .b4a-wa-fab-tooltip,
.b4a-wa-fab-btn:focus .b4a-wa-fab-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* Badge notifications */
.b4a-wa-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--b4a-bordeaux, #9b2d5b);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #fff;
}

/* ── OVERLAY ── */
.b4a-wa-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: 9990;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.b4a-wa-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ── MODAL ── */
.b4a-wa-modal {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 420px;
  max-width: 100vw;
  max-height: 92vh;
  background: #fff;
  z-index: 9991;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: -4px 0 40px rgba(0,0,0,0.18);
}

.b4a-wa-modal.open {
  transform: translateY(0);
}

/* En-tête modal */
.b4a-wa-modal-header {
  background: #25d366;
  padding: 18px 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.b4a-wa-modal-header-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 22px;
}

.b4a-wa-modal-header-info {
  flex: 1;
}

.b4a-wa-modal-header-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.b4a-wa-modal-header-status {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  gap: 5px;
}

.b4a-wa-modal-header-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b5ead7;
  flex-shrink: 0;
}

.b4a-wa-modal-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.b4a-wa-modal-close:hover { background: rgba(255,255,255,0.35); }

/* Bulle de chat "fond" */
.b4a-wa-modal-chat {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #ece5dd url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' opacity='0.06'%3E%3Ctext y='40' font-size='40'%3E💄%3C/text%3E%3Ctext x='80' y='100' font-size='32'%3E🌸%3C/text%3E%3Ctext y='160' font-size='36'%3E🧴%3C/text%3E%3Ctext x='120' y='55' font-size='28'%3E✨%3C/text%3E%3C/svg%3E");
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Bulles messages */
.b4a-wa-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  word-break: break-word;
}

.b4a-wa-bubble.agent {
  background: #fff;
  color: #2a2a2a;
  align-self: flex-start;
  border-top-left-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.b4a-wa-bubble.agent::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 0;
  border: 8px solid transparent;
  border-right-color: #fff;
  border-top: none;
}

.b4a-wa-bubble.user {
  background: #dcf8c6;
  color: #2a2a2a;
  align-self: flex-end;
  border-top-right-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.b4a-wa-bubble.user::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 0;
  border: 8px solid transparent;
  border-left-color: #dcf8c6;
  border-top: none;
}

.b4a-wa-bubble-time {
  font-size: 10px;
  color: rgba(0,0,0,0.4);
  text-align: right;
  margin-top: 4px;
}

/* Produit dans bulle */
.b4a-wa-product-preview {
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(255,255,255,0.7);
  padding: 10px;
  border-radius: 6px;
  margin-top: 8px;
  border-left: 3px solid #25d366;
}

.b4a-wa-product-preview img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.b4a-wa-product-preview-info {
  flex: 1;
  min-width: 0;
}

.b4a-wa-product-preview-name {
  font-size: 13px;
  font-weight: 600;
  color: #2a2a2a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.b4a-wa-product-preview-price {
  font-size: 13px;
  color: var(--b4a-bordeaux, #9b2d5b);
  font-weight: 700;
  margin-top: 2px;
}

/* Options rapides (chips cliquables) */
.b4a-wa-quick-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}

.b4a-wa-quick-opt {
  background: #fff;
  border: 1.5px solid #25d366;
  color: #128c7e;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--b4a-font-body, 'Jost', sans-serif);
}

.b4a-wa-quick-opt:hover,
.b4a-wa-quick-opt.selected {
  background: #25d366;
  color: #fff;
}

/* Formulaire de commande */
.b4a-wa-form {
  padding: 16px;
  flex-shrink: 0;
  border-top: 1px solid #e8e0db;
  background: #fff;
}

.b4a-wa-form-title {
  font-size: 13px;
  font-weight: 700;
  color: #2a2a2a;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.b4a-wa-field {
  margin-bottom: 10px;
}

.b4a-wa-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9a9a9a;
  margin-bottom: 5px;
}

.b4a-wa-field input,
.b4a-wa-field textarea,
.b4a-wa-field select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e8e0db;
  font-family: var(--b4a-font-body, 'Jost', sans-serif);
  font-size: 14px;
  color: #2a2a2a;
  outline: none;
  border-radius: 0;
  transition: border-color 0.2s;
  background: #fff;
  box-sizing: border-box;
}

.b4a-wa-field input:focus,
.b4a-wa-field textarea:focus,
.b4a-wa-field select:focus {
  border-color: #25d366;
}

.b4a-wa-field textarea {
  resize: vertical;
  min-height: 70px;
}

.b4a-wa-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Récapitulatif commande */
.b4a-wa-recap {
  background: #f8f9fa;
  border: 1px solid #e8e0db;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 13px;
}

.b4a-wa-recap-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid #e8e0db;
  color: #5a5a5a;
}

.b4a-wa-recap-row:last-child {
  border-bottom: none;
  font-weight: 700;
  font-size: 15px;
  color: #2a2a2a;
  padding-top: 8px;
  margin-top: 4px;
}

.b4a-wa-recap-row span:last-child {
  color: var(--b4a-bordeaux, #9b2d5b);
  font-weight: 600;
}

/* Bouton envoyer */
.b4a-wa-send-btn {
  width: 100%;
  background: #25d366;
  color: #fff;
  border: none;
  padding: 15px;
  font-family: var(--b4a-font-body, 'Jost', sans-serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s, transform 0.15s;
  margin-top: 4px;
}

.b4a-wa-send-btn:hover {
  background: #128c7e;
  transform: translateY(-1px);
}

.b4a-wa-send-btn svg {
  width: 20px;
  height: 20px;
  fill: #fff;
  flex-shrink: 0;
}

/* Étapes du modal */
.b4a-wa-step { display: none; }
.b4a-wa-step.active { display: block; }

/* Bouton WA sur page produit */
.b4a-wa-product-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: #25d366;
  color: #fff;
  border: none;
  padding: 14px 20px;
  font-family: var(--b4a-font-body, 'Jost', sans-serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  margin-top: 10px;
}

.b4a-wa-product-btn:hover {
  background: #128c7e;
  transform: translateY(-1px);
}

.b4a-wa-product-btn svg {
  width: 20px;
  height: 20px;
  fill: #fff;
  flex-shrink: 0;
}

/* Bouton WA dans la loop produits */
.b4a-wa-loop-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  background: #25d366;
  color: #fff;
  border: none;
  padding: 10px 12px;
  font-family: var(--b4a-font-body, 'Jost', sans-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 6px;
}

.b4a-wa-loop-btn:hover { background: #128c7e; }

.b4a-wa-loop-btn svg {
  width: 14px;
  height: 14px;
  fill: #fff;
}

/* Indicateur "en train d'écrire" */
.b4a-wa-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 8px;
  border-top-left-radius: 2px;
  align-self: flex-start;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.b4a-wa-typing span {
  width: 7px;
  height: 7px;
  background: #9a9a9a;
  border-radius: 50%;
  animation: wa-typing 1.2s infinite;
}

.b4a-wa-typing span:nth-child(2) { animation-delay: 0.2s; }
.b4a-wa-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes wa-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* Section arabe RTL dans modal */
.b4a-wa-arabic {
  direction: rtl;
  text-align: right;
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
  .b4a-wa-modal {
    width: 100vw;
    border-radius: 16px 16px 0 0;
  }

  .b4a-wa-fab {
    bottom: 20px;
    right: 16px;
  }

  .b4a-wa-fab-btn {
    width: 54px;
    height: 54px;
  }
}

/* Scroll modal */
.b4a-wa-modal-chat::-webkit-scrollbar { width: 4px; }
.b4a-wa-modal-chat::-webkit-scrollbar-track { background: transparent; }
.b4a-wa-modal-chat::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 2px; }
