/**
 * footer block styles
 */

@layer mm-block {
  .mm-x-footer {
    background: #0a0a0a;
    color: #d4d8df;
    padding: 64px 0 0;
  }

  /* Brand logo plate — the source logo is dark/blue on transparent, so it needs
     a light backing to read on the near-black footer. */
  .mm-x-footer-logo {
    display: inline-block;
    line-height: 0;
  }

  .mm-x-footer-logo img {
    display: block;
    width: auto;
    max-width: 200px;
    height: auto;
    filter: brightness(100);
  }

  .mm-x-footer-contact a {
    color: inherit;
    text-decoration: none;
  }

  .mm-x-footer-contact a:hover {
    color: var(--mmx-orange);
  }

  .mm-x-footer-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr 1fr 1.2fr;
    gap: 34px;
  }

  .mm-x-footer h3 {
    color: #fff;
    margin: 0 0 16px;
    font-size: 18px;
  }

  .mm-x-footer p, .mm-x-footer li {
    color: #b6bcc6;
    font-size: 14px;
  }

  .mm-x-footer ul {
    padding: 0;
    margin: 0;
    list-style: none;
    display: grid;
    gap: 8px;
  }

  .mm-x-footer input {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid #363a40;
    border-radius: 4px;
    background: #151719;
    color: #fff;
    margin: 12px 0 10px;
  }

  .mm-x-legal {
    margin-top: 48px;
    padding: 18px 0;
    border-top: 1px solid #25282d;
    color: #9da4af;
    font-size: 13px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 14px;
  }

  .mm-x-legal nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
  }

  .mm-x-social-links {
    display: flex;
    gap: 10px;
    margin-top: 18px;
  }

  .mm-x-social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid #30343a;
    border-radius: 50%;
    background: #151719;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    transition: .2s ease;
  }

  .mm-x-social-btn:hover {
    background: var(--mmx-orange);
    border-color: var(--mmx-orange);
  }

  .mm-x-social-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
  }
}

@layer mm-responsive {
  /* ── Responsive ───────────────────────────────────────────────────── */
  @media (max-width: 980px) {
    .mm-x-footer-grid {
      grid-template-columns: 1fr 1fr;
      gap: 26px 18px;
    }
    .mm-x-footer-grid > :first-child,
    .mm-x-footer-grid > :last-child {
      grid-column: 1 / -1;
    }
    .mm-x-footer {
      padding: 48px 0 0;
    }
    .mm-x-legal {
      flex-direction: column;
      text-align: center;
      gap: 10px;
    }
    .mm-x-legal nav {
      justify-content: center;
    }
    /* subtle dividers between stacked full-width blocks */
    .mm-x-footer-grid > :first-child {
      padding-bottom: 24px;
      border-bottom: 1px solid #1e2026;
    }
    .mm-x-footer-grid > :last-child {
      padding-top: 24px;
      border-top: 1px solid #1e2026;
    }
  }
}

