/* Global footer styles shared across all pages */
#footer.app-footer-section {
  background: linear-gradient(180deg, #0d1320 0%, #090e17 100%);
  color: #fff;
  margin-left: 10px;
  margin-right: 10px;
  width: calc(100% - 20px);
  border-radius: 0;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  position: relative;
  overflow: hidden;
}

#footer .footer-main-area {
  padding: 56px 0 30px;
  position: relative;
  z-index: 2;
}

/* Footer layout fallback so non-home pages don't depend on home.css */
#footer .footer-main-area .row.justify-content-between {
  display: flex;
  flex-wrap: wrap;
  margin-left: -12px;
  margin-right: -12px;
  row-gap: 24px;
}

#footer .footer-main-area .row.justify-content-between > [class*="col-"] {
  width: 100%;
  max-width: 100%;
  flex: 0 0 100%;
  padding-left: 12px;
  padding-right: 12px;
  margin-bottom: 0;
}

@media (min-width: 768px) {
  #footer .footer-main-area .row.justify-content-between > .col-md-6 {
    width: 50%;
    max-width: 50%;
    flex: 0 0 50%;
  }
}

@media (min-width: 992px) {
  #footer .footer-main-area .row.justify-content-between > .col-lg-3 {
    width: 25%;
    max-width: 25%;
    flex: 0 0 25%;
  }

  #footer .footer-main-area .row.justify-content-between > .col-lg-2 {
    width: 16.666667%;
    max-width: 16.666667%;
    flex: 0 0 16.666667%;
  }
}

@media (min-width: 1200px) {
  #footer .footer-main-area .row.justify-content-between > .col-xl-3 {
    width: 25%;
    max-width: 25%;
    flex: 0 0 25%;
  }

  #footer .footer-main-area .row.justify-content-between > .col-xl-2 {
    width: 16.666667%;
    max-width: 16.666667%;
    flex: 0 0 16.666667%;
  }
}

/* Keep footer as a single 5-column row on desktop */
@media (min-width: 992px) {
  #footer .footer-main-area .row.justify-content-between {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) repeat(3, minmax(0, 0.95fr)) minmax(0, 1.25fr);
    column-gap: 30px;
    row-gap: 0;
    margin-left: 0;
    margin-right: 0;
    justify-content: normal;
    align-items: start;
  }

  #footer .footer-main-area .row.justify-content-between > [class*="col-"] {
    width: auto !important;
    max-width: none !important;
    flex: initial !important;
    padding-left: 0;
    padding-right: 0;
  }
}

@media (min-width: 1200px) {
  #footer .footer-main-area .row.justify-content-between {
    grid-template-columns: minmax(0, 1.1fr) repeat(3, minmax(0, 0.95fr)) minmax(0, 1.3fr);
    column-gap: 34px;
  }
}

#footer .footer-widget {
  height: 100%;
  display: flex;
  flex-direction: column;
}

@media (min-width: 992px) {
  #footer .footer-main-area .col-xl-3:first-child .footer-widget,
  #footer .footer-main-area .col-lg-3:first-child .footer-widget {
    max-width: 280px;
  }

  #footer .footer-main-area .col-xl-3:last-child .footer-widget,
  #footer .footer-main-area .col-lg-3:last-child .footer-widget {
    max-width: 380px;
    width: 100%;
    margin-left: auto;
  }
}

#footer .footer-widget .title {
  margin: 0 0 14px;
  font-family: var(--font-heading, 'Oswald', sans-serif) !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: #fff !important;
  writing-mode: horizontal-tb;
}

#footer .footer-logo a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff !important;
  text-decoration: none;
}

#footer .footer-logo img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

#footer .footer-logo-text {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff !important;
}

#footer .footer-text p,
#footer .subscribe-form p,
#footer .copyright-text p,
#footer .footer-contact .text {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.78) !important;
  font-family: var(--font-body, 'Poppins', sans-serif) !important;
  font-size: 0.86rem !important;
  line-height: 1.55 !important;
  writing-mode: horizontal-tb;
}

#footer .footer-main-area .col-xl-3:first-child .footer-text p,
#footer .footer-main-area .col-lg-3:first-child .footer-text p {
  max-width: 26ch;
  margin-bottom: 16px;
  text-wrap: pretty;
}

#footer .footer-contact ul,
#footer .widget-nav-menu ul,
#footer .footer-legal-links,
#footer .social-links ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

#footer .footer-contact ul li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

#footer .footer-contact ul li:last-child {
  margin-bottom: 0;
}

#footer .footer-contact .icon {
  margin-top: 1px;
  color: #fff !important;
}

#footer .footer-contact .text {
  line-height: 1.45 !important;
}

#footer .widget-nav-menu ul li {
  margin-bottom: 10px;
}

#footer .widget-nav-menu ul li:last-child {
  margin-bottom: 0;
}

#footer .widget-nav-menu ul li a,
#footer .footer-contact ul li a,
#footer .footer-legal-links li a,
#footer .copyright-text a {
  font-family: var(--font-body, 'Poppins', sans-serif) !important;
  font-size: 0.86rem !important;
  line-height: 1.6 !important;
  color: #fff !important;
  text-decoration: none !important;
  transition: color 0.2s ease, transform 0.2s ease;
  writing-mode: horizontal-tb;
}

#footer .widget-nav-menu ul li a,
#footer .footer-contact ul li a {
  display: inline-block;
  max-width: 100%;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

#footer .widget-nav-menu ul li a:hover,
#footer .footer-contact ul li a:hover,
#footer .footer-legal-links li a:hover,
#footer .copyright-text a:hover {
  color: #7eb8ff !important;
}

