/* =========================================================
   AI BUSINESS ASSISTANT FOOTER — FINAL WIDE GRID V2
   Premium AI theme footer with mobile overflow protection
========================================================= */

.ai-footer {
  max-width: 100%;
  overflow-x: clip;
  padding: 58px 0 24px;
  background:
    radial-gradient(circle at top left, rgba(255, 13, 150, 0.06), transparent 26%),
    radial-gradient(circle at 80% 12%, rgba(111, 31, 229, 0.08), transparent 28%),
    linear-gradient(180deg, #f7f1ff 0%, #efe6ff 100%);
  border-top: 1px solid rgba(111, 31, 229, 0.10);
}

@supports not (overflow: clip) {
  .ai-footer {
    overflow-x: hidden;
  }
}

.ai-footer,
.ai-footer *,
.ai-footer *::before,
.ai-footer *::after {
  box-sizing: border-box;
}

.ai-footer-shell {
  width: min(1560px, calc(100% - 48px));
  max-width: 100%;
  margin: 0 auto;
}

/* ================= TOP LAYOUT ================= */

.ai-footer-top {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(0, 2.22fr);
  gap: 28px;
  align-items: stretch;
  max-width: 100%;
}

/* ================= LEFT BRAND CARD ================= */

.ai-footer-brand {
  min-width: 0;
  min-height: 100%;
  padding: 24px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.20), transparent 30%),
    linear-gradient(180deg, #ff17a8 0%, #f70f95 100%);
  box-shadow:
    0 22px 44px rgba(112, 8, 86, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.ai-footer-logo {
  display: inline-flex;
  margin-bottom: 12px;
  text-decoration: none;
}

.ai-footer-logo-image {
  width: 42px;
  height: 42px;
  max-width: 100%;
  object-fit: contain;
}

.ai-footer-kicker {
  margin: 0 0 8px;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.ai-footer-title {
  max-width: 19ch;
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.35rem, 1.65vw, 1.95rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  font-weight: 620;
  overflow-wrap: anywhere;
}

.ai-footer-text {
  max-width: 43ch;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.9rem;
  line-height: 1.62;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.ai-footer-brand .ai-footer-text:nth-of-type(2) {
  display: none;
}

.ai-footer-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 17px;
}

.ai-footer-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 0 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 620;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.ai-footer-btn:hover,
.ai-footer-btn:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.ai-footer-btn-primary {
  background: #ffffff;
  color: #4f0fb8;
  border: 1px solid transparent;
  box-shadow: 0 12px 24px rgba(67, 6, 76, 0.16);
}

.ai-footer-btn-primary:hover,
.ai-footer-btn-primary:focus-visible {
  background: #fff6fd;
  color: #2a0146;
}

.ai-footer-btn-secondary {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.ai-footer-btn-secondary:hover,
.ai-footer-btn-secondary:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.34);
}

.ai-footer-contact-row {
  margin-top: 15px;
}

.ai-footer-contact-row button,
.ai-footer-actions button,
.ai-footer-brand button[data-support-open] {
  display: none !important;
}

.ai-footer-email {
  display: inline-block;
  max-width: 100%;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 560;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.ai-footer-email:hover,
.ai-footer-email:focus-visible {
  color: #fff3fb;
  text-decoration: underline;
  text-underline-offset: 3px;
  outline: none;
}

/* ================= RIGHT LINK GRID ================= */

.ai-footer-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  min-width: 0;
  max-width: 100%;
}

.ai-footer-col {
  min-width: 0;
  min-height: 100%;
  padding: 24px;
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(123, 35, 236, 0.12), transparent 36%),
    linear-gradient(180deg, #2a0146 0%, #22003b 100%);
  box-shadow:
    0 18px 34px rgba(42, 1, 70, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.ai-footer-col h3 {
  margin: 0 0 16px;
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 620;
  letter-spacing: -0.01em;
}

.ai-footer-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.ai-footer-col a {
  display: inline-block;
  max-width: 100%;
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  font-size: 0.96rem;
  line-height: 1.35;
  font-weight: 400;
  white-space: normal;
  overflow-wrap: anywhere;
  transition:
    color 0.16s ease,
    opacity 0.16s ease,
    transform 0.16s ease;
}

.ai-footer-col a:hover,
.ai-footer-col a:focus-visible {
  color: #ffffff;
  transform: translateX(2px);
  outline: none;
}

/* ================= BOTTOM ================= */

.ai-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 100%;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(111, 31, 229, 0.14);
  color: #6e7890;
  font-size: 0.88rem;
  line-height: 1.4;
}

.ai-footer-bottom-left {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: #6e7890;
  font-size: 0.88rem;
  line-height: 1.5;
}

.ai-footer-bottom-left p,
.ai-footer-bottom-left span,
.ai-footer-bottom p {
  margin: 0;
  overflow-wrap: anywhere;
}

.ai-footer-trust {
  min-width: 0;
  color: #4c5872;
  font-size: 0.84rem;
  text-align: center;
  overflow-wrap: anywhere;
}

.ai-footer-bottom-links {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  flex: 0 1 auto;
  min-width: 0;
  flex-wrap: wrap;
}

.ai-footer-bottom-links a {
  color: #6e7890;
  text-decoration: none;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.ai-footer-bottom-links a:hover,
.ai-footer-bottom-links a:focus-visible {
  color: #2a0146;
  outline: none;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 1320px) {
  .ai-footer-shell {
    width: min(1180px, calc(100% - 36px));
  }

  .ai-footer-top {
    grid-template-columns: 1fr;
  }

  .ai-footer-links {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ai-footer-brand {
    min-height: auto;
  }

  .ai-footer-title {
    max-width: 30ch;
  }

  .ai-footer-text {
    max-width: 78ch;
  }
}

@media (max-width: 980px) {
  .ai-footer-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-footer-col {
    padding: 22px;
  }
}

@media (max-width: 640px) {
  .ai-footer {
    padding: 46px 0 22px;
  }

  .ai-footer-shell {
    width: calc(100% - 20px);
  }

  .ai-footer-brand,
  .ai-footer-col {
    padding: 20px 16px;
    border-radius: 22px;
  }

  .ai-footer-logo-image {
    width: 40px;
    height: 40px;
  }

  .ai-footer-title {
    max-width: 100%;
    font-size: clamp(1.45rem, 7vw, 1.95rem);
  }

  .ai-footer-text {
    max-width: 100%;
    font-size: 0.9rem;
    line-height: 1.6;
  }

  .ai-footer-actions {
    flex-direction: column;
  }

  .ai-footer-btn {
    width: 100%;
    min-height: 44px;
    font-size: 0.8rem;
    white-space: normal;
    text-align: center;
  }

  .ai-footer-links {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .ai-footer-col h3 {
    font-size: 0.96rem;
  }

  .ai-footer-col a {
    font-size: 0.93rem;
  }

  .ai-footer-email {
    font-size: 0.9rem;
  }

  .ai-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    white-space: normal;
  }

  .ai-footer-trust {
    text-align: left;
  }

  .ai-footer-bottom-links {
    width: 100%;
    gap: 10px 12px;
  }
}