/* ==========================================================================
   evtec.am — Enhancements Stylesheet
   Responsive / defensive CSS for everything added on top of the existing
   site design: language switcher, cookie consent bar, extra floating
   buttons (Viber/Telegram), the Smart Configurator page, and the booking
   widget. This file only ADDS rules — it does not override css/style.css.
   ========================================================================== */

/* ---- Global safety net (harmless even if style.css already sets these) --- */
img, video { max-width: 100%; height: auto; }
iframe { max-width: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: hidden; }

/* ---- Language switcher (HY / EN / RU) ------------------------------------ */
.lang-switch { flex-shrink: 0; }
@media (max-width: 860px) {
  .header-container { flex-wrap: wrap; row-gap: 0.5rem; }
  .lang-switch {
    order: 5;
    width: 100%;
    justify-content: center;
    margin: 0.3rem 0 0 !important;
  }
}

/* ---- Cookie consent bar --------------------------------------------------- */
#cookieConsent {
  padding: 1rem !important;
}
@media (max-width: 560px) {
  #cookieConsent { flex-direction: column; text-align: center; }
  #cookieConsent span[style*="display:flex"] { width: 100%; justify-content: center; }
}

/* ---- Floating action buttons (call / whatsapp / viber / telegram / chat / top) */
@media (max-width: 480px) {
  .floating-buttons {
    transform: scale(0.85);
    transform-origin: bottom right;
  }
}

/* ---- Smart Configurator page ---------------------------------------------- */
@media (max-width: 640px) {
  .cfg-card { padding: 1.25rem; }
  .cfg-steps { gap: 0.4rem; }
  .cfg-step-dot { font-size: 0.72rem; padding: 0.3rem 0.6rem; }
  .cfg-actions { flex-direction: column; }
  .cfg-actions .btn { min-width: 0; width: 100%; }
  .cfg-metric-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
  .cfg-metric-grid { grid-template-columns: 1fr; }
}

/* ---- Booking / Calendly widget -------------------------------------------- */
.calendly-inline-widget { width: 100%; }
@media (max-width: 480px) {
  .calendly-inline-widget { min-height: 560px !important; height: 560px !important; }
}

/* ---- Homepage configurator promo banner ----------------------------------- */
@media (max-width: 720px) {
  .promo-cfg-banner { flex-direction: column; text-align: center; padding: 1.75rem !important; }
  .promo-cfg-banner > a { width: 100%; justify-content: center; }
}

/* ---- Contact form honeypot: extra safety even if inline style is stripped */
input[name="website_url"] {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* ---- Generic small-screen text scaling for hero/section titles that use
   clamp() already; this is a fallback for any that don't ----------------- */
@media (max-width: 400px) {
  h1 { word-break: break-word; }
}

/* ---- AI Advisor chat widget -------------------------------------------
   The launcher button is inserted as an actual child of .floating-buttons
   (see js/ai-advisor.js), so its size, spacing, and position come from the
   site's own .floating-btn styling automatically — only the color and the
   small "AI" badge are custom here. */
.floating-btn.ai-advisor {
  background: linear-gradient(135deg, #6a5cff, #00c8b0) !important;
  color: #fff !important;
  position: relative;
}
.ai-advisor-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff5c5c;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}
.floating-btn.ai-advisor.hide-badge .ai-advisor-badge { display: none; }

.ai-advisor-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 200px);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.ai-advisor-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.ai-advisor-header {
  background: linear-gradient(120deg, #0e1c2f, #1a2f4a);
  color: #fff;
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
}
.ai-advisor-title { font-weight: 800; font-size: 0.95rem; }
.ai-advisor-subtitle { font-size: 0.72rem; opacity: 0.7; margin-top: 0.2rem; }
.ai-advisor-close {
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}
.ai-advisor-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: #f6f7f9;
}
.ai-advisor-msg {
  max-width: 84%;
  padding: 0.6rem 0.85rem;
  border-radius: 14px;
  font-size: 0.86rem;
  line-height: 1.45;
  white-space: pre-wrap;
}
.ai-advisor-msg.assistant {
  align-self: flex-start;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  border-bottom-left-radius: 4px;
}
.ai-advisor-msg.user {
  align-self: flex-end;
  background: #00c853;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ai-advisor-typing span {
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 3px;
  border-radius: 50%;
  background: #999;
  animation: aiTyping 1.2s infinite ease-in-out;
}
.ai-advisor-typing span:nth-child(2) { animation-delay: .2s; }
.ai-advisor-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes aiTyping { 0%,60%,100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.ai-advisor-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  padding: 0.65rem;
  margin: 0.6rem 0.9rem 0;
  background: rgba(0,200,83,0.1);
  color: #00a844;
  font-weight: 700;
  font-size: 0.8rem;
  border-radius: 12px;
  text-decoration: none;
  flex-shrink: 0;
}
.ai-advisor-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem 0.9rem;
  flex-shrink: 0;
}
.ai-advisor-form textarea {
  flex: 1;
  resize: none;
  border: 1.5px solid rgba(0,0,0,0.12);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  font-size: 0.86rem;
  font-family: inherit;
  max-height: 110px;
}
.ai-advisor-form button {
  width: 40px; height: 40px;
  border-radius: 12px;
  border: none;
  background: #00c853;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .ai-advisor-panel {
    right: 8px;
    left: 8px;
    bottom: 8px;
    width: auto;
    max-width: none;
    height: 78vh;
    max-height: 78vh;
  }
}