@layer mm-responsive {
  @media (max-width: 640px) {
    .mm-x-footer-grid {
      grid-template-columns: 1fr 1fr;
      gap: 18px 14px;
    }
    .mm-x-footer-grid > :first-child,
    .mm-x-footer-grid > :last-child {
      grid-column: 1 / -1;
    }
    .mm-x-footer {
      padding: 36px 0 0;
    }
    /* brand section: center consistently */
    .mm-x-footer-grid > :first-child {
      text-align: center;
      padding-bottom: 18px;
      border-bottom: 1px solid #1e2026;
    }
    .mm-x-footer-grid > :last-child {
      padding-top: 18px;
      border-top: 1px solid #1e2026;
    }
    .mm-x-footer h3 {
      margin: 0 0 7px;
      font-size: 15px;
    }
    .mm-x-footer p,
    .mm-x-footer li {
      font-size: 13px;
    }
    .mm-x-footer ul {
      gap: 6px;
    }
    .mm-x-social-links {
      justify-content: center;
      margin-top: 10px;
    }
    .mm-x-footer-logo {
      display: block;
    }
    .mm-x-footer-logo img {
      margin: 0 auto;
      max-width: 150px;
    }
    /* Contact Us button: full-width centered on mobile */
    .mm-x-footer-grid > :last-child .mm-x-btn {
      width: 100%;
      margin-top: 14px;
    }
    .mm-x-legal {
      margin-top: 28px;
      padding: 14px 0;
    }
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Fixed side-contact widget — global chrome
   Desktop: fixed right sidebar   Mobile: right floating FABs
   ═══════════════════════════════════════════════════════════════════════════ */

@layer mm-block {
  .mm-x-side-contact {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 998;
    pointer-events: none;
  }

  .mm-x-side-contact-inner {
    border: 1px solid #e2e6eb;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(15, 23, 42, .12);
    border-right: none;
    border-radius: 20px 0 0 20px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    pointer-events: auto;
    overflow: hidden;
    transition: padding .25s ease, border-radius .25s ease;
  }

  /* ── Panel-wide hover: expand all items together ── */
  .mm-x-side-contact-inner:hover {
    padding: 12px 14px;
  }

  .mm-x-side-contact-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: default;
    padding: 0;
    margin-bottom: 8px;
    align-self: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--mmx-orange, #f47b20);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
  }

  .mm-x-side-contact-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
  }

  .mm-x-side-contact-list li {
    margin: 0;
    padding: 0;
  }

  .mm-x-side-contact-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 38px;
    width: 38px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid transparent;
    color: var(--mmx-ink);
    transition: width .25s ease, padding .25s ease, background .2s ease, color .2s ease, border-color .2s ease, border-radius .2s ease, transform .2s ease;
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
  }

  .mm-x-side-contact-item svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    color: var(--mmx-orange);
    flex-shrink: 0;
    margin-left: 10px;
    transition: margin .25s ease;
  }

  .mm-x-side-contact-text {
    display: block;
    font-size: 12px;
    line-height: 1;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity .25s ease, transform .25s ease;
    margin-left: 0;
    pointer-events: none;
  }

  /* ── Panel hover → expand every item in sync ── */
  .mm-x-side-contact-inner:hover .mm-x-side-contact-item {
    width: 200px;
    padding-right: 14px;
    border-radius: 8px;
  }

  .mm-x-side-contact-inner:hover .mm-x-side-contact-item svg {
    margin-left: 12px;
  }

  .mm-x-side-contact-inner:hover .mm-x-side-contact-text {
    opacity: 1;
    transform: translateX(0);
    margin-left: 8px;
  }

  /* Per-item hover highlight */
  .mm-x-side-contact-inner:hover .mm-x-side-contact-item:hover {
    border-color: var(--mmx-orange, #f47b20);
    border-radius: 10px;
    transform: scale(1.05);
  }

  .mm-x-side-contact-item:active {
    transform: scale(.96);
  }
}

