/* DZD Sooq — Global Site Footer
 * Source of truth: docs/previews/footer/style.css (APPROVED Visual Lock)
 * Desktop ≥1200 · Tablet 768–1199 · Mobile ≤767 hidden
 */

/*
 * Sticky footer layout (global).
 * Prefers the existing Theme shell `.dzd-theme-wrapper`.
 * Falls back to body flex when Theme does not own chrome (legacy Listivo path).
 * Modals must stay position:fixed / <dialog> top-layer — never in document flow.
 */
html {
  height: 100%;
}

body.dzd-sooq-has-global-footer {
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  /* Match the page canvas so nothing white peeks under the flex shell/footer. */
  background: var(--dzd-color-page, #eef0f5);
}

html:has(body.dzd-sooq-has-global-footer) {
  background: var(--dzd-color-page, #eef0f5);
}

body.dzd-sooq-has-global-footer .dzd-theme-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

body.admin-bar.dzd-sooq-has-global-footer .dzd-theme-wrapper {
  min-height: calc(100vh - 32px);
  min-height: calc(100dvh - 32px);
}

@media screen and (max-width: 782px) {
  body.admin-bar.dzd-sooq-has-global-footer .dzd-theme-wrapper {
    min-height: calc(100vh - 46px);
    min-height: calc(100dvh - 46px);
  }
}

body.dzd-sooq-has-global-footer .dzd-theme-wrapper > .dzd-theme-slot-host[data-dzd-slot="header.root"],
body.dzd-sooq-has-global-footer .dzd-theme-wrapper > .dzd-site-header {
  flex-shrink: 0;
}

body.dzd-sooq-has-global-footer .dzd-theme-wrapper > .dzd-theme-main,
body.dzd-sooq-has-global-footer .dzd-theme-wrapper > .dzd-panel-page,
body.dzd-sooq-has-global-footer .dzd-theme-wrapper > main,
body.dzd-sooq-has-global-footer .dzd-theme-wrapper > #dzd-sooq-content {
  flex: 1 0 auto;
  width: 100%;
  min-width: 0;
  /* Grow into remaining viewport so the footer sits at the bottom on short pages. */
  margin-top: 0;
}

body.dzd-sooq-has-global-footer .dzd-theme-wrapper > .dzd-theme-slot-host[data-dzd-slot="footer.root"],
body.dzd-sooq-has-global-footer .dzd-theme-wrapper > .dzd-site-footer {
  flex-shrink: 0;
  width: 100%;
  margin-top: auto;
  margin-bottom: 0;
}

/* Legacy path: footer mounts via wp_footer as a direct body child. */
body.dzd-sooq-has-global-footer:not(.dzd-theme-owns-chrome) {
  display: flex;
  flex-direction: column;
}

body.dzd-sooq-has-global-footer:not(.dzd-theme-owns-chrome) > .dzd-site-footer {
  flex-shrink: 0;
  margin-top: auto;
  width: 100%;
}

.dzd-site-footer {
  width: 100%;
  position: relative;
  z-index: 20;
  flex-shrink: 0;
}

.dzd-footer {
  --ftr-bg: #1e1f24;
  --ftr-title: #ffffff;
  --ftr-secondary: #b8bdc8;
  --ftr-link: #ffffff;
  --ftr-link-hover: #5e43d6;
  --ftr-divider: rgba(255, 255, 255, 0.08);
  --ftr-accent: #5e43d6;
  --ftr-social-bg: rgba(255, 255, 255, 0.04);
  --ftr-font: Inter, "SF Pro Display", "Segoe UI", system-ui, sans-serif;

  background: var(--ftr-bg);
  color: var(--ftr-secondary);
  font-family: var(--ftr-font);
}

.dzd-footer a {
  color: inherit;
  text-decoration: none;
  transition: color 160ms ease;
}

.dzd-footer a:hover,
.dzd-footer a:focus-visible {
  color: var(--ftr-link-hover);
  outline: none;
}

.dzd-footer__inner {
  width: 100%;
  max-width: var(--dzd-layout-max, 1310px);
  margin: 0 auto;
  padding: 56px 48px 0;
}

@media (min-width: 768px) {
  .dzd-footer__inner {
    padding-left: var(--dzd-layout-gutter, 24px);
    padding-right: var(--dzd-layout-gutter, 24px);
  }
}

.dzd-footer__grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.05fr) minmax(200px, 1.35fr) minmax(140px, 0.85fr) minmax(160px, 0.95fr);
  column-gap: 48px;
  align-items: start;
  padding-bottom: 48px;
}

/* Brand */
.dzd-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.dzd-footer__logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  width: fit-content;
  line-height: 0;
}

.dzd-footer__logo:hover,
.dzd-footer__logo:focus-visible {
  filter: brightness(1.09);
  outline: none;
}

.dzd-footer__logo-img {
  display: block;
  width: auto;
  height: 44px;
  max-width: 176px;
  object-fit: contain;
  object-position: left center;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* Social */
.dzd-footer__social {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dzd-footer__social a {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #2a2b31;
  color: #d7dbe3;
  border: 0;
  transition: color 180ms ease;
}

.dzd-footer__social a:hover,
.dzd-footer__social a:focus-visible {
  color: #5e43d6;
  background: #2a2b31;
  border: 0;
  outline: none;
}

.dzd-footer__social svg {
  display: block;
  width: 18px;
  height: 18px;
}

/* Social tooltips — below icon */
.dzd-footer__social a::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  z-index: 5;
  padding: 5px 9px;
  border-radius: 8px;
  background: #1e1f24;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(7px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.dzd-footer__social a:hover::after,
.dzd-footer__social a:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .dzd-footer__social a,
  .dzd-footer__social a::after {
    transition: none;
  }
}

/* Tagline */
.dzd-footer__tagline {
  margin: 6px 0 0;
  max-width: 34ch;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--ftr-secondary);
}

