/* ============================================================
   Public Footer — optimized design (v136)
   Always follows Admin → theme_primary via --p
   ============================================================ */

html[data-public-theme="1"] .public-footer,
html[data-public-theme="1"] footer.public-footer {
  position: relative;
  margin-top: 0;
  padding: 3rem 0 0;
  overflow: hidden;
  background: var(--card, #fff) !important;
  border-top: 1px solid var(--bd, #e5e7eb) !important;
  color: var(--mu, #6b7280) !important;
}

/* Primary accent line */
html[data-public-theme="1"] .public-footer::before,
html[data-public-theme="1"] .public-footer:before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--p) !important;
  background-image: none !important;
  opacity: 1;
  z-index: 2;
}

/* Soft primary glow (decorative) */
html[data-public-theme="1"] .public-footer::after,
html[data-public-theme="1"] .public-footer:after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -120px;
  top: -140px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--p) 7%, transparent) !important;
  pointer-events: none;
  z-index: 0;
}

html[data-public-theme="1"] .public-footer .public-footer-inner,
html[data-public-theme="1"] .public-footer .wrap {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 1.15rem;
  padding-right: 1.15rem;
  box-sizing: border-box;
}

/* Grid */
html[data-public-theme="1"] .public-footer .public-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)) minmax(0, 1.15fr);
  gap: 2rem 2.25rem;
  padding-bottom: 2.25rem;
}

