/**
 * Ácácias — responsividade mobile / tablet
 * Carregar por último (depois de theme + motion)
 */

/* —— Base: cortar overflow sem esconder sticky/float —— */
html {
  max-width: 100%;
  overflow-x: clip;
}
body {
  max-width: 100%;
  overflow-x: clip;
}

img, video, iframe, svg, embed, object {
  max-width: 100%;
  height: auto;
}

.table-responsive,
.ac-scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.para-desc {
  max-width: min(600px, 100%);
}

.ac-marquee {
  width: 100%;
  max-width: 100%;
  overflow: hidden !important;
}
.ac-marquee__track {
  max-width: none; /* precisa de largura intrínseca para o loop */
}

.swiper,
.swiper-slider-hero,
.section,
.footer,
.bg-cta,
.bg-half-170 {
  max-width: 100%;
  overflow-x: clip;
}

/* —— Header mobile (≤991px) —— */
@media (max-width: 991px) {
  #topnav {
    background-color: #1a1a18 !important;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.35) !important;
    min-height: 70px !important;
    height: auto !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  #topnav .container {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 0.5rem;
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    position: relative;
    min-height: 70px;
  }

  /* Logo maior e legível */
  #topnav .logo {
    float: none !important;
    display: flex !important;
    align-items: center;
    flex: 0 1 auto;
    line-height: 1;
    padding: 6px 0;
    margin: 0 !important;
    max-width: calc(100% - 140px);
    position: relative;
    z-index: 2;
  }
  #topnav .logo .logo-light-mode {
    display: flex !important;
    align-items: center;
  }
  #topnav .logo img,
  #topnav .logo .l-light,
  #topnav .logo .l-dark {
    max-height: 62px !important;
    height: 62px !important;
    width: auto !important;
    max-width: 168px;
    object-fit: contain;
  }
  #topnav .logo .l-dark {
    display: none !important;
  }
  #topnav .logo .l-light {
    display: block !important;
  }
  #topnav .logo-dark-mode {
    display: none !important;
  }

  /* CTA compacto */
  #topnav .buy-button {
    float: none !important;
    margin: 0 0 0 auto !important;
    padding: 0 !important;
    position: relative;
    z-index: 2;
    order: 2;
  }
  #topnav .buy-button .btn {
    font-size: 0.7rem !important;
    padding: 0.45rem 0.75rem !important;
    white-space: nowrap;
    line-height: 1.2;
  }

  #topnav .menu-extras {
    float: none !important;
    display: block !important;
    margin: 0 !important;
    order: 3;
    flex-shrink: 0;
  }
  #topnav .menu-extras .menu-item {
    border-color: rgba(255, 255, 255, 0.4) !important;
  }
  #topnav .navbar-toggle {
    display: block !important;
    margin: 0;
    padding: 8px 4px;
  }
  #topnav .navbar-toggle span {
    background-color: #cfcfcb !important;
  }

  /* Menu painel */
  #topnav #navigation,
  #navigation {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-height: min(75vh, 480px);
    overflow-y: auto;
    background: #1f1f1d !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45);
    z-index: 1000;
    display: none;
    padding: 0.25rem 0 0.75rem;
  }
  #topnav #navigation.open,
  #navigation.open,
  #topnav #navigation[style*="block"],
  #navigation[style*="block"] {
    display: block !important;
  }

  #topnav .navigation-menu {
    display: block !important;
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  #topnav .navigation-menu > li {
    float: none !important;
    display: block !important;
    width: 100%;
    margin: 0 !important;
  }
  #topnav .navigation-menu > li > a,
  #topnav .navigation-menu.nav-light > li > a,
  #topnav .navigation-menu > li.active > a,
  #topnav .navigation-menu.nav-light > li.active > a {
    color: #f2f0ec !important;
    padding: 14px 1.25rem !important;
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.95rem;
  }
  #topnav .navigation-menu > li > a:hover,
  #topnav .navigation-menu > li.active > a,
  #topnav .navigation-menu > li:hover > a {
    color: #cfcfcb !important;
    background: rgba(255, 255, 255, 0.04);
  }

  /* CTA extra no fim do menu (visível quando o botão some) */
  #topnav .navigation-menu > li.ac-nav-cta > a,
  #topnav .navigation-menu.nav-light > li.ac-nav-cta > a {
    color: #1a1a18 !important;
    background: #cfcfcb !important;
    margin: 0.75rem 1.25rem 0.25rem;
    border-radius: 0.35rem;
    text-align: center;
    font-weight: 600;
    border-bottom: none !important;
  }
  #topnav .navigation-menu > li.ac-nav-cta > a:hover {
    background: #e8e8e4 !important;
    color: #1a1a18 !important;
  }
}

