/*
 * mobile-overrides.css
 * Mobile CSS improvements for mouthprop.amaseon.com
 * Tested against: iPhone 14 Pro (390×844, 2× DPR) emulation
 * Crawled pages: home, ueber-uns, produkte, service, konfigurator,
 *                projekt/ysl, projekt/twenty4hrs, projekt/sparkasse,
 *                projekt/lotto-hamburg, impressum, datenschutz, agbs
 *
 * How to inject:
 *   Option A – WordPress: Appearance → Customize → Additional CSS → paste all.
 *   Option B – Enqueue in theme: wp_enqueue_style('mobile-fixes', …, [], null, 'screen and (max-width:768px)');
 *   Option C – Browser extension (Stylus) or reverse-proxy rule.
 */

@media screen and (max-width: 768px) {

  /* ===========================================================
     1. GLOBAL — Prevent horizontal overflow
     Issue: body scrollWidth > 390 on homepage & produkte;
            header.site-header measures 628 px wide on datenschutz/
            impressum because long unbroken URLs widen the layout
            viewport when only body (not html) has overflow-x:hidden.
     =========================================================== */

  html {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* Long URLs (datenschutz, impressum, agbs pages) break the layout */
  a,
  p,
  li,
  td,
  th {
    word-break: break-word;
    overflow-wrap: break-word;
  }


  /* ===========================================================
     2. HEADER — Clamp width & reduce height
     Issue: header.site-header is 628 px on text pages;
            at 120 px tall it takes up ~14% of the viewport.
     =========================================================== */

  .site-header {
    width: 100vw !important;
    max-width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
    box-sizing: border-box !important;
  }

  /* Logo/hamburger button: the img is styled to 80px via main.css
     at max-width:767px. Reduce to 64px so the header shrinks to ~90px. */
  .menu-toggle > img {
    height: 64px !important;
    width: auto !important;
  }

  /* Ensure the hamburger tap area meets 44×44 px minimum */
  .menu-toggle {
    min-width: 64px;
    min-height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    touch-action: manipulation;
  }


  /* ===========================================================
     3. HERO SLIDER — Contain parallax scale overflow
     Issue: .main-bg elements are scaled ~1.07× by GSAP (parallax).
            getBoundingClientRect.right = 404–449 px on a 390 px
            viewport, producing visible fringe on the right.
     Fix: clip at the section level; the existing overflow:hidden on
          .main__item is insufficient because the JS transform is
          applied after layout; ensuring the wrapper also clips fixes it.
     =========================================================== */




  /* ===========================================================
     4. HERO TEXT OVERLAY — Reposition for narrow screens
     Issue: .content is position:fixed left:100px bottom:100px.
            On desktop this is a deliberate design choice; on 390 px
            it leaves only 290 px of width and no left breathing room.
            .side__text (vertical rotated text, left:50px) renders
            on top of content.
     =========================================================== */



  /* Subtitle / animated text inside the overlay */
  .subtitle {
    font-size: 14px !important;
    letter-spacing: 1px !important;
  }

  .title {
    font-size: 36px !important;
    line-height: 1.3 !important;
  }


  /* ===========================================================
     5. NAVIGATION OVERLAY — Improve touch targets
     Issue: .nav-menu__legal links (IMPRESSUM, DATENSCHUTZ, AGBs)
            measure 64×32, 79×32, 28×32 px — all below the 44 px
            minimum in both dimensions for AGBs.
     =========================================================== */

  /* Legal links at the bottom of the fullscreen menu */
  .nav-menu__legal li a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 8px 16px !important;
  }

  /* Main menu items (WORK, MOUTH PROPAGANDA, PRODUKTE, SERVICE) */
  #primary-menu li a {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
  }


  /* ===========================================================
     6. FOOTER — Improve touch targets
     Issue: email & phone links at 257×43 and 157×43 px are just
            under 44 px; social icon links have no explicit sizing.
     =========================================================== */

  .footer__links a,
  .footer__title a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 4px 0;
  }

  .footer__socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 8px;
  }


  /* ===========================================================
     7. SERVICE PAGE — Fix popup close button & popup sizing
     Issue: .service__popup-close "×" is 28×32 px (too small).
            Service popups are 370 px wide — leaves only 10 px
            margin on a 390 px screen.
     =========================================================== */

  .service__popup-close {
    min-width: 44px !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 28px !important;
    padding: 8px !important;
    touch-action: manipulation;
    cursor: pointer;
  }

  /* Give popups breathing room */
  .service__popup {
    max-width: calc(100vw - 32px) !important;
    width: calc(100vw - 32px) !important;
    left: 16px !important;
    right: 16px !important;
    box-sizing: border-box !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
  }


  /* ===========================================================
     8. PRODUKTE PAGE — Contain grid overflow
     Issue: body scrollWidth = 406 px (16 px bleed).
            Likely caused by a WPBakery inner row with fixed margins.
     =========================================================== */

  .vc_row.vc_inner,
  .vc_row-fluid.vc_inner {
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow: hidden;
  }

  /* Small icon/social link without text (a "" 35×29 px) */
  .footer__socials .textwidget a,
  .wpb_text_column a:empty {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }


  /* ===========================================================
     9. PROJEKT PAGES — Sticky product image
     Issue: .product__image sticky with height 0–580 px; on mobile
            a sticky sidebar next to text is too narrow and can
            block content when height is 580 px (lotto-hamburg,
            sparkasse).
     =========================================================== */

  .product__image {
    position: relative !important;
    top: auto !important;
    width: 100% !important;
    max-height: 55vw;
    overflow: hidden;
  }

  .product__image img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }


  /* ===========================================================
     10. KONFIGURATOR — Adapt fixed-size box to mobile
     Issue: The configurator box uses CSS variables --kfg-w:860px
            and --kfg-h:620px. max-width:96vw shrinks the width
            correctly but inner padding (52px each side) leaves
            only ~270 px for content. Height stays fixed at 620 px
            causing vertical clip. Font sizes 10 px are below limit.
     =========================================================== */

  .wpkfg-root {
    --kfg-w: 100%;
    --kfg-h: auto;
    min-height: unset !important;
    overflow: visible;
  }

  .wpkfg-wrap {
    width: 100% !important;
    max-width: 100vw !important;
    padding-top: 110px !important; /* clear fixed 64px-tall header */
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Allow the box to grow to fit content vertically */
  .wpkfg-box {
    height: auto !important;
    min-height: 320px;
    overflow: visible !important;
  }

  /* Reduce side padding so text and cards have room */
  .wpkfg-inner {
    padding: 24px 20px 20px !important;
    overflow-y: visible !important;
    overflow-x: hidden !important;
  }

  /* Sticky bottom nav bar with backdrop blur */
  .wpkfg-nav {
    padding: 12px 20px 16px !important;
    position: sticky;
    bottom: 0;
    background: rgba(14, 14, 14, 0.96) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 50;
  }

  /* Step headings */
  .wpkfg-root .kfg-step__title {
    font-size: 22px !important;
    margin-bottom: 24px !important;
  }

  /* Raise sub-minimum font sizes */
  .wpkfg-root .kfg-step__meta,
  .wpkfg-root .kfg-nav__ctr {
    font-size: 11px !important;
  }

  /* Collapse 3-5 column grids to 2 columns */
  .wpkfg-root .kfg-cols-3,
  .wpkfg-root .kfg-cols-4,
  .wpkfg-root .kfg-cols-5 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Card height: let it size to content */
  .wpkfg-root .kfg-card {
    height: auto !important;
    min-height: 140px;
  }

  /* Limit card image height */
  .wpkfg-root .kfg-card__img {
    max-height: 120px !important;
  }

  /* Product preview: move from absolute-at-top to in-flow above box */
  .wpkfg-preview {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: rotate(90deg) !important;
    margin: 0 auto 16px !important;
    min-height: 160px;
  }

  .wpkfg-preview--no-rotate {
    transform: none !important;
  }

  /* Progress bar: horizontal on mobile */
  .wpkfg-pb {
    width: 100% !important;
    height: 2px !important;
    align-self: auto !important;
    margin-bottom: 16px;
  }

  /* Configurator logo */
  .wpkfg-logo {
    right: 12px;
    top: 12px;
  }


  /* ===========================================================
     11. CONTACT FORM (CF7 + konfigurator form)
     Issue: wpcf7 inputs are 39 px tall (below 44 px minimum).
            font-size < 16 px triggers iOS auto-zoom on focus.
            .mouth-label is 11 px.
     =========================================================== */

  /* CF7 text/email/tel/date inputs */
  input.wpcf7-form-control,
  select.wpcf7-form-control,
  textarea.wpcf7-form-control {
    min-height: 44px !important;
    font-size: 16px !important; /* prevents iOS zoom-on-focus */
    padding: 10px 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Date inputs need extra care on iOS */
  input.wpcf7-form-control[type="date"] {
    min-height: 44px !important;
    padding: 10px 8px !important;
    -webkit-appearance: none;
    appearance: none;
  }

  /* Submit button */
  .wpcf7-submit,
  input.wpcf7-submit {
    min-height: 48px !important;
    width: 100% !important;
    font-size: 16px !important;
    cursor: pointer;
    touch-action: manipulation;
  }

  /* Form section spacing */
  .mouth-section {
    padding: 48px 20px 64px !important;
  }

  .mouth-row {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  /* Form labels */
  .mouth-label {
    font-size: 12px !important;
  }

  /* Konfigurator field inputs */
  .wpkfg-root .kfg-field__input {
    min-height: 44px !important;
    font-size: 16px !important; /* prevent iOS zoom */
    padding: 13px 14px !important;
  }

.main__item .content__holder .content{
    left:20px!important;
}
  /* ===========================================================
     12. CONTENT PAGES (datenschutz, impressum, agbs)
     Issue: Long URL-links (.wixui-rich-text__text) up to 487 px
            wide break out of the 390 px viewport, widening the
            layout and pushing the fixed header to 628 px.
            Link height is 29 px (below 44 px minimum).
     =========================================================== */

  .wixui-rich-text__text {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    max-width: 100% !important;
    display: inline !important;
    line-height: 2 !important; /* increase tap area in running text */
    font-size: 15px !important;
  }


  /* Headings on legal pages */
  .entry-content h2,
  .entry-content h3 {
    font-size: 24px !important;
    line-height: 1.3;
  }


  /* ===========================================================
     13. TYPOGRAPHY — Global scale-down
     Issue: body font-size is 24px (fine for the bold aesthetic)
            but h1/h2 remain large on mobile. The existing media
            queries in main.css already handle h1 (→42px) and h2
            (→38px); these refine further for sub-480 px.
     =========================================================== */

  .font-xxl, h1 {
    font-size: 36px !important;
    line-height: 1.2 !important;
    margin-bottom: 12px !important;
  }

  .font-xl, h2 {
    font-size: 28px !important;
  }

  .font-l, h3 {
    font-size: 24px !important;
  }


  /* ===========================================================
     14. SKIP LINK
     Issue: a.skip-link.screen-reader-text is 1×1 px at all times.
            Screen-reader users lose the skip target visually on
            focus. Standard a11y pattern: show on focus.
     =========================================================== */

  .skip-link:focus {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: auto !important;
    height: auto !important;
    clip: auto !important;
    clip-path: none !important;
    padding: 12px 20px !important;
    background: #000 !important;
    color: #fff !important;
    font-size: 16px !important;
    z-index: 9999 !important;
  }


  /* ===========================================================
     15. CURSOR DOT — Disable on touch
     Issue: .main__wrapper::after creates a custom cursor dot that
            follows mouse coordinates (--x, --y). On touch devices
            there is no persistent cursor; the dot stays at the
            last tap position and blocks re-taps.
     =========================================================== */

  .main__wrapper::after {
    display: none !important;
  }
  .product .wpb_row {
    flex-wrap:wrap;
  }
.product .wpb_row .wpb_column:nth-child(2) > .vc_column-inner{
   position: relative!important;
  }
  .product .wpb_row .wpb_column:nth-child(2) > .vc_column-inner img{
   margin-bottom:50px!important;

  }
  .product__media {
    margin-top:50px;
  }
  .product__media .product__image{
    margin-left:auto;
    margin-right:auto;
  }
}


/* ===========================================================
   EXTRA: sub-480 px refinements (smallest phones)
   =========================================================== */
@media screen and (max-width: 480px) {



  /* Konfigurator: single column for very narrow screens */
  .wpkfg-root .kfg-cols-2 {
    grid-template-columns: 1fr !important;
  }

  /* Tighten konfigurator card on small phones */
  .wpkfg-root .kfg-card {
    min-height: 100px;
  }

  /* Footer centred stack */
  .footer__container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

}
