/* =========================
   MOBILE OPTIMIERUNG
   Perko Production
========================= */

@media (max-width: 991px) {

    /* ===== BODY ===== */
    body {
        font-size: 14px;
        line-height: 1.4;
    }

    h1 { font-size: 26px; }
    h2 { font-size: 22px; }
    h3 { font-size: 18px; }

    /* ===== HEADER ===== */
    #header {
        padding: 10px 0;
        background: #111 !important;
    }

    #header #logo {
        top: 8px !important;
    }

    #header #logo img {
        max-height: 28px !important;
    }

    /* ===== MENU ===== */
    .tt-menu-collapse {
        background: #111;
        padding: 15px;
    }

    .tt-menu-nav {
        width: 100%;
    }

    .tt-menu-nav > li {
        display: block;
        width: 100%;
        text-align: center;
        margin: 0;
    }

    .tt-menu-nav > li > a {
        display: block;
        padding: 14px;
        font-size: 16px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    /* ===== CONTENT ===== */
    section {
        padding: 40px 15px !important;
    }

    .tt-heading-title {
        font-size: 24px !important;
    }

    .tt-heading-subtitle {
        font-size: 14px !important;
    }

    /* ===== GRID FIX ===== */
    .col-md-6,
    .col-md-4,
    .col-md-3 {
        width: 100%;
        margin-bottom: 20px;
    }

    /* ===== BUTTONS ===== */
    .btn {
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }

    /* ===== IMAGES ===== */
    img {
        width: 100%;
        height: auto;
    }

    /* ===== TOUCH OPTIMIERUNG ===== */
    a {
        padding: 8px 4px;
    }

    input, textarea {
        font-size: 16px !important;
    }

    /* ===== FIX OVERFLOW ===== */
    body {
        overflow-x: hidden;
    }

}


/* ===== MOBILE CTA BUTTON ===== */
@media (max-width: 768px) {
    .mobile-cta {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        z-index: 9999;
        background: #08c1b8;
        color: #fff;
        text-align: center;
        padding: 15px;
        font-weight: bold;
    }
}
/* =========================
   SOCIAL PAGE FIX
========================= */
@media (max-width: 768px) {

    /* Container auf 1 Spalte */
    .social-item,
    .portfolio-item,
    .isotope-item {
        width: 100% !important;
        float: none !important;
        display: block !important;
    }

    /* Bilder & Videos sauber */
    .social-item img,
    .social-item video,
    .portfolio-item img,
    .portfolio-item video {
        width: 100% !important;
        height: auto !important;
        display: block;
    }

    /* Abstand zwischen Items */
    .social-item,
    .portfolio-item {
        margin-bottom: 20px;
    }

    /* FIX gegen Überlappen */
    .isotope {
        display: block !important;
    }

    .isotope .isotope-item {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
    }
    .isotope-top-content{
        padding: 10px 3% 10px 3%;
    }
}
/* =========================
   VIDEOS ZENTRIEREN (MOBILE)
========================= */
@media (max-width: 768px) {

    /* gesamtes Item zentrieren */
    .social-item,
    .portfolio-item,
    .isotope-item {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
    }

    /* innerer Content */
    .social-item > *,
    .portfolio-item > *,
    .isotope-item > * {
        max-width: 90%;
        margin: 0 auto;
    }

    /* Videos */
    video {
        display: block;
        margin: 0 auto;
        max-width: 100%;
        height: auto;
    }

    /* Bilder ebenfalls */
    img {
        display: block;
        margin: 0 auto;
    }

}
/* =========================
   FIX OVERLAP SECTIONS
========================= */
@media (max-width: 768px) {

    /* Isotope Container Höhe korrekt */
    .isotope {
        height: auto !important;
        overflow: visible !important;
    }

    /* Items normal im Flow */
    .isotope-item {
        position: relative !important;
        display: block !important;
        width: 100% !important;
        margin-bottom: 30px;
    }

    /* WICHTIG: Elterncontainer darf nicht absolut sein */
    .isotope,
    .isotope-wrap,
    .portfolio-wrap {
        position: relative !important;
    }

    /* nächste Section Abstand erzwingen */
    .tt-section,
    section {
        clear: both;
        position: relative;
        z-index: 1;
    }

}
/* =========================
   FIX: OVERLAY SECTION MOBILE
========================= */
@media (max-width: 768px) {

    /* "Weitere Projekte" Overlay deaktivieren */
    .tt-gallery-carousel,
    .tt-carousel,
    .tt-content-carousel,
    .tt-grid-item {
        position: relative !important;
    }

    /* Text nicht mehr absolut mittig */
    .tt-grid-item .tt-heading,
    .tt-grid-item .tt-heading-inner,
    .tt-grid-item .tt-heading-title,
    .tt-grid-item .tt-heading-subtitle {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        text-align: center;
        padding: 20px 10px;
    }

    /* verhindert dass Elemente übereinander liegen */
    .tt-grid-item {
        margin-bottom: 30px;
        overflow: hidden;
    }

    /* GANZ WICHTIG: Section darunter freimachen */
    section,
    .tt-section {
        position: relative;
        z-index: 2;
        margin-top: 0;
    }

}

/* =========================
   VIDEOS RELATIVE (MOBILE FIX)
========================= */
@media (max-width: 768px) {

    /* gesamter Video Container */
    .social-item,
    .portfolio-item,
    .isotope-item {
        position: relative !important;
        display: block !important;
        width: 100% !important;
        float: none !important;
        transform: none !important;
    }

    /* alle inneren Wrapper */
    .social-item *,
    .portfolio-item *,
    .isotope-item * {
        position: relative !important;
    }

    /* Video selbst */
    video {
        position: relative !important;
        display: block;
        width: 100% !important;
        height: auto !important;
        margin: 0 auto;
        z-index: 1;
    }

    /* verhindert Overlay von Text */
    .tt-heading,
    .tt-heading-inner {
        position: relative !important;
        transform: none !important;
        top: auto !important;
        left: auto !important;
    }

    /* wichtig: kein Überlappen mehr */
    .isotope {
        height: auto !important;
        overflow: visible !important;
    }

}