/* ══════════════════════════════════════════════════════════════
   L'Atelier de la Source — Espace revendeur (B2B)
   /wp-content/themes/Divi-Community/assets/wholesale.css
   La couleur --als-pro est injectée en inline depuis la config.
══════════════════════════════════════════════════════════════ */

:root {
  --als-pro: #00abb2;
}

/* ── Bandeau de contexte ─────────────────────────────────────
   Le header du thème est en position:fixed (topbar + header).
   Le bandeau doit donc appartenir à la même pile fixe, sinon il
   passe SOUS le header. assets/header.js le positionne et décale
   la topbar, le header et le spacer de sa hauteur.
────────────────────────────────────────────────────────────── */
.als-pro-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1011;            /* au-dessus du header (1002 / 1010 mobile) */
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  justify-content: center;
  background: var(--als-pro);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.4;
  padding: 7px 18px;
  letter-spacing: .01em;
  overflow: hidden;
  transition: max-height .3s ease, opacity .25s ease, padding .3s ease;
}

/* Masqué au scroll, comme la topbar */
.als-pro-bar.hidden {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  pointer-events: none;
}

/* Libellés longs / courts */
.als-lbl-short { display: none; }
.als-lbl-full  { display: inline; }

.als-pro-bar__tag {
  background: rgba(255, 255, 255, .18);
  border-radius: 3px;
  padding: 2px 9px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: .08em;
}

.als-pro-bar__company { font-weight: 600; }

.als-pro-bar__links { display: flex; align-items: center; gap: 16px; flex-wrap: nowrap; }
.als-pro-bar__intro { opacity: .85; }

.als-pro-bar a,
.als-pro-bar a:visited {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, .45);
  padding-bottom: 1px;
}

