/* 
    Autoshine.lk - Mobile Responsive Overrides
    -------------------------------------------
    This file contains all custom mobile fixes and high-fidelity 
    adjustments for devices under 768px.
*/

@media (max-width: 767px) {

    /* ── Global Mobile Fixes ── */
    body.home {
        padding-top: 0 !important;
    }

    .page-header {
        position: fixed !important;
        top: 0 !important;
        width: 100% !important;
        z-index: 9999 !important;
    }

    /* Header row gap fix */
    .page-header .header-row {
        padding: 10px 0 !important;
        min-height: 60px !important;
        display: flex !important;
        align-items: center !important;
    }

    /* Appointment button in header */
    .appointment-btn {
        padding: 6px 12px !important;
        font-size: 11px !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        margin: 0 10px 0 0 !important;
        /* Right margin to shift left */
        width: auto !important;
        transform: translateX(-5px) !important;
        /* Explicit shift left */
    }

    /* ── Hero Slider — flush to navbar, zero gap to promo below ── */
    #hero-slider {
        margin: 0 !important;
        padding: 0 !important;
        height: 300px !important;
    }

    body.home #pageContent,
    body.home .content-area {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    #hero-slider .slide,
    #hero-slider .img--holder {
        height: 300px !important;
        min-height: 300px !important;
        margin: 0 !important;
        top: 0 !important;
    }

    #hero-slider .img--holder {
        background-size: cover !important;
        background-position: center !important;
    }

    #hero-slider .slick-slider,
    #hero-slider .slick-list,
    #hero-slider .slick-track,
    #mainSliderWrapper {
        margin: 0 !important;
        padding: 0 !important;
        height: 300px !important;
    }

    /* Zero gap between slider and promo banner */
    #promo-banner {
        margin-top: 0 !important;
    }

    #promo-banner .block {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    /* Slide Content Glassmorphism & Perfect Centering */
    .slide-content {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .slide-content .vert-wrap,
    .slide-content .vert {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        height: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .slide-content h3 {
        font-size: 28px !important;
        line-height: 1.15 !important;
        text-align: center !important;
    }

    .slide-content h4 {
        font-size: 13px !important;
        text-align: center !important;
    }

    .slide-content p {
        font-size: 14px !important;
        text-align: center !important;
    }

    .slide-content .vert>.container {
        padding: 25px 20px !important;
        max-width: 90% !important;
        border-radius: 15px !important;
        margin-top: 0 !important;
        background: rgba(0, 0, 0, 0.45) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }

    .slide-content .btn {
        margin: 15px auto 0 !important;
        display: table !important;
    }

    /* ── Promo-01 Banner (After Hours Drop-Off) ── */
    .promo-01 {
        padding: 18px 15px !important;
    }

    .promo-01__col-right .btn {
        width: auto !important;
    }

    /* ── What We Do (Home Only) ── */
    body.home #what-we-do .block {
        padding-top: 30px !important;
        padding-bottom: 30px !important;
    }

    body.home .services-block {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 15px !important;
    }

    body.home .services-block .service {
        width: 100% !important;
        float: none !important;
        margin-top: 15px !important;
        margin-bottom: 0 !important;
        display: block !important;
        border-radius: 8px !important;
        overflow: hidden !important;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1) !important;
        height: 220px !important; /* Slightly more compact */
        background-color: #fede00 !important; /* Match brand yellow base */
    }

    body.home .services-block .service.hidden-xs {
        display: none !important;
    }

    /* Card Image & Overlay */
    body.home .services-block .service .image {
        height: 100% !important;
        width: 100% !important;
        position: relative !important;
    }

    body.home .services-block .service .image img {
        height: 100% !important;
        object-fit: cover !important;
        opacity: 0.9 !important; /* Let some of the card color through */
    }

    /* Subtler gradient overlay */
    body.home .services-block .service .image:after {
        content: "" !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.55) 100%) !important;
        z-index: 1 !important;
    }

    /* Elegant Caption Styling */
    body.home .services-block .service .caption {
        position: absolute !important;
        bottom: 0 !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        padding: 15px !important;
        text-align: center !important;
        z-index: 5 !important;
        background: transparent !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
    }

    body.home .services-block .service .caption h3 {
        color: #fede00 !important;
        font-size: 21px !important;
        line-height: 1.2 !important;
        margin-bottom: 5px !important;
        font-weight: 700 !important;
        text-shadow: 0 1px 3px rgba(0,0,0,0.5) !important;
        text-transform: uppercase !important;
    }

    body.home .services-block .service .caption .text {
        color: #ffffff !important;
        font-size: 13px !important;
        line-height: 1.4 !important;
        margin-top: 0 !important;
        opacity: 1 !important;
        max-width: 85% !important;
        text-shadow: 0 1px 2px rgba(0,0,0,0.6) !important;
    }

    /* Restore background text but with mobile-optimized scale */
    body.home .services-block .services__text-background {
        display: block !important;
        font-size: 48px !important;
        bottom: 5px !important;
        opacity: 0.12 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        width: 100% !important;
    }

    /* ── Services Page (Our Services) Fixes ── */
    .services-alt {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

    .services-alt .col-xs-6,
    .services-alt .slick-slide {
        display: flex !important;
        height: auto !important;
        padding: 8px !important;
    }

    .services-block-alt {
        margin-bottom: 30px !important;
        background: transparent !important;
        border-radius: 0 !important;
        overflow: visible !important;
        padding: 0 !important;
        border: none !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        height: 100% !important;
        flex: 1 1 auto !important;
        transition: all 0.3s ease !important;
        position: relative !important;
        text-align: center !important;
        cursor: pointer !important;
    }

    .services-block-alt .image {
        position: relative !important;
        width: 100% !important;
        height: 140px !important;
        flex-shrink: 0 !important;
    }

    .services-block-alt .image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    /* Mobile Icon Styling - Centered Yellow Circle like Desktop */
    .services-block-alt .image i,
    .services-block-alt .image .fack_icon_div {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translate(-50%, -50%) scale(0.6) !important;
        top: 50% !important;
        left: 50% !important;
        position: absolute !important;
        margin: 0 !important;
        width: 118px !important;
        height: 118px !important;
        line-height: 118px !important;
        background-color: #fede00 !important;
        border-radius: 50% !important;
        color: #000 !important;
        font-size: 50px !important;
        text-align: center !important;
        z-index: 10 !important;
    }

    .services-block-alt .caption {
        padding: 20px 0 !important;
        text-align: center !important;
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
        justify-content: flex-start !important;
    }

    .services-block-alt .title {
        font-size: 22px !important;
        line-height: 1.2 !important;
        margin-bottom: 10px !important;
        font-weight: 700 !important;
        text-transform: capitalize !important;
    }

    .services-block-alt .title a {
        color: #111 !important;
        text-decoration: none !important;
    }

    .services-block-alt .text {
        font-size: 14px !important;
        line-height: 1.5 !important;
        color: #666 !important;
        margin: 0 !important;
    }

    .services-alt .col-xs-6 {
        padding: 8px !important;
    }

    .services-block-alt:active {
        transform: scale(0.98) !important;
    }

    .services-block-alt .image a.image-scale-color:before {
        content: "" !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        z-index: 5 !important;
    }

    .services-block-alt .caption .title a {
        position: static !important;
    }

    .services-block-alt .caption .title a:after {
        content: "" !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        right: 0 !important;
        z-index: 10 !important;
    }

    /* Tighten grid */


    /* ── How It Works — promo02 step cards ── */
    .promo02 .promo02__marker {
        font-size: 120px !important;
        top: -12px !important;
        left: -8px !important;
        width: 25% !important;
    }

    .promo02 .promo02__content {
        width: 75% !important;
    }

    .promo02 .promo02__img {
        height: 160px !important;
    }

    .promo02 .promo02__img .promo02__title {
        font-size: 14px !important;
        line-height: 1.3 !important;
    }

    .js-promo02-carousel.slick-initialized .promo02 {
        width: calc(100vw - 40px) !important;
        max-width: 360px !important;
    }

    /* ── 100% Guarantee boxes ── */
    .box01 {
        margin-bottom: 15px !important;
    }

    /* ── Why Choose Us cards ── */
    .text-icon {
        padding: 25px 15px !important;
        margin-bottom: 12px !important;
    }

    .text-icon .title {
        font-size: 18px !important;
    }

    /* ── Statistics ── */
    .stat-box02 {
        margin-bottom: 15px !important;
    }

    .video-block {
        display: block !important;
        width: 100% !important;
        margin: 20px 0 !important;
    }

    /* ── Appointment CTA ── */
    .img-move {
        display: block !important;
        max-width: 100% !important;
        margin: 10px auto 0 !important;
        opacity: 0.85 !important;
    }

    .img-move img {
        max-width: 100% !important;
        height: auto !important;
    }

    .text-appointment h2.h-phone {
        font-size: 20px !important;
    }

    h2.h-lg {
        margin-bottom: 15px !important;
    }

    h2.h-phone {
        margin-top: 10px !important;
    }

    p.info {
        margin-bottom: 15px !important;
    }

    /* ── Content buttons ── */
    .block .btn-border:not(.appointment-btn) {
        width: 100% !important;
        margin-bottom: 10px !important;
        border-radius: 8px !important;
    }

    /* ── Mobile Menu Fixes ── */
    #mobile-menu {
        z-index: 100000 !important;
        background: #0a0a0a !important;
    }

    .mm-fullscreen-bg {
        z-index: 99999 !important;
    }

    /* ── Mobile Navbar Modernization ── */
    .header-row-unified {
        padding: 10px 15px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        min-height: 60px !important;
    }

    .logo-main {
        max-height: 32px !important;
        width: auto !important;
    }

    .header-actions {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
    }

    .btn-text-desktop {
        display: none !important;
    }

    .btn-text-mobile {
        display: inline !important;
    }

    .appointment-btn {
        padding: 0 15px !important;
        font-size: 12px !important;
        height: 34px !important;
        border-radius: 17px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        background: #fede00 !important;
        color: #000 !important;
        font-weight: 700 !important;
        box-shadow: 0 4px 10px rgba(254, 222, 0, 0.2) !important;
        order: 1 !important; /* Move Book button to the left of the group */
    }

    .appointment-btn i {
        font-size: 14px !important;
        margin-right: 5px !important;
    }

    .search-trigger-btn {
        background: transparent !important;
        border: none !important;
        color: #ffffff !important; /* Ensure search icon is white */
        font-size: 18px !important;
        padding: 5px !important;
        display: flex !important;
        align-items: center !important;
        order: 2 !important; /* Position between Book and Menu */
    }

    /* Modern Burger Icon */
    .navbar-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        margin: 0 0 0 5px !important;
        width: 32px !important;
        height: 32px !important;
        background: transparent !important;
        border: none !important;
        order: 3 !important; /* Move Menu to the far right */
    }

    .burger-menu {
        width: 22px;
        height: 14px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .burger-menu .line {
        display: block;
        width: 100%;
        height: 2px;
        background-color: #ffffff !important; /* Changed to white for visibility */
        border-radius: 2px;
    }

    .burger-menu .line:nth-child(2) {
        width: 80%;
        margin-left: auto;
    }

    .mm-close-parent {
        background: #111 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        padding: 12px 20px !important;
        text-align: right !important;
    }

    .mm-close {
        color: #fede00 !important;
        font-size: 0 !important;
        display: inline-block !important;
        text-decoration: none !important;
        line-height: 1 !important;
    }

    .mm-close:before {
        content: none !important;
    }

    .mm-close:after {
        content: "\e930";
        font-family: 'auto' !important;
        font-size: 26px !important;
        font-weight: normal !important;
        visibility: visible !important;
        display: block !important;
    }

    .mmpanel li a {
        padding: 15px 20px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        color: #fff !important;
        font-weight: 500 !important;
    }

    .mmpanel li a:hover,
    .mmpanel li a.mm-original-link {
        color: #fede00 !important;
    }

    /* ── Page Title Wrapper (Internal Pages) ── */
    .page-title-wrapper {
        min-height: 100px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .page-title-wrapper h1 {
        margin: 0 !important;
        line-height: 1.2 !important;
        text-align: center !important;
    }

    .page-title-wrapper .breadcrumbs {
        display: none !important;
    }

    /* ── About Us Page Fixes ── */
    #about-story .block {
        padding-top: 30px !important;
        padding-bottom: 30px !important;
    }

    .wrapper-parallax-left02 {
        display: flex !important;
        flex-direction: column !important;
    }

    .wrapper-parallax-left02 .col-img {
        width: 100% !important;
        margin-bottom: 25px !important;
        text-align: center !important;
    }

    .wrapper-parallax-left02 .col-img img {
        max-width: 80% !important;
        height: auto !important;
    }

    .wrapper-parallax-left02 .col-description {
        width: 100% !important;
        padding: 0 15px !important;
    }

    .about-us .block-title__title,
    .contacts .block-title__title,
    .home .block-title__title {
        margin-bottom: 15px !important;
    }

    .title-separator {
        margin: 15px 0 !important;
        width: 50px !important;
        height: 2px !important;
        background: #fede00 !important;
    }

    /* ── Service Subpages Cleanup ── */
    .service-single {
        padding-top: 20px !important;
    }

    .service-single h2,
    .service-single h3 {
        margin-top: 15px !important;
        margin-bottom: 15px !important;
    }

    .service-content p {
        margin-bottom: 15px !important;
    }

    .marker-list-sm li {
        padding-left: 25px !important;
        margin-bottom: 8px !important;
    }

    .content-top {
        margin-top: 30px !important;
    }

    .content-top .col-md-6 img {
        margin-bottom: 20px !important;
        border-radius: 10px !important;
    }

    /* ── Button Fixes (Packages & CTAs) ── */
    .btn-inline .btn-wide {
        width: auto !important;
        min-width: 180px !important;
        max-width: 250px !important;
        display: inline-block !important;
        margin: 5px auto 10px !important;
    }

    .btn-inline {
        text-align: center !important;
        width: 100% !important;
    }

    /* ── Gallery & Packages Fixes ── */
    .filters-by-category {
        margin-bottom: 15px !important;
    }

    .filters-by-category ul li {
        margin-bottom: 8px !important;
    }

    .filters-by-category ul li a {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }

    /* ── Force Flexbox Centering & Override Isotope JS ── */
    .gallery-isotope {
        width: 100% !important;
        padding: 0 15px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        /* Centers the items perfectly */
        height: auto !important;
        /* Overrides Isotope's fixed container height */
    }

    .gallery.gallery-isotope .gallery-item {
        width: 100% !important;
        max-width: 350px !important;
        /* Keeps the image from getting too massive */
        margin: 0 0 20px 0 !important;
        /* Adds space only to the bottom */
        padding: 0 !important;
        float: none !important;
        position: relative !important;
        /* Kills Isotope's absolute positioning */
        left: auto !important;
        /* Overrides JS left math */
        top: auto !important;
        /* Overrides JS top math */
    }

    /* ── Footer ── */
    .footer-map-container {
        display: none !important;
    }

    .footer-map-section {
        display: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .map-overlay-container {
        display: none !important;
    }

    .map-glass-card {
        display: none !important;
    }

    .divider.visible-xs,
    div.divider.visible-xs {
        display: none !important;
        height: 0 !important;
        margin: 0 !important;
    }

    .page-footer {
        margin-bottom: 0 !important;
    }

    .footer-bottom {
        padding-bottom: 0 !important;
        padding-top: 15px !important;
    }

    /* Hide header top info bar on mobile/tablet */
    .header-top-bar {
        display: none !important;
    }

    /* ── Contact Page Mobile Polish ── */
    .info02-wrapper {
        margin-bottom: 50px !important;
    }

    .info02 {
        text-align: center !important;
        padding: 0 15px !important;
    }

    .info02__icon {
        margin-bottom: 10px !important;
    }
}

/* ── Global Gallery Fixes (PC & Mobile) ── */
.gallery-item-image img {
    border-radius: 8px !important;
    width: 100% !important;
    height: auto !important;
}

@media (min-width: 992px) {
    #gallery.gallery-isotope.gallery-col-4 .gallery-item {
        width: calc(25% - 22.5px) !important;
        /* Perfect 4-column math for 30px gutter */
        margin-bottom: 30px !important;
    }
}