/* ==========================================================================
   MOBILE & RESPONSIVE ENHANCEMENTS FOR BOSCH DIZEL SERVIS RISTOVIĆ
   ========================================================================== */

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

.allcontain {
    overflow-x: hidden;
}

/* Global responsive image fix */
img {
    max-width: 100%;
    height: auto;
}

@media screen and (max-width: 767px) {
    /* --------------------------------------------------
       1. TOP HEADER (Phone & Email)
       -------------------------------------------------- */
    .header {
        padding: 8px 12px !important;
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 8px 14px !important;
        background-color: #14171c !important;
    }
    .header .socialicon {
        display: none !important;
    }
    .header .givusacall,
    .header .logreg {
        display: inline-flex !important;
        align-items: center !important;
        padding: 0 !important;
        margin: 0 !important;
        float: none !important;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
        font-size: 13px !important;
        letter-spacing: 0.5px !important;
    }
    .header .givusacall li,
    .header .logreg li {
        float: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .header .givusacall a,
    .header .logreg a {
        color: #fff !important;
        text-decoration: none !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 5px 10px !important;
        background: rgba(255, 255, 255, 0.12) !important;
        border-radius: 4px !important;
        transition: background 0.2s ease !important;
    }
    .header .givusacall a:hover,
    .header .logreg a:hover {
        background: rgba(5, 113, 188, 0.6) !important;
    }

    /* --------------------------------------------------
       2. TOP NAVBAR & LOGO & HAMBURGER
       -------------------------------------------------- */
    .topnavbar {
        background: #fff !important;
        border: none !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
        margin-bottom: 0 !important;
    }
    .topnavbar .container {
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        width: 100% !important;
    }
    .topnavbar .navbar-header {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        float: none !important;
        padding: 8px 0 !important;
        margin: 0 !important;
        min-height: 52px !important;
    }
    .topnavbar .navbar-brand.logo,
    .logo {
        position: static !important;
        float: none !important;
        width: auto !important;
        height: auto !important;
        max-height: 42px !important;
        padding: 0 !important;
        margin: 0 !important;
        transform: none !important;
        -webkit-transform: none !important;
        display: flex !important;
        align-items: center !important;
    }
    .topnavbar .navbar-brand.logo img,
    .logo img {
        height: 36px !important;
        max-height: 36px !important;
        width: auto !important;
        max-width: 180px !important;
        object-fit: contain !important;
        display: block !important;
    }
    .topnavbar .toggle-costume {
        float: none !important;
        margin: 0 !important;
        padding: 8px 11px !important;
        background-color: #0571bc !important;
        border: none !important;
        border-radius: 6px !important;
        transition: all 0.2s ease !important;
    }
    .topnavbar .toggle-costume:focus,
    .topnavbar .toggle-costume:hover {
        background-color: #045a96 !important;
    }
    .topnavbar .toggle-costume .icon-bar {
        background-color: #fff !important;
        height: 3px !important;
        border-radius: 2px !important;
        width: 22px !important;
    }
    .topnavbar .toggle-costume .icon-bar + .icon-bar {
        margin-top: 4px !important;
    }

    /* Collapsed menu dropdown */
    #upmenu {
        background: #fff !important;
        border-top: 1px solid #f0f0f0 !important;
        box-shadow: 0 6px 15px rgba(0,0,0,0.1) !important;
        padding: 0 !important;
        margin: 0 !important;
        max-height: calc(100vh - 120px) !important;
        overflow-y: auto !important;
    }
    #navbarontop {
        padding: 8px 0 !important;
        height: auto !important;
        margin: 0 !important;
    }
    #navbarontop > li {
        float: none !important;
        margin: 0 !important;
    }
    #navbarontop > li > a {
        display: block !important;
        padding: 13px 20px !important;
        margin: 0 !important;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        letter-spacing: 0.5px !important;
        color: #222 !important;
        border-bottom: 1px solid #f3f3f3 !important;
        border-left: 4px solid transparent !important;
        transition: all 0.2s ease !important;
    }
    #navbarontop > li.active > a,
    #navbarontop > li > a:hover {
        color: #0571bc !important;
        background: #f7faff !important;
        border-left: 4px solid #0571bc !important;
    }

    /* --------------------------------------------------
       3. HERO SLIDER & MIDDLE TITLE
       -------------------------------------------------- */
    #carousel-up {
        position: relative !important;
    }
    #carousel-up .carousel-inner .item img {
        min-height: 200px !important;
        max-height: 280px !important;
        object-fit: cover !important;
        width: 100% !important;
    }
    .midle-nav {
        position: relative !important;
        top: 0 !important;
        bottom: 0 !important;
        background: #0571bc !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }
    #navbarmidle,
    #navbarmidle.collapse {
        display: block !important;
        height: auto !important;
        visibility: visible !important;
        padding: 12px 15px !important;
        background: #0571bc !important;
        margin: 0 !important;
    }
    .searchtxt {
        max-width: 100% !important;
        padding: 0 !important;
    }
    .searchtxt > h1 {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
        font-size: 17px !important;
        font-weight: 700 !important;
        color: #fff !important;
        letter-spacing: 1.5px !important;
        margin: 0 !important;
        padding: 0 !important;
        text-align: center !important;
        text-transform: uppercase !important;
    }

    /* --------------------------------------------------
       4. SECTION HEADINGS (U S L U G E, V I D E O, etc.)
       -------------------------------------------------- */
    .feturedsection,
    .latestcars {
        padding: 25px 15px 15px !important;
        margin: 0 !important;
    }
    .feturedsection > h1,
    .latestcars > h1 {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
        font-size: 20px !important;
        font-weight: 700 !important;
        letter-spacing: 3px !important;
        color: #0571bc !important;
        margin: 0 !important;
        text-align: center !important;
    }

    /* --------------------------------------------------
       5. FEATURED SERVICES CARDS (HOMEPAGE)
       -------------------------------------------------- */
    .feturedimage {
        padding: 0 15px !important;
    }
    .feturedimage .firstrow {
        margin: 0 !important;
    }
    .costumcol {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 0 20px 0 !important;
        padding: 0 !important;
    }
    .costumrow {
        display: flex !important;
        flex-direction: column !important;
        background: #fff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 10px !important;
        overflow: hidden !important;
        box-shadow: 0 3px 12px rgba(0,0,0,0.06) !important;
        margin: 0 !important;
    }
    .colborder1, .colborder2 {
        border: none !important;
    }
    .img1colon {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .img1colon img,
    .img1colon img.object-fit {
        width: 100% !important;
        height: 200px !important;
        object-fit: cover !important;
        display: block !important;
    }
    .txt1colon {
        width: 100% !important;
        max-width: 100% !important;
        padding: 20px 18px !important;
        margin: 0 !important;
    }
    .featurecontant {
        width: 100% !important;
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
        text-align: center !important;
    }
    .featurecontant > h1 {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
        font-size: 18px !important;
        font-weight: 700 !important;
        color: #222 !important;
        margin: 0 0 10px 0 !important;
        letter-spacing: 0.5px !important;
    }
    .featurecontant > p {
        margin: 0 !important;
    }
    .featurecontant > h2 {
        display: none !important; /* Remove excessive empty whitespace */
    }
    .featurecontant > button {
        width: 100% !important;
        margin: 15px 0 0 0 !important;
        padding: 13px 20px !important;
        background: #e52d27 !important;
        border: none !important;
        border-radius: 6px !important;
        letter-spacing: 1px !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        box-shadow: 0 3px 8px rgba(229, 45, 39, 0.3) !important;
    }
    .featurecontant > button a {
        color: #fff !important;
        display: block !important;
        text-decoration: none !important;
    }

    /* --------------------------------------------------
       6. VIDEO SECTION (16:9 RESPONSIVE)
       -------------------------------------------------- */
    .video-responsive-wrapper {
        position: relative !important;
        padding-bottom: 56.25% !important;
        height: 0 !important;
        overflow: hidden !important;
        border-radius: 10px !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.12) !important;
    }
    .video-responsive-wrapper iframe {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        border: 0 !important;
    }

    /* --------------------------------------------------
       7. GALLERY PREVIEWS (2 COLUMNS ON MOBILE)
       -------------------------------------------------- */
    .pocetna-galerija {
        padding: 0 10px !important;
    }
    .pocetna-galerija .row {
        margin: 0 -5px !important;
        display: flex !important;
        flex-wrap: wrap !important;
    }
    .pocetna-galerija .row > div {
        padding: 0 5px 10px 5px !important;
        width: 50% !important;
        float: left !important;
    }
    .txthover {
        border-radius: 8px !important;
        overflow: hidden !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
    }
    .txthover img {
        width: 100% !important;
        height: 130px !important;
        object-fit: cover !important;
        display: block !important;
    }

    /* --------------------------------------------------
       8. NEWSLETTER / CONTACT SECTION (FIXING ROTATION BUG)
       -------------------------------------------------- */
    .newslettercontent {
        position: relative !important;
        margin: 25px 15px 35px !important;
        padding: 24px 18px !important;
        background: linear-gradient(135deg, #1f2329 0%, #111418 100%) !important;
        border-radius: 12px !important;
        box-shadow: 0 8px 24px rgba(0,0,0,0.18) !important;
        overflow: hidden !important;
        height: auto !important;
    }
    .leftside {
        position: static !important;
        width: 100% !important;
        text-align: center !important;
        margin-bottom: 20px !important;
    }
    .leftside > img {
        display: none !important; /* Remove buggy rotated border image */
    }
    .leftside > h1 {
        position: static !important;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
        font-size: 20px !important;
        font-weight: 700 !important;
        color: #fff !important;
        letter-spacing: 2px !important;
        margin: 0 0 10px 0 !important;
        text-align: center !important;
    }
    .leftside > p {
        position: static !important;
        width: 100% !important;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
        font-size: 14px !important;
        line-height: 1.5 !important;
        color: #ccd2db !important;
        margin: 0 !important;
        text-align: center !important;
    }
    .rightside {
        position: static !important;
        width: 100% !important;
        left: auto !important;
        top: auto !important;
        text-align: center !important;
    }
    .rightside > img,
    .rightside .newsimage {
        width: 100% !important;
        height: 170px !important;
        object-fit: cover !important;
        border-radius: 8px !important;
        margin-bottom: 16px !important;
        display: block !important;
    }
    .rightside > button {
        position: static !important;
        width: 100% !important;
        margin: 0 !important;
        left: auto !important;
        top: auto !important;
        padding: 14px 20px !important;
        background: #0571bc !important;
        border: none !important;
        border-radius: 6px !important;
        font-size: 19px !important;
        font-weight: 700 !important;
        letter-spacing: 1px !important;
        box-shadow: 0 4px 14px rgba(5,113,188,0.4) !important;
    }
    .rightside > button a {
        color: #fff !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        text-decoration: none !important;
    }
    .rightside > button a::before {
        content: "\f095";
        font-family: FontAwesome;
        margin-right: 8px;
    }

    /* --------------------------------------------------
       9. FOOTER & BOTTOM MENU
       -------------------------------------------------- */
    .bottommenu {
        top: 0 !important;
        padding: 30px 15px 75px !important; /* space for sticky bar */
        background: #fbfbfb !important;
    }
    .bottomlogo img {
        width: 60% !important;
        max-width: 200px !important;
        margin: 0 auto 15px !important;
    }
    .bottommenu > ul,
    .bottomlinks {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px 16px !important;
        padding: 0 !important;
        margin: 0 0 20px 0 !important;
        border: none !important;
    }
    .bottomlinks > li {
        float: none !important;
        margin: 0 !important;
    }
    .bottomlinks > li > a {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        letter-spacing: 1px !important;
        color: #444 !important;
        padding: 4px 8px !important;
        border: none !important;
        border-radius: 4px !important;
    }
    .bottommenu > p {
        padding-top: 0 !important;
        font-size: 13px !important;
        line-height: 1.6 !important;
        color: #666 !important;
        text-align: center !important;
        max-width: 500px !important;
        margin: 0 auto 20px !important;
    }
    .bottommenu > p br {
        display: none !important; /* avoid awkward jagged line breaks */
    }
    .bottommenu > img {
        display: block !important;
        padding: 0 !important;
        margin: 15px auto !important;
        max-width: 200px !important;
    }
    .footer {
        height: auto !important;
        padding: 12px 15px !important;
        margin-top: 15px !important;
        background-color: #111 !important;
    }
    .copyright {
        float: none !important;
        text-align: center !important;
        padding: 0 !important;
        margin-bottom: 6px !important;
        font-size: 12px !important;
        color: #999 !important;
    }
    .atisda {
        float: none !important;
        text-align: center !important;
        padding: 0 !important;
        font-size: 12px !important;
    }
    .atisda a {
        color: #0571bc !important;
        padding: 0 4px !important;
    }

    /* --------------------------------------------------
       10. USLUGE PAGE
       -------------------------------------------------- */
    .container h2 {
        font-size: 18px !important;
        line-height: 1.4 !important;
        margin-top: 25px !important;
        color: #0571bc !important;
        font-weight: 700 !important;
    }
    .container p {
        font-size: 14px !important;
        line-height: 1.6 !important;
        color: #444 !important;
    }
    .container p br {
        display: none !important; /* avoid jagged line wraps on mobile */
    }
    .container ul {
        padding-left: 20px !important;
        font-size: 14px !important;
        line-height: 1.7 !important;
    }
    .container img {
        max-width: 100% !important;
        height: auto !important;
        border-radius: 8px !important;
        margin-bottom: 12px !important;
        box-shadow: 0 3px 10px rgba(0,0,0,0.08) !important;
    }

    /* --------------------------------------------------
       11. KONTAKT PAGE
       -------------------------------------------------- */
    .contact-card-box {
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        padding: 18px 15px;
        margin-bottom: 15px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
        text-align: center;
        font-size: 15px;
        line-height: 1.6;
    }
    .contact-card-box .icon {
        font-size: 24px;
        color: #0571bc;
        margin-bottom: 8px;
        display: block;
    }
    .contact-card-box a {
        color: #0571bc;
        font-weight: 600;
    }
    .map-responsive {
        border-radius: 10px;
        overflow: hidden;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        height: 320px !important;
        margin-bottom: 25px;
    }
    .map-responsive iframe {
        height: 320px !important;
    }

    /* --------------------------------------------------
       12. GALERIJA PAGE
       -------------------------------------------------- */
    .galerija.row {
        margin: 0 -5px !important;
        display: flex !important;
        flex-wrap: wrap !important;
    }
    .galerija.row > div {
        padding: 0 5px 10px 5px !important;
        width: 50% !important;
        float: left !important;
    }
    .galerija.row img {
        width: 100% !important;
        height: 130px !important;
        object-fit: cover !important;
        border-radius: 6px !important;
        display: block !important;
        box-shadow: 0 2px 6px rgba(0,0,0,0.08) !important;
    }

    /* --------------------------------------------------
       13. STICKY MOBILE CALL BAR (ACTION BAR AT BOTTOM)
       -------------------------------------------------- */
    .mobile-sticky-action-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 58px;
        background: #14171c;
        display: flex;
        align-items: center;
        justify-content: space-around;
        padding: 7px 12px;
        box-shadow: 0 -4px 16px rgba(0,0,0,0.3);
        z-index: 99999;
    }
    .mobile-sticky-action-bar a {
        flex: 1;
        margin: 0 6px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        border-radius: 6px;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        font-size: 14px;
        font-weight: 700;
        text-decoration: none;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        transition: transform 0.1s ease;
    }
    .mobile-sticky-action-bar a:active {
        transform: scale(0.97);
    }
    .mobile-sticky-action-bar .btn-call {
        background: #e52d27;
        color: #fff !important;
        box-shadow: 0 2px 8px rgba(229, 45, 39, 0.4);
    }
    .mobile-sticky-action-bar .btn-nav {
        background: #0571bc;
        color: #fff !important;
        box-shadow: 0 2px 8px rgba(5, 113, 188, 0.4);
    }
}

/* Hide sticky bar on desktop */
@media screen and (min-width: 768px) {
    .mobile-sticky-action-bar {
        display: none !important;
    }
}
