/* ============================================
   CERESIO5VALLI - Mobile Responsive Fixes
   v2.4 - Clean version
   ============================================ */

/* === OVERFLOW GLOBALE === */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

@media (max-width: 768px) {
  
  /* === NASCONDI IUBENDA === */
  .iubenda-tp-btn,
  .iubenda-cs-preferences-link,
  a[href*="iubenda"].iubenda-tp-btn {
    display: none !important;
  }
  
  /* === TITOLI === */
  h1, h2, h3, h4,
  .elementor-heading-title,
  .percorso-hero-content h1,
  .ev-hero__title,
  .section-title {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    -webkit-hyphens: auto !important;
  }

  /* === CONTENUTO PERCORSI === */
  .percorso-single,
  .percorso-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
  }
  
  .percorso-content,
  .content-section {
    padding: 0 12px !important;
    max-width: 100% !important;
  }
  
  .percorso-content p,
  .content-section p {
    font-size: 1rem !important;
    line-height: 1.6 !important;
    max-width: 100% !important;
  }
  
  /* === MAPPE === */
  #route-map,
  .wpgpxmaps,
  [id^="wpgpxmaps"],
  .leaflet-container {
    width: 100% !important;
    max-width: 100% !important;
    height: 350px !important;
    min-height: 300px !important;
  }
  
  #home-map {
    width: 100% !important;
    height: 300px !important;
  }
  
  /* === SIDEBAR PERCORSI === */
  .percorso-main-grid {
    display: block !important;
  }
  
  .percorso-sidebar {
    width: 100% !important;
    padding: 0 12px !important;
  }

  /* === GALLERIA === */
  .percorso-gallery-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .percorso-gallery-item img {
    width: 100% !important;
    height: 250px !important;
    object-fit: cover !important;
  }
  
  .percorso-gallery-item figcaption {
    font-size: 0.85rem !important;
    padding: 10px !important;
  }

  /* === EVENTI === */
  .ev-main,
  .ev-content {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .ev-card {
    padding: 15px !important;
    margin: 0 10px !important;
  }
  
  .ev-hero__title {
    font-size: 1.4rem !important;
    padding: 0 15px !important;
  }
  
  .ev-infobar {
    flex-direction: column !important;
    align-items: center !important;
    gap: 15px !important;
    padding: 15px !important;
  }

  /* === IMMAGINI === */
  img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* === BANNER HOME === */
  .destinazione-banner div[style*="0.85rem"],
  .destinazione-banner div[style*="0.95rem"],
  .destinazione-banner div[style*="0.9rem"],
  .destinazione-banner div[style*="letter-spacing"] {
    display: none !important;
  }
  
  .destinazione-banner div[style*="1.8rem"],
  .destinazione-banner div[style*="1.4rem"] {
    font-size: 0.95rem !important;
  }

  /* === PULSANTI HERO === */
  .cta-primary, .cta-secondary {
    width: 65% !important;
    font-size: 0.85rem !important;
    padding: 12px 18px !important;
  }
}

/* === MAPPA POI/STRUTTURE MOBILE === */
@media (max-width: 768px) {
  .mappa-container,
  .mappa-container > div,
  .mappa-container .leaflet-container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  /* Fix sidebar che potrebbe restringere la mappa */
  .poi-sidebar,
  .struttura-sidebar,
  .ristorante-sidebar {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 10px !important;
  }
}

/* === NASCONDI WIDGET SOCIAL/FLAG FLOATING === */
/* Widget GTranslate o simili floating a destra */
.gtranslate_wrapper.gt_float_switcher,
div[class*="gt_float"],
div[class*="gtranslate"][style*="fixed"],
div[style*="position: fixed"][style*="right"],
.gt_float_switcher,
#gt_float_wrapper,
.nicdark_widget_social_float,
div[class*="floating"][class*="social"],
div[class*="social"][class*="float"],
/* Elementi floating generici a destra dello schermo */
body > div[style*="position:fixed"][style*="right:"][style*="z-index"]:not(.iubenda-tp-btn):not(#crisp-chatbox):not([class*="chat"]) {
    display: none !important;
}