.als-pro-bar a:hover { color: #fff; border-bottom-color: #fff; }

.als-pro-bar--public {
  background: #f4f6f7;
  color: #4a5459;
  border-bottom: 1px solid #e4e8ea;
}

/* Le soulignement suit la couleur configurée (plus de valeur codée en dur) */
.als-pro-bar--public a,
.als-pro-bar--public a:visited {
  color: var(--als-pro);
  border-bottom-color: currentColor;                                /* repli */
  border-bottom-color: color-mix(in srgb, currentColor 40%, transparent);
}
.als-pro-bar--public a:hover { color: var(--als-pro); border-bottom-color: currentColor; }

@media (max-width: 782px) {
  .als-pro-bar { font-size: 11px; gap: 9px; padding: 6px 10px; white-space: nowrap; }
  .als-pro-bar__links { gap: 11px; flex-wrap: nowrap; }
  .als-pro-bar__company { display: none; }
  .als-pro-bar__tag { padding: 2px 7px; font-size: 9.5px; }
  .als-lbl-short { display: inline; }
  .als-lbl-full  { display: none; }
}

@media (max-width: 360px) {
  .als-pro-bar { font-size: 10.5px; gap: 7px; padding: 5px 8px; }
  .als-pro-bar__links { gap: 9px; }
}

/* ── Badges prix ─────────────────────────────────────────── */
.als-wholesale-badge {
  display: inline-block;
  background: var(--als-pro);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  margin-right: 8px;
  vertical-align: middle;
}

.als-tax-suffix {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
  color: #888;
  text-transform: uppercase;
  margin-left: 3px;
  vertical-align: middle;
}

.als-price-hidden { font-size: 13px; color: #888; font-style: italic; }
.als-price-hidden a,
.als-price-hidden a:visited { color: var(--als-pro); font-style: normal; font-weight: 600; text-decoration: none; }
.als-price-hidden a:hover { text-decoration: underline; }

/* ── Paliers dégressifs ──────────────────────────────────── */
.als-tier-badge {
  display: inline-block;
  background: var(--als-pro);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  margin-left: 8px;
}

.als-tier-next { display: inline-block; color: #888; font-size: 10px; font-style: italic; margin-left: 6px; }

.als-tier-table {
  margin: 18px 0 22px;
  border: 1px solid #e3e8ea;
  border-radius: 8px;
  overflow: hidden;
  max-width: 380px;
}

.als-tier-table__title {
  display: block;
  background: #f4f8f9;
  color: var(--als-pro);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 9px 14px;
  border-bottom: 1px solid #e3e8ea;
}

.als-tier-table table { width: 100%; border-collapse: collapse; margin: 0; }
.als-tier-table th,
.als-tier-table td { padding: 7px 14px; font-size: 13px; text-align: left; border: none; }
.als-tier-table th { color: #8a949a; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.als-tier-table tr + tr td { border-top: 1px solid #f0f3f4; }
.als-tier-table td:last-child { text-align: right; }

/* ── Tableau "Mes tarifs" ────────────────────────────────── */
.als-tarifs-table { width: 100%; }
.als-tarifs-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #6b7478; }
.als-tarifs-table td { vertical-align: middle; font-size: 14px; }

/* ══ PAGE ESPACE PRO ══════════════════════════════════════ */
.als-pro-block {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 44px;
  align-items: start;
  max-width: 1080px;
  margin: 0 auto;
}
.als-pro-block--solo { grid-template-columns: minmax(0, 1fr); max-width: 620px; }

.als-pro-title {
  font-size: clamp(22px, 4vw, 30px);
  line-height: 1.2;
  margin: 0 0 10px;
}
.als-pro-intro {
  font-size: 15px;
  line-height: 1.6;
  color: #5a6368;
  margin: 0 0 26px;
}

/* ── Formulaire ──────────────────────────────────────────── */
.als-pro-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}
.als-pro-form .als-field--full { grid-column: 1 / -1; }

.als-pro-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 13px;
  color: #2f373b;
}
.als-req { color: var(--als-pro); font-weight: 700; }

.als-pro-form input[type="text"],
.als-pro-form input[type="email"],
.als-pro-form input[type="tel"],
.als-pro-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d8dee1;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  box-sizing: border-box;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.als-pro-form input:focus,
.als-pro-form textarea:focus {
  outline: none;
  border-color: var(--als-pro);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--als-pro) 18%, transparent);
}
.als-pro-form textarea { resize: vertical; min-height: 96px; }

.als-hint { display: block; margin-top: 5px; font-size: 12px; color: #8a949a; }

.als-field--check label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
  font-size: 13px;
  line-height: 1.5;
  color: #5a6368;
  cursor: pointer;
}
.als-field--check input { margin-top: 2px; flex: 0 0 auto; }

.als-submit-btn--lg { padding: 15px 34px; font-size: 15px; width: 100%; }

.als-pro-form__legal {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: #8a949a;
  text-align: center;
}

/* ── Colonne latérale ────────────────────────────────────── */
.als-pro-aside { display: flex; flex-direction: column; gap: 22px; }

.als-pro-steps {
  background: color-mix(in srgb, var(--als-pro) 7%, #fff);
  border: 1px solid color-mix(in srgb, var(--als-pro) 22%, transparent);
  border-radius: 12px;
  padding: 22px 24px;
}
.als-pro-steps h3 {
  margin: 0 0 14px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--als-pro);
}
.als-pro-steps ol { margin: 0; padding: 0; list-style: none; }
.als-pro-steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.5;
  color: #3d464a;
  padding: 8px 0;
}
.als-pro-steps li span {
  flex: 0 0 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--als-pro);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.als-pro-benefits { display: flex; flex-direction: column; gap: 2px; }