#footer .widget-nav-menu ul li a:hover {
  transform: translateX(3px);
}

#footer .social-links ul {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

#footer .social-links a {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff !important;
  text-decoration: none;
}

#footer .social-links a i {
  font-size: 1.1rem;
  color: inherit !important;
}

#footer .social-links a:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #7eb8ff !important;
}

#footer .subscribe-form__message--success {
  color: #34d399 !important;
}

#footer .subscribe-form__message--error {
  color: #f87171 !important;
}

#footer .app-copyright-area {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.12);
  padding: 14px 0;
  margin-bottom: 0 !important;
  position: relative;
  z-index: 2;
}

#footer .copyright-content-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

#footer .footer-legal-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

#footer .copyright-text p {
  margin-bottom: 0 !important;
}

#footer .bg-shape-1,
#footer .bg-shape-2 {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 100%;
  max-width: 370px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  mix-blend-mode: screen;
}

#footer .bg-shape-2 {
  top: auto;
  bottom: 0;
  inset-inline-start: auto;
  inset-inline-end: 0;
}

#footer .bg-shape-1 img,
#footer .bg-shape-2 img {
  display: block;
  width: 100%;
  height: auto;
}

/* Keep CTA aligned with footer container and avoid extra gap */
.footer-cta-banner {
  width: calc(100% - 20px) !important;
  margin-left: 10px !important;
  margin-right: 10px !important;
  margin-bottom: 0 !important;
  border-radius: 8px 8px 0 0 !important;
}

.footer-cta-banner__title {
  font-family: var(--font-heading, 'Oswald', sans-serif) !important;
  font-size: clamp(1.05rem, 1.9vw, 1.35rem) !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: #fff !important;
}

#footer-newsletter-email::placeholder {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
}

#footer .footer-subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  position: static;
}

#footer .widget-subscribe .subscribe-form > p {
  max-width: 34ch;
  margin-bottom: 12px;
  text-wrap: pretty;
}

#footer .footer-subscribe-form__field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  align-items: stretch;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
}

#footer .footer-subscribe-form__input {
  flex: 1;
  min-width: 0;
  min-height: 50px;
  height: auto;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.85rem 0.95rem;
  color: #fff;
  outline: none;
  font-size: 0.92rem;
}

#footer .footer-subscribe-form__button {
  flex: 0 0 auto;
  min-width: 118px;
  min-height: 50px;
  height: auto;
  margin: 0;
  position: static !important;
  top: auto !important;
  right: auto !important;
  inset: auto !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: #2563eb;
  color: #fff;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0 1.1rem;
  font-size: 0.84rem;
  line-height: 1.15;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

#footer .footer-subscribe-form__button:hover {
  background: #1d4ed8;
}

#footer .footer-subscribe-form__privacy {
  margin: 0 !important;
  font-size: 0.82rem !important;
  line-height: 1.4 !important;
  color: rgba(255, 255, 255, 0.6) !important;
}

#footer .footer-subscribe-form__privacy-link {
  color: #fff !important;
  text-decoration: underline !important;
}

@media (max-width: 767px) {
  #footer.app-footer-section {
    margin-left: 8px;
    margin-right: 8px;
    width: calc(100% - 16px);
  }

  #footer .bg-shape-1,
  #footer .bg-shape-2 {
    max-width: 260px;
  }

  #footer .footer-main-area {
    padding: 44px 0 20px;
  }

  #footer .footer-main-area [class*="col-"] .footer-widget {
    max-width: none;
    margin-left: 0;
  }

  #footer .copyright-content-area {
    flex-direction: column;
    text-align: center;
  }

  #footer .footer-legal-links {
    justify-content: center;
  }

  #footer .copyright-content-area p {
    font-size: 0.75rem;
    line-height: 1.3;
  }

  #footer .footer-legal-links {
    gap: 8px;
  }

  #footer .footer-legal-links a {
    font-size: 0.75rem;
    line-height: 1.3;
  }

  #footer .footer-legal-links .hide-mobile {
    display: none;
  }

  .footer-cta-banner {
    width: calc(100% - 16px) !important;
    margin-left: 8px !important;
    margin-right: 8px !important;
    border-radius: 6px 6px 0 0 !important;
  }

  .footer-cta-banner__title {
    font-size: 0.86rem !important;
    letter-spacing: 0.02em !important;
  }

  #footer .footer-subscribe-form__field {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #footer .widget-subscribe .subscribe-form > p {
    max-width: none;
  }

  #footer .footer-subscribe-form__button {
    min-width: 104px;
    min-height: 42px;
    padding: 0 0.9rem;
    font-size: 0.8rem;
  }
}

/* Global scroll-to-top styles (rendered on all pages) */
.scroll-to-top {
  position: fixed;
  bottom: max(32px, env(safe-area-inset-bottom));
  right: max(32px, env(safe-area-inset-right));
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  color: var(--app-color-theme-primary, #2563eb);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

.scroll-to-top--active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-to-top:hover {
  color: #1d4ed8;
  transform: translateY(-2px);
}

.scroll-to-top svg {
  width: 64px;
  height: 64px;
}

.scroll-to-top svg path {
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scroll-to-top__arrow {
  animation: scrollTopArrow 2s ease-in-out infinite;
}

@keyframes scrollTopArrow {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@media (max-width: 576px) {
  .scroll-to-top {
    bottom: max(20px, env(safe-area-inset-bottom));
    right: max(20px, env(safe-area-inset-right));
  }

  .scroll-to-top svg {
    width: 52px;
    height: 52px;
  }
}
