/*==================================================
  Mobile Responsive Fixes for Meenashi Steels Website
  Created: December 2024
==================================================*/

/* ===== GLOBAL OVERFLOW FIX ===== */
@media (max-width: 991px) {

    html,
    body {
        overflow-x: hidden !important;
        width: 100% !important;
        position: relative;
    }

    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
        max-width: 100%;
        overflow-x: hidden;
    }
}

/* ===== ACTIVE MENU HIGHLIGHTING ===== */
.consen_menu>ul>li>a.active-menu,
.consen_menu>ul>li.current-menu-item>a,
.mean-container .mean-nav ul li a.active-menu {
    color: #ff5e14 !important;
    position: relative;
}

.consen_menu>ul>li>a.active-menu::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 15px;
    right: 15px;
    height: 2px;
    background-color: #ff5e14;
}

/* Mobile menu active state */
.mean-container .mean-nav ul li a.active-menu {
    background-color: rgba(255, 94, 20, 0.1) !important;
    border-left: 3px solid #ff5e14 !important;
}

/* ===== MOBILE NAVIGATION FIXES ===== */
@media (max-width: 991px) {
    .mobile-menu-area {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        width: 100% !important;
        z-index: 9999;
        background: #262626;
    }

    .mean-container .mean-bar {
        background: #ff5e14;
        min-height: 50px !important;
        max-height: 50px !important;
        /* Lock the height */
        height: 50px !important;
        /* Fixed height */
        width: 100%;
        padding: 0 !important;
        position: relative;
        display: block !important;
        overflow: visible !important;
    }

    .mean-container a.meanmenu-reveal {
        padding: 15px 15px !important;
        right: 10px !important;
        position: absolute !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 10003 !important;
        /* Ensure it's above the logo */
    }

    /* Close icon (X) styling when menu is open */
    .mean-container a.meanmenu-reveal.meanclose {
        font-size: 26px !important;
        font-weight: bold !important;
        color: #ffffff !important;
        text-align: center !important;
        line-height: 22px !important;
        text-indent: 0 !important;
    }

    /* Keep the whole mobile bar above the overlay */
    .mean-container .mean-bar {
        z-index: 10002 !important;
    }

    /* Off-canvas drawer panel */
    .mean-container .mean-nav {
        position: fixed !important;
        top: 50px !important;
        right: 0 !important;
        height: calc(100vh - 50px) !important;
        width: min(85vw, 360px) !important;
        margin-top: 0 !important;
        background: #ffffff !important;
        box-shadow: -12px 0 30px rgba(0, 0, 0, 0.18) !important;
        transform: translateX(110%) !important;
        transition: transform 220ms ease !important;
        z-index: 10001 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    body.mobile-menu-open .mean-container .mean-nav {
        transform: translateX(0) !important;
    }

    /* Dim overlay behind drawer */
    .mobile-menu-overlay {
        position: fixed;
        inset: 0;
        /* background: rgba(0, 0, 0, 0.45); */
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 200ms ease, visibility 200ms ease;
        /* z-index: 10000; */
    }

    body.mobile-menu-open .mobile-menu-overlay {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Ensure menu items are visible when menu is open */
    .mean-container .mean-nav ul {
        display: block !important;
        background: #ffffff !important;
        width: 100% !important;
    }

    .mean-container .mean-nav ul li {
        display: block !important;
        width: 100% !important;
        background: #ffffff !important;
    }

    .mean-container .mean-nav ul li a {
        padding: 14px 16px;
        border-bottom: 1px solid #f0f0f0;
    }

    /* Submenu styling inside drawer (Products sub-items) */
    .mean-container .mean-nav ul li ul li a {
        padding-left: 32px !important;
        font-size: 14px !important;
        background: #fafafa !important;
    }

    .mean-container .mean-nav ul li ul li a:hover {
        background: #f3f3f3 !important;
    }

    /* Remove logo pseudo-element as we are using the HTML injection */
    .mean-container .mean-bar::before {
        display: none !important;
        content: none !important;
    }

    /* Style the injected logo */
    .mean-container .mean-bar .logo {
        position: absolute !important;
        left: 10px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 1000 !important;
        max-width: 180px !important;
        display: block !important;
    }

    /* Hide the sticky logo variant to prevent duplication */
    .mean-container .mean-bar .logo .main_sticky {
        display: none !important;
    }

    /* Show only the regular logo */
    .mean-container .mean-bar .logo .logo_img {
        display: inline-block !important;
    }

    .mean-container .mean-bar .logo img {
        /* height: 35px !important; */
        /* Reduced from 40px to minimize blank space */
        width: auto !important;
        max-width: 100% !important;
        object-fit: contain !important;
        display: block !important;
    }

    /* Prevent background scrolling when drawer is open */
    body.mobile-menu-open {
        overflow: hidden;
        touch-action: none;
    }
}

/* ===== HERO/SLIDER SECTION FIXES ===== */
@media (max-width: 767px) {
    .slider-area {
        height: 100vh !important;
        min-height: 500px;
        padding: 100px 15px 60px;
        display: flex;
        align-items: center;
    }

    .slider-content h1 {
        font-size: 28px !important;
        line-height: 1.2 !important;
        margin-bottom: 5px;
    }

    .slider-content h3 {
        font-size: 14px !important;
    }

    .hero-description p {
        width: 100% !important;
        font-size: 14px !important;
        padding: 15px 0 !important;
    }

    /* Fix video background on mobile */
    .video-background {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100vw !important;
        height: 100vh !important;
        z-index: -1;
        overflow: hidden;
    }

    .video-foreground {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 177.78vh;
        /* 16:9 aspect ratio */
        height: 100vh;
        min-width: 100vw;
        min-height: 56.25vw;
        /* 16:9 aspect ratio */
    }

    .video-background iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100% !important;
        height: 100% !important;
    }

    .video-icon-cda {
        margin-top: 20px;
    }

    /* Hero button mobile styling */
    .hero-button.hero {
        float: none !important;
        margin-top: 20px;
    }

    .hero-button.hero .video-vemo-icon {
        padding: 10px 20px !important;
        font-size: 14px !important;
    }

    /* Breadcrumb section */
    .breadcumb-section {
        height: auto !important;
        min-height: 250px;
        padding: 140px 15px 50px !important;
        /* Increased top padding to account for fixed header */
        margin-top: 0 !important;
    }

    .breadcumb-content h1 {
        font-size: 28px !important;
    }
}

/* Tablet fixes */
@media (min-width: 768px) and (max-width: 991px) {
    .slider-area {
        height: 100vh !important;
        padding-top: 80px;
    }

    .slider-content h1 {
        font-size: 42px !important;
    }

    .hero-description p {
        width: 80% !important;
    }
}

/* ===== ABOUT SECTION FIXES ===== */
@media (max-width: 767px) {
    .about-section {
        padding: 40px 0 !important;
    }

    .about-thumb {
        margin-bottom: 30px;
    }

    .about-thumb img {
        width: 100%;
        height: auto;
    }

    .about-item {
        padding: 15px !important;
        margin-bottom: 15px;
    }

    .consen-section-title h2 {
        font-size: 24px !important;
        line-height: 1.3 !important;
    }

    .consen-section-title p {
        font-size: 14px !important;
    }

    .about-area {
        padding: 30px 0 !important;
    }

    .about-thumb-right img {
        width: 100%;
        max-width: 100%;
    }

    .about-item-solar {
        padding: 20px !important;
    }
}

/* ===== COUNTER SECTION FIXES ===== */
@media (max-width: 767px) {
    .counter-section {
        padding: 30px 0 !important;
    }

    .row.cntr-bg {
        flex-direction: column;
        padding: 30px 15px !important;
    }

    .counter-single-item-inner {
        text-align: center;
        margin-bottom: 25px;
        width: 100%;
    }

    .col-lg-2.col-md-6 {
        width: 50%;
        flex: 0 0 50%;
    }

    .counter-text h1,
    .counter-text span {
        font-size: 28px !important;
    }

    .counter-title h3 {
        font-size: 14px !important;
    }
}

/* ===== SERVICE SECTION FIXES ===== */
@media (max-width: 767px) {
    .service-section {
        padding: 40px 0 !important;
    }

    .single-service-box {
        margin-bottom: 60px !important;
        height: auto !important;
    }

    .service-content h3 {
        font-size: 18px !important;
    }

    .service-content p {
        font-size: 14px !important;
    }
}

/* ===== PROJECT/GALLERY SECTION FIXES ===== */
@media (max-width: 767px) {
    .project-section {
        padding: 100px 0 40px !important;
    }

    .single-project-box {
        margin-bottom: 30px;
    }

    .project-thumb img {
        width: 100%;
        height: auto;
    }

    .project-content {
        padding: 30px 20px !important;
    }

    .project-content h3 {
        font-size: 18px !important;
    }

    .project-content h4 {
        font-size: 12px !important;
    }

    .Indastre-btn.text-right {
        text-align: left !important;
        margin-top: 20px;
    }
}

/* ===== FOOTER FIXES ===== */
@media (max-width: 767px) {
    .footer-area {
        padding: 50px 0 30px !important;
    }

    .footer-widget-titel h4 {
        margin-bottom: 25px !important;
        margin-top: 30px;
    }

    .footer-widget-menu ul li a {
        font-size: 15px;
    }

    p.footer-desc {
        width: 100% !important;
        font-size: 14px !important;
    }

    .footer-bottom-area {
        padding: 20px 0 !important;
    }

    .footer-bottom-content-copy p {
        font-size: 13px !important;
        text-align: center;
        margin-bottom: 10px;
    }

    .footer-bottom-menu {
        text-align: center !important;
    }
}

/* ===== FLOATING BUTTONS FIXES ===== */
@media (max-width: 767px) {
    .float {
        width: 50px !important;
        height: 50px !important;
        bottom: 20px !important;
        right: 15px !important;
        font-size: 24px !important;
    }

    .my-float {
        margin-top: 13px !important;
    }

    /* Back to top button */
    #scrollUp {
        width: 40px !important;
        height: 40px !important;
        right: 15px !important;
        bottom: 80px !important;
    }
}

