/* HAD V3 — bilingue AR/FR, parcours ordonnance, assistant connecté.
   Se charge APRÈS styles.css. N'écrase rien d'existant sans nécessité. */

/* ---------- Sélecteur de langue ---------- */
.langswitch{display:inline-flex;align-items:center;border:1px solid #cfe1eb;border-radius:14px;overflow:hidden;background:#fff;height:44px;margin-inline-end:8px}
.langswitch button{border:0;background:transparent;padding:0 13px;height:100%;font-weight:900;font-size:12px;color:#61798D;cursor:pointer;transition:.2s;min-width:44px}
.langswitch button[lang="ar"]{font-size:17px;line-height:1}
.langswitch button:hover{color:var(--had-blue,#224379)}
.langswitch button.active{background:linear-gradient(135deg,#224379,#09C2EE);color:#fff}
.langswitch button:focus-visible{outline:3px solid #09C2EE;outline-offset:-3px}
@media(max-width:650px){.langswitch{height:43px;margin-inline-end:6px}.langswitch button{padding:0 11px;min-width:40px}}

/* ---------- Arabe & RTL ---------- */
html[lang="ar"] body{
  font-family:"Noto Kufi Arabic","Segoe UI",Tahoma,system-ui,sans-serif;
  letter-spacing:0;
}
html[dir="rtl"] .topbar a{margin-left:0;margin-right:auto}
html[dir="rtl"] .links{margin-left:0;margin-right:auto}
html[dir="rtl"] .links a:after{left:auto;right:0;transform-origin:right}
html[dir="rtl"] .nav-actions{margin-left:0;margin-right:auto}
html[dir="rtl"] .cart-link .cart-count{right:auto;left:-7px}
html[dir="rtl"] .category em,
html[dir="rtl"] .hero-actions .btn,
html[dir="rtl"] .section-head>a{transform:scaleX(1)}
html[dir="rtl"] .category em{transform:scaleX(-1);align-self:flex-start}
html[dir="rtl"] .badge,html[dir="rtl"] .rx-badge{left:auto;right:14px}
.badge,.rx-badge{width:max-content;max-width:calc(100% - 28px)}
html[lang="ar"] .badge,html[lang="ar"] .rx-badge{font-size:11.5px;padding:6px 11px}
html[lang="ar"] .product-cat,html[lang="ar"] .eyebrow{font-size:11.5px;letter-spacing:0}
html[lang="ar"] .trust b,html[lang="ar"] .glass b{font-size:14px}
html[dir="rtl"] .glass-a{right:auto;left:18px}
html[dir="rtl"] .glass-b{left:auto;right:18px}
html[dir="rtl"] .video-status{left:auto;right:20px}
html[dir="rtl"] .fab{right:auto;left:18px}
html[dir="rtl"] .chat{right:auto;left:18px}
html[dir="rtl"] .drawer{right:auto;left:0;transform:translateX(-105%)}
html[dir="rtl"] .drawer.open{transform:none}
html[dir="rtl"] .msg.user{margin-left:0;margin-right:auto}
html[dir="rtl"] .remove-link{margin-left:0;margin-right:10px}
html[dir="rtl"] .dot-stack i{margin-right:0;margin-left:-7px}
html[dir="rtl"] .trust article{border-right:0;border-left:1px solid var(--line)}
html[dir="rtl"] .trust article:last-child{border-left:0}
html[dir="rtl"] .cart-item{grid-template-columns:auto 1fr 64px}
/* Les nombres, prix et téléphones restent en lecture latine même en RTL. */
html[dir="rtl"] .price,html[dir="rtl"] .cart-row-price,html[dir="rtl"] [data-cart-total],
html[dir="rtl"] a[href^="tel:"],html[dir="rtl"] a[href^="mailto:"],
html[dir="rtl"] .metrics strong,html[dir="rtl"] .qty-control span{direction:ltr;unicode-bidi:isolate}
@media(max-width:650px){
  html[dir="rtl"] .video-status{right:12px;left:auto}
  html[dir="rtl"] .fab{left:12px;right:auto}
  html[dir="rtl"] .chat{left:12px;right:auto}
  html[dir="rtl"] .hero-media-video .glass-b{right:12px;left:auto}
  html[dir="rtl"] .hero-media-video .glass-a{left:12px;right:auto}
}

/* ---------- Parcours ordonnance ---------- */
.rx-badge svg{width:13px;height:13px;flex:none}
.rx-badge{
  position:absolute;left:14px;top:14px;z-index:2;border-radius:999px;padding:7px 11px;
  background:#FFF1F4;color:#B3123A;border:1px solid #F7C9D5;
  font-size:10px;font-weight:950;display:inline-flex;align-items:center;gap:5px;white-space:nowrap;line-height:1
}
.badge + .rx-badge{top:48px}
.rx-badge svg{width:13px;height:13px;flex:none}
.rx-note{
  display:flex;gap:12px;align-items:flex-start;margin:18px 0;
  background:#FFF6F8;border:1px solid #F5D2DC;border-radius:16px;padding:14px 16px
}
.rx-note svg{width:22px;height:22px;flex:none;color:#B3123A;margin-top:1px}
.rx-note b{display:block;color:#8E0E2E;font-size:13px;margin-bottom:3px}
.rx-note span{font-size:12.5px;line-height:1.55;color:#6B4450}
.rx-cart-flag{
  display:inline-flex;align-items:center;gap:5px;margin-top:6px;
  font-size:10px;font-weight:900;color:#B3123A;background:#FFF1F4;
  border:1px solid #F7C9D5;border-radius:999px;padding:4px 9px
}

/* ---------- Assistant connecté ---------- */
.chat-messages .msg.bot.typing{display:inline-flex;gap:4px;align-items:center;padding:13px 14px}
.chat-messages .msg.bot.typing i{width:6px;height:6px;border-radius:50%;background:#9DB6C6;animation:hadDot 1.1s infinite}
.chat-messages .msg.bot.typing i:nth-child(2){animation-delay:.18s}
.chat-messages .msg.bot.typing i:nth-child(3){animation-delay:.36s}
@keyframes hadDot{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}
.chat-disclaimer{
  padding:9px 14px;background:#F5FAFF;border-top:1px solid var(--line,#DCEAF1);
  font-size:10.5px;line-height:1.45;color:#6B8399
}
.chat-form button:disabled{opacity:.45;cursor:not-allowed}

/* ---------- Accessibilité & confort de lecture ---------- */
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible{
  outline:3px solid #09C2EE;outline-offset:2px;border-radius:6px
}
.skip-link{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.skip-link:focus{position:fixed;inset-inline-start:0;top:0;z-index:200;width:auto;height:auto;clip:auto;margin:0;padding:12px 18px;background:#224379;color:#fff;font-weight:900;border-radius:0 0 12px 12px}
.category small,.service p,.trust small{color:#4F6A80}
.trust small,.category small{font-size:12.5px}
.service p{font-size:14.5px}
.footer p,.footer a,.footer span{font-size:13px}
.btn,.links a,.cart-link{min-height:44px}
@media(prefers-reduced-motion:reduce){
  .reveal{opacity:1;transform:none;transition:none}
  .btn:hover,.product:hover,.category:hover{transform:none}
  .chat-messages .msg.bot.typing i{animation:none}
  .hero-video{display:none}
}