.als-pro-benefit {
  padding: 13px 0;
  border-bottom: 1px solid #eceff0;
}
.als-pro-benefit:last-child { border-bottom: none; }
.als-pro-benefit strong { display: block; font-size: 14px; margin-bottom: 3px; color: #2f373b; }
.als-pro-benefit span { font-size: 13.5px; line-height: 1.5; color: #6b7478; }

.als-pro-login {
  font-size: 14px;
  color: #5a6368;
  padding: 16px 20px;
  background: #f6f8f9;
  border-radius: 10px;
}
.als-pro-login a {
  display: block;
  margin-top: 4px;
  color: var(--als-pro);
  font-weight: 700;
  text-decoration: none;
}
.als-pro-login a:hover { text-decoration: underline; }

/* ── Cartes d'état ───────────────────────────────────────── */
.als-pro-card {
  border-radius: 12px;
  padding: 26px 28px;
  background: #f6f8f9;
}
.als-pro-card--ok {
  background: color-mix(in srgb, var(--als-pro) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--als-pro) 25%, transparent);
}
.als-pro-card h3 { margin: 0 0 10px; font-size: 19px; color: var(--als-pro); }
.als-pro-card p { margin: 0 0 10px; font-size: 15px; line-height: 1.6; }
.als-pro-card__meta { font-size: 13px; color: #6b7478; }

.als-pro-account { margin: 0 0 8px; }
.als-pro-account .als-submit-btn { color: #fff; }

@media (max-width: 900px) {
  .als-pro-block { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .als-pro-form  { grid-template-columns: minmax(0, 1fr); }
  .als-pro-form .als-field--full { grid-column: auto; }
}

/* ── Ancien conteneur, conservé pour compatibilité ───────── */
.als-request-form-wrap { max-width: 560px; margin: 0 auto; }
.als-request-form-wrap .als-field { margin-bottom: 16px; }
.als-request-form-wrap label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 13px; }
.als-request-form-wrap input,
.als-request-form-wrap textarea,
.als-request-form-wrap select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}
.als-request-form-wrap textarea { min-height: 100px; resize: vertical; }

/* Honeypot antispam */
.als-hp { position: absolute !important; left: -9999px !important; height: 0; overflow: hidden; }

.als-submit-btn {
  display: inline-block;
  background: var(--als-pro);
  color: #fff;
  border: none;
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: .04em;
  text-decoration: none;
}
.als-submit-btn:visited { color: #fff; }
.als-submit-btn:hover { opacity: .88; color: #fff; }
.als-submit-btn--ghost { background: #3a3a3a; }

.als-notice { padding: 14px 18px; border-radius: 6px; margin: 16px 0; font-size: 14px; }
.als-notice-success { background: #e8f5e9; border-left: 4px solid #4caf50; color: #2e7d32; }
.als-notice-error { background: #fdecea; border-left: 4px solid #f44336; color: #c62828; }

/* ── Bloc protégé ────────────────────────────────────────── */
.als-protected-block {
  background: #f4f8f9;
  border-left: 4px solid var(--als-pro);
  padding: 20px 24px;
  border-radius: 0 8px 8px 0;
  margin: 20px 0;
}
.als-protected-block p { margin: 0 0 14px; color: #3a3a3a; font-size: 14px; }

/* ── Bouton facture dans Mon compte ──────────────────────── */
.woocommerce-orders-table__cell-order-actions a[href*="als_invoice_request"] {
  background: var(--als-pro) !important;
  color: #fff !important;
  border-color: var(--als-pro) !important;
  font-weight: 600;
}
.woocommerce-orders-table__cell-order-actions a[href*="als_invoice_request"]:hover { opacity: .88; }

.als-wholesale-badge--single {
  display: inline-block;
  font-size: 11px;
  padding: 4px 12px;
  margin: 0 0 12px;
  letter-spacing: .05em;
}


/* ── Repli sans JS ────────────────────────────────────────────
   header.js décale la topbar et le header (top en !important).
   Si le script n'a pas encore tourné, on réserve la hauteur ici
   pour que le bandeau ne recouvre pas le header.
──────────────────────────────────────────────────────────────*/
body.als-has-probar #topbar-als,
body.als-has-probar #header-als {
  top: var(--als-probar-h, 32px);
}