/* ===== SECTION TITLE FIXES ===== */
@media (max-width: 767px) {
    .section-title h2 {
        font-size: 28px !important;
        line-height: 1.3 !important;
    }

    .section-title h1 {
        font-size: 24px !important;
        line-height: 1.3 !important;
    }

    p.section-text {
        font-size: 16px !important;
        margin-top: 20px !important;
    }

    .em-bar {
        top: -30px !important;
    }
}

/* ===== WHY CHOOSE US SECTION FIXES ===== */
@media (max-width: 767px) {
    .why-choose-us-area {
        padding: 40px 0 !important;
    }

    .row.choose-us_bg {
        padding: 30px 15px !important;
    }

    .choose-left {
        min-height: 200px;
        margin-bottom: 30px;
    }

    .section-description {
        width: 100% !important;
        font-size: 14px !important;
    }
}

/* ===== GALLERY PAGE FIXES ===== */
@media (max-width: 767px) {
    .gallery-section {
        padding: 40px 0 !important;
    }

    .gallery-thumb img {
        width: 100%;
        height: auto;
    }
}

/* ===== CONTACT PAGE FIXES ===== */
@media (max-width: 767px) {
    .contact_from_box {
        padding: 30px 20px !important;
    }

    .contact_from_box input,
    .contact_from_box textarea {
        font-size: 14px;
    }
}

/* ===== PRODUCTS PAGE FIXES ===== */
@media (max-width: 767px) {
    .indastre-service-single-item {
        padding: 20px !important;
    }

    .accordion li a {
        font-size: 14px !important;
        padding: 15px 10px !important;
    }
}

/* ===== GENERAL MOBILE SPACING ===== */
@media (max-width: 767px) {
    .mb-60 {
        margin-bottom: 30px !important;
    }

    .pb-10 {
        padding-bottom: 5px !important;
    }

    .pt-100 {
        padding-top: 50px !important;
    }

    .row {
        margin-left: 0;
        margin-right: 0;
    }

    [class*="col-"] {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* ===== EXTRA SMALL DEVICES ===== */
@media (max-width: 480px) {
    .slider-content h1 {
        font-size: 20px !important;
    }

    .consen-section-title h2 {
        font-size: 20px !important;
    }

    .breadcumb-content h1 {
        font-size: 24px !important;
    }

    .counter-text h1,
    .counter-text span {
        font-size: 24px !important;
    }

    .Indastre-btn a {
        padding: 12px 20px !important;
        font-size: 14px !important;
    }
}