/* ═══════════════════════════════════════════════════════════════
   Geniium — Modals, drawers and AI chat
   ═══════════════════════════════════════════════════════════════ */

/* ═══ OVERLAY ═══ */
.ov {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--ov-bg);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; transition: opacity .22s;
}
.ov.open { display: flex; opacity: 1; }

.modal {
  background: var(--surface); border: 1px solid var(--border-m);
  border-radius: 22px; width: 100%; max-width: 720px; max-height: 88vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 32px 90px var(--sh-c2);
  transform: translateY(16px) scale(.985); transition: transform .28s cubic-bezier(.16, 1, .3, 1);
}
.ov.open .modal { transform: none; }
.modal.wide { max-width: 820px; }
.modal.narrow { max-width: 520px; }

.m-head {
  padding: 26px 30px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-shrink: 0;
}
.m-eyebrow {
  font-size: 10.5px; font-weight: 800; letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--azure); margin-bottom: 7px;
}
.m-title { font-size: 22px; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.m-sub { font-size: 13.5px; color: var(--t3); margin-top: 6px; }

.m-close {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  background: var(--tint-2); border: 1px solid var(--border);
  color: var(--t3); font-size: 17px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .16s, color .16s;
}
.m-close:hover { background: var(--tint-3); color: var(--t1); }
.m-close.locked { opacity: .3; cursor: not-allowed; pointer-events: none; }

.m-body { flex: 1; overflow-y: auto; padding: 26px 30px; }
.m-body::-webkit-scrollbar { width: 4px; }
.m-body::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 2px; }
.m-body::-webkit-scrollbar-thumb:hover { background: var(--azure); }

.m-foot {
  padding: 18px 30px 22px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; flex-shrink: 0; background: var(--surface);
}
.m-foot .btn { flex-shrink: 0; }

/* ═══ PRODUCT DETAIL MODAL ═══ */
.pd-lead {
  font-size: 15.5px; color: var(--t2); line-height: 1.7;
  padding: 16px 18px; background: rgba(59, 147, 238, .06);
  border: 1px solid rgba(59, 147, 238, .16); border-radius: var(--r-md);
  margin-bottom: 26px;
}
.pd-block { margin-bottom: 26px; }
.pd-block h4 {
  font-size: 12px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--teal); margin-bottom: 13px; padding-bottom: 9px; border-bottom: 1px solid var(--border);
}
.pd-list { list-style: none; }
.pd-list li {
  font-size: 14.5px; color: var(--t2); line-height: 1.65;
  padding: 7px 0 7px 22px; position: relative;
}
.pd-list li::before {
  content: ''; position: absolute; left: 0; top: 15px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--azure);
}
.pd-facts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 26px;
}
.pd-fact {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px 16px;
}
.pd-fact .v { font-size: 17px; font-weight: 800; color: var(--t1); line-height: 1.2; }
.pd-fact .l { font-size: 11px; color: var(--t3); margin-top: 4px; }

.pd-faq { border-top: 1px solid var(--border); padding-top: 22px; }
.pd-faq h4 {
  font-size: 12px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--t3); margin-bottom: 14px;
}
.faq-item { border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 9px; overflow: hidden; }
.faq-q {
  padding: 14px 16px; font-size: 14px; font-weight: 700; color: var(--t1);
  cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  transition: background .16s;
}
.faq-q:hover { background: var(--tint-1); }
.faq-q .chev { color: var(--t3); transition: transform .22s; flex-shrink: 0; }
.faq-item.open .faq-q .chev { transform: rotate(180deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .28s cubic-bezier(.16, 1, .3, 1); }
.faq-item.open .faq-a { max-height: 300px; }
.faq-a-inner { padding: 0 16px 15px; font-size: 14px; color: var(--t2); line-height: 1.65; }

/* ═══ PRIVACY MODAL ═══ */
.pv-body h2 { font-size: 20px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 6px; }
.pv-body .pv-sub { font-size: 13.5px; color: var(--t3); font-style: italic; margin-bottom: 24px; }
.pv-sec { margin-bottom: 24px; }
.pv-sec h3 { font-size: 15px; font-weight: 800; color: var(--t1); margin-bottom: 10px; }
.pv-sec p { font-size: 14px; color: var(--t2); line-height: 1.75; margin-bottom: 9px; }
.pv-sec ul { list-style: none; margin: 6px 0 12px; }
.pv-sec ul li {
  font-size: 14px; color: var(--t2); line-height: 1.75;
  padding-left: 18px; position: relative; margin-bottom: 4px;
}
.pv-sec ul li::before { content: '—'; position: absolute; left: 0; color: var(--azure); font-weight: 700; }
.pv-updated {
  margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--t3); font-style: italic;
}
.pv-hint { font-size: 13px; color: var(--t3); flex: 1; display: flex; align-items: center; gap: 8px; }
.pv-hint.done { color: var(--teal); }
.pv-hint svg { flex-shrink: 0; }

