/* SoloStocks — Frontend */

.swoa-auth-section { margin-bottom: 18px; }
.swoa-hidden-field { display: none !important; }
.swoa-wrapper { margin-bottom: 10px; }

.swoa-phone-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: 100%;
}

.swoa-phone-row .woocommerce-Input,
.swoa-phone-row .input-text {
  flex: 1;
  min-width: 0;
}

.swoa-send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  min-width: 165px;
  padding: 0 18px;
  border: 0 !important;
  border-radius: 8px !important;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #fff !important;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(37, 211, 102, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.swoa-send-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.28);
}

.swoa-send-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  box-shadow: none;
}

.swoa-send-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  max-width: 18px;
  max-height: 18px;
  color: #fff;
  line-height: 1;
  overflow: hidden;
  flex: 0 0 18px;
}

.swoa-send-icon img,
.swoa-send-icon svg {
  display: block;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  max-width: 18px;
  max-height: 18px;
  object-fit: contain;
  flex: 0 0 18px;
}

.swoa-status {
  display: block;
  margin-top: 8px;
  min-height: 18px;
  font-size: 13px;
}

.swoa-status--success { color: #197a42; font-weight: 600; }
.swoa-status--error   { color: #c62828; font-weight: 600; }

.swoa-otp-row[hidden] { display: none !important; }

.swoa-otp-input {
  max-width: 220px;
  letter-spacing: 8px;
  text-align: center;
  font-size: 21px !important;
  font-weight: 700 !important;
}

.swoa-resend-wrap {
  display: block;
  margin-top: 8px;
  color: #5f6b7a;
  font-size: 12.5px;
}

.swoa-resend-wrap a {
  color: #128c7e;
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}

.swoa-account-fieldset {
  margin: 24px 0;
  padding: 22px 24px;
  border: 1px solid #d7e7ee;
  border-radius: 12px;
  background: linear-gradient(180deg, #f9fcfd 0%, #f4f9fb 100%);
}

.swoa-account-fieldset legend { padding: 0 8px; font-weight: 700; }

.swoa-current-phone {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.swoa-current-phone strong {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 999px;
  background: #e7f5ff;
}

.swoa-change-toggle { margin: 10px 0 0; }
.swoa-change-toggle a { font-weight: 600; text-decoration: underline; }
.swoa-no-phone { color: #5f6b7a; }

.swoa-google-wrap { margin-top: 18px; }
.swoa-google-wrap--login-screen { max-width: 320px; margin: 22px auto 0; }

.swoa-or-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 16px 0;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.swoa-or-divider::before,
.swoa-or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #d6dce3;
}

.swoa-google-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid #d6dce3;
  border-radius: 10px;
  background: #fff;
  color: #202124 !important;
  font-weight: 700;
  text-decoration: none !important;
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.swoa-google-button:hover {
  transform: translateY(-1px);
  border-color: #b7c0ca;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.1);
}

.swoa-google-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  max-width: 20px;
  max-height: 20px;
  line-height: 1;
  overflow: hidden;
  flex: 0 0 20px;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.swoa-google-icon img,
.swoa-google-icon svg {
  display: block;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  max-width: 20px;
  max-height: 20px;
  object-fit: contain;
  flex: 0 0 20px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Masque le formulaire natif WooCommerce (filet de sécurité CSS) */
.swoa-hide-native-cart.single-product div.product form.cart {
  display: none !important;
}

.single-product div.product .swoa-product-whatsapp {
  margin: 0 0 1.25em;
}

.swoa-product-whatsapp-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.swoa-product-quantity-wrap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.swoa-qty {
  width: 64px !important;
  height: 54px !important;
  min-width: 64px !important;
  max-width: 64px !important;
  min-height: 54px !important;
  max-height: 54px !important;
  padding: 0 4px !important;
  margin: 0 !important;
  border: 1px solid #c1c7d0 !important;
  border-radius: 5px !important;
  background: #fff !important;
  color: #1d2939 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-align: center !important;
  line-height: 1 !important;
  box-shadow: none !important;
  -moz-appearance: textfield !important;
  appearance: textfield !important;
  -webkit-appearance: none !important;
}

.swoa-qty::-webkit-inner-spin-button,
.swoa-qty::-webkit-outer-spin-button {
  -webkit-appearance: none !important;
  appearance: none !important;
  margin: 0 !important;
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

.swoa-qty:focus {
  outline: none !important;
  border-color: #25d366 !important;
  box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.18) !important;
}

@keyframes swoa-pulse {
  0% { transform: scale(1); box-shadow: 0 8px 18px rgba(37, 211, 102, 0.22); }
  50% { transform: scale(1.03); box-shadow: 0 12px 28px rgba(37, 211, 102, 0.35); }
  100% { transform: scale(1); box-shadow: 0 8px 18px rgba(37, 211, 102, 0.22); }
}

.swoa-product-whatsapp-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  min-height: 54px !important;
  width: 480px !important;
  max-width: 100% !important;
  padding: 0 24px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%) !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 700;
  text-decoration: none !important;
  box-shadow: 0 8px 18px rgba(37, 211, 102, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  white-space: nowrap;
  animation: swoa-pulse 2.5s infinite ease-in-out;
}

.swoa-product-whatsapp-button:hover,
.swoa-product-whatsapp-button:focus {
  animation-play-state: paused;
  transform: scale(1.03);
  box-shadow: 0 12px 28px rgba(37, 211, 102, 0.35);
  color: #fff !important;
}

@media (max-width: 640px) {
  .swoa-phone-row { flex-direction: column; }
  .swoa-send-btn { width: 100%; }
  .swoa-product-whatsapp-form { flex-direction: row; align-items: center; flex-wrap: nowrap; }
  .swoa-product-whatsapp-button { flex: 1; }
  .swoa-otp-input { max-width: 100%; }
}

/* ============================================================
   Séparateur "ou"
   ============================================================ */
.swoa-order-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: #374151;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.swoa-order-divider::before,
.swoa-order-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #c1c7d0;
}

/* ============================================================
   Formulaire de commande directe
   ============================================================ */
.swoa-order-form-wrap {
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 24px 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.swoa-order-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.swoa-order-form__field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.swoa-order-form__field:last-child {
  margin-bottom: 0;
}

.swoa-order-form__row .swoa-order-form__field {
  margin-bottom: 0;
}

.swoa-order-form__field label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.swoa-order-input {
  width: 100% !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  padding: 0 12px !important;
  margin: 0 !important;
  border: 1px solid #d1d5db !important;
  border-radius: 7px !important;
  background: #fff !important;
  color: #1d2939 !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease !important;
  box-sizing: border-box !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

.swoa-order-input:focus {
  outline: none !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

.swoa-order-input::placeholder {
  color: #9ca3af !important;
  font-weight: 400 !important;
}

.swoa-phone-prefix-wrap {
  display: flex;
  align-items: center;
  position: relative;
}

.swoa-phone-prefix {
  position: absolute;
  left: 13px;
  color: #1d2939;
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
  z-index: 2;
}

.swoa-order-input--phone {
  padding-left: 24px !important;
}

.swoa-order-form__footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
}

.swoa-order-submit-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 44px !important;
  padding: 0 32px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: linear-gradient(135deg, #0266cd 0%, #0052a3 100%) !important;
  color: #fff !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  box-shadow: 0 4px 12px rgba(2, 102, 205, 0.2) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.15s ease !important;
  white-space: nowrap !important;
  text-decoration: none !important;
}

.swoa-order-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(2, 102, 205, 0.3) !important;
  color: #fff !important;
}

.swoa-order-submit-btn:disabled {
  opacity: 0.7 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Message de succès inline */
.swoa-order-status {
  display: block;
  min-height: 0;
  font-size: 14px;
  margin: 0;
  width: 100%;
  text-align: center;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.swoa-order-status:empty {
  display: none;
}

.swoa-order-status--success {
  color: #155724;
  font-weight: 600;
  background: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 6px;
  padding: 10px 14px;
}

.swoa-order-status.swoa-fade-out {
  opacity: 0;
}

.swoa-order-status--error-inline {
  color: #721c24;
  font-weight: 600;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 6px;
  padding: 10px 14px;
}


/* ============================================================
   Toast — notification flottante
   ============================================================ */
@keyframes swoa-slide-in {
  from { transform: translateY(-110%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

@keyframes swoa-slide-out {
  from { transform: translateY(0);     opacity: 1; }
  to   { transform: translateY(-110%); opacity: 0; }
}

@keyframes swoa-progress {
  from { width: 100%; }
  to   { width: 0%; }
}

.swoa-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999999;
  min-width: 300px;
  max-width: min(520px, calc(100vw - 32px));
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
  overflow: hidden;
  animation: swoa-slide-in 0.32s cubic-bezier(0.22,1,0.36,1) forwards;
  pointer-events: auto;
}

.swoa-toast--out {
  animation: swoa-slide-out 0.32s ease forwards;
}

.swoa-toast--error {
  background: #7f1d1d;
}

.swoa-toast--success {
  background: #14532d;
}

.swoa-toast__content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 48px 16px 18px;
}

.swoa-toast__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 22px;
  margin-top: 1px;
}

.swoa-toast__text {
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.55;
  flex: 1;
}

.swoa-toast__close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.7);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.swoa-toast__close:hover {
  color: #fff;
  background: rgba(255,255,255,0.12);
}

.swoa-toast__bar {
  height: 3px;
  background: rgba(255,255,255,0.12);
  position: relative;
  overflow: hidden;
}

.swoa-toast__bar-inner {
  height: 100%;
  background: rgba(255,255,255,0.5);
  animation: swoa-progress linear forwards;
  transform-origin: left;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 640px) {
  .swoa-order-form__row {
    grid-template-columns: 1fr;
  }

  .swoa-order-submit-btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .swoa-toast {
    top: 12px;
    max-width: calc(100vw - 24px);
    min-width: 0;
    left: 12px;
    right: 12px;
    transform: none;
  }

  .swoa-toast--out {
    animation: swoa-slide-out 0.3s ease forwards;
  }
}

/* ============================================================
   Formulaire de réinitialisation mot de passe — WhatsApp
   ============================================================ */

#swoa-reset-form { margin-top: 10px; }

.swoa-reset-step[hidden] { display: none !important; }

.swoa-reset-hint {
  font-size: 13.5px;
  color: #5f6b7a;
  margin-bottom: 12px;
}

.swoa-reset-status {
  display: none;
  margin-top: 10px;
  padding: 9px 14px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 600;
}

.swoa-reset-status--success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.swoa-reset-status--error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Champ mot de passe + bouton afficher/masquer */
.swoa-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.swoa-password-wrap .input-text {
  flex: 1;
  padding-right: 44px !important;
}

.swoa-toggle-pass {
  position: absolute;
  right: 10px;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 17px;
  color: #6b7280;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s ease;
}

.swoa-toggle-pass:hover { color: #128c7e; }

/* ============================================================
   Modal Achat Rapide
   ============================================================ */
.swoa-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999990;
  display: flex;
  align-items: center;
  justify-content: center;
}

.swoa-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1;
}

.swoa-modal-content {
  position: relative;
  z-index: 2;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  overflow-y: auto;
  padding: 30px 24px;
  animation: swoa-modal-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes swoa-modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.swoa-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: 0;
  font-size: 28px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  z-index: 10;
}

.swoa-modal-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.swoa-modal-header {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.swoa-modal-product-name {
  margin: 0 0 8px !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #111827 !important;
  line-height: 1.3 !important;
}

.swoa-modal-product-price {
  font-size: 16px;
  color: #374151;
  font-weight: 600;
}

.swoa-modal-product-price ins {
  text-decoration: none;
  color: #111827;
}

.swoa-modal-product-price del {
  color: #9ca3af;
  margin-right: 6px;
  font-weight: 400;
}

.swoa-loop-buy-btn {
  width: 100% !important;
  border-radius: 6px !important;
  text-align: center !important;
  display: block;
}

/* Page produit unique */
.single-product a.button.alt.swoa-product-whatsapp-button {
  width: 480px !important;
}

/* Modale de la boutique */
.swoa-modal a.button.alt.swoa-product-whatsapp-button {
  width: 350px !important;
}