/* Help */
.dzd-footer__heading {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ftr-title);
}

.dzd-footer__links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dzd-footer__links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ftr-secondary);
  line-height: 1.35;
}

.dzd-footer__links a:hover,
.dzd-footer__links a:focus-visible {
  color: var(--ftr-link-hover);
}

.dzd-footer__links--cols {
  display: none;
}

/* Download — Desktop only */
.dzd-footer__download {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}

.dzd-footer__stores {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dzd-footer__store {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 148px;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1.5px solid #000;
  background: #fff;
  color: #000;
  text-decoration: none;
  transform: scale(1);
  transform-origin: center center;
  transition: transform 180ms ease;
  will-change: transform;
}

.dzd-footer__store:hover,
.dzd-footer__store:focus-visible {
  color: #000;
  background: #fff;
  border-color: #000;
  transform: scale(1.05);
  outline: none;
  filter: none;
}

.dzd-footer__store:active {
  transform: scale(1.02);
}

.dzd-footer__store-icon {
  flex-shrink: 0;
  width: 22px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #000;
}

.dzd-footer__store-logo {
  display: block;
  width: 20px;
  height: 22px;
  object-fit: contain;
  object-position: center;
}

.dzd-footer__store-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.05;
  color: #000;
}

.dzd-footer__store-kicker {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #000;
  opacity: 1;
}

.dzd-footer__store-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #000;
}

/* Bottom bar */
.dzd-footer__bottom {
  border-top: 1px solid var(--ftr-divider);
  padding: 18px 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  flex-wrap: nowrap;
}

.dzd-footer__copy {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--ftr-secondary);
}

.dzd-footer__legal {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.dzd-footer__legal a {
  font-size: 13px;
  font-weight: 500;
  color: var(--ftr-secondary);
}

.dzd-footer__legal a:hover,
.dzd-footer__legal a:focus-visible {
  color: var(--ftr-link-hover);
}

@media (min-width: 1200px) {
  .dzd-footer__links--desktop {
    display: flex;
  }

  .dzd-footer__links--cols {
    display: none !important;
  }
}

/* —— Tablet Visual Lock —— */
@media (min-width: 768px) and (max-width: 1199px) {
  .dzd-footer__inner {
    padding: 36px 28px 0;
  }

  .dzd-footer__grid {
    grid-template-columns: minmax(160px, 0.9fr) minmax(200px, 1.4fr) minmax(200px, 1fr);
    column-gap: 28px;
    padding-bottom: 28px;
  }

  .dzd-footer__brand {
    gap: 14px;
  }

  .dzd-footer__logo-img {
    height: 38px;
    max-width: 152px;
  }

  .dzd-footer__social {
    gap: 8px;
  }

  .dzd-footer__social a {
    width: 34px;
    height: 34px;
  }

  .dzd-footer__social svg {
    width: 15px;
    height: 15px;
  }

  .dzd-footer__tagline {
    margin-top: 2px;
    font-size: 13.5px;
    max-width: 32ch;
  }

  .dzd-footer__heading {
    margin-bottom: 12px;
    font-size: 14px;
  }

  .dzd-footer__links--desktop {
    display: none !important;
  }

  .dzd-footer__links--cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 28px;
    row-gap: 0;
  }

  .dzd-footer__links-col {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 9px;
  }

  .dzd-footer__links-col a {
    font-size: 13px;
    font-weight: 500;
    color: var(--ftr-secondary);
    line-height: 1.35;
    text-decoration: none;
  }

  .dzd-footer__links-col a:hover,
  .dzd-footer__links-col a:focus-visible {
    color: var(--ftr-link-hover);
  }

  .dzd-footer__download,
  .dzd-footer__stores {
    display: none !important;
  }

  .dzd-footer__bottom {
    padding: 14px 0 16px;
    gap: 10px 16px;
    flex-wrap: wrap;
  }

  .dzd-footer__copy,
  .dzd-footer__legal a {
    font-size: 12px;
  }

  .dzd-footer__legal {
    gap: 6px 16px;
  }
}

/*
 * Mobile: no global website footer.
 * Bottom Navigation is separate chrome and must remain.
 * display:none collapses all footer space (no white strip / empty shell).
 */
@media (max-width: 767px) {
  .dzd-site-footer,
  .dzd-footer,
  .dzd-theme-wrapper > .dzd-theme-slot-host[data-dzd-slot="footer.root"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    min-height: 0 !important;
    flex: 0 0 0 !important;
  }
}

/* Kill leftover Listivo / Elementor footer chrome */
body.dzd-sooq-has-global-footer .listivo-footer,
body.dzd-sooq-has-global-footer .elementor-widget-lst_footer_listing_list,
body.dzd-sooq-has-global-footer [data-widget_type^="lst_footer"],
body.dzd-sooq-has-global-footer [data-widget_type*="footer_listing"] {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}