@layer mm-responsive {
  /* ── Tablet: keep the panel but slightly more compact ── */
  @media (max-width: 980px) {
    .mm-x-side-contact-inner {
      padding: 8px 6px;
      border-radius: 8px 0 0 8px;
    }
    .mm-x-side-contact-inner:hover {
      padding: 8px 10px;
    }
    .mm-x-side-contact-item {
      width: 34px;
      height: 34px;
      border-radius: 6px;
    }
    .mm-x-side-contact-item svg {
      width: 16px;
      height: 16px;
      margin-left: 9px;
    }
    .mm-x-side-contact-inner:hover .mm-x-side-contact-item {
      width: 200px;
    }
    .mm-x-side-contact-inner:hover .mm-x-side-contact-item svg {
      margin-left: 10px;
    }
    .mm-x-side-contact-toggle {
      font-size: 9px;
    }
    .mm-x-side-contact-text {
      font-size: 11px;
    }
  }

  /* ── Mobile: single toggle button → tap to expand contact list ── */
  @media (max-width: 768px) {
    .mm-x-side-contact {
      position: fixed;
      right: 12px;
      bottom: 20px;
      top: auto;
      left: auto;
      transform: none;
      z-index: 998;
    }

    .mm-x-side-contact-inner {
      flex-direction: column;
      align-items: center;
      gap: 0;
      padding: 6px;
      border-radius: 28px;
      border: 1px solid #e2e6eb;
      background: rgba(255, 255, 255, .92);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      box-shadow: 0 4px 20px rgba(15, 23, 42, .12);
      overflow: visible;
      transition: border-radius .25s ease, padding .25s ease, box-shadow .25s ease;
    }

    /* ── Toggle button (collapsed default) ── */
    .mm-x-side-contact-toggle {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 50px;
      height: 50px;
      border-radius: 50%;
      border: none;
      background: var(--mmx-orange, #f47b20);
      color: #fff;
      cursor: pointer;
      padding: 0;
      box-shadow: 0 4px 16px rgba(244, 123, 32, .35);
      transition: width .25s ease, border-radius .25s ease, background .2s ease;
      flex-shrink: 0;
    }

    .mm-x-side-contact-toggle:active {
      transform: scale(.94);
    }

    .mm-x-side-contact-toggle-icon {
      width: 22px;
      height: 22px;
      fill: currentColor;
      flex-shrink: 0;
    }



    /* ── Panel: hidden by default ── */
    .mm-x-side-contact-list {
      flex-direction: column;
      gap: 0;
      width: auto;
      max-height: 0;
      opacity: 0;
      overflow: hidden;
      transition: max-height .3s ease, opacity .25s ease, gap .25s ease, margin .25s ease;
      margin-top: 0;
    }

    .mm-x-side-contact-item {
      width: 44px;
      height: 44px;
      border-radius: 50%;
      justify-content: center;
      background: #f5f7fa;
      box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
      transition: width .25s ease, border-radius .25s ease, background .2s ease, color .2s ease;
    }

    .mm-x-side-contact-item svg {
      width: 20px;
      height: 20px;
      margin-left: 0;
    }

    .mm-x-side-contact-text {
      font-size: 12px;
      opacity: 0;
      display: block;
      transition: opacity .25s ease;
    }

    /* ── Open state ── */
    .mm-x-side-contact--open .mm-x-side-contact-inner {
      padding: 9px;
      border-radius: 24px;
      box-shadow: 0 8px 32px rgba(15, 23, 42, .16);
    }


    .mm-x-side-contact--open .mm-x-side-contact-toggle-icon {
      width: 18px;
      height: 18px;
    }

    .mm-x-side-contact--open .mm-x-side-contact-list {
      max-height: 200px;
      opacity: 1;
      gap: 8px;
      margin-top: 4px;
    }

    .mm-x-side-contact--open .mm-x-side-contact-item {
      width: 200px;
      border-radius: 22px;
      justify-content: flex-start;
      padding-left: 14px;
    }

    .mm-x-side-contact--open .mm-x-side-contact-item svg {
      margin-left: 0;
    }

    .mm-x-side-contact--open .mm-x-side-contact-text {
      opacity: 1;
      margin-left: 10px;
    }

    .mm-x-side-contact--open .mm-x-side-contact-item:hover,
    .mm-x-side-contact--open .mm-x-side-contact-item:active {
      background: var(--mmx-orange, #f47b20);
      color: #fff;
    }

    /* Overlay backdrop when open (JS adds) */
    .mm-x-side-contact-overlay {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 997;
      background: transparent;
    }

    .mm-x-side-contact--open ~ .mm-x-side-contact-overlay,
    .mm-x-side-contact--open + .mm-x-side-contact-overlay {
      display: block;
    }

    .mm-x-footer {
      padding-bottom: 80px;
    }
  }

  /* ── Very small screens: tighter toggle ── */
  @media (max-width: 380px) {
    .mm-x-side-contact {
      right: 8px;
      bottom: 12px;
    }
    .mm-x-side-contact-toggle {
      width: 44px;
      height: 44px;
    }
    .mm-x-side-contact-toggle-icon {
      width: 20px;
      height: 20px;
    }
    .mm-x-side-contact--open .mm-x-side-contact-item {
      width: 140px;
      border-radius: 20px;
    }
    .mm-x-footer {
      padding-bottom: 68px;
    }
  }
}
