/* Additional fixes for mobile issues */

/* Ensure navbar has proper positioning */
/* Ensure navbar has proper positioning */
.header_main-navbar {
    position: sticky !important;
    /* Make sticky */
    top: 0 !important;
    z-index: 1020 !important;
    /* Ensure it stays above other content */
    background-color: white !important;
    /* preventing transparency issues */
    overflow: visible;
}

/* Make menu icon orange and visible */
/* Make menu icon orange and visible */
.header_navbar-toggler {
    background-color: transparent !important;
    /* Transparent background */
    border: none !important;
    padding: 8px 10px !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Show hamburger on mobile only */
@media (max-width: 991.98px) {
    .header_navbar-toggler {
        display: flex !important;
    }
}

/* Hide hamburger on desktop */
@media (min-width: 992px) {
    .header_navbar-toggler {
        display: none !important;
    }
}

.header_navbar-toggler-icon {
    /* Orange stroke (#ff6600), transparent fill */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23ff6600' stroke-linecap='round' stroke-miterlimit='10' stroke-width='3' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

.header_navbar-toggler:focus {
    box-shadow: none !important;
    outline: none !important;
}

/* Ensure benefit bar is visible on all devices */
.header_benefit-bar {
    display: block !important;
}

/* Base row styles */
.header_benefit-bar .row {
    display: flex !important;
}

/* Desktop menu visibility */
@media (min-width: 992px) {
    .header_navbar-collapse {
        display: block !important;
        position: static !important;
    }
}

/* Ensure dropdown overlays properly on mobile */
@media (max-width: 991px) {
    .header_navbar-collapse {
        position: absolute !important;
        top: 100% !important;
        left: auto !important;
        right: 0 !important;
        width: auto !important;
        min-width: 200px !important;
        background: white !important;
        z-index: 1050 !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 4px !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
        padding: 10px !important;
        margin: 0 !important;
    }

    .header_navbar-collapse.collapsing,
    .header_navbar-collapse.show {
        display: block !important;
    }
}

/* Fix benefit bar to horizontal scroll on mobile */
@media (max-width: 768px) {
    .header_benefit-bar {
        display: block !important;
    }

    .header_benefit-bar .row {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }

    .header_benefit-bar .row::-webkit-scrollbar {
        display: none !important;
    }

    .header_benefit-bar .col {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 150px !important;
        max-width: 200px !important;
        display: inline-block !important;
    }

    .header_benefit-bar .col:not(:last-child) {
        border-right: 1px solid var(--border-color) !important;
        border-bottom: none !important;
    }

    .header_benefit-item {
        white-space: nowrap !important;
    }
}

/* Prevent horizontal scrollbar */
body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

.container,
.container-fluid {
    overflow-x: hidden !important;
}

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

/* Ensure top bar is visible on mobile */
@media (max-width: 768px) {
    body.page-category .mobile-categories-breadcrumb .container,
    body.page-category .category-container,
    body.page-category .category-container > .row,
    body.page-category .category-container > .row > .col-12,
    body.page-category .products-container {
        display: block !important;
        justify-content: initial !important;
        align-items: initial !important;
        flex-wrap: nowrap !important;
    }

    .header_top-bar {
        display: block !important;
        background-color: var(--navy-blue);
        /* Match header styles */
    }

    .header_top-bar .container {
        justify-content: flex-start !important;
        overflow-x: auto !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
        scrollbar-width: none !important;
        /* Hide scrollbar Firefox */
    }

    .header_main-navbar .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
        margin: 0 !important;
    }

    .header_top-bar .container::-webkit-scrollbar {
        display: none !important;
        /* Hide scrollbar Chrome/Safari */
    }

    .header_top-bar .container>div {
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr) auto !important;
        align-items: center !important;
        white-space: nowrap !important;
        padding-bottom: 0 !important;
        width: 100% !important;
        min-width: 100% !important;
        gap: 4px !important;
    }

    .header_top-bar .container>div>a,
    .header_top-bar .container>div>.user-auth-dropdown {
        min-width: 0 !important;
    }

    .header_top-bar .header-topbar-item,
    .header_top-bar .header-topbar-user,
    .header_top-bar .auth-menu-toggle {
        min-width: 0 !important;
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
    }

    .header_top-bar .header_top-bar-separator {
        display: none !important;
    }

    .header_top-bar .header-topbar-phone {
        justify-self: start !important;
        justify-content: flex-start !important;
        gap: 4px !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        overflow: visible !important;
    }

    .header_top-bar .header-topbar-email {
        justify-self: center !important;
        justify-content: center !important;
        text-align: center !important;
        gap: 4px !important;
        margin: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        overflow: visible !important;
    }

    .header_top-bar .header-topbar-user {
        justify-self: end !important;
        display: flex !important;
        justify-content: flex-end !important;
        margin-left: 0 !important;
        overflow: visible !important;
    }

    .header_top-bar .auth-menu-toggle {
        white-space: nowrap !important;
        font-size: 9px !important;
        gap: 4px !important;
        justify-content: flex-end !important;
        margin-left: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        line-height: 1 !important;
    }

    .header_top-bar .header-topbar-icon {
        display: inline-block !important;
        height: 12px !important;
        width: 12px !important;
        min-width: 12px !important;
        margin: 0 !important;
        flex: 0 0 12px !important;
    }

    .header_top-bar .header-topbar-email .header-topbar-icon {
        width: 12px !important;
        min-width: 12px !important;
        flex: 0 0 12px !important;
        object-fit: contain !important;
    }

    .header_top-bar .header-topbar-text {
        display: inline-block !important;
        line-height: 1 !important;
        margin: 0 !important;
    }

    .header_top-bar .header-topbar-email .header-topbar-text {
        overflow: visible !important;
    }

    .header_top-bar .me-2,
    .header_top-bar .me-3,
    .header_top-bar .ms-2,
    .header_top-bar .mx-2 {
        margin: 0 !important;
    }

    .header_top-bar .header-topbar-phone,
    .header_top-bar .header-topbar-email,
    .header_top-bar .auth-menu-toggle {
        font-size: 9px !important;
    }

    .header_top-bar .header-phone-country-code {
        display: none !important;
    }

    .header_navbar-brand img,
    #inp-custom-logo {
        height: 60px !important;
        max-height: 60px !important;
        width: auto !important;
    }

    .header_top-bar {
        font-size: 13px !important;
        /* Slightly smaller text */
    }

    /* Make hero section smaller on mobile */
    .homepage_hero-section {
        min-height: 250px !important;
        height: auto !important;
        /* Flexible height */
        max-height: none !important;
        /* Remove restriction */
    }

    /* Make hero image smaller and visible */
    .homepage_hero-section img {
        max-width: 80% !important;
        height: auto !important;
        margin-left: auto;
        display: block;
    }

    /* Fix Shop By Category spacing and overlapping */
    .homepage_industry-card,
    .homepage_category-card,
    .homepage_category-card-horizontal {
        margin-bottom: 15px !important;
        height: 100% !important;
        /* Ensure equal height */
        min-height: 110px !important;
        /* Minimum breathing room */
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
    }

    /* Fix Industry Card Image Truncation & Height */
    .homepage_industry-card {
        background-position: top center !important;
        background-size: cover !important;
        min-height: 250px !important;
        /* Increased height */
        height: 250px !important;
    }

    .homepage_cat-label {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        line-height: 1.2 !important;
        width: 100% !important;
        /* Contain text */
    }

    .row.g-3>[class*="col-"],
    .homepage_categories-grid-container .col {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }

    .homepage_categories-grid-container .row.g-0 > .col,
    .homepage_categories-grid-container .row > .col,
    .homepage_categories-grid-container .col {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 !important;
    }

    .homepage_categories-grid-container .homepage_category-card-horizontal {
        margin-bottom: 0 !important;
        border-radius: 0 !important;
    }

    /* Fix Residential/Commercial Protection Cards */
    /* Fix Residential/Commercial Protection Cards */
    .homepage_promo-card-v2 {
        background-size: cover !important;
        background-position: center !important;
        height: 200px !important;
        /* Reduced to match desktop/request */
        min-height: 200px !important;
        margin-bottom: 20px !important;
        /* Spacing between stacked cards */
        border-radius: 10px !important;
        padding: 30px !important;
        /* Match desktop padding */
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        width: 100% !important;
    }

    /* Ensure text is readable over background, but NO shadow as requested */
    .homepage_promo-card-v2 h3,
    .homepage_promo-card-v2 h2 {
        text-shadow: none !important;
        /* Removed shadow */
    }

    /* Increase logo size on mobile */
    .header_navbar-brand img {
        height: 70px !important;
        /* Force increased height */
        width: auto !important;
        /* Allow width to scale proportionally */
        max-height: none !important;
        max-width: none !important;
        /* Remove any width constraints */
    }
}