@media (max-width: 575px) {
  #topnav .buy-button {
    display: none !important;
  }
  #topnav .logo {
    max-width: calc(100% - 56px);
  }
  #topnav .logo img,
  #topnav .logo .l-light {
    max-height: 56px !important;
    height: 56px !important;
    max-width: 150px;
  }
  #topnav .container {
    min-height: 64px;
  }
  #topnav {
    min-height: 64px !important;
  }
}

/* —— Hero —— */
@media (max-width: 991px) {
  .swiper-slider-hero,
  .swiper-slider-hero.vh-100 {
    min-height: 72vh !important;
    height: auto !important;
  }
  .swiper-slider-hero .swiper-slide {
    min-height: 72vh;
    padding: 5.5rem 0 3rem;
    width: 100% !important;
  }
  .swiper-slider-hero .swiper-wrapper {
    max-width: 100%;
  }
  .swiper-slider-hero .display-3,
  .swiper-slider-hero h1 {
    font-size: clamp(1.65rem, 6.5vw, 2.35rem) !important;
    line-height: 1.2 !important;
    max-width: 100%;
    word-wrap: break-word;
  }
  .swiper-slider-hero .para-desc {
    font-size: 0.95rem !important;
    max-width: 100% !important;
    padding: 0 0.15rem;
  }
  .swiper-slider-hero .title-heading .mt-4 {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .swiper-slider-hero .btn {
    width: 100%;
    margin: 0 !important;
    justify-content: center;
  }
  .swiper-button-next,
  .swiper-button-prev {
    display: none !important;
  }

  /* Ken Burns mais contido no telemóvel */
  .ac-hero-bg {
    inset: 0 !important;
    animation: none !important;
    transform: none !important;
  }
}

@media (max-width: 575px) {
  .swiper-slider-hero,
  .swiper-slider-hero.vh-100,
  .swiper-slider-hero .swiper-slide {
    min-height: 78vh !important;
  }
}

/* —— Secções / grelhas —— */
@media (max-width: 991px) {
  .section {
    padding: 2.75rem 0 !important;
  }
  .mt-100,
  .mt-60 {
    margin-top: 2.25rem !important;
  }
  .section-title .title {
    font-size: clamp(1.35rem, 5vw, 1.85rem) !important;
  }

  .section .mx-lg-5.px-lg-5 {
    margin-top: 1rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .section .ms-lg-5,
  .section .ms-md-4 {
    margin-left: 0 !important;
    margin-top: 1.25rem;
  }

  .bg-cta .title,
  .bg-cta h1 {
    font-size: clamp(1.35rem, 5.5vw, 2rem) !important;
  }
  .bg-cta {
    background-attachment: scroll !important;
  }

  .counter-box h1,
  .counter-box .display-4 {
    font-size: 2.1rem !important;
  }

  .footer-py-60 {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }
  .footer .text-md-start,
  .footer .text-md-end {
    text-align: center !important;
  }
}

@media (max-width: 767px) {
  .container,
  .container-sm,
  .container-md {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    max-width: 100% !important;
  }

  .feature,
  .blog,
  .card.shadow {
    margin-bottom: 0.25rem;
    transform: none !important;
  }

  .card.border-0.shadow.rounded.p-4 {
    padding: 1.25rem !important;
  }

  .ac-marquee {
    padding: 0.65rem 0;
  }
  .ac-marquee__track {
    gap: 1.5rem;
    animation-duration: 28s;
  }
  .ac-marquee__track span {
    font-size: 0.65rem;
  }

  .whatsapp-float {
    width: 3rem;
    height: 3rem;
    bottom: 1rem;
    right: 1rem;
  }

  .back-to-top {
    right: 1rem !important;
    bottom: 4.5rem !important;
  }

  form .btn-primary,
  .card form .btn {
    width: 100%;
  }

  .ac-filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
  }
  .ac-filter-bar .btn {
    flex: 1 1 auto;
    min-width: 42%;
  }

  /* Tiny-slider / depoimentos */
  .tns-outer,
  .tns-ovh,
  .tiny-single-item {
    max-width: 100%;
    overflow: hidden;
  }

  .client-testi {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

/* Page title */
@media (max-width: 767px) {
  .bg-half-170 {
    padding: 6.5rem 0 2.75rem !important;
    min-height: auto !important;
  }
  .bg-half-170 .heading,
  .bg-half-170 h3 {
    font-size: 1.45rem !important;
  }
  .position-middle-bottom {
    position: relative !important;
    bottom: auto !important;
    margin-top: 1.25rem;
  }
  .breadcrumb {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Forms: inputs e selects a 100% */
@media (max-width: 575px) {
  .form-control,
  .form-select,
  input[type="date"],
  input[type="number"],
  input[type="email"],
  input[type="tel"],
  input[type="text"],
  textarea {
    font-size: 16px !important; /* evita zoom iOS */
  }
}

/* Galeria / Tobii */
@media (max-width: 767px) {
  .tobii__slide,
  .tobii {
    max-width: 100vw;
  }
}