/* ═══ MATERIAL REQUEST MODAL ═══ */
.mr-intro {
  display: flex; gap: 15px; align-items: flex-start;
  padding: 16px 18px; background: rgba(0, 219, 164, .05);
  border: 1px solid rgba(0, 219, 164, .18); border-radius: var(--r-md); margin-bottom: 22px;
}
.mr-intro-icon {
  width: 40px; height: 40px; border-radius: var(--r-md); flex-shrink: 0;
  background: rgba(0, 219, 164, .12); border: 1px solid rgba(0, 219, 164, .22);
  display: flex; align-items: center; justify-content: center; color: var(--teal);
}
.mr-intro h4 { font-size: 15px; font-weight: 800; margin-bottom: 4px; }
.mr-intro p { font-size: 13.5px; color: var(--t2); line-height: 1.6; }

/* ═══ AI CHAT WIDGET ═══ */
.chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 950;
  width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(135deg, #00DBA4, #00B886);
  border: none; cursor: pointer; color: #041016;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 28px rgba(0, 219, 164, .4);
  transition: transform .2s, box-shadow .2s;
}
.chat-fab:hover { transform: scale(1.06); box-shadow: 0 10px 34px rgba(0, 219, 164, .55); }
.chat-fab.hide { display: none; }
.chat-fab .dot {
  position: absolute; top: 3px; right: 3px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--azure); border: 2px solid var(--base);
  animation: fabPulse 2.4s ease infinite;
}
@keyframes fabPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.25); opacity: .7; } }

.chat-panel {
  position: fixed; right: 22px; bottom: 22px; z-index: 960;
  width: 396px; max-width: calc(100vw - 32px);
  height: 588px; max-height: calc(100vh - 44px);
  background: var(--surface); border: 1px solid var(--border-m);
  border-radius: 20px; overflow: hidden; flex-direction: column;
  box-shadow: 0 28px 80px var(--sh-c2);
  display: none; transform: translateY(18px) scale(.97); opacity: 0;
  transition: transform .28s cubic-bezier(.16, 1, .3, 1), opacity .22s;
}
.chat-panel.open { display: flex; transform: none; opacity: 1; }

.chat-head {
  padding: 16px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
  background: linear-gradient(120deg, var(--surface2), var(--surface));
}
.chat-avatar {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(135deg, #00DBA4, #3B93EE);
  display: flex; align-items: center; justify-content: center; color: #041016;
}
.chat-head-txt { flex: 1; min-width: 0; }
.chat-head-txt .t { font-size: 14.5px; font-weight: 800; letter-spacing: -.01em; }
.chat-head-txt .s { font-size: 11.5px; color: var(--teal); display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.chat-head-txt .s::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }

.chat-body {
  flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px;
}
.chat-body::-webkit-scrollbar { width: 4px; }
.chat-body::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 2px; }

.msg { display: flex; gap: 9px; max-width: 88%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg-bubble {
  padding: 11px 15px; border-radius: 15px; font-size: 14px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.msg.bot .msg-bubble {
  background: var(--surface2); border: 1px solid var(--border);
  border-bottom-left-radius: 5px; color: var(--t1);
}
.msg.user .msg-bubble {
  background: var(--grad); color: #fff; border-bottom-right-radius: 5px;
}
.msg-ava {
  width: 27px; height: 27px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800;
}
.msg.bot .msg-ava { background: rgba(0, 219, 164, .14); color: var(--teal); border: 1px solid rgba(0, 219, 164, .22); }
.msg.user .msg-ava { background: rgba(59, 147, 238, .16); color: var(--azure); border: 1px solid rgba(59, 147, 238, .25); }

.typing { display: flex; gap: 4px; padding: 13px 15px; }
.typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--t3);
  animation: typeBounce 1.3s ease infinite;
}
.typing span:nth-child(2) { animation-delay: .18s; }
.typing span:nth-child(3) { animation-delay: .36s; }
@keyframes typeBounce { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }

