@media only screen and (max-width: 859px) {
	
    .aktuellemeldung {
        margin-top: 80px;
    }
    
    .main {
    }
    
	.grossestitelbild {
		margin-top: 80px;
	}
	
    .firstmainmargin {
        margin-top: 80px;
    }

    
    .gallery-main {
        margin-top: 80px;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-top: 0;
    }
    
    .headercenter {
        height: 80px; /* Reduced from 100px to 80px */
    }
    
    .fzlistefirstmainmargin {
        margin-bottom: 1em !important;
    }
        
    .gallery-container {
        flex-direction: column;
        width: 100%;
        gap: 10px;
        margin-bottom: 0px;
    }

    .thumbnail-slider {
        width: 100%;
        padding: 0;
    }

    .large-thumbnail {
        display: none;
    }

    .small-thumbnails {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 5px;        
    }
    
    .thumbnail-wrapper {
        aspect-ratio: 1;
        overflow: hidden;
    }

    .thumbnail-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

	  #main-header,
  #main-header.scrolled {
	    margin-bottom: 0.2em;
        padding-left: 0;
        padding-right: 0;
        height: 80px;
    background-color: #fff !important;
    /* Optional, falls du den Border-Bottom auch anpassen willst: */
    border-bottom: none !important;
  }
    
	#main-header a {
	color: #000;
}
	
    .garagereichlinlogo {
        margin-top: 5px;
        margin-bottom: 5px;
    }
    
	.fahrzeuglistewrapper {
		margin-top: 80px;
        padding-top: 20px;
	}
	
    .fahrzeuglistefilterwrapper {
        display: none;    
        flex-wrap: wrap;
        align-content: flex-start;
        position: fixed;
        overflow: scroll;
        color: #000;
        height: 100vh;
        top: 0 !important;
        width: 100vw;
        left: 0;
        z-index: 10001;
        background: #FFF;
        -webkit-overflo-scrolling: touch;
        margin-bottom: 10vh;
        justify-content: center;
        padding-top: 20px;
        padding-left: 20px;
        padding-right: 20px;
        margin-right: 0;
        box-sizing: border-box;
    }
    
    .fahrzeuglistefilterschliessen {
    display: flex;
    }
    
    .filter-container {
        display: flex;
        flex-wrap: wrap;
        flex-grow: 1;
    }
    
    .filter-item:last-of-type {
        margin-bottom: 100px;
    }
    
    .filter-content span, .filter-content-modell span {
        padding-bottom: 2px;
        padding-top: 2px;
    }    
    
    .filter-content-marke {
	    max-height: 100%;
    }
    
    .filter-checkbox:checked ~ .filter-content {
        display: grid;
        overflow-y: visible;
        overflow-x: visible;
        position: relative;
        max-height: fit-content;
        z-index: 0;
    }
    
    .FilterSelectedPos:after {
        content: "X";
        padding-right: 5px;
    }
    
    .filter-content span:hover, .filter-content-modell span:hover {
	    background-color: #FFF;
	}
    
    .FilterSelectedPos {
	    background-color: #c2cbd8;
	}

	.FilterSelectedPos:hover {
	    background-color: #c2cbd8 !important;
	}
    
    .fahrzeugliste {
        padding: 0;
        margin: 0 auto;
        max-width: 100%;
    }
	
	.fahrzeugliste .car-cards-container > * {
		max-width: 100%;
	}
    
    .filtersvg {
        display: flex;
        margin-bottom: 1em;		
		box-sizing: border-box;
		width: 100%;
		margin-top: 0.5em;
    }
	
	.filtersvg svg {
	  stroke-width: 1.0;
	}
	
	.filter-title {
		padding: 14px 15px;
	}


     .car-cards-container {
        grid-template-columns: repeat(1, 1fr); 
    }
    
    .car-model {
          max-width: 308px;
    }
    
    .car-image-container {
        max-width: 600px;
    }
    
    .news-full, .news-half {
        flex: 1 1 100%; /* Beiträge nehmen die volle Breite ein */
		text-align: center;
		display: block;
		padding-bottom: 20px;
    }
	
	.news-link-full {
		display: block;
		width: auto;
	}
	
	.news-content-full {
		padding-left: 0;
		width: 100%;
	}
    
    .news-container {
        gap: 1.5em; /* Weniger Abstand auf kleinen Bildschirmen */
    }
    
    .news-item:nth-child(n+4) { /* Ab dem 4. Beitrag ausblenden */
        display: none;
    }
    
    	
	.headernavigation {
	display: none;
	}

	.garagereichlinlogo {
	flex-grow: 1;
    padding-top: 0;
    margin-left: 10px;
	}
	
	.garagereichlinlogo a img {
	width: 170px;
	}
	
	h1 {
        font-size: 1.8em !important;

	}
	
	h2 {
        font-size: 1.3em !important;
	}
	
    /* Titel-Styling */
    .news-title {
    font-size: 1.2em;
    }
    
	/*Navigationswrapper*/
 
      #navigationswrapper {
        top: 80px; /* Match new header height */
    }
    
	.mobilemenubutton {
	padding-right: 10px;
	text-align: right;
	width: 45px;
	}
	
	.footernavi {
	display: none
	}
	
	.main {
    padding-left: 10px;
    padding-right: 10px;
	}
	
	.carousel-wrapper {
    }
    
    .carousel-wrapper-startseite {
    height: 95vh !important;
    }
    
     .carousel {
        width: 100%;
        height: 100%;
        position: relative;
        overflow: hidden;
        touch-action: pan-x pinch-zoom;
    }

       .carousel img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        opacity: 0;
        transition: opacity 0.3s ease, transform 0.3s ease;
        display: block; /* Ensure image is displayed */
    }

    /* Active image state */
    .carousel img.active {
        opacity: 1;
        z-index: 1; /* Ensure active image is on top */
        display: block;
    }
	
	.container {
	max-width: 767px;
	}
	
	.fzdetailservicewrapper {
        grid-template-columns: repeat(1, 1fr);
        gap: 20px;
	}    
		
	.fzdetailbemerkung {
	width: 100%
	}
	
	.fzdetailserienausstattungwrapper {
		width: 100%;
		column-count: 1;
	}
	
	.fzdetailtag {
		padding-bottom: 20px;
		padding-top: 0;
	}
	
	.element12 {
	width: 100%;
	padding-right: 0;
	margin-bottom: 0em;
	}
	
	.element12small {
	width: 75%;
	margin-left: 0;
	margin-right: 0;
	padding: 0
	}
	
	.element12smallleft {
	width: 75%;
	justify-content: flex-start;
	margin-bottom: 1em;
	margin-left: 0;
	margin-right: 0;
	padding: 0
	}
	
	.element13 {
	width: 100%;
	}		
    
    .probefahrt {
    width: 100%;
    }
	
	.markenlogo-grid {
    grid-template-columns: repeat(1, 1fr);
        padding: 0 20px;
	}
	
	.markenlogo {
	
	}
    
    .markenlogo-element {
   
    }
    
    .markenlogo-mitbutton {
  
    }
	
	.kialogo {

	}

	.opellogo {
	}

	.lexuslogo {
	}

	.toyotalogo {
	}

    .line-1 {
    margin-top: 0 !important;
    }
    
    .titelbild {
    padding-top: 1em;
    }
    
    .titelbildtext a {
    margin-top: 3px !important
    }
    
	
	.titelbildtext img {
	margin-left: auto;
	margin-right: auto;
	margin-top: 1em
	}
	
	.fahrzeuglistepic {
    width: 100%;
	}
	
	.quicklinkboxwrapper {
	margin-top: 4em;
	margin-bottom: 2em;
	}
	
	.quicklinkbox {
	width: 100%;
	}
	
	.centertext {
	width: 100%;
    padding: 0;
	margin-bottom: 2.5em;
	}
    
    .filterbuttonscontainer {
    display: flex;
    width: 100%;
    position: fixed;
    bottom: 0;
    background-color: #FFF;
    }
    
    .linkfilterreset {
    width: 50%;
    margin: 0;
	padding-right: 20px;
    padding-top: 15px;
    padding-left: 20px;
    padding-bottom: 20px;
	font-size: 1em;
    text-align: center;
    box-sizing: border-box;
    color: #374151;
    background: linear-gradient(to right, #f3f4f6 0%, white 50%, #f3f4f6 100%);
    background-size: 200% 100%;
    background-position: 100% 0;
    transition: background-position 0.5s ease;
    border: 2px solid #0055A0;    
    }
    
    .fahrzeuglistefilterschliessen {
    display: flex;
    width: 50%;    
    margin: 0;
	color: #0055A0;
	padding-right: 20px;
    padding-top: 15px;
    padding-left: 20px;
    padding-bottom: 20px;
	font-size: 1em;
    text-align: center;
    box-sizing: border-box;
    color: #FFF;
    background: linear-gradient(to left, #2563eb 0%, #1e3a8a 50%, #2563eb 100%);
    background-size: 200% 100%;
    background-position: 100% 0;
    transition: background-position 0.5s ease; 
    justify-content: center;
    }
	
	.fahrzeuglistefilter {
	flex-direction: column;
	}
	
	.fahrzeuglistefilterspalte {
	width: 100%;
	margin-top: 0;
	margin-bottom: 1.5em;
	border-left: none;	
	min-width: none;
	max-width: none;
	padding-left: 0
	}	
	
	.fahrzeuglistefilterspalte span {
	height: 28px;
	}
	
	.fahrzeuglistefilterspalte span:hover {
	background-color: transparent;
	}
	
	.titelleistefahrzeugsuche {
		width: 100%;
		margin-bottom: 0;
	}	
	
    .fahrzeuglistepic img {
	align-self: center;
    }
    
	.fahrzeugsortierung {
        max-width: 45%;
	}
	
	.teammember {
		width: 100%;
		margin-bottom: 3em;
		flex-wrap: inherit;
	}
	
	.teammember h3 {
		margin-bottom: 0.25em;
	}
	
	.teammember img {
		padding-right: 25px;
	}
	
	.teammemberdetail {
		width: auto;
	}
	
	.neuwagenbestseller a {
	width: calc(100% / 2);
	box-sizing: border-box;
	padding: 25px;
	margin-bottom: 0.5em;
}

.bildergallerie a {
	width: 47%;
	margin-bottom: 1.5em;
}
    
.newsmain {
        margin-top: 0 !important;
}
    
.newsartikel h1 {
    margin-top: 0;    
}
    
.newsartikel h2 {
     margin-bottom: 1em
}
    
.newseinleitung {
     margin-bottom: 1em
}
    
.newsbild {
    padding-top: 4%;
    padding-bottom: 0;
    width: 100%;
    margin-top: 0;
    margin-bottom: 0;
}
    
.image-grid-meilensteine {
  display: flex;
    flex-direction: column;
    width: 90%;
    margin-left: auto;
    margin-right: auto;           
}
	
.image-grid-meilensteine div {
	padding-top: 1.5em;
	padding-bottom: 1.5em;
}
    

.textleft {
    width: 100%;
    margin-bottom: 1.5em;
}
    
.footercopyright {
     flex-wrap: wrap
    }
    
 .footerlogo {
     width: 100%;
     text-align: center;
}
	
	.fzdetailtitel {
		width: 100%;
		padding-left: 10px;
		padding-right: 10px;
		padding-top: 15px;
	}
	
	.fzdetaildatenwrapper {
		grid-template-columns: repeat(1, 1fr);
		max-width: 100%;
	}	
	
	.fzdetaildatenlabel {
		white-space: nowrap;
		flex-grow: 1;
	}
	
	.fzdetaildatenwert {
		flex-grow: 0;
		width: auto;
	}
	
/*  #Formular ================================================== */
	
	.fzdetailformulare {
		padding-left: 0;
		padding-right: 0
		
	}
	
	select, textarea {
	width: 100% !important
	}
	
	form select {
		padding-left: 6px;
        padding-top: 0;
        padding-bottom: 0;
	}

	form input[type="text"], form input[type="email"], form input[type="date"]  {
		width: 100%;
		min-width: 350px;
	}	
    
    .labelbold {
        margin-top: 1em;
    }

	form div {
		width: 100%;
	}

	form input[type="checkbox"] {
		margin-right: 8px;
	}

	.schritt {
		width: 60px; 
		margin-left: 10px;
		margin-right: 10px; 
		text-align: center;
		padding: 0px 10px 3px 10px;
		font-size: 1em;
		}

	.schritt span {
		display: none
		}

	.nummer {
		display: block !important
		}

	.schrittaktiv {
		color: #FFF;
		}

	.schritterledigt {
		}

	.fortschritt {
		width: 100%;
		}	

	form {
		width: 100%;
		padding: 1em 0.5em;
		box-sizing: border-box;
		}
	
	form h2 {
		margin-top: 0.5em; 
	}

	.tooltip [data-tip]:after {
		display:none; 
		content:attr(data-tip); 
		width: 100%;
		position: static;
		margin-top: 5px;
		}

	.checkboxnutzungderdaten {
		width: 100%;
		}

    #InpSort {
        display: none;
    }

	#FbMessage, #FbName, #FbMail, #FbPhone, #FbMsgStep1, #FbMsgStep2, #FbMsgStep3, #FbMsgStep4, #FbCarQuestMessage, #FbCarQuestName, #FbCarQuestMail, #FbCarQuestPhone, #FbCarDriveDate, #FbCarDriveTime, #FbCarDriveName, #FbCarDrivePhone, FbCarDriveMail {
		
	}
    
    .gallery-container {
        flex-direction: column;
    }

    .main-image {
    width: 100%;
    aspect-ratio: 4/3;
    position: relative;
    overflow: hidden; 
    flex-basis: fit-content;
    }
    
    .carousel-nav {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: rgba(0, 0, 0, 0.5);
    opacity: 1; /* Always visible on mobile */
    transform: translateY(-50%);
    transition: background-color 0.3s ease;
    z-index: 2;
    bottom: -12px;    
    }
    
    .carousel-nav:active {
        background: rgba(0, 0, 0, 0.9);
    }
        
     .carousel::after {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.1);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .carousel.is-swiping::after {
        opacity: 1;
    }

    .main-image:hover .carousel-nav {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }

    .large-thumbnail {
        display: none;
    }

    .small-thumbnails {
    }
    
       .lightbox {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 1);
        z-index: 2500;
    }

    .lightbox.active {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    
    .lightbox-content {
    width: 100%;
    height: 100%;
    padding: 0;
    justify-content: center;
    margin-bottom: 5em;
    }

  .lightbox-main-image {
        max-height: 70vh;
        width: 100%;
        object-fit: contain;
        transition: transform 0.3s ease;
        transform: translateX(0);
        will-change: transform;
    }

   .lightbox-nav {
        position: fixed;
        top: 65%;
        transform: translateY(-50%);
        width: 44px;
        height: 44px;
        background: rgba(0, 0, 0, 0.7);
        color: white;
        border: none;
        font-size: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 2501;
    }
    
    .lightbox-nav.prev {
        left: 30px;
    }

    .lightbox-nav.next {
        right: 30px;
    }

    .lightbox-close {
        position: fixed;
        top: 10px;
        right: 10px;
        z-index: 2501;
    }

 
    .lightbox-thumbnails {
           position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 10px;
        background: rgba(0, 0, 0, 0.8);
        display: flex;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }

    .lightbox-thumbnails::-webkit-scrollbar {
        display: none; /* Chrome, Safari */
    }

    
     .lightbox-thumbnails img {
        width: 60px;
        height: 60px;
        border: 2px solid transparent;
    }
    
    .lightbox-thumbnails img.active {
        border-color: #fff;
    }
    
    /* Touch feedback */
    .thumbnail-wrapper:active,
    .lightbox-thumbnails img:active {
        opacity: 0.7;
    }

    .carousel-nav:active,
    .lightbox-nav:active,
    .lightbox-close:active {
        transform: scale(0.95);
    }

    /* Disable hover effects on mobile */
    .thumbnail-wrapper:hover img,
    .large-thumbnail:hover img {
        transform: none;
    }

    /* Swipe hint animation */
    @keyframes swipeHint {
        0%, 100% { transform: translateX(0); }
        50% { transform: translateX(20px); }
    }

    /* Hide large thumbnail on mobile */
    .large-thumbnail {
        display: none;
    }

    
    /* Improve touch targets */
    .lightbox-nav,
    .lightbox-close {
        padding: 12px;
        touch-action: manipulation;
    }
    
    /* Add swipe hint on mobile */
    .lightbox::after {
        content: 'Swipe to navigate';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: white;
        background: rgba(0, 0, 0, 0.7);
        padding: 10px 20px;
        border-radius: 20px;
        font-size: 14px;
        opacity: 0.8;
        pointer-events: none;
        animation: fadeOut 2s forwards 1s;
    }
    
    .gallery-container,
    .carousel,
    .main-image,
    .lightbox,
    .lightbox-main-image,
    .thumbnail-wrapper,
    .carousel-nav,
    .lightbox-nav {
        touch-action: none;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }

    /* Ensure proper rendering for touch interactions */
    .carousel img {
        pointer-events: none;
        will-change: transform;
    }

    .lightbox-main-image {
        pointer-events: none;
        will-change: transform;
        touch-action: none;
    }
	
	