/* Brand */
html[data-public-theme="1"] .public-footer .public-footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--tx, #111827) !important;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
html[data-public-theme="1"] .public-footer .public-footer-logo img {
  display: block;
  max-width: 150px;
  height: 34px;
  width: auto;
  object-fit: contain;
}
html[data-public-theme="1"] .public-footer .public-footer-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  background: var(--p) !important;
  color: #fff !important;
  flex-shrink: 0;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--p) 28%, transparent);
}
html[data-public-theme="1"] .public-footer .public-footer-name {
  color: var(--tx, #111827) !important;
}
html[data-public-theme="1"] .public-footer .public-footer-tagline,
html[data-public-theme="1"] .public-footer .public-footer-brand p {
  margin: 0.85rem 0 1rem;
  max-width: 300px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--mu, #6b7280) !important;
}

/* Contact chips */
html[data-public-theme="1"] .public-footer .public-footer-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
html[data-public-theme="1"] .public-footer .public-footer-chip,
html[data-public-theme="1"] .public-footer .public-footer-contact a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--p) 18%, var(--bd, #e5e7eb)) !important;
  background: color-mix(in srgb, var(--p) 6%, var(--card, #fff)) !important;
  color: var(--tx, #111827) !important;
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 700;
  transition: border-color .15s ease, color .15s ease, transform .15s ease;
}
html[data-public-theme="1"] .public-footer .public-footer-chip:hover,
html[data-public-theme="1"] .public-footer .public-footer-contact a:hover {
  border-color: color-mix(in srgb, var(--p) 45%, var(--bd, #e5e7eb)) !important;
  color: var(--p) !important;
  transform: translateY(-1px);
}

/* Columns */
html[data-public-theme="1"] .public-footer h3 {
  margin: 0 0 0.9rem;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--tx, #111827) !important;
}
html[data-public-theme="1"] .public-footer nav {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
html[data-public-theme="1"] .public-footer nav a {
  color: var(--mu, #6b7280) !important;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.4;
  transition: color .15s ease, transform .15s ease;
}
html[data-public-theme="1"] .public-footer nav a:hover {
  color: var(--p) !important;
  transform: translateX(3px);
}

/* Highlight card */
html[data-public-theme="1"] .public-footer .public-footer-highlight {
  padding: 1.15rem 1.2rem;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--p) 18%, var(--bd, #e5e7eb)) !important;
  background: color-mix(in srgb, var(--p) 5%, var(--card, #fff)) !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}
html[data-public-theme="1"] .public-footer .public-footer-highlight h3 {
  margin-top: 0;
}
html[data-public-theme="1"] .public-footer .public-footer-points {
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
html[data-public-theme="1"] .public-footer .public-footer-points li,
html[data-public-theme="1"] .public-footer .public-footer-points span {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--mu, #6b7280) !important;
}
html[data-public-theme="1"] .public-footer .public-footer-check,
html[data-public-theme="1"] .public-footer .public-footer-points b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  background: var(--p) !important;
  color: #fff !important;
  margin-top: 1px;
}

/* CTA */
html[data-public-theme="1"] .public-footer .public-footer-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.95rem;
  border-radius: 11px;
  border: 0;
  background: var(--p) !important;
  color: #fff !important;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 800;
  transition: filter .15s ease, transform .15s ease;
}
html[data-public-theme="1"] .public-footer .public-footer-cta:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
  color: #fff !important;
  background: var(--p) !important;
}

/* Bottom bar */
html[data-public-theme="1"] .public-footer .public-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0 1.35rem;
  border-top: 1px solid var(--bd, #e5e7eb) !important;
  font-size: 12px;
  color: var(--mu, #6b7280) !important;
}
html[data-public-theme="1"] .public-footer .public-footer-bottom-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.85rem 1.1rem;
}
html[data-public-theme="1"] .public-footer .public-footer-bottom a,
html[data-public-theme="1"] .public-footer .public-footer-bottom-links a {
  color: var(--mu, #6b7280) !important;
  text-decoration: none;
  font-size: 12px;
}
html[data-public-theme="1"] .public-footer .public-footer-bottom a:hover,
html[data-public-theme="1"] .public-footer .public-footer-bottom-links a:hover {
  color: var(--p) !important;
}

/* Dark mode */
html[data-public-theme="1"][data-theme="dark"] .public-footer,
html[data-public-theme="1"][data-theme="dark"] footer.public-footer {
  background: var(--card, #111827) !important;
  border-top-color: var(--bd, #263247) !important;
  color: var(--mu, #94a3b8) !important;
}
html[data-public-theme="1"][data-theme="dark"] .public-footer .public-footer-highlight {
  background: color-mix(in srgb, var(--p) 8%, var(--card, #111827)) !important;
  border-color: color-mix(in srgb, var(--p) 22%, var(--bd, #263247)) !important;
}

/* Classic theme: never force blue surfaces */
html[data-public-theme="1"][data-ui-theme="classic"][data-theme="light"] .public-footer,
html[data-public-theme="1"][data-ui-theme="classic"][data-theme="light"] footer.public-footer {
  background: var(--card) !important;
  border-top-color: var(--bd) !important;
  color: var(--mu) !important;
}

/* Responsive */
@media (max-width: 900px) {
  html[data-public-theme="1"] .public-footer .public-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem 1.25rem;
  }
  html[data-public-theme="1"] .public-footer .public-footer-brand,
  html[data-public-theme="1"] .public-footer .public-footer-highlight {
    grid-column: 1 / -1;
  }
}
@media (max-width: 560px) {
  html[data-public-theme="1"] .public-footer {
    padding-top: 2.25rem;
  }
  html[data-public-theme="1"] .public-footer .public-footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
  }
  html[data-public-theme="1"] .public-footer .public-footer-brand,
  html[data-public-theme="1"] .public-footer .public-footer-highlight {
    grid-column: auto;
  }
  html[data-public-theme="1"] .public-footer .public-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 1rem;
    padding-bottom: 1.15rem;
  }
  html[data-public-theme="1"] .public-footer .public-footer-bottom-links {
    justify-content: flex-start;
  }
  html[data-public-theme="1"] .public-footer::after {
    width: 180px;
    height: 180px;
    right: -80px;
    top: -90px;
  }
}

/* Mobile: copyright only — no extra Terms/Privacy under it */
@media (max-width: 767px) {
  html[data-public-theme="1"] .public-footer .public-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
  html[data-public-theme="1"] .public-footer .public-footer-bottom-desktop {
    display: none !important;
  }
}