.chat-sugg { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 18px 14px; flex-shrink: 0; }
.chat-sugg button {
  font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--t2);
  background: var(--tint-1); border: 1px solid var(--border);
  border-radius: 100px; padding: 7px 13px; cursor: pointer;
  transition: border-color .16s, color .16s, background .16s;
}
.chat-sugg button:hover { border-color: rgba(0, 219, 164, .4); color: var(--teal); background: rgba(0, 219, 164, .06); }

.chat-rec {
  margin: 0 18px 14px; padding: 15px 16px; flex-shrink: 0;
  background: rgba(0, 219, 164, .06); border: 1px solid rgba(0, 219, 164, .24);
  border-radius: var(--r-md); display: none;
}
.chat-rec.show { display: block; }
.chat-rec .rt {
  font-size: 10.5px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--teal); margin-bottom: 6px;
}
.chat-rec .rn { font-size: 15px; font-weight: 800; margin-bottom: 5px; }
.chat-rec .rd { font-size: 13px; color: var(--t2); line-height: 1.55; margin-bottom: 12px; }
.chat-rec .btn { width: 100%; }

.chat-foot { padding: 14px 18px 16px; border-top: 1px solid var(--border); flex-shrink: 0; }
.chat-input-row { display: flex; gap: 9px; align-items: flex-end; }
.chat-input {
  flex: 1; font-family: var(--sans); font-size: 14px; color: var(--t1);
  background: var(--tint-1); border: 1px solid var(--border-m);
  border-radius: 12px; padding: 11px 14px; outline: none; resize: none;
  max-height: 100px; line-height: 1.5; transition: border-color .18s;
}
.chat-input:focus { border-color: var(--teal); }
.chat-input::placeholder { color: var(--t3); }
.chat-send {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0; border: none;
  background: linear-gradient(135deg, #00DBA4, #00B886); color: #041016;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform .16s, opacity .16s;
}
.chat-send:hover { transform: scale(1.05); }
.chat-send:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.chat-disclaimer { font-size: 10.5px; color: var(--t3); text-align: center; margin-top: 9px; line-height: 1.4; }

/* ═══ TOAST ═══ */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  z-index: 1100; background: var(--surface2); border: 1px solid var(--border-m);
  border-radius: 12px; padding: 13px 20px; font-size: 14px; color: var(--t1);
  box-shadow: 0 14px 40px var(--sh-c2);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  max-width: calc(100vw - 40px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { border-color: rgba(0, 219, 164, .4); }
.toast.err { border-color: rgba(255, 92, 92, .45); }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 720px) {
  .ov { padding: 0; align-items: flex-end; }
  .modal { max-width: 100%; max-height: 94vh; border-radius: 20px 20px 0 0; }
  .m-head { padding: 20px 20px 16px; }
  .m-body { padding: 20px; }
  .m-foot { padding: 14px 20px 18px; flex-wrap: wrap; }
  .m-foot .btn { width: 100%; }
  .m-title { font-size: 18px; }
  .pd-facts { grid-template-columns: 1fr; gap: 9px; }

  .chat-panel {
    right: 0; bottom: 0; width: 100%; max-width: 100%;
    height: 100%; max-height: 100%; border-radius: 0;
  }
  .chat-fab { right: 16px; bottom: 16px; width: 54px; height: 54px; }
}

/* ═══ Chat privacy notice ═══ */
.chat-notice {
  display: flex; gap: 10px; align-items: flex-start; flex-shrink: 0;
  margin: 14px 18px 0; padding: 12px 14px;
  background: rgba(255, 176, 32, .08);
  border: 1px solid rgba(255, 176, 32, .26);
  border-radius: var(--r-md);
  font-size: 12.5px; line-height: 1.55; color: var(--t2);
}
.chat-notice b { color: var(--t1); font-weight: 700; display: block; margin-bottom: 2px; }
.chat-notice-ic { color: #FFB020; flex-shrink: 0; margin-top: 1px; }
.chat-link { color: var(--teal); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.chat-link:hover { color: var(--azure); }
