/* ===== MOBILE FIX for schreinerei-pinnekamp.de ===== */

/* --- Tablet & Mobile: 1024px and below --- */
@media (max-width: 1024px) {

  /* Reduce large font sizes */
  .entry-content :where(h1), h1 { font-size: clamp(2rem, 5vw, 3rem) !important; }
  .entry-content :where(h2), h2 { font-size: clamp(1.5rem, 4vw, 2rem) !important; }
  .entry-content :where(h3), h3 { font-size: clamp(1.3rem, 3.5vw, 1.7rem) !important; }

  /* Tame negative margins on headings so they dont cut off */
  .elementor-heading-title {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Hero: reduce extreme padding */
  [data-id="094be62"] {
    --padding-top: 150px !important;
  }

  /* Section padding reduction */
  [data-id="d86f416"],
  [data-id="dae2285"],
  [data-id="19f73d5"] {
    --padding-top: 60px !important;
    --padding-bottom: 60px !important;
  }

  [data-id="fc1c9ac"] {
    --padding-top: 50px !important;
    --padding-bottom: 50px !important;
  }

  /* Remove excessive horizontal padding on columns */
  [data-id="1cc0575"] { --padding-right: 20px !important; }
  [data-id="2f4db7f"] { --padding-left: 20px !important; }

  /* Infocard title: remove huge horizontal margins */
  .hfe-infocard-title {
    margin: 0 0 15px 0 !important;
  }

  /* Icon widget padding */
  [data-id="8a045e8"] { padding: 25px 0 !important; }
  [data-id="fb44a5d"] { padding: 0 20px 15px 20px !important; }

  /* Fix container max-width */
  .e-con-boxed { --container-max-width: 100% !important; }
}

/* --- Mobile only: 767px and below --- */
@media (max-width: 767px) {

  /* Scale down very large fonts further */
  h1, .elementor-heading-title { font-size: clamp(1.8rem, 6vw, 2.5rem) !important; }
  h2 { font-size: clamp(1.4rem, 5vw, 1.8rem) !important; }
  h3 { font-size: clamp(1.1rem, 4vw, 1.4rem) !important; }
  h4, h5, h6 { font-size: clamp(1rem, 3.5vw, 1.2rem) !important; }

  /* Body text: ensure readable */
  body, p, li, .elementor-text-editor {
    font-size: 16px !important;
    line-height: 1.6 !important;
  }

  /* Hero: reduce padding more */
  [data-id="094be62"] {
    --padding-top: 100px !important;
    --padding-bottom: 50px !important;
  }

  /* All sections: consistent padding */
  .e-con-boxed.e-parent {
    --padding-top: 40px !important;
    --padding-bottom: 40px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* Fix negative margins on all headings */
  .elementor-widget-heading .elementor-heading-title,
  .elementor-widget-container {
    margin: 0 auto !important;
  }

  /* Image widgets: full width, center */
  .elementor-widget-image img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }

  /* Image box: ensure images fit */
  .elementor-widget-image-box .elementor-image-box-img img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Counter: center */
  .elementor-widget-counter .elementor-counter-number {
    font-size: clamp(2rem, 8vw, 3rem) !important;
  }

  /* Button: full width */
  .elementor-button {
    width: 100% !important;
    text-align: center !important;
  }

  /* Infocard: card style */
  .hfe-infocard {
    text-align: center !important;
  }
  .hfe-infocard .hfe-infocard-title {
    margin: 0 0 10px 0 !important;
    font-size: clamp(1.1rem, 4vw, 1.4rem) !important;
  }

  /* Grid columns: single column */
  .e-con.e-flex {
    --flex-wrap: wrap !important;
  }

  /* Fix reference cards spacing */
  [data-id="8e68b1a"] .e-con-inner {
    gap: 20px !important;
  }

  /* Mobile menu: ensure proper sizing */
  .ast-mobile-popup-inner {
    max-height: 100vh !important;
    overflow-y: auto !important;
  }
  .main-header-menu .menu-link {
    padding: 10px 20px !important;
    font-size: 16px !important;
  }

  /* Footer: consistent padding */
  .site-primary-footer-wrap {
    padding-top: 40px !important;
    padding-bottom: 30px !important;
  }
  .site-below-footer-wrap {
    padding: 15px !important;
  }

  /* Footer text: center */
  .ast-footer-copyright {
    text-align: center !important;
    font-size: 14px !important;
  }

  /* Remove horizontal scroll */
  body, html {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  /* Sections: prevent overflow */
  .elementor-section, .e-con {
    overflow-x: hidden !important;
  }

  /* Divider */
  .elementor-widget-divider .elementor-divider {
    padding: 10px 0 !important;
  }

  /* Icon list */
  .elementor-icon-list-item {
    font-size: 15px !important;
  }
}
