/*
  mobile.css – phone layout pass (Oct 2026). Loaded on every page after custom.css.
  Everything visible is inside @media (max-width: 767px), so tablets/desktop keep the Adobe look.
  Pairs with js/mobile-nav.js (phone header bar + menu).
  Colors: navy #102e63 / #013b85, light blue #209dce (logo "PROS LLC"), cyan #22d7eb.
*/

/* Hidden everywhere except phones */
.spm-bar, .spm-menu { display: none; }

@media (max-width: 767px) {
  :root { --spm-h: 64px; --spm-navy: #102e63; --spm-blue: #013b85; --spm-light: #209dce; }

  /* ---------- No sideways scrolling ---------- */
  html, body { overflow-x: hidden; }
  @supports (overflow: clip) { html, body { overflow-x: clip; } }
  img, iframe, video { max-width: 100%; }
  .site-wrap, .site-container, .site-content, .page-container, .page, .page-content { max-width: 100%; box-sizing: border-box; }

  /* ---------- Phone header bar (built by js/mobile-nav.js) ----------
     The old Adobe header (faint logo + menu icon over the photo) is hidden but keeps its space,
     so every page's text stays exactly where it was on its photo. The bar sits over that space. */
  html.spm-ready .site-header { visibility: hidden !important; }
  html.spm-ready .js-responsive-nav, html.spm-ready .hamburger-click-area { display: none !important; }
  /* Pages without an Adobe header (Free Estimate landing page): push the page below the bar */
  html.spm-ready.spm-noheader body { padding-top: var(--spm-h); }
  /* Home: the hero is rebuilt for phones below, so drop the old header space entirely
     and start the photo (the <html> background) just below the bar */
  html.spm-ready.sp-home-html body { padding-top: var(--spm-h); }
  html.spm-ready.sp-home-html { background-position: center var(--spm-h) !important; }
  html.spm-ready.sp-home-html .site-header { display: none !important; }

  .spm-bar {
    display: flex; align-items: center; justify-content: space-between;
    position: fixed; top: 0; left: 0; right: 0; z-index: 100000;
    height: var(--spm-h); padding: 0 12px 0 14px; box-sizing: border-box;
    background: #ffffff; box-shadow: 0 2px 10px rgba(16, 46, 99, 0.18);
    border-bottom: 3px solid var(--spm-light);
    font-family: 'Montserrat', sans-serif;
  }
  .spm-logo { display: flex; align-items: center; height: 100%; min-width: 44px; }
  .spm-logo img { display: block; height: 44px; width: auto; max-width: 150px; }
  .spm-actions { display: flex; align-items: center; gap: 8px; }
  .spm-call, .spm-toggle {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-width: 48px; height: 46px; padding: 0 12px; box-sizing: border-box;
    border-radius: 10px; border: 0; margin: 0;
    font-family: 'Montserrat', sans-serif; font-size: 14px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
    text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: rgba(32, 157, 206, 0.25);
  }
  .spm-call { background: #ffffff; color: var(--spm-blue); border: 2px solid var(--spm-light); }
  .spm-toggle { background: var(--spm-navy); color: #ffffff; }
  .spm-call:focus-visible, .spm-toggle:focus-visible, .spm-menu a:focus-visible { outline: 3px solid #22d7eb; outline-offset: 2px; }
  .spm-toggle-bars { display: inline-flex; flex-direction: column; justify-content: space-between; width: 20px; height: 14px; }
  .spm-toggle-bars i { display: block; height: 2px; border-radius: 2px; background: currentColor; transition: transform .2s, opacity .2s; }
  html.spm-open .spm-toggle-bars i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  html.spm-open .spm-toggle-bars i:nth-child(2) { opacity: 0; }
  html.spm-open .spm-toggle-bars i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  @media (max-width: 359px) { .spm-call-text, .spm-toggle-text { display: none; } }

  /* Full-width menu panel */
  .spm-menu:not([hidden]) {
    display: block; position: fixed; top: var(--spm-h); left: 0; right: 0; bottom: 0; z-index: 99999;
    background: #ffffff; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    padding: 6px 0 28px; box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    animation: spm-in .18s ease-out;
  }
  @keyframes spm-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
  html.spm-open, html.spm-open body { overflow: hidden; }
  .spm-list { list-style: none; margin: 0; padding: 0; }
  .spm-list li { margin: 0; padding: 0; }
  .spm-list a {
    display: flex; align-items: center; min-height: 52px; padding: 6px 22px; box-sizing: border-box;
    color: var(--spm-blue); font-size: 17px; font-weight: 700; text-decoration: none; letter-spacing: 0.01em;
    border-bottom: 1px solid #e6edf5;
  }
  .spm-list a.is-active { color: var(--spm-navy); background: #eef7fc; box-shadow: inset 4px 0 0 var(--spm-light); }
  .spm-list .spm-group {
    padding: 18px 22px 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #6b7a90;
  }
  .spm-cta { display: flex; flex-direction: column; gap: 12px; padding: 22px 18px 0; }
  .spm-cta a {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 54px; padding: 8px 16px; box-sizing: border-box; border-radius: 12px;
    font-size: 17px; font-weight: 800; text-decoration: none; text-align: center;
  }
  .spm-cta-call { background: var(--spm-navy); color: #ffffff; }
  .spm-cta-estimate { background: #ffffff; color: var(--spm-blue); border: 2px solid var(--spm-blue); text-transform: uppercase; letter-spacing: 0.03em; }
  .spm-cta a.spm-cta-email { min-height: 44px; font-size: 15px; font-weight: 600; color: var(--spm-blue); text-decoration: underline; }

  /* Tap-to-call numbers found in page text (js/mobile-nav.js) */
  a.sp-tel-auto { color: inherit; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }

  /* ---------- Rows of side-by-side blocks ("tree" modules): stack them on phones ----------
     Adobe only does this inside .modules; several home sections sit outside it. */
  .site-content .tree .tree-wrapper { display: flex !important; flex-direction: column; align-items: stretch; }
  .site-content .tree .tree-child-wrapper { flex: none !important; width: 100% !important; border-left: 0 !important; border-right: 0 !important; min-width: 0; box-sizing: border-box; }
  .site-content .sp-stack-img-first > .tree-wrapper > .tree-child-wrapper:last-child { order: -1; }

  /* Long words never break mid-word; long things (emails, URLs) may wrap at sensible points */
  .rich-text, .rich-text div, .rich-text span { word-break: normal !important; overflow-wrap: break-word; hyphens: manual; -webkit-hyphens: manual; }

  /* ---------- Buttons: full labels, wrap if needed, 44px+ tall ---------- */
  .project-module-button .button-module {
    white-space: normal !important; overflow-wrap: break-word; max-width: 100%; box-sizing: border-box;
    min-height: 48px; height: auto !important;
  }

  /* ---------- Forms: inputs fit the screen ---------- */
  .project-module-form { width: 100% !important; max-width: 100%; box-sizing: border-box; }
  .project-module-form .contact-form, .project-module-form .form-input { width: 100%; max-width: 100%; box-sizing: border-box; }
  .project-module-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  .project-module-form textarea, .project-module-form select {
    width: 100% !important; max-width: 100%; box-sizing: border-box !important; font-size: 16px !important; min-height: 48px;
  }
  .project-module-form textarea { min-height: 110px; }
  .project-module-form .submit-button {
    display: flex !important; align-items: center; justify-content: center;
    width: 100% !important; min-height: 52px; height: auto !important; line-height: 1.2 !important;
    padding: 14px 16px !important; box-sizing: border-box; white-space: nowrap; overflow: visible !important;
  }
  .project-module-form .submit-button .submit-text { white-space: nowrap; }

  /* ---------- Back to top: comfortable tap target ---------- */
  .back-to-top a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; }


  /* Page titles over the photos: keep them off the screen edges */
  html.spm-ready:not(.sp-home-html) .page-header .title,
  html.spm-ready:not(.sp-home-html) .page-header .description,
  html.spm-ready:not(.sp-home-html) .page-header .custom1,
  html.spm-ready:not(.sp-home-html) .page-header .custom2 {
    box-sizing: border-box; padding-left: 16px !important; padding-right: 16px !important; overflow-wrap: normal;
  }
  /* Custom Products: the thin blue title lines sit on a light photo – a soft white halo makes them readable */
  html.spm-p-custom-products .page-header .description,
  html.spm-p-custom-products .page-header .custom1,
  html.spm-p-custom-products .page-header .custom2,
  html.spm-p-custom-products .page-header .title {
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.95), 0 0 14px rgba(255, 255, 255, 0.8);
  }
}

@media (max-width: 540px) {
  /* 2-across tile grids: an odd last tile sits centered (the grid's hidden spacer is the real last child) */
  .standard-modules .modules .sp-grid-2m .grid__item-container:nth-last-child(2):nth-child(odd) {
    grid-column: 1 / -1; width: calc(50% - 5px) !important; justify-self: center;
  }
}

@media (max-width: 767px) {
  /* Social icon rows inside the page (Free Estimate page): 44px tap targets */
  .project-module-social_icons .social a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
}

/* =========================== HOME PAGE (body.sp-home) =========================== */
/* Footer email/phone links keep the surrounding text look (desktop unchanged) */
a.sp-contact-link, a.sp-contact-link:hover, a.sp-contact-link:focus { color: inherit !important; text-decoration: none !important; border: 0 !important; }

@media (max-width: 767px) {
  /* Hero: headline over the photo, sized to fit; subline under the photo. Photo height = 67.5vw. */
  .sp-home .page-header { padding: 0 !important; max-width: 100%; }
  .sp-home .page-header .description {
    box-sizing: border-box; width: 100% !important; margin: 0;
    font-size: clamp(24px, 8.4vw, 36px) !important; line-height: 1.04 !important;
    min-height: 67.5vw; display: flex; flex-direction: column; justify-content: flex-end;
    padding: 16px 16px 6vw !important; text-align: center !important;
    overflow-wrap: normal; word-break: normal;
    text-shadow: 0 2px 6px rgba(0, 20, 50, 0.65), 0 0 18px rgba(0, 20, 50, 0.45);
  }
  .sp-home .page-header .custom2 {
    box-sizing: border-box; width: 100% !important; margin: 0;
    font-size: clamp(19px, 6.1vw, 27px) !important; line-height: 1.15 !important;
    padding: 20px 16px 4px !important; text-align: center !important; white-space: normal !important;
  }
  /* "GET A FREE ESTIMATE": less empty space around it */
  .sp-home .project-module-button[data-id=m6ab320928c7c4668bebcd8493a5584254b71074fe53bdbf6b4266] { padding: 18px 16px 28px !important; }
  .sp-home .project-module-button[data-id=m6ab320928c7c4668bebcd8493a5584254b71074fe53bdbf6b4266] .button-module {
    font-size: 19px !important; line-height: 1.2 !important; padding: 18px 24px !important; min-height: 60px;
    display: inline-flex; align-items: center; justify-content: center;
  }

  /* Areas-we-serve + map band */
  .sp-home .sp-navy-band--compact .project-module-embed { width: 100% !important; padding: 18px 16px 0 !important; box-sizing: border-box; }

  /* "Refresh your outdated bathroom!" title: tighter spacing */
  .sp-home .sp-refresh-title { padding: 36px 16px 20px !important; }
  .sp-home .sp-refresh-title span[style*="font-size"] { font-size: clamp(26px, 8vw, 34px) !important; line-height: 1.15 !important; }

  /* Service cards: photo on top, label below, full width */
  .sp-home .sp-svc-card {
    margin: 0 16px 22px !important; padding: 0 !important; width: auto !important;
    border: 1px solid rgba(1, 59, 133, 0.35); border-radius: 16px; overflow: hidden; background: #ffffff;
    box-shadow: 0 6px 18px rgba(16, 46, 99, 0.12);
  }
  .sp-home .sp-svc-card > .tree-wrapper > .tree-child-wrapper { padding: 0 !important; }
  .sp-home .sp-svc-card .project-module-image { width: 100% !important; padding: 0 !important; margin: 0 !important; }
  .sp-home .sp-svc-card .project-module-image img { display: block; width: 100% !important; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
  .sp-home .sp-svc-card .project-module-button { padding: 0 !important; margin: 0 !important; width: 100% !important; }
  .sp-home .sp-svc-card .button-container { width: 100%; }
  .sp-home .sp-svc-card .button-module {
    display: flex !important; align-items: center; justify-content: center; width: 100% !important; box-sizing: border-box;
    min-height: 64px; height: auto !important; margin: 0 !important; padding: 16px 18px !important;
    border: 0 !important; border-top: 3px solid var(--spm-light) !important; border-radius: 0 !important;
    font-size: 19px !important; line-height: 1.25 !important; text-align: center; white-space: normal !important;
    background: #ffffff;
  }
  .sp-home .sp-svc-card .button-module::before, .sp-home .sp-svc-card .button-module::after { display: none !important; }
  .sp-home .sp-svc-card .sp-home-gallery { width: 100% !important; padding: 10px 10px 0 !important; box-sizing: border-box; }

  /* Free estimate band: text above the form, full width */
  .sp-home .sp-estimate-band .project-module-text { padding: 0 20px 24px !important; width: 100% !important; box-sizing: border-box; }
  .sp-home .sp-estimate-band .project-module-form { padding: 0 20px !important; }
  .sp-home .sp-estimate-band .form-input { padding-bottom: 14px; }
  .sp-home .sp-estimate-band label { display: block; text-align: left; font-size: 15px; margin-bottom: 6px; }

  /* Footer hours + contact: stacked, full width, centered */
  .sp-home .sp-footer-info .project-module-text { width: 100% !important; float: none !important; padding: 10px 24px 6px !important; box-sizing: border-box; }
  .sp-home .sp-footer-info .rich-text div { text-align: center !important; }
  html .sp-home .sp-footer-info a.sp-contact-link { display: inline-block; min-height: 44px; line-height: 44px; color: var(--spm-blue) !important; text-decoration: underline !important; text-underline-offset: 3px; }

  /* Home: SCHEDULE / FINANCING and AREAS WE SERVE / BLOG – two equal buttons per row */
  .sp-home .sp-btn-pair { padding: 0 16px 12px !important; box-sizing: border-box; }
  .sp-home .sp-btn-pair > .tree-wrapper { flex-direction: row !important; gap: 12px; align-items: stretch !important; }
  .sp-home .sp-btn-pair > .tree-wrapper > .tree-child-wrapper { flex: 1 1 0 !important; width: auto !important; }
  .sp-home .sp-btn-pair .project-module-button { padding: 0 !important; width: 100% !important; height: 100%; }
  .sp-home .sp-btn-pair .button-container { width: 100%; height: 100%; }
  .sp-home .sp-btn-pair .button-module {
    display: flex !important; align-items: center; justify-content: center; width: 100% !important; height: 100% !important;
    min-height: 60px; margin: 0 !important; padding: 10px 8px !important; box-sizing: border-box;
    font-size: clamp(14px, 4.2vw, 17px) !important; line-height: 1.2 !important; text-align: center;
  }
  .sp-home .sp-btn-pair .button-module::before, .sp-home .sp-btn-pair .button-module::after { display: none !important; }
  /* "GET A FREE ESTIMATE" on one line */
  .sp-home .project-module-button[data-id=m6ab320928c7c4668bebcd8493a5584254b71074fe53bdbf6b4266] .button-module {
    white-space: nowrap !important; font-size: clamp(17px, 5.4vw, 22px) !important; padding: 18px 20px !important; width: 100%; max-width: 360px;
  }
  .sp-home .project-module-button[data-id=m6ab320928c7c4668bebcd8493a5584254b71074fe53bdbf6b4266] .button-module::before,
  .sp-home .project-module-button[data-id=m6ab320928c7c4668bebcd8493a5584254b71074fe53bdbf6b4266] .button-module::after { display: none !important; }

  /* Home hero: the old -28px lift is not needed under the phone bar */
  .sp-home .page-header { margin-top: 0 !important; transform: none !important; }
  /* "Why hire" tiles: full width, the third tile centered under the first two */
  .sp-home .sp-why-tiles { width: 100% !important; padding-left: 16px !important; padding-right: 16px !important; box-sizing: border-box; }
  .sp-home .sp-why-tiles .grid--main { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .sp-home .sp-why-tiles .grid__item-container:nth-child(3) { grid-column: 1 / -1; width: calc(50% - 6px) !important; justify-self: center; }
  .sp-home .sp-help-tiles { padding-left: 16px !important; padding-right: 16px !important; box-sizing: border-box; }
}
