/* MemeTape Tools Replica Bridge Styles */
.top-bar-trend,
.footer-badge {
  display: none !important;
}

/* 0ms anti-flash: never paint original videosi SVG logos in header or footer */
header a.logo svg,
header a.brand svg,
footer a.logo svg,
footer a.brand svg,
.footer-mark svg {
  display: none !important;
}

.footer-mark {
  display: flex !important;
  justify-content: center;
  align-items: center;
  padding: 24px var(--gutter, 20px) 48px !important;
}

.footer-mark::before {
  content: "";
  display: block;
  width: min(360px, 72vw);
  height: clamp(32px, 6vw, 60px);
  background: url("/brand/wordmark.svg") center / contain no-repeat;
  opacity: 0.14;
}

header .logo[data-mt-branded="1"],
header .brand[data-mt-branded="1"] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

header .logo[data-mt-branded="1"] .mt-logo-mark,
header .brand[data-mt-branded="1"] .mt-logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: block;
}

header .logo[data-mt-branded="1"] .mt-logo-word,
header .brand[data-mt-branded="1"] .mt-logo-word {
  height: 18px;
  width: auto;
  display: block;
}

/* MemeTape 2-Step Purchase & Winback Modal */
.mt-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 10, 14, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.mt-modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: #141418;
  color: #f7f6f2;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  padding: 26px 24px 22px;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.55);
  font-family: inherit;
}

.mt-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #f7f6f2;
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.mt-modal-close:hover {
  background: rgba(255, 255, 255, 0.14);
}

.mt-modal-kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ff6b2c;
  background: rgba(255, 107, 44, 0.14);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.mt-modal-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 8px;
  color: #ffffff;
}

.mt-modal-sub {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(247, 246, 242, 0.74);
  margin: 0 0 18px;
}

.mt-offer-hero {
  border: 1.5px solid #ff6b2c;
  background: rgba(255, 107, 44, 0.08);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
}

.mt-offer-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.mt-offer-name {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.mt-offer-price {
  font-size: 24px;
  font-weight: 800;
  color: #ff6b2c;
}

.mt-offer-price s {
  font-size: 14px;
  font-weight: 500;
  color: rgba(247, 246, 242, 0.45);
  margin-right: 6px;
}

.mt-offer-hint {
  font-size: 12.5px;
  color: rgba(247, 246, 242, 0.72);
  margin: 8px 0 0;
  line-height: 1.45;
}

.mt-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  max-height: 270px;
  overflow-y: auto;
}

.mt-option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: #f7f6f2;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.mt-option-item[aria-checked="true"] {
  border-color: #ff6b2c;
  background: rgba(255, 107, 44, 0.11);
}

.mt-option-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mt-option-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mt-option-badge {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: #ff6b2c;
  color: #ffffff;
}

.mt-option-meta {
  font-size: 12px;
  color: rgba(247, 246, 242, 0.65);
}

.mt-option-right {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

.mt-modal-cta {
  width: 100%;
  padding: 13px 18px;
  border-radius: 999px;
  border: none;
  background: #ff6b2c;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.mt-modal-cta:hover {
  opacity: 0.94;
}

.mt-modal-cta:disabled {
  opacity: 0.55;
  cursor: wait;
}

.mt-modal-foot {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(247, 246, 242, 0.55);
}

.mt-modal-link {
  background: none;
  border: none;
  color: rgba(247, 246, 242, 0.82);
  text-decoration: underline;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

/* Mobile bottom navigation bar (matches main MemeTape BottomNav, hidden on desktop) */
.mt-tools-bottom-nav {
  display: none;
}

.mt-tools-mobile-subbar {
  display: none;
}

@media (max-width: 768px) {
  html,
  body {
    overflow-x: clip !important;
    max-width: 100vw !important;
  }

  body {
    padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Clean mobile header: keep Logo + User/Credits pill spacious, hide cramped desktop nav links */
  header.nav {
    position: sticky !important;
    top: 0;
    z-index: 40;
  }

  header.nav .nav-in {
    height: 56px !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  header.nav .nav-links {
    display: none !important;
  }

  header.nav a.logo {
    margin-right: 0 !important;
  }

  header a.logo[data-mt-branded="1"] .mt-logo-mark,
  header a.logo:not([data-mt-branded="1"])::before {
    width: 26px !important;
    height: 26px !important;
  }

  header a.logo[data-mt-branded="1"] .mt-logo-word,
  header a.logo:not([data-mt-branded="1"])::after {
    height: 16px !important;
    width: 95px !important;
  }

  /* Compact sub-bar on individual /tools/<slug> pages for quick switch back to All Tools */
  .mt-tools-mobile-subbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 14px;
    background: #f6f5f2;
    border-bottom: 1px solid rgba(17, 17, 17, 0.08);
    font-size: 13px;
    font-weight: 600;
  }

  .mt-tools-mobile-subbar a {
    color: #141414;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 32px;
  }

  .mt-tools-mobile-subbar a.mt-subbar-effects {
    color: #ff5a36;
  }

  /* Prevent iOS Safari auto-zoom on form focus & improve tap targets */
  main input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  main textarea,
  main select {
    font-size: 16px !important;
  }

  main button,
  main .btn,
  main a.btn {
    min-height: 44px;
    touch-action: manipulation;
  }

  /* Ensure footer & watermark fit neatly above bottom tab bar */
  .footer-mark {
    padding: 16px 16px 24px !important;
  }

  .mt-modal-card {
    max-height: 90dvh;
    overflow-y: auto;
    padding: 20px 18px 18px;
    border-radius: 18px;
  }

  /* MemeTape 5-tab mobile bottom navigation */
  .mt-tools-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9000;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding: 0 4px env(safe-area-inset-bottom, 0px);
    background: #111111;
    color: rgba(255, 255, 255, 0.65);
    transform: translate3d(0, 0, 0);
    will-change: transform;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.16);
  }

  .mt-tools-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    padding-bottom: 9px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .mt-tools-bottom-nav a.is-active {
    color: #ffd23f;
  }

  .mt-tools-bottom-nav a svg {
    width: 22px;
    height: 22px;
    display: block;
  }

  .mt-tools-bottom-nav a.is-make {
    color: #ffffff;
  }

  .mt-tools-bottom-nav a.is-make .mt-make-pill {
    margin-top: -14px;
    width: 56px;
    height: 40px;
    border-radius: 14px;
    background: #ff5a36;
    color: #ffffff;
    display: grid;
    place-items: center;
    box-shadow: 0 0 0 3px #ffffff;
  }
}