/* Fix About Company Layout Disturbance on Tablets/Mobile */
@media (max-width: 991px) {
    .homepage_about-collage {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        margin-bottom: 20px !important;
        height: auto !important;
        /* Reset grid if set elsewhere */
        grid-template-columns: none !important;
        grid-template-rows: none !important;
    }

    /* Make ALL images full width and consistent */
    .homepage_about-img-item,
    .homepage_about-img-large {
        width: 100% !important;
        /* Full Width */
        height: 250px !important;
        /* Consistent Height */
        margin: 0 !important;
        grid-column: auto !important;
        grid-row: auto !important;
    }

    /* Keep large image visually on top if desired, or natural flow */
    .homepage_about-img-large {
        order: -1 !important;
        /* Main image on top */
    }

    /* Fix content box padding since overlap is gone */
    .homepage_about-content-box {
        padding: 30px 20px !important;
        min-height: auto !important;
        text-align: left !important;
    }

    /* Fix Why Inprotech Images */
    .homepage_why-card {
        margin-bottom: 20px !important;
        width: 100% !important;
    }

    .homepage_why-card-img {
        width: 100% !important;
        height: 250px !important;
        /* Consistent with About section */
    }

.homepage_why-card-img img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
}

/* Mobile header cleanup: keep desktop untouched */
@media (max-width: 768px) {
    .header_benefit-bar {
        display: none !important;
    }

    .header_top-bar {
        margin-bottom: 0 !important;
    }

    .inp-custom-mobile-actions-wrap .header_right-actions {
        align-items: center !important;
        gap: 10px !important;
    }

    .inp-custom-mobile-search-pill {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        height: 40px !important;
    }

    .inp-custom-mobile-search-pill .header-search-input {
        font-size: 15px !important;
        height: 100% !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .header_cart-box {
        display: flex !important;
        align-items: center !important;
        height: 40px !important;
        gap: 10px !important;
        flex-shrink: 0 !important;
        transform: none !important;
        margin: 0 !important;
    }

    .header_wishlist-icon,
    .header_cart-icon {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 40px !important;
        align-self: center !important;
        line-height: 1 !important;
        margin: 0 !important;
    }

    .header_cart-icon img {
        display: block !important;
        height: 24px !important;
        width: auto !important;
    }

}

/* Tighten mobile/tablet header spacing so search stays flush with the banner */
@media (max-width: 991.98px) {
    .header_main-navbar {
        padding-top: 4px !important;
        padding-bottom: 6px !important;
        border-bottom: 1px solid #edf0f4 !important;
        box-shadow: 0 8px 20px rgba(12, 24, 44, 0.08) !important;
    }

    .inp-custom-desktop-row {
        gap: 0 !important;
    }

    .inp-custom-mobile-logo-wrap {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        min-height: 56px !important;
    }

    .inp-custom-mobile-toggle {
        width: 42px !important;
        height: 42px !important;
        flex: 0 0 42px !important;
        border-radius: 10px !important;
        background: #ff7700 !important;
        box-shadow: 0 6px 14px rgba(255, 119, 0, 0.24) !important;
    }

    .inp-custom-mobile-toggle:active {
        transform: translateY(1px) !important;
    }

    .inp-custom-mobile-toggle .header_navbar-toggler-icon {
        width: 22px !important;
        height: 22px !important;
        filter: brightness(0) invert(1) !important;
    }

    .inp-custom-mobile-logo-wrap,
    .inp-custom-mobile-actions-wrap,
    .inp-custom-mobile-search-pill,
    .inp-custom-mobile-actions-wrap .header_right-actions {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .header_main-navbar + #home.banner-slider-section,
    #home.banner-slider-section {
        margin-top: 0 !important;
        padding-top: 5px !important;
    }

    .inp-custom-homepage-cat-subtitle {
        font-size: 14px !important;
    }
}

@media (max-width: 600px) {
    .inp-custom-mobile-search-pill .search-results-popup,
    #mainHeaderSearchResultsPopup {
        left: 0 !important;
        right: auto !important;
        width: min(calc(100% + 74px), calc(100vw - 32px)) !important;
        min-width: min(calc(100% + 74px), calc(100vw - 32px)) !important;
        max-width: calc(100vw - 32px) !important;
        box-sizing: border-box !important;
    }
}

/* Mobile sticky top contact bar */
@media (max-width: 768px) {
    .header_top-bar {
        position: sticky !important;
        top: 0 !important;
        z-index: 1040 !important;
    }

    .header_main-navbar {
        position: sticky !important;
        top: 22px !important;
        z-index: 1035 !important;
    }
}
