/* Mobile brief layout: max-width 767px only. Desktop and 768px+ are unchanged. */

.header-wa,
.footer-text-links,
.home-call-mobile {
  display: none;
}

@media (max-width: 767px) {
  .header-wa {
    display: inline-flex;
    align-items: center;
  }
  .header-talk {
    display: none;
  }
  .footer-text-links {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .9rem;
    width: 100%;
    margin-top: .55rem;
    font-size: .86rem;
  }
  .footer-text-links a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  /* Mobile menu: Home, Services, EcoCertex, About, Contact. Articles stay in the footer row. */
  .primary-menu {
    display: flex;
    flex-direction: column;
    width: 100%;
  }
  .primary-menu > li {
    order: 10;
  }
  .primary-menu > li.cx-nav-home { order: 1; }
  .primary-menu > li.cx-nav-services { order: 2; }
  .primary-menu > li.cx-nav-eco { order: 3; }
  .primary-menu > li.cx-nav-about { order: 4; }
  .primary-menu > li.cx-nav-contact { order: 5; }
  .primary-menu > li.cx-nav-articles {
    display: none !important;
  }

  .section {
    padding-top: 1.6rem;
    padding-bottom: 1.6rem;
  }

  /* -------- Homepage sections -------- */
  body.home #intro p:not(.kicker):not(.lead),
  body.front-page #intro p:not(.kicker):not(.lead) {
    display: none;
  }
  body.home #intro .lead,
  body.front-page #intro .lead {
    margin-bottom: 0;
  }

  body.home #ecocertex .eco-net-visual,
  body.home #ecocertex .eco-orbit,
  body.home #ecocertex .eco-home-copy p:not(.kicker):not(.lead),
  body.front-page #ecocertex .eco-net-visual,
  body.front-page #ecocertex .eco-orbit,
  body.front-page #ecocertex .eco-home-copy p:not(.kicker):not(.lead) {
    display: none !important;
  }
  body.home #ecocertex .eco-home,
  body.front-page #ecocertex .eco-home {
    display: block;
  }
  body.home #ecocertex .eco-home-copy,
  body.front-page #ecocertex .eco-home-copy {
    background: #fff;
    border-radius: 16px;
    padding: 1rem 1.1rem 1.15rem;
    border: 1px solid rgba(93, 206, 138, .28);
    box-shadow: 0 10px 24px rgba(1, 43, 54, .06);
  }
  body.home #ecocertex .eco-home-copy::before,
  body.front-page #ecocertex .eco-home-copy::before {
    content: "";
    display: block;
    width: 168px;
    height: 38px;
    margin: 0 0 .7rem;
    background: url("../images/ecocertex-logo-mark.png") left center / contain no-repeat;
  }
  body.home #ecocertex .eco-home-copy h2,
  body.front-page #ecocertex .eco-home-copy h2 {
    font-size: 1.15rem;
    margin: 0 0 .45rem;
  }
  body.home #ecocertex .cta-row .btn-navy,
  body.front-page #ecocertex .cta-row .btn-navy {
    display: none;
  }
  body.home #ecocertex .cta-row,
  body.front-page #ecocertex .cta-row {
    margin-top: .8rem !important;
  }

  body.home #standards h2,
  body.front-page #standards h2 {
    font-size: 1.2rem;
    margin-bottom: .8rem;
  }
  body.home #standards .std-grid,
  body.front-page #standards .std-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
  }
  body.home #standards .std-card,
  body.front-page #standards .std-card {
    display: inline-flex;
    align-items: center;
    padding: .38rem .7rem;
    border-radius: 99px;
    margin: 0;
    box-shadow: none;
    background: #fff;
    border: 1px solid #e4eef3;
  }
  body.home #standards .std-card h3,
  body.front-page #standards .std-card h3 {
    margin: 0;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.2;
  }
  body.home #standards .std-card p,
  body.front-page #standards .std-card p {
    display: none;
  }

  body.home #services-teaser .lead,
  body.front-page #services-teaser .lead {
    display: none;
  }
  body.home #services-teaser h2,
  body.front-page #services-teaser h2 {
    font-size: 1.2rem;
    margin-bottom: .8rem;
  }
  body.home #services-teaser .svc-grid,
  body.front-page #services-teaser .svc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .55rem;
  }
  body.home #services-teaser .svc-card,
  body.front-page #services-teaser .svc-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .45rem;
    padding: .7rem .7rem .75rem;
    margin: 0;
    box-shadow: none;
    border: 1px solid #e4eef3;
    border-radius: 14px;
    min-height: 0;
  }
  body.home #services-teaser .svc-card::before,
  body.front-page #services-teaser .svc-card::before {
    content: "";
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--cx-navy, #012B36);
    box-shadow: inset 0 0 0 2px rgba(20, 171, 244, .85);
    flex: 0 0 auto;
  }
  body.home #services-teaser .svc-card h3,
  body.front-page #services-teaser .svc-card h3 {
    margin: 0;
    font-size: .86rem;
    line-height: 1.3;
  }
  body.home #services-teaser .svc-card p,
  body.front-page #services-teaser .svc-card p {
    display: none;
  }
  body.home #services-teaser .cta-row,
  body.front-page #services-teaser .cta-row {
    margin-top: .9rem !important;
  }

  body.home #process h2,
  body.front-page #process h2 {
    font-size: 1.2rem;
    margin-bottom: .7rem;
  }
  body.home #process .process,
  body.front-page #process .process {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  body.home #process .step,
  body.front-page #process .step {
    display: grid;
    grid-template-columns: 1.7rem 1fr;
    align-items: center;
    gap: .15rem .65rem;
    padding: .45rem 0;
    margin: 0;
    box-shadow: none;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(1, 43, 54, .1);
    transform: none !important;
    border-radius: 0;
  }
  body.home #process .step:last-child,
  body.front-page #process .step:last-child {
    border-bottom: 0;
  }
  body.home #process .step-num,
  body.front-page #process .step-num {
    margin: 0;
  }
  body.home #process .step h3,
  body.front-page #process .step h3 {
    margin: 0;
    font-size: .95rem;
  }
  body.home #process .step p,
  body.front-page #process .step p {
    display: none;
  }

  body.home #figures h2,
  body.front-page #figures h2 {
    font-size: 1.2rem;
    margin-bottom: .8rem;
  }
  body.home #figures .lead,
  body.home #figures .wrap > p:not(.kicker):not(.lead),
  body.front-page #figures .lead,
  body.front-page #figures .wrap > p:not(.kicker):not(.lead) {
    display: none;
  }
  body.home #figures .trust-grid,
  body.front-page #figures .trust-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .35rem;
  }
  body.home #figures .trust-stat,
  body.front-page #figures .trust-stat {
    padding: .45rem .15rem;
    text-align: center;
  }
  body.home #figures .trust-stat strong,
  body.front-page #figures .trust-stat strong {
    font-size: 1.05rem;
    display: block;
  }
  body.home #figures .trust-stat span,
  body.front-page #figures .trust-stat span {
    font-size: .62rem;
    line-height: 1.25;
  }

  body.home #book-assessment .book-box,
  body.front-page #book-assessment .book-box {
    padding: 1rem 1.1rem;
    gap: .8rem;
  }
  body.home #book-assessment h2,
  body.front-page #book-assessment h2 {
    font-size: 1.15rem;
    margin-bottom: .4rem;
  }

  body.home #home-cta h2,
  body.front-page #home-cta h2 {
    font-size: 1.25rem;
  }
  body.home #home-cta .lead,
  body.front-page #home-cta .lead {
    margin-bottom: .2rem;
  }
  body.home #home-cta .cta-row,
  body.front-page #home-cta .cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
  }
  .home-call-mobile {
    display: inline-flex;
    align-items: center;
  }

  body.home .related-seo,
  body.front-page .related-seo {
    margin: 0;
    padding: 1rem 1.1rem 1.1rem;
  }
  body.home .related-seo h2,
  body.front-page .related-seo h2 {
    font-size: 1rem;
    margin-bottom: .5rem;
  }
  body.home .related-seo ul,
  body.front-page .related-seo ul {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    list-style: none;
    padding: 0;
    margin: 0;
  }
  body.home .related-seo li,
  body.front-page .related-seo li {
    margin: 0;
  }
  body.home .related-seo a,
  body.front-page .related-seo a {
    display: inline-block;
    padding: .3rem .6rem;
    border-radius: 99px;
    border: 1px solid #e4eef3;
    background: #fff;
    font-size: .8rem;
    text-decoration: none;
  }

  /* -------- Inner pages -------- */
  body.page .content-hero,
  body.page .page-hero,
  body.has-brand-hero .content-hero {
    min-height: 0;
    padding-top: 4.6rem;
    padding-bottom: 1.4rem;
  }

  /* Hide decorative visuals; keep text summaries */
  body.page .gulf-map .gulf-canvas,
  body.page .eco-orbit,
  body.page .eco-orbit-wrap .eco-orbit,
  body.page .eco-net-visual,
  body.page .page-visual,
  body.page .band-visual {
    display: none !important;
  }
  body.page .eco-orbit-wrap {
    display: block;
  }
  body.page .eco-intro-grid,
  body.page .eco-home {
    display: block;
  }
  body.page .eco-logo-panel,
  body.page .eco-logo-stage {
    max-width: 220px;
    padding: .8rem 1rem;
    margin: 0 0 1rem;
    animation: none !important;
  }

  body.page .svc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: .55rem;
  }
  body.page .svc-card {
    padding: .8rem .9rem;
    box-shadow: none;
    margin: 0;
  }
  body.page .svc-card h3 {
    margin: 0 0 .35rem;
    font-size: 1rem;
  }
  body.page .std-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
  }
  body.page .std-grid .std-card {
    padding: .38rem .7rem;
    border-radius: 99px;
    box-shadow: none;
    margin: 0;
  }
  body.page .std-grid .std-card h3 {
    margin: 0;
    font-size: .82rem;
  }
  body.page .std-grid .std-card p {
    display: none;
  }

  body.page .process {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  body.page .process .step {
    display: grid;
    grid-template-columns: 1.7rem 1fr;
    align-items: start;
    gap: .1rem .65rem;
    padding: .45rem 0;
    box-shadow: none;
    border: 0;
    border-bottom: 1px solid rgba(1, 43, 54, .1);
    border-radius: 0;
    transform: none !important;
  }
  body.page .process .step p {
    grid-column: 2;
    margin: 0;
    font-size: .86rem;
  }

  details.cx-more {
    margin: .35rem 0 .9rem;
  }
  details.cx-more > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: var(--cx-blue, #14ABF4);
    font-weight: 600;
    font-size: .92rem;
    padding: .15rem 0 .4rem;
  }
  details.cx-more > summary::-webkit-details-marker {
    display: none;
  }
  details.cx-more > summary::after {
    content: "";
    width: .45rem;
    height: .45rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-top: -.15rem;
  }
  details.cx-more[open] > summary::after {
    transform: rotate(225deg);
    margin-top: .15rem;
  }
  details.cx-more--card {
    margin: 0;
  }
  details.cx-more--card > summary {
    font-size: .84rem;
    padding: 0;
  }

  /* Contact stays usable: tighten, don't hide the form */
  body.page-contact-us .contact-grid,
  body.contact-us .contact-grid {
    display: block;
  }
  body.page-contact-us .contact-aside,
  body.contact-us .contact-aside {
    margin-top: 1.2rem;
  }
}

@media (min-width: 768px) {
  /* Desktop: if JS has wrapped text, keep it fully visible and hide the control. */
  details.cx-more > summary {
    display: none !important;
  }
}
