/* ==========================================================================
   SBBI GROUP - CUSTOM RESPONSIVE STYLESHEET
   Supports: Desktop (1440px+), PC/Notebooks (992px - 1366px), 
             Tablets (768px - 991px), Android & Smartphones (320px - 576px)
   ========================================================================== */

/* --- 1. GLOBAL RESETS & FLUID LAYOUT --- */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  max-width: 100vw;
  overflow-x: clip;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, picture, video, canvas, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Fix indiscriminate .btn width rule for mobile */
@media only screen and (max-width: 576px) {
  .btn {
    display: inline-block;
    width: auto;
  }
  .btn.btn--primary:not(.selos, .btn-close),
  .formulario [type="submit"],
  .wppPopup__form-submit button {
    display: block;
    width: 100%;
    max-width: 100%;
  }
}

.btn-close {
  box-sizing: content-box !important;
  width: 1em !important;
  height: 1em !important;
  padding: 0.5em !important;
}

/* Prevent auto-zoom in mobile input focus (iOS & Android) */
@media screen and (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* --- 2. HEADER & NAVIGATION --- */
header {
  width: 100%;
  transition: all 0.3s ease;
}

.navbar-brand img,
.logo-desktop,
.logo-mobile-menu {
  max-width: 150px;
  height: auto;
  transition: transform 0.2s ease;
}

@media (max-width: 576px) {
  .navbar-brand img,
  .logo-desktop,
  .logo-mobile-menu {
    max-width: 120px;
  }
}

/* Notebook optimization (992px to 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
  #dropdown-custom .nav-link {
    padding: 0.4rem 0.55rem !important;
    font-size: 0.88rem !important;
  }
  .navbar-brand img {
    max-width: 130px;
  }
}

/* Desktop Dropdowns */
@media (min-width: 992px) {
  /* Common hover trigger on desktop for all nav dropdowns */
  #dropdown-custom .nav-item.dropdown:hover > .dropdown-menu {
    display: block;
  }

  /* 1. Standard Dropdown ("Serviços") */
  #dropdown-custom .nav-item.dropdown:not([data-icon-menu]) .dropdown-menu {
    min-width: 290px;
    padding: 0.5rem 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    margin-top: 0.25rem;
  }

  #dropdown-custom .nav-item.dropdown:not([data-icon-menu]) .dropdown-item {
    padding: 0.55rem 1.25rem;
    font-size: 0.88rem;
    white-space: normal;
    line-height: 1.35;
    transition: background-color 0.2s ease, color 0.2s ease;
  }

  #dropdown-custom .nav-item.dropdown:not([data-icon-menu]) .dropdown-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--primary-color, #0d6efd);
  }

  /* 2. Mega Dropdown ("Informações" with [data-icon-menu]) */
  #dropdown-custom .nav-item.dropdown[data-icon-menu] .dropdown-menu {
    min-width: 650px;
    max-width: 80vw;
    max-height: 68vh;
    overflow-y: auto;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 16px;
    padding: 1.25rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    right: 0 !important;
    left: auto !important;
  }

  /* Only display grid when opened (.show) or hovered on desktop */
  #dropdown-custom .nav-item.dropdown[data-icon-menu] .dropdown-menu.show,
  #dropdown-custom .nav-item.dropdown[data-icon-menu]:hover > .dropdown-menu {
    display: grid !important;
  }

  #dropdown-custom .nav-item.dropdown[data-icon-menu] .dropdown-menu .nav-item {
    width: 100%;
  }

  #dropdown-custom .nav-item.dropdown[data-icon-menu] .dropdown-menu .dropdown-item {
    padding: 0.4rem 0.6rem;
    font-size: 0.82rem;
    white-space: normal;
    border-radius: 4px;
    line-height: 1.35;
  }
}

@media (min-width: 1400px) {
  #dropdown-custom .nav-item.dropdown[data-icon-menu] .dropdown-menu {
    min-width: 780px;
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mobile & Tablet Offcanvas Menu */
@media (max-width: 991px) {
  .offcanvas {
    max-width: 85vw;
  }
  .offcanvas-body {
    padding: 1.25rem;
    overflow-y: auto;
  }
  .offcanvas-body #dropdown-custom {
    max-width: 100% !important;
  }
  .offcanvas-body .dropdown-menu {
    max-height: 260px;
    overflow-y: auto;
    background: #fdfdfd;
    border-left: 3px solid var(--primary-color, #0d6efd);
    padding-left: 0.5rem;
    margin: 0.5rem 0 1rem;
  }
  .offcanvas-body .dropdown-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    min-height: 40px;
    display: flex;
    align-items: center;
  }
}

/* --- 3. HERO / BANNER SECTION --- */
.splide-banner {
  width: 100%;
  position: relative;
}

/* Allow banner to show responsively on mobile instead of complete cut */
.splide-banner.ocultar-mobile {
  display: block !important;
}

