/* ============================================================
   MOBILE RESPONSIVE ENHANCEMENTS
   Autoscuola Cremonese - Additional mobile-first fixes
   ============================================================ */

/* === GENERAL MOBILE FIXES === */

/* Prevent horizontal overflow on all devices */
html,
body {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

/* Make all images responsive by default */
img {
    max-width: 100%;
    height: auto;
}

/* Make iframes responsive */
iframe {
    max-width: 100%;
}

/* === MEDIUM SCREENS (tablets, ≤991px) === */
@media (max-width: 991px) {

    /* Title section - reduce side padding */
    .mu-title p {
        padding: 0 30px;
    }

    /* About us section - reduce padding */
    #mu-about-us {
        padding: 60px 0;
    }

    /* Features section - reduce padding */
    #mu-features {
        padding: 60px 0;
    }

    /* About section image - add spacing after */
    #mu-about-us .mu-about-us-area .mu-about-us-right {
        margin-top: 30px;
    }

    /* Footer columns stack on tablets */
    #mu-footer .mu-footer-top .mu-footer-top-area .col-sm-3 {
        width: 50%;
        margin-bottom: 20px;
    }
}

/* === SMALL SCREENS (phones, ≤767px) === */
@media (max-width: 767px) {

    /* Title section - minimal padding */
    .mu-title p {
        padding: 0 10px;
        font-size: 14px;
    }

    /* Header - compact */
    #mu-header .mu-header-area {
        padding: 5px 0;
    }

    /* Menu - ensure proper stacking */
    #mu-menu {
        position: relative !important;
        top: auto !important;
    }

    /* Navbar brand image smaller */
    .navbar-brand>img {
        max-height: 35px;
        margin-top: -5px;
    }

    /* Navbar toggle button - more visible */
    .navbar-default .navbar-toggle {
        margin-top: 12px;
        margin-bottom: 12px;
        border-color: #8c1000;
        background-color: #8c1000;
    }

    .navbar-default .navbar-toggle .icon-bar {
        background-color: #fff;
    }

    /* Dropdown menu - full width on mobile */
    #mu-menu .navbar-default .navbar-nav li .dropdown-menu {
        position: static;
        float: none;
        width: auto;
        background-color: #f5f5f5;
        border: none;
        box-shadow: none;
    }

    #mu-menu .navbar-default .navbar-nav li .dropdown-menu li a {
        padding: 10px 25px;
        color: #333;
    }

    #mu-menu .navbar-default .navbar-nav li .dropdown-menu li a:hover,
    #mu-menu .navbar-default .navbar-nav li .dropdown-menu li a:focus {
        color: #8c1000;
        background-color: #eee;
    }

    /* Service cards - stack vertically */
    #mu-service .mu-service-area .mu-service-single {
        width: 100%;
        padding: 25px 20px;
    }

    #mu-service .mu-service-area .mu-service-single h3 {
        font-size: 20px;
    }

    #mu-service {
        margin-top: 0;
    }

    #mu-service .mu-service-area {
        border-width: 0;
    }

    /* Slider - smaller on mobile */
    #mu-slider .mu-slider-single .mu-slider-img {
        height: 250px;
    }

    #mu-slider .mu-slider-single .mu-slider-content {
        top: 10%;
        padding: 0 5%;
    }

    #mu-slider .mu-slider-single .mu-slider-content img {
        height: 150px !important;
        width: auto !important;
    }

    /* Hero slider arrows - smaller and repositioned */
    #mu-slider .slick-prev,
    #mu-slider .slick-next {
        height: 35px;
        width: 35px;
        z-index: 100;
    }

    #mu-slider .slick-prev {
        left: 5px;
    }

    #mu-slider .slick-next {
        right: 5px;
    }

    /* About section */
    #mu-about-us {
        padding: 40px 0;
    }

    #mu-about-us .mu-about-us-area .mu-about-us-left h2 {
        font-size: 24px;
        text-align: center;
    }

    #mu-about-us .mu-about-us-area .mu-about-us-left p {
        font-size: 14px;
        line-height: 1.7;
    }

    #mu-about-us .mu-about-us-area .mu-about-us-left ul {
        font-size: 14px;
    }

    #mu-about-us .mu-about-us-area .mu-about-us-right {
        margin-top: 20px;
    }

    /* Features section - single column */
    #mu-features {
        padding: 40px 0;
    }

    #mu-features .mu-features-area .mu-features-content .mu-single-feature {
        text-align: center;
        padding: 20px 15px;
    }

    #mu-features .mu-features-area .mu-features-content .mu-single-feature h4:after {
        left: 50%;
        transform: translateX(-50%);
    }

    /* Footer - stack columns */
    #mu-footer .mu-footer-top .mu-footer-top-area .col-lg-3,
    #mu-footer .mu-footer-top .mu-footer-top-area .col-md-3,
    #mu-footer .mu-footer-top .mu-footer-top-area .col-sm-3 {
        width: 100%;
        float: none;
    }

    #mu-footer .mu-footer-top .mu-footer-top-area .mu-footer-widget {
        margin-bottom: 25px;
        text-align: center;
    }

    #mu-footer .mu-footer-bottom .mu-footer-bottom-area p {
        font-size: 12px;
        padding: 0 10px;
    }

    /* Breadcrumb */
    #mu-page-breadcrumb .mu-page-breadcrumb-area h2 {
        font-size: 22px;
        letter-spacing: 2px;
    }

    /* Course page content */
    #mu-course-content {
        padding: 30px 0;
    }

    #mu-course-content .mu-course-content-area .mu-course-details .mu-latest-course-single .mu-latest-course-single-content h2 {
        font-size: 22px;
        line-height: 1.4;
    }

    /* Tables - horizontal scroll */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table.data,
    table.no-row {
        min-width: 100%;
    }

    table.data td,
    table.no-row td {
        font-size: 14px;
        padding: 6px 8px;
    }

    td.first {
        width: auto;
        min-width: 80px;
    }

    /* Contact section */
    #mu-contact {
        padding: 30px 0;
    }

    #mu-contact .mu-contact-area .mu-title p {
        font-size: 14px;
        padding: 0;
    }

    /* Google Maps */
    #mu-contact iframe {
        height: 300px;
    }

    /* About page */
    .aboutus p {
        font-size: 14px;
        line-height: 1.8;
    }

    .aboutus img.logo {
        padding: 0 10%;
        margin-bottom: 20px;
    }

    .aboutus .row .col-md-6 {
        margin-bottom: 20px;
    }

    /* Process items (Orari page) */
    .process .media-right {
        display: none;
    }

    .process .media-body {
        width: 100%;
    }

    .process .media-body h4 {
        font-size: 16px;
        text-align: center;
        margin-bottom: 10px;
    }

    /* Search overlay - mobile friendly */
    #mu-search .mu-search-area .mu-search-form input[type="search"] {
        font-size: 20px;
        height: 60px;
    }

    #mu-search .mu-search-area .mu-search-close {
        right: 20px;
        top: 20px;
    }

    /* Scroll to top button - smaller */
    .scrollToTop {
        height: 40px;
        width: 40px;
        line-height: 40px;
        font-size: 22px;
        bottom: 20px;
        right: 10px;
    }

    /* Subscribe button - larger tap target */
    .mu-subscribe-btn {
        padding: 12px 25px;
        font-size: 16px;
    }

    /* Info list */
    ul.info-list {
        font-size: 14px;
    }

    /* Sidebar categories */
    .mu-sidebar-catg li a {
        padding: 8px 0;
        display: block;
    }
}

