/* ===== WD Ordine veloce ===== */
.wdais { --wdais-accent: #e30613; --wdais-dark: #111; font-size: 14px; }
.wdais [hidden] { display: none !important; }

/* pagina intera */
.wdais-embedded { max-width: 1000px; margin: 0 auto 40px; }
.wdais-embedded .wdais-panel { border: 1px solid #e6e6e6; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; min-height: 520px; }
.wdais-embedded .wdais-thread { min-height: 360px; max-height: 65vh; }

/* finestrella: di default in basso a sinistra (a destra c'è WhatsApp) */
.wdais-floating { position: fixed; left: 18px; bottom: 18px; z-index: 1050; }
.wdais-floating.wdais-pos-right { left: auto; right: 18px; bottom: 18px; }
.wdais-launcher { display: inline-flex; align-items: center; gap: 6px; background: var(--wdais-dark); color: #fff; border: 0; border-radius: 28px; padding: 12px 18px; font-weight: 700; font-size: 15px; box-shadow: 0 6px 20px rgba(0,0,0,.25); cursor: pointer; transition: transform .1s, background .15s; }
.wdais-launcher:hover { background: #000; transform: translateY(-1px); }
.wdais-floating .wdais-panel { position: absolute; left: 0; bottom: 62px; width: 400px; height: min(640px, calc(100vh - 110px)); background: #fff; border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.25); display: flex; flex-direction: column; overflow: hidden; }
.wdais-floating.wdais-pos-right .wdais-panel { left: auto; right: 0; }
.wdais-floating.wdais-above-wa { bottom: 84px; }
.wdais-floating.wdais-above-wa .wdais-panel { height: min(640px, calc(100vh - 176px)); }
/* nella finestrella: schede orizzontali compatte */
.wdais-floating .wdais-grid { display: flex; flex-direction: column; gap: 6px; }
.wdais-floating .wdais-card { flex-direction: row; align-items: stretch; }
.wdais-floating .wdais-img { flex: 0 0 86px; width: 86px; aspect-ratio: auto; border-right: 1px solid #f0f0f0; display: flex; align-items: center; justify-content: center; padding: 4px; }
.wdais-floating .wdais-img img { width: 78px; height: 78px; }
.wdais-floating .wdais-body { padding: 7px 9px; gap: 2px; min-width: 0; }
.wdais-floating .wdais-name { font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wdais-floating .wdais-brand { font-size: 10px; }
.wdais-floating .wdais-price { font-size: 14px; }
.wdais-floating .wdais-actions { padding-top: 4px; }
.wdais-floating .wdais-btn { padding: 6px 8px; font-size: 12px; }

.wdais-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; background: var(--wdais-dark); color: #fff; }
.wdais-head strong { display: block; font-size: 15px; }
.wdais-head small { display: block; opacity: .75; font-size: 12px; }
.wdais-head-actions { display: flex; gap: 6px; flex-shrink: 0; }
.wdais-head > div:first-child { min-width: 0; }
.wdais-head button { white-space: nowrap; }
.wdais-head button { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 12px; }
.wdais-head button:hover { background: rgba(255,255,255,.22); }
.wdais-head .wdais-wa-head { display: inline-flex; align-items: center; gap: 4px; background: #25d366; color: #fff; }
.wdais-head .wdais-wa-head:hover { background: #1ebe5b; }
.wdais-wa-btn { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 2px; padding: 9px 14px; border-radius: 20px; background: #25d366; color: #fff !important; font-weight: 600; text-decoration: none !important; word-break: normal !important; }
.wdais-wa-btn:hover { background: #1ebe5b; }
@media (max-width: 400px) { .wdais-head .wdais-wa-head span { display: none; } }

.wdais-vehicle { display: flex; align-items: center; gap: 8px; background: #f3f3f3; padding: 6px 10px 6px 14px; font-size: 13px; }
.wdais-vehicle-clear { margin-left: auto; border: 0; background: #ddd; border-radius: 50%; width: 22px; height: 22px; line-height: 22px; padding: 0; cursor: pointer; }

.wdais-thread { position: relative; flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #fafafa; }
.wdais-msg { padding: 10px 13px; border-radius: 14px; line-height: 1.45; }
.wdais-msg p { margin: 0 0 8px; } .wdais-msg p:last-child { margin-bottom: 0; }
.wdais-user { align-self: flex-end; background: var(--wdais-dark); color: #fff; max-width: 85%; border-bottom-right-radius: 4px; }
.wdais-bot { align-self: stretch; background: #fff; border: 1px solid #eee; border-bottom-left-radius: 4px; }
.wdais-bot a { color: var(--wdais-accent); text-decoration: underline; word-break: break-all; }
.wdais-dots i { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: #999; animation: wdais-b 1s infinite; }
.wdais-step { color: #666; font-size: 13px; margin-left: 4px; }
.wdais-replies { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wdais-reply { border: 1px solid var(--wdais-dark); background: #fff; color: var(--wdais-dark); border-radius: 16px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; text-align: left; }
.wdais-reply:hover { background: var(--wdais-dark); color: #fff; }
.wdais-dots i:nth-child(2) { animation-delay: .15s; } .wdais-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes wdais-b { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.wdais-examples { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; background: #fff; }
.wdais-chip { border: 1px solid #ddd; background: #fff; border-radius: 16px; padding: 5px 11px; font-size: 12.5px; cursor: pointer; text-align: left; }
.wdais-chip:hover { border-color: var(--wdais-dark); }

/* campo di scrittura a pillola con bottone tondo */
.wdais-form { padding: 10px 12px 12px; background: #fff; border-top: 1px solid #eee; margin: 0; }
.wdais-field { display: flex; align-items: center; gap: 6px; background: #f2f2f2; border: 1px solid transparent; border-radius: 26px; padding: 4px 4px 4px 16px; transition: border-color .15s, background .15s; }
.wdais-field:focus-within { background: #fff; border-color: #cfcfcf; box-shadow: 0 0 0 3px rgba(0,0,0,.04); }
.wdais-input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; outline: none !important; box-shadow: none !important; font-size: 15px; height: 38px; padding: 0; color: #111; }
.wdais-send { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--wdais-dark); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s, transform .1s; }
.wdais-send:hover { background: var(--wdais-accent); }
.wdais-send:active { transform: scale(.94); }
.wdais-send:disabled { background: #bbb; cursor: default; }

/* bottoni */
.wdais-btn { display: block; width: 100%; border: 0; border-radius: 8px; padding: 8px 10px; font-size: 13px; font-weight: 600; line-height: 1.2; background: var(--wdais-dark); color: #fff; cursor: pointer; text-align: center; transition: background .15s; }
.wdais-btn:hover { background: var(--wdais-accent); }
.wdais-btn:disabled { background: #9a9a9a; cursor: default; }
.wdais-btn-light { background: #fff; color: var(--wdais-dark); border: 1px solid var(--wdais-dark); }
.wdais-btn-light:hover { background: var(--wdais-dark); color: #fff; }
.wdais-variants { display: flex; flex-direction: column; gap: 5px; }
.wdais-select { width: 100%; height: 34px; border: 1px solid #ccc; border-radius: 8px; padding: 0 6px; font-size: 13px; background: #fff; }
.wdais-variant-info { font-size: 11.5px; color: #555; }

/* schede prodotto */
.wdais-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin: 8px 0; }
.wdais-card { background: #fff; border: 1px solid #eee; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.wdais-img { display: block; aspect-ratio: 1; background: #fff; }
.wdais-img img { width: 100%; height: 100%; object-fit: contain; }
.wdais-body { padding: 8px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.wdais-brand { font-size: 11px; text-transform: uppercase; color: #888; letter-spacing: .03em; }
.wdais-name { font-weight: 600; color: #111 !important; font-size: 13px; line-height: 1.3; text-decoration: none !important; word-break: normal !important; }
.wdais-years { font-size: 11.5px; color: #2a7a2a; }
.wdais-price { font-size: 15px; } .wdais-price s { color: #999; font-size: 12px; }
.wdais-badge { align-self: flex-start; font-size: 11px; padding: 2px 7px; border-radius: 10px; }
.wdais-store { background: #e3f4e3; color: #1d6b1d; }
.wdais-supplier { background: #eef2f7; color: #3a4a5c; }
.wdais-order { background: #f1f1f1; color: #555; }
.wdais-actions { margin-top: auto; padding-top: 6px; }

/* proposta carrello */
.wdais-proposal { border: 2px solid var(--wdais-dark); border-radius: 12px; padding: 10px 12px; margin: 8px 0; background: #fff; }
.wdais-proposal-title { font-weight: 700; margin-bottom: 6px; }
.wdais-proposal-row, .wdais-proposal-total { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 13px; }
.wdais-proposal-total { border-top: 1px solid #eee; margin-top: 4px; padding-top: 6px; font-size: 15px; }
.wdais-confirm { margin-top: 8px; padding: 10px; font-size: 14px; }

/* fumetto di benvenuto */
.wdais-teaser { position: absolute; bottom: 60px; right: 0; width: 260px; background: #fff; color: #111; border-radius: 14px; padding: 12px 34px 12px 14px; box-shadow: 0 8px 28px rgba(0,0,0,.22); font-size: 14px; line-height: 1.4; cursor: pointer; opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; }
.wdais-teaser.is-in { opacity: 1; transform: translateY(0); }
.wdais-teaser::after { content: ""; position: absolute; bottom: -7px; right: 26px; width: 14px; height: 14px; background: #fff; transform: rotate(45deg); box-shadow: 3px 3px 6px rgba(0,0,0,.06); }
.wdais-floating:not(.wdais-pos-right) .wdais-teaser { right: auto; left: 0; }
.wdais-floating:not(.wdais-pos-right) .wdais-teaser::after { right: auto; left: 26px; }
.wdais-teaser-x { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: #f0f0f0; color: #555; font-size: 11px; line-height: 22px; padding: 0; cursor: pointer; }

@media (max-width: 576px) {
  .wdais-teaser { width: calc(100vw - 40px); max-width: 300px; }
  .wdais-floating { left: 10px; bottom: 10px; }
  .wdais-floating.wdais-pos-right { left: auto; right: 10px; bottom: 10px; }
  .wdais-launcher { padding: 11px 15px; font-size: 14px; }
  .wdais-floating.is-open { left: 0; right: 0; top: 0; bottom: 0; }
  .wdais-floating.is-open .wdais-launcher { display: none; }
  .wdais-floating .wdais-panel, .wdais-floating.wdais-pos-right .wdais-panel { position: fixed; inset: 0; width: auto; height: auto; border-radius: 0; }
  .wdais-embedded .wdais-grid { grid-template-columns: repeat(2, 1fr); }
}