.splide--hero .splide__slide,
.splide-banner .splide__slide {
  height: 500px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splide__content {
  padding: 1.5rem;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.splide__content h2 {
  font-size: clamp(1.4rem, 4vw, 2.5rem) !important;
  line-height: 1.25;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.splide__content p {
  font-size: clamp(0.95rem, 2.5vw, 1.25rem) !important;
  line-height: 1.4;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

@media (max-width: 991px) {
  .splide--hero .splide__slide,
  .splide-banner .splide__slide {
    height: 380px;
  }
}

@media (max-width: 576px) {
  .splide--hero .splide__slide,
  .splide-banner .splide__slide {
    height: 300px;
  }
  .splide__content {
    padding: 1rem 0.5rem;
  }
}

/* --- 4. BREADCRUMBS & INNER PAGE HEADERS --- */
.bread {
  min-height: 280px;
  padding: 100px 1rem 2rem;
}

@media (max-width: 768px) {
  .bread {
    min-height: 220px;
    padding: 80px 1rem 1.5rem;
  }
  .bread__title {
    font-size: 1.5rem !important;
  }
  #breadcrumb {
    font-size: 0.8rem;
  }
}

/* --- 5. HOMOLOGAÇÕES & CLIENTES GRIDS --- */
.homologacoes-grid img {
  max-height: 65px;
  width: auto;
  object-fit: contain;
  margin: 0.5rem auto;
  transition: transform 0.2s ease;
}

.homologacoes-grid img:hover {
  transform: scale(1.05);
}

.splide-clientes .splide__slide img {
  max-height: 55px;
  width: auto;
  object-fit: contain;
  margin: 0 auto;
}

@media (max-width: 576px) {
  .homologacoes-grid img {
    max-height: 45px;
  }
  .splide-clientes .splide__slide img {
    max-height: 42px;
  }
}

/* --- 6. CARDS & SECTIONS --- */
.card--mod-23,
.card--mod-21 {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card--mod-23:hover,
.card--mod-21:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card--mod-23 .card__image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card--mod-23 .card__description {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
}

@media (max-width: 576px) {
  .card--mod-23 .card__image {
    height: 180px;
  }
}

/* Call to Action Pattern */
.bg-cta-pattern {
  padding: 3.5rem 1rem;
  min-height: 260px;
}

.bg-cta-pattern h2 {
  font-size: clamp(1.4rem, 4vw, 2.2rem) !important;
}

.bg-cta-pattern p {
  font-size: clamp(0.95rem, 2.5vw, 1.25rem) !important;
}

/* --- 7. TABLES & FORMS --- */
.cart-table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.5rem;
}

@media only screen and (max-width: 1200px) {
  .cart-table {
    min-width: 650px;
    width: 100% !important;
  }
}

@media only screen and (max-width: 576px) {
  .cart-table tr {
    font-size: 0.85rem;
  }
  .cart-table :is(th, td) {
    padding: 8px 4px;
  }
}

/* --- 8. FOOTER RESPONSIVE ENHANCEMENTS --- */
footer {
  padding-top: 35px;
  padding-bottom: 15px;
}

footer .logo-desktop {
  margin: 0 auto 1.5rem;
}

@media (min-width: 992px) {
  footer .logo-desktop {
    margin: 0 0 1.5rem 0;
  }
}

footer h3 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
}

footer .footer__nav ul {
  padding: 0;
  list-style: none;
}

footer .address a,
footer .address span {
  font-size: 0.9rem;
}

.copyright-footer {
  margin-top: 1.5rem;
}

@media (max-width: 991px) {
  footer [class*="col-"] {
    margin-bottom: 2rem;
  }
}

@media (max-width: 576px) {
  .copyright-footer .d-flex {
    text-align: center;
  }
  .copyright-footer .selos {
    font-size: 0.75rem;
    padding: 4px 8px !important;
  }
}

/* --- 9. WHATSAPP FLOATING POPUP & SEARCH MODAL --- */
.wpp-container {
  position: relative;
  z-index: 9999;
}

.wppButton {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99999;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.wppButton:hover {
  transform: scale(1.08);
}

.wppPopup {
  position: fixed;
  bottom: 85px;
  right: 20px;
  width: 340px;
  max-width: 90vw;
  z-index: 99999;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.wppPopup .wppClose {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.15);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.wppPopup .wppClose:hover {
  background: rgba(0, 0, 0, 0.4);
}

@media (max-width: 576px) {
  .wppButton {
    bottom: 15px;
    right: 15px;
  }
  .wppPopup {
    width: calc(100vw - 30px);
    right: 15px;
    left: 15px;
    bottom: 75px;
    max-height: 80vh;
  }
}

#scrollUp {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: auto;
  z-index: 9998;
}

@media (max-width: 576px) {
  #scrollUp {
    bottom: 15px;
    left: 15px;
  }
}
