/* =========================================================================
   Bertuola Ristrutturazioni — Custom overrides
   Aggiunte 13 maggio 2026 — fix mobile, contatti cliccabili, widget WhatsApp
   ========================================================================= */

/* Fix overflow orizzontale su mobile (sezione progetti home) */
html, body {
  overflow-x: hidden !important;
}

/* Style switcher del template — nascondi a vista, sicurezza extra */
.color-settings,
.style-switcher,
.switcher,
#styleSwitcher,
#color-settings,
[class*="color-setting"],
[class*="style-switch"] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Telefono/email cliccabili — eredita il colore del testo */
a.brt-contact-link,
a.brt-contact-link:hover,
a.brt-contact-link:focus {
  color: inherit !important;
  text-decoration: none !important;
  cursor: pointer;
}

/* ==================== WIDGET WHATSAPP FLOATING ==================== */
.brt-whatsapp-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.45), 0 2px 6px rgba(0,0,0,0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  text-decoration: none;
  animation: brt-wa-pulse 2.4s ease-in-out infinite;
}
.brt-whatsapp-fab:hover,
.brt-whatsapp-fab:focus {
  transform: scale(1.08);
  box-shadow: 0 6px 22px rgba(37, 211, 102, 0.6), 0 3px 8px rgba(0,0,0,0.22);
  animation-play-state: paused;
}
.brt-whatsapp-fab svg {
  width: 32px;
  height: 32px;
  fill: #ffffff;
  display: block;
}
.brt-whatsapp-fab .brt-wa-tooltip {
  position: absolute;
  right: 70px;
  top: 50%;
  transform: translateY(-50%);
  background: #1f2937;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.brt-whatsapp-fab .brt-wa-tooltip::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: #1f2937;
}
.brt-whatsapp-fab:hover .brt-wa-tooltip,
.brt-whatsapp-fab:focus .brt-wa-tooltip {
  opacity: 1;
}

@keyframes brt-wa-pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(37,211,102,0.45), 0 2px 6px rgba(0,0,0,0.18); }
  50%      { box-shadow: 0 4px 16px rgba(37,211,102,0.45), 0 2px 6px rgba(0,0,0,0.18), 0 0 0 14px rgba(37,211,102,0); }
  25%      { box-shadow: 0 4px 16px rgba(37,211,102,0.45), 0 2px 6px rgba(0,0,0,0.18), 0 0 0 0 rgba(37,211,102,0.45); }
}

@media (max-width: 600px) {
  .brt-whatsapp-fab {
    right: 16px;
    bottom: 16px;
    width: 54px;
    height: 54px;
  }
  .brt-whatsapp-fab svg { width: 28px; height: 28px; }
  .brt-whatsapp-fab .brt-wa-tooltip { display: none; }
}

/* Pagine legal */
.brt-legal-content {
  max-width: 840px;
  margin: 40px auto;
  padding: 0 24px;
  font-size: 16px;
  line-height: 1.7;
  color: #374151;
}
.brt-legal-content h1 { font-size: 32px; margin: 24px 0 16px; color: #111827; }
.brt-legal-content h2 { font-size: 22px; margin: 32px 0 12px; color: #111827; }
.brt-legal-content h3 { font-size: 18px; margin: 24px 0 8px; color: #1f2937; }
.brt-legal-content p, .brt-legal-content li { margin-bottom: 12px; }
.brt-legal-content ul, .brt-legal-content ol { padding-left: 22px; margin: 8px 0 16px; }
.brt-legal-content a { color: #d4a017; text-decoration: underline; }
.brt-legal-content table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.brt-legal-content table td, .brt-legal-content table th { border: 1px solid #e5e7eb; padding: 10px; text-align: left; font-size: 14px; vertical-align: top; }
.brt-legal-content table th { background: #f9fafb; }
.brt-legal-content .brt-legal-meta { font-size: 13px; color: #6b7280; margin-bottom: 32px; }

/* Cookie banner */
.brt-cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 9998;
  background: #111827;
  color: #f3f4f6;
  border-radius: 14px;
  padding: 18px 22px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  max-width: 560px;
  margin: 0 auto;
  font-size: 14px;
  line-height: 1.5;
}
.brt-cookie-banner.is-hidden { display: none; }
.brt-cookie-banner__text { margin: 0 0 12px; }
.brt-cookie-banner__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.brt-cookie-banner__btn {
  font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 8px;
  border: none; cursor: pointer;
  transition: all 0.15s ease;
}
.brt-cookie-banner__btn--accept { background: #facc15; color: #111827; }
.brt-cookie-banner__btn--accept:hover { background: #fde047; }
.brt-cookie-banner__btn--reject { background: transparent; color: #d1d5db; border: 1px solid #4b5563; }
.brt-cookie-banner__btn--reject:hover { background: rgba(255,255,255,0.05); }
.brt-cookie-banner a { color: #facc15; text-decoration: underline; }


/* ============================================================
   FIX IMMAGINI MOBILE (aggiunto 14 maggio 2026)
   ============================================================ */
@media (max-width: 991px) {
  /* Nessuna immagine deve sforare il container */
  img, picture, video, iframe { max-width: 100% !important; height: auto !important; }
  /* Sezione progetti home — i blocchi sono in larghezza desktop */
  .project-block_one, .project-block_one-inner, .project-block_one-image,
  .project-block_one img, .project-block_one-overlay,
  .pin-spacer { max-width: 100% !important; width: 100% !important; }
  .project-block_one img { width: 100% !important; height: auto !important; object-fit: cover !important; }
  /* About section — limito le immagini hero */
  .about-style-one_image-1, .about-style-one_image-2, .about-image, .about-1 { max-width: 100% !important; }
  .about-style-one_image-1 img, .about-style-one_image-2 img { width: 100% !important; height: auto !important; object-fit: cover !important; }
  /* Slider Swiper — forza altezza auto e fit cover */
  .swiper-slide img, .swiper-wrapper img { width: 100% !important; height: auto !important; max-width: 100% !important; }
  /* Card servizi: padding ridotto, immagini cover */
  .service-block, .service-block_one, .service-block_image { max-width: 100% !important; }
  .service-block img, .service-block_image img { width: 100% !important; height: auto !important; max-height: 320px !important; object-fit: cover !important; }
  /* Blog post images */
  .news-block img, .news-block_image img, .blog-image img { width: 100% !important; height: auto !important; object-fit: cover !important; }
  /* Hero / banner images */
  .banner-section img, .banner-image img, .hero-image img, .main-banner img { width: 100% !important; height: auto !important; object-fit: cover !important; }
  /* Tipografia hero più piccola */
  .banner-section h1, .banner-section h2, .main-banner h1, .page-title h1 { font-size: 28px !important; line-height: 1.2 !important; word-wrap: break-word !important; }
  /* Footer logo centrato */
  .footer img, .footer-logo img { max-width: 200px !important; height: auto !important; }
  /* Forza body e wrapper a non avere overflow orizzontale */
  body, .page-wrapper, main, section, footer, header { max-width: 100vw !important; overflow-x: hidden !important; }
}
@media (max-width: 575px) {
  /* Su schermi davvero piccoli, riduzioni extra */
  .banner-section h1, .main-banner h1, .page-title h1 { font-size: 24px !important; }
  h1 { font-size: 26px !important; }
  h2 { font-size: 22px !important; }
  .service-block img, .service-block_image img { max-height: 240px !important; }
}