/* === VERY SMALL SCREENS (≤480px) === */
@media (max-width: 480px) {

    /* Header top bar - icons only */
    #mu-header .mu-header-area .mu-header-top-right .mu-top-social span {
        display: none;
    }

    /* Slider even smaller */
    #mu-slider .mu-slider-single .mu-slider-img {
        height: 200px;
    }

    #mu-slider .mu-slider-single .mu-slider-content img {
        height: 100px !important;
    }

    /* About section heading */
    #mu-about-us .mu-about-us-area .mu-about-us-left h2 {
        font-size: 20px;
    }

    #mu-about-us .mu-about-us-area .mu-title h2 {
        font-size: 20px;
    }

    /* Course content heading */
    #mu-course-content .mu-course-content-area .mu-course-details .mu-latest-course-single .mu-latest-course-single-content h2 {
        font-size: 20px;
    }

    /* Breadcrumb heading */
    #mu-page-breadcrumb .mu-page-breadcrumb-area h2 {
        font-size: 18px;
        letter-spacing: 1px;
    }

    /* Tables - more compact */
    table.data td,
    table.no-row td {
        font-size: 13px;
        padding: 5px 6px;
    }

    td.first {
        min-width: 60px;
        font-size: 12px;
    }

    /* Process icons - hide completely */
    .process i.fa {
        display: none;
    }

    /* Blockquote */
    blockquote {
        padding: 10px 15px;
        margin: 10px 0;
        font-size: 14px;
    }

    /* Read more button - full width */
    .mu-read-more-btn {
        display: block;
        text-align: center;
        padding: 12px 20px;
    }
}

/* === TOUCH DEVICE ENHANCEMENTS === */
@media (hover: none) and (pointer: coarse) {

    /* Larger tap targets for links */
    #mu-footer .mu-footer-widget ul li a {
        display: block;
        padding: 6px 0;
        min-height: 40px;
        line-height: 28px;
    }

    /* Navbar links - larger touch targets */
    #mu-menu .navbar-default .navbar-nav li>a {
        min-height: 44px;
    }

    /* Sidebar links */
    .mu-sidebar-catg li a,
    .mu-sidebar-archives li a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Feature links */
    #mu-features .mu-features-area .mu-features-content .mu-single-feature a {
        padding: 10px 15px;
        min-height: 44px;
    }
}

/* === LANDSCAPE PHONE ORIENTATION === */
@media (max-height: 500px) and (orientation: landscape) {
    #mu-slider .mu-slider-single .mu-slider-img {
        height: 200px;
    }

    #mu-slider .mu-slider-single .mu-slider-content {
        top: 5%;
    }

    #mu-slider .mu-slider-single .mu-slider-content img {
        height: 100px !important;
    }
}

/* === HIDE ON MOBILE === */
@media (max-width: 640px) {
    .no-cell {
        display: none;
    }
}