/*-----------------------------------------------------------------------------------
    Custom Responsive Styles
    Consolidated from various files to ensure better mobile responsiveness.
-----------------------------------------------------------------------------------*/

/* Large devices (less than 1200px) */
@media (max-width: 1199px) {
    .jsw-logo-section {
        width: 550px;
        min-width: auto;
    }

    .jsw-main-nav-section ul li {
        margin-left: 15px;
    }
}

/* Medium devices (less than 992px) */
@media (max-width: 991px) {

    /* Header & Nav Rearrangement */
    .jsw-header {
        display: flex;
        flex-wrap: wrap;
    }

    .jsw-top-tier {
        display: contents;
        /* Allows children to be direct flex items of .jsw-header */
    }

    /* ── ROW 1: Logo left, hamburger right in a single row ── */
    .jsw-bottom-tier {
        display: none !important;
        /* Hide the second redundant bar */
    }

    .jsw-logo-section {
        order: 1;
        width: 60%;
        height: 50px;
        /* Compact mobile navbar height */
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding-left: 15px;
        background: #1D4289 !important;
        position: sticky;
        top: 0;
        z-index: 10006;
        border-bottom: none !important;
    }

    .desktop-logo {
        display: none !important;
    }

    .mobile-logo {
        display: block !important;
        max-height: 42px !important;
        width: auto;
        object-fit: contain;
    }

    .jsw-main-nav-section {
        order: 2;
        width: 40%;
        padding: 0 15px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        height: 50px;
        position: sticky;
        top: 0;
        background: #1D4289 !important;
        border-bottom: none !important;
        z-index: 10006;
    }

    /* Hide desktop nav links */
    .jsw-main-nav-section ul {
        display: none !important;
    }

    /* Hamburger (Now in Row 1, right side) */
    .hamburger {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: transparent !important;
        border: none;
        color: #fff !important;
        /* White hamburger on blue bg */
        font-size: 28px;
        /* Slightly bigger for ease of use */
        cursor: pointer;
        outline: none;
        padding: 0;
    }

    .hamburger-bottom,
    .jsw-secondary-nav {
        display: none !important;
        /* Remove redundant mobile dropdowns */
    }


    /* ── Secondary Nav dropdown (white-bar hamburger)
         → drops from top of bottom-tier, blue bg, orange hover ── */
    .jsw-secondary-nav {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        width: 100vw;
        background: #1D4289;
        flex-direction: column;
        z-index: 10005;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
        padding: 0;
        border-top: 2px solid rgba(255, 255, 255, 0.2);
    }

    .jsw-secondary-nav li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        border-right: none !important;
        height: auto;
    }

    .jsw-secondary-nav li a {
        padding: 14px 25px;
        color: #fff !important;
        font-weight: 700;
        font-size: 13px;
        display: block;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        transition: background 0.2s, color 0.2s;
    }

    .jsw-secondary-nav li a:hover,
    .jsw-secondary-nav li.active>a,
    .jsw-secondary-nav li a.active {
        background: #FF8C00 !important;
        color: #fff !important;
    }

    .jsw-secondary-nav li.dropdown {
        position: relative;
    }

    .jsw-secondary-nav li.dropdown .dropdown-menu {
        background: rgba(0, 0, 0, 0.12);
        border: none;
        border-top: none !important;
        padding: 0;
        box-shadow: none;
        position: static;
        display: none;
        min-width: unset;
    }

    .jsw-secondary-nav li.dropdown.is-open .dropdown-menu {
        display: block !important;
    }

    .jsw-secondary-nav li.dropdown .dropdown-menu ul li {
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .jsw-secondary-nav li.dropdown .dropdown-menu ul li a {
        padding: 11px 45px !important;
        font-size: 12px !important;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.85) !important;
    }

    .jsw-secondary-nav li.dropdown .dropdown-menu ul li a:hover {
        background: #FF8C00 !important;
        color: #fff !important;
        padding-left: 45px !important;
    }

    .jsw-secondary-nav.show {
        display: flex !important;
    }

    /* Override JS sticky logic for mobile */
    .jsw-bottom-tier.is-sticky {
        position: sticky !important;
        top: 0 !important;
        width: 40% !important;
        box-shadow: none !important;
        animation: none !important;
        border-bottom: 1px solid #eee !important;
    }

    /* Hero Section */
    .jsw-hero-container {
        height: 350px;
    }

    .jsw-hero-bg {
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

    .breadcrumb-height {
        min-height: 180px !important;
    }

    /* ════════════════════════════════════════════
       LEFT-SIDE DRAWER — Main nav (blue), Image 2
    ════════════════════════════════════════════ */
    .mobile-menu-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 20000;
        visibility: hidden;
        transition: visibility 0.35s;
    }

    .mobile-menu-wrapper.open {
        visibility: visible;
    }

    .mobile-menu-content {
        position: absolute;
        top: 0;
        right: -85%;
        /* Start off-screen on the RIGHT */
        width: 85%;
        max-width: 380px;
        height: 100%;
        background-color: #1D4289;
        z-index: 10002;
        transition: right 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        display: flex;
        flex-direction: column;
        box-shadow: -6px 0 20px rgba(0, 0, 0, 0.35);
        /* Shadow on the left */
    }

    .mobile-menu-wrapper.open .mobile-menu-content {
        right: 0;
        /* Slide into view */
    }


    .mobile-menu-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 10001;
        opacity: 0;
        transition: opacity 0.35s;
    }

    .mobile-menu-wrapper.open .mobile-menu-overlay {
        opacity: 1;
    }

    /* Drawer header: white bg + logo block */
    .mobile-menu-header {
        background: #fff;
        padding: 12px 15px;
        /* Reduced from 18px */
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
        border-bottom: 2px solid #eee;
        min-height: 70px;
        /* Reduced from 90px */
    }

    .mobile-menu-logo img {
        max-height: 50px;
        /* Reduced from 65px */
        width: auto;
        object-fit: contain;
    }

    .mobile-menu-close {
        position: absolute;
        top: 10px;
        right: 14px;
        background: none;
        border: none;
        color: #1D4289;
        font-size: 26px;
        font-weight: bold;
        cursor: pointer;
        z-index: 10005;
        line-height: 1;
    }

    /* Drawer body: nav list */
    .mobile-menu-body {
        flex-grow: 1;
        overflow-y: auto;
        padding: 8px 0;
    }

    .mobile-nav {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .mobile-nav li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .mobile-nav li:first-child {
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .mobile-nav li>a {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 25px;
        color: #fff;
        text-transform: uppercase;
        font-weight: 700;
        font-size: 19px;
        font-family: 'Rajdhani', sans-serif;
        letter-spacing: 0.5px;
        text-decoration: none;
        transition: background 0.2s, color 0.2s;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .mobile-nav li>a:hover,
    .mobile-nav li.active>a {
        background: rgba(255, 255, 255, 0.07);
        color: #FF8C00;
    }

    /* Quick Connect Section Styling */
    .quick-connect {
        padding: 25px 20px;
        margin-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .quick-connect-title {
        color: rgba(255, 255, 255, 0.6);
        font-size: 13px;
        font-weight: 600;
        letter-spacing: 1px;
        margin-bottom: 15px;
        text-transform: uppercase;
    }

    .quick-btns {
        display: flex;
        gap: 12px;
        margin-bottom: 20px;
    }

    .quick-btns a {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 12px 10px;
        border-radius: 8px;
        font-weight: 700;
        font-size: 15px;
        text-decoration: none;
        transition: transform 0.2s, opacity 0.2s;
    }

    .quick-btns a:active {
        transform: scale(0.96);
    }

    .btn-call {
        background-color: #d1a53e;
        color: #000 !important;
    }

    .btn-whatsapp {
        background-color: #25d366;
        color: #fff !important;
    }

    .contact-numbers {
        margin-top: 10px;
    }

    .contact-numbers p {
        color: #fff;
        font-size: 18px;
        font-weight: 700;
        margin: 5px 0;
        letter-spacing: 0.5px;
    }

    .mobile-nav .sub-menu {
        display: none;
        list-style: none;
        padding: 0;
        background: rgba(0, 0, 0, 0.15);
    }

    .mobile-nav .sub-menu li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
        border-top: none;
    }

    .mobile-nav .sub-menu li a {
        padding: 8px 45px;
        /* Reduced from 12px */
        font-size: 12px;
        /* Reduced from 13px */
        font-weight: 600;
        letter-spacing: 0.3px;
        color: rgba(255, 255, 255, 0.85);
    }

    .mobile-nav .sub-menu li a:hover {
        background: rgba(255, 140, 0, 0.25);
        color: #FF8C00;
    }

    .mobile-nav li.has-sub.active>.sub-menu {
        display: block;
    }

    .mobile-nav li.has-sub>a i {
        transition: transform 0.3s ease;
        font-size: 12px;
    }

    .mobile-nav li.has-sub.active>a i {
        transform: rotate(180deg);
    }

    body.no-scroll {
        overflow: hidden;
    }

    .contact-header h1 {
        font-size: 26px !important;
        /* Decreased font size for mobile */
    }

    .contact-header {
        margin-bottom: 20px !important;
        /* Reduced bottom margin */
    }

    .contact-layout {
        flex-direction: column;
        align-items: center;
        gap: 0 !important;
        /* Remove gap between image and message */
    }

    .sidebar-banner {
        flex: none;
        width: 100%;
        max-width: 360px;
        margin-bottom: 0 !important;
    }

    .form-section {
        margin-top: 0 !important;
        text-align: center;
    }

    .form-section h5 {
        margin-top: 0 !important;
        margin-bottom: 5px !important;
    }

    .form-section p {
        margin-bottom: 15px !important;
    }

    .form-grid {
        text-align: left;
        /* Keep form inputs left-aligned */
    }

    /* Colour Page */
    .shade-container {
        flex-direction: column;
    }

    .selector-controls {
        border-left: none;
        padding-left: 0;
        flex: none;
    }

    /* Spacing fixes for home/features page */
    .jsw-hero-slider {
        margin-bottom: 0 !important;
    }

    .product-gallery-area {
        padding: 10px 0 !important;
        /* Tighten overall padding */
    }

    .product-gallery-area .section-title.mb-60 {
        margin-bottom: 10px !important;
        /* Reduce space below title */
    }
}

/* Tablets and small desktops (less than 768px) */
@media (max-width: 768px) {
    .modal-body-split {
        flex-direction: column;
    }

    /* Mobile Features Grid - Force 3-3-2 Layout */
    .jsw-features-grid {
        padding-bottom: 30px;
    }

    .feature-grid-row {
        gap: 8px;
        /* Further reduced to ensure 3 fit */
        margin-bottom: 25px;
        flex-wrap: wrap;
        justify-content: center;
        padding-left: 70px;
        padding-right: 0px;
    }

    .feature-item {
        width: calc(33.33% - 12px);
        /* Stable 3-column width */
        min-width: 75px;
        margin: 8px 0;
    }

    .feature-icon-circle {
        width: 70px;
        /* Slightly smaller for better fit */
        height: 70px;
        margin-bottom: 10px;
        background: #fff;
        border: 1px dashed #214391;
    }

    .feature-icon-circle img {
        max-width: 60%;
    }

    .feature-title {
        font-size: 11px;
        min-height: 24px;
        line-height: 1.2;
    }


    /* Mobile Feature Detail Items */
    .jsw-features-details {
        padding-top: 0;
    }

    .feature-detail-item {
        padding: 30px 0;
    }

    .feature-detail-item::before {
        top: -15px;
    }

    .feature-detail-item:first-child {
        padding-top: 0;
    }

    .feature-detail-title {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .feature-detail-circle {
        width: 90px;
        height: 90px;
        min-width: 90px;
    }

    .feature-detail-row {
        flex-direction: column;
        max-width: 100%;
    }

    .feature-detail-card {
        padding: 20px;
        margin-left: 0;
        margin-top: 15px;
        min-height: auto;
        border-radius: 8px;
    }

    .feature-detail-row-reverse {
        flex-direction: column;
    }

    .feature-detail-row-reverse .feature-detail-card {
        margin-right: 0;
        padding: 20px;
    }

    .feature-detail-card ul li {
        font-size: 13px;
        line-height: 1.4;
    }

    .design-item h3 {
        margin-top: 10px;
    }

    .design-item {
        width: 100% !important;
        max-width: 450px;
        margin: 0 auto 30px;
    }

    .design-item a:active,
    .design-item a:focus {
        transform: translateY(-5px) !important;
        box-shadow: 0 0 30px 5px rgba(29, 66, 137, 0.4) !important;
        border-color: #1d4289 !important;
    }
}

/* Mobile Devices (less than 767px) */
@media (max-width: 767px) {

    /* Privilege Club */
    .privilege-hero {
        height: 300px;
    }

    .sidebar-nav-box {
        margin-bottom: 30px;
    }

    /* Font size adjustments for about page content */
    .font-size-20 {
        font-size: 16px !important;
    }

    .short-desc {
        font-size: 15px !important;
    }

    /* Image display adjustments for about page */
    .about-img-wrap {
        width: 100%;
        margin-bottom: 20px;
        /* Add spacing between image and text */
    }

    .about-img {
        width: 100%;
    }

    .about-img-wrap .about-img img {
        width: 100%;
        height: auto;
        /* Maintain aspect ratio */
        border-radius: 0 !important;
        /* Remove border-radius for edge-to-edge */
    }

    .row.align-items-center.pb-50>div {
        padding-left: 0;
        padding-right: 0;
    }

    .section-desc {
        padding-left: 25px !important;
        padding-right: 25px !important;
    }

    .about-content {
        padding-left: 25px !important;
        padding-right: 25px !important;
        padding-top: 0 !important;
    }

    /* Remove white space between hero image and About Us heading */
    .breadcrumb-height {
        min-height: 100px !important;
        /* Reduced height for hero image area */
    }

    .about-area.about-style-2 {
        padding-top: 30px !important;
        /* Reduced padding-top for about section */
    }

    /* Remove space between Section 3 and Profile Photos heading */
    .brand-area {
        padding-top: 20px !important;
        /* Significantly reduced from 100px */
        padding-bottom: 30px !important;
    }

    .section-title-area.style-01 {
        padding-bottom: 20px !important;
    }

    /* Headings font size decrease */
    .section-title span {
        font-size: 14px !important;
        /* Smaller font for 'ABOUT US' */
    }

    .section-title h2 {
        font-size: 24px !important;
        /* Smaller font for 'Who we are' */
    }

    /* Remove white space between 'Who we are' matter and first section image */
    .section-title-area.style-01 {
        padding-bottom: 5px !important;
        /* Significantly reduced to remove gap */
    }


    /* Ensure images touch both edges (already largely handled, but reinforce) */
    .about-img-wrap .about-img img {
        width: 100%;
        height: auto;
        /* Maintain aspect ratio */
        display: block;
        border-radius: 0 !important;
        /* Ensure no rounded corners for full edge-to-edge */
        object-fit: cover;
        /* Ensure image covers the area, possibly cropping */
    }

    /* Remove horizontal padding from columns containing images/text to push to edges */
    .row.align-items-center>div {
        padding-left: 0;
        padding-right: 0;
    }

    /* Section Images - Small Square Format */
    .about-img-wrap {
        width: 230px !important;
        /* Fixed small size like attachment */
        height: 130px !important;
        /* Square format */
        margin: 0 auto 5px !important;
        /* Reduced bottom margin to 5px */
        background: #fff;
        border-radius: 20px !important;
        border-left: 6px solid #f36303 !important;
        /* Subtle orange border */
        box-shadow: 0 10px 20px rgba(86, 83, 83, 0.08) !important;
        overflow: hidden;
        padding: 0 !important;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .about-img-wrap .about-img {
        width: 100% !important;
        height: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .about-img-wrap .about-img img {
        width: 100% !important;
        height: 100% !important;
        min-height: auto !important;
        display: block;
        border-radius: 0 !important;
        object-fit: cover;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Sriroof Profile Photos Gallery - 2 big images per view on Mobile */
    .sriroof-gallery-slider.swiper-container {
        padding: 0 !important;
        margin-left: -5px !important;
        margin-right: -5px !important;
        width: calc(100% + 10px) !important;
    }

    .sriroof-gallery-slider .swiper-slide a {
        width: 100% !important;
        height: 100% !important;
        aspect-ratio: 1 / 1.5;
        /* Slightly taller for more impact */
        margin: 5px 0 !important;
        background: #fff;
        border-radius: 25px !important;
        /* Very rounded pill-style as requested */
        border: 1px solid #eee !important;
        /* Subtle border instead of orange top */
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08) !important;
        padding: 0 !important;
        display: block;
        overflow: hidden;
    }

    .sriroof-gallery-slider .swiper-slide img {
        height: 100% !important;
        width: 100% !important;
        border-radius: 0 !important;
        object-fit: cover;
    }

    /* Adjust swiper arrows for mobile to be on top of images */
    .sriroof-gallery-slider .swiper-button-next,
    .sriroof-gallery-slider .swiper-button-prev {
        width: 45px !important;
        /* Bigger arrows for the bigger images */
        height: 45px !important;
        background: rgba(0, 0, 0, 0.4) !important;
    }

    .sriroof-gallery-slider .swiper-button-next:after,
    .sriroof-gallery-slider .swiper-button-prev:after {
        font-size: 15px !important;
    }

    .sriroof-gallery-slider .swiper-button-prev {
        left: 10px !important;
    }

    .sriroof-gallery-slider .swiper-button-next {
        right: 10px !important;
    }

    /* Products & Features heading — smaller on mobile */
    .product-gallery-area {
        padding: 15px 0 10px !important;
        position: relative;
        z-index: 1;
        clear: both;
    }

    .jsw-hero-slider-section {
        display: block;
        position: relative;
        z-index: 0;
        margin-bottom: 0;
        padding-bottom: 0;
        margin-top: -50px !important;
        padding-top: 0 !important;
    }

    /* Remove white space between navbar and hero image on branch pages */
    .home-visaul.inner-visaul {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Collapse header placeholder height on mobile so hero sits right under sticky navbar */
    #header-placeholder {
        height: 50px !important;
        overflow: visible;
    }

    .product-gallery-area .section-title.mb-60 {
        margin-bottom: 10px !important;
        margin-top: 5px !important;
    }

    .product-gallery-area .section-title h2.title,
    .product-gallery-area h2.title {
        font-size: 18px !important;
        margin-bottom: 0 !important;
    }

    .jsw-section-title {
        font-size: 18px !important;
        margin-top: 10px !important;
        margin-bottom: 30px !important;
    }
}

/* Small Mobile Devices (less than 600px) */
@media (max-width: 600px) {

    /* Contact Form Grid */
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: 1;
    }
}

/* Extra small devices (less than 480px) */
@media (max-width: 479px) {
    .feature-item {
        width: 30% !important;
        /* Force 3 icons per row */
        min-width: 80px !important;
    }

    .feature-icon-circle {
        width: 70px;
        /* Slightly smaller for very small screens */
        height: 70px;
    }


    .jsw-hero-container {
        height: 250px;
        /* Increased from 170px for better visibility */
    }
}

/* Mobile Menu Wrapper Base Styles */
.mobile-menu-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20000;
    visibility: hidden;
    transition: visibility 0.3s;
}

@media (min-width: 992px) {
    .mobile-menu-wrapper {
        display: none !important;
    }
}