/* ========================================
   COMPREHENSIVE RESPONSIVE DESIGN
   All device compatibility
   ======================================== */

/* ========================================
   BASE STYLES
   ======================================== */

/* Ensure no horizontal overflow */
body {
    overflow-x: hidden;
    width: 100%;
    min-width: 320px;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: hidden;
    width: 100%;
}

.container-fluid {
    overflow-x: hidden;
}

/* ========================================
   HEADER & NAVBAR - RESPONSIVE
   ======================================== */

/* Hide topbar on mobile and tablets */
@media (max-width: 991px) {
    .container-fluid.px-5.d-none.border-bottom.d-lg-block {
        display: none !important;
    }

    /* Adjust body padding when topbar is hidden */
    body {
        padding-top: 60px !important;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 60px !important;
    }
}

@media (max-width: 576px) {
    body {
        padding-top: 55px !important;
    }
}

@media (max-width: 400px) {
    body {
        padding-top: 50px !important;
    }
}

/* Tablets and below */
@media (max-width: 991px) {
    .container-fluid.px-5 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .nav-bar .px-5 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .navbar-brand img {
        height: 50px !important;
    }

    .navbar-toggler {
        padding: 0.5rem 0.75rem;
        border: 1px solid rgba(255, 255, 255, 0.5);
    }

    .navbar-toggler .fa-bars {
        color: #fff;
    }

    .navbar-nav {
        padding: 1rem 0;
    }

    .nav-item.nav-link {
        padding: 0.5rem 1rem;
        text-align: left;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .container-fluid.px-5 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .nav-bar .px-5 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .navbar-brand img {
        height: 45px !important;
    }

    /* Top bar contact info - adjust for mobile */
    .d-inline-flex.align-items-center a {
        font-size: 11px !important;
        margin-left: 0.5rem !important;
    }

    .d-inline-flex.align-items-center .fab,
    .d-inline-flex.align-items-center .fas {
        font-size: 14px !important;
    }
}

/* Extra Small Mobile */
@media (max-width: 575px) {
    .container-fluid.px-5 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .nav-bar .px-5 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .navbar-brand img {
        height: 45px !important;
    }

    .navbar-toggler {
        padding: 0.5rem 0.7rem;
        border: 2px solid rgba(255, 255, 255, 0.6);
        border-radius: 5px;
    }

    .navbar-toggler .fa-bars {
        font-size: 1.3rem;
        color: #fff;
    }

    /* Better header spacing */
    .nav-bar {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

/* Collapse menu styling for mobile */
@media (max-width: 991px) {
    .navbar-collapse {
        background: var(--bs-primary, #667eea);
        margin-top: 1rem;
        border-radius: 8px;
        padding: 0.5rem;
    }

    .navbar-nav .nav-link {
        color: #fff !important;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }

    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link.active {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 4px;
    }
}

/* ========================================
   SERVICES SECTION - RESPONSIVE
   ======================================== */

/* Desktop and Large Tablets (992px and above) */
@media (min-width: 992px) {
    .container-fluid.px-0 .col-lg-2 {
        flex: 0 0 16.666667%;
        max-width: 16.666667%;
    }
}

/* Tablets (768px to 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .container-fluid.px-0 .col-md-4 {
        padding: 0 !important;
    }

    .container-fluid.px-0 .col-md-4 .p-4 {
        padding: 1.5rem !important;
    }

    .container-fluid.px-0 .col-md-4 h6 {
        font-size: 13px;
    }

    .container-fluid.px-0 .col-md-4 p {
        font-size: 12px;
    }

    .container-fluid.px-0 .col-md-4 i {
        font-size: 1.5rem !important;
    }
}

/* Mobile Landscape and Small Tablets (576px to 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .container-fluid.px-0 .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .container-fluid.px-0 .col-6 .p-4 {
        padding: 1.2rem 0.8rem !important;
    }

    .container-fluid.px-0 .col-6 h6 {
        font-size: 11px;
        margin-bottom: 8px;
    }

    .container-fluid.px-0 .col-6 p {
        font-size: 10px;
        line-height: 1.3;
    }

    .container-fluid.px-0 .col-6 i {
        font-size: 1.3rem !important;
    }

    .container-fluid.px-0 .col-6 .ms-4 {
        margin-left: 0.8rem !important;
    }
}

/* Mobile Portrait (below 576px) */
@media (max-width: 575px) {
    .container-fluid.px-0 .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .container-fluid.px-0 .col-6 .p-4 {
        padding: 0.8rem 0.4rem !important;
    }

    .container-fluid.px-0 .col-6 .d-flex,
    .container-fluid.px-0 .col-6 .d-inline-flex {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }

    .container-fluid.px-0 .col-6 h6 {
        font-size: 9px;
        margin-bottom: 4px;
        text-align: center;
        font-weight: 600;
    }

    .container-fluid.px-0 .col-6 p {
        font-size: 8px;
        line-height: 1.2;
        margin-bottom: 0;
        text-align: center;
    }

    .container-fluid.px-0 .col-6 i {
        font-size: 1rem !important;
        margin-bottom: 6px;
    }

    .container-fluid.px-0 .col-6 .ms-4 {
        margin-left: 0 !important;
        margin-top: 0.2rem;
    }

    /* Hide borders on mobile for cleaner look */
    .container-fluid.px-0 .border-start,
    .container-fluid.px-0 .border-end {
        border-left: 0 !important;
        border-right: 0 !important;
    }

    /* Add bottom border instead */
    .container-fluid.px-0 .col-6 {
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .container-fluid.px-0 .row .col-6:nth-last-child(-n+2) {
        border-bottom: 0;
    }
}

/* Extra Small Devices (below 400px) */
@media (max-width: 399px) {
    .container-fluid.px-0 .col-6 .p-4 {
        padding: 0.8rem 0.3rem !important;
    }

    .container-fluid.px-0 .col-6 h6 {
        font-size: 9px;
    }

    .container-fluid.px-0 .col-6 p {
        font-size: 8px;
    }

    .container-fluid.px-0 .col-6 i {
        font-size: 1rem !important;
    }
}

/* ========================================
   EXPLORE PRODUCTS SECTION - RESPONSIVE
   ======================================== */

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
    .container-fluid.bg-light h1 {
        font-size: 32px !important;
    }
}

/* Desktop (1200px to 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .container-fluid.bg-light h1 {
        font-size: 30px !important;
    }

    .explore-product-item {
        padding: 22px 15px !important;
    }
}

/* Tablets (992px to 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .container-fluid.bg-light {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    .container-fluid.bg-light h1 {
        font-size: 28px !important;
    }

    .explore-product-item {
        padding: 20px 12px !important;
    }

    .explore-product-item h5 {
        font-size: 13px;
    }
}

/* Small Tablets (768px to 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .container-fluid.bg-light {
        padding-top: 40px !important;
        padding-bottom: 30px !important;
    }

    .container-fluid.bg-light h1 {
        font-size: 26px !important;
        margin-bottom: 25px !important;
    }

    .explore-product-item {
        padding: 18px 10px !important;
    }

    .explore-product-item h5 {
        font-size: 12px;
    }

    .explore-product-img {
        min-height: 100px;
        max-height: 100px;
    }

    .explore-product-img img {
        max-height: 100px;
    }
}

/* Mobile Landscape (576px to 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .container-fluid.bg-light {
        padding-top: 35px !important;
        padding-bottom: 25px !important;
    }

    .container-fluid.bg-light h1 {
        font-size: 24px !important;
        margin-bottom: 20px !important;
        text-align: center;
    }

    .col-sm-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .explore-product-item {
        padding: 16px 10px !important;
    }

    .explore-product-item h5 {
        font-size: 11px;
    }

    .explore-product-img {
        min-height: 90px;
        max-height: 90px;
        margin-bottom: 12px;
    }

    .explore-product-img img {
        max-height: 90px;
    }
}

/* Mobile Portrait (below 576px) */
@media (max-width: 575px) {

    .container-fluid.bg-light,
    .container-fluid.bg-white {
        padding-top: 25px !important;
        padding-bottom: 25px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .container-fluid.bg-light h1,
    .container-fluid.bg-white h1 {
        font-size: 20px !important;
        margin-bottom: 16px !important;
        text-align: center;
        font-weight: 700;
    }

    .col-sm-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .explore-product-item {
        padding: 12px 8px !important;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08) !important;
    }

    .explore-product-item h5 {
        font-size: 10px;
        line-height: 1.3;
        font-weight: 600;
    }

    .explore-product-img {
        min-height: 70px;
        max-height: 70px;
        margin-bottom: 8px;
    }

    .explore-product-img img {
        max-height: 70px;
    }

    .row.g-4 {
        row-gap: 0.8rem !important;
        column-gap: 0.5rem !important;
    }
}

/* Extra Small Devices (below 400px) */
@media (max-width: 399px) {
    .container-fluid.bg-light h1 {
        font-size: 20px !important;
        margin-bottom: 15px !important;
    }

    .explore-product-item {
        padding: 12px 6px !important;
    }

    .explore-product-item h5 {
        font-size: 9px;
    }

    .explore-product-img {
        min-height: 70px;
        max-height: 70px;
        margin-bottom: 8px;
    }

    .explore-product-img img {
        max-height: 70px;
    }
}

/* ========================================
   UPCOMING PRODUCTS SECTION - RESPONSIVE
   ======================================== */

/* Desktop */
@media (min-width: 1200px) {
    .container-fluid.bg-white {
        padding-bottom: 80px !important;
    }
}

/* Tablets */
@media (min-width: 768px) and (max-width: 1199px) {
    .container-fluid.bg-white {
        padding-top: 30px !important;
        padding-bottom: 60px !important;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .container-fluid.bg-white {
        padding-top: 25px !important;
        padding-bottom: 40px !important;
    }
}

@media (max-width: 575px) {
    .container-fluid.bg-white {
        padding-top: 20px !important;
        padding-bottom: 30px !important;
    }
}

/* ========================================
   MARQUEE SECTION - RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .marquee-container {
        font-size: 12px;
        padding: 10px 0;
        letter-spacing: 1px;
    }
}

@media (max-width: 576px) {
    .marquee-container {
        font-size: 11px;
        padding: 8px 0;
        letter-spacing: 0.5px;
    }
}

@media (max-width: 400px) {
    .marquee-container {
        font-size: 10px;
        padding: 7px 0;
        letter-spacing: 0.5px;
    }
}

/* ========================================
   CAROUSEL MOBILE ENHANCEMENTS
   ======================================== */

/* Mobile specific carousel adjustments */
@media (max-width: 768px) {
    .container-fluid.carousel {
        top: -20px;
        margin-bottom: -20px;
        background: transparent;
    }

    .header-carousel .owl-item,
    .header-carousel-item {
        height: 300px !important;
        background: transparent;
    }

    .header-carousel-item img {
        object-fit: cover !important;
        object-position: center !important;
    }
}

@media (max-width: 576px) {
    .container-fluid.carousel {
        top: -15px;
        margin-bottom: -15px;
    }

    .header-carousel .owl-item,
    .header-carousel-item {
        height: 280px !important;
    }
}

@media (max-width: 480px) {

    .header-carousel .owl-item,
    .header-carousel-item {
        height: 260px !important;
    }
}

@media (max-width: 400px) {

    .header-carousel .owl-item,
    .header-carousel-item {
        height: 240px !important;
    }
}

@media (max-width: 360px) {

    .header-carousel .owl-item,
    .header-carousel-item {
        height: 220px !important;
    }
}

/* ========================================
   GENERAL UTILITY CLASSES
   ======================================== */

/* Prevent text from wrapping awkwardly on small screens */
@media (max-width: 576px) {

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Ensure proper spacing on all devices */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

/* ========================================
   BORDER FIXES FOR MOBILE
   ======================================== */

/* Ensure borders look good on all screen sizes */
@media (max-width: 767px) {

    .border-start,
    .border-end {
        border-width: 1px !important;
    }
}

@media (max-width: 575px) {
    .col-6.border-start:nth-child(odd) {
        border-left: 0 !important;
    }

    .col-6.border-end:nth-child(even) {
        border-right: 0 !important;
    }
}

/* ========================================
   GRID ADJUSTMENTS
   ======================================== */

/* Ensure proper grid gaps on mobile */
@media (max-width: 576px) {
    .g-4 {
        gap: 0.75rem !important;
    }
}

@media (max-width: 399px) {
    .g-4 {
        gap: 0.5rem !important;
    }
}

/* ========================================
   IMAGE OPTIMIZATION
   ======================================== */

/* Ensure all images scale properly */
img {
    max-width: 100%;
    height: auto;
}

.img-fluid {
    max-width: 100%;
    height: auto;
}

/* ========================================
   HOVER EFFECTS - DISABLE ON TOUCH DEVICES
   ======================================== */

@media (hover: none) and (pointer: coarse) {
    .explore-product-item:hover {
        transform: none;
    }

    .explore-product-item:active {
        transform: scale(0.98);
    }
}

/* ========================================
   LANDSCAPE ORIENTATION FIXES
   ======================================== */

@media (max-height: 600px) and (orientation: landscape) {

    .header-carousel .owl-item,
    .header-carousel-item {
        height: 100vh !important;
        max-height: 500px !important;
    }
}

/* ========================================
   VERY LARGE SCREENS (4K and above)
   ======================================== */

@media (min-width: 2560px) {
    .container-fluid.bg-light h1 {
        font-size: 40px !important;
    }

    .explore-product-item {
        padding: 30px 20px !important;
    }

    .explore-product-item h5 {
        font-size: 18px;
    }

    .explore-product-img {
        min-height: 150px;
        max-height: 150px;
    }

    .explore-product-img img {
        max-height: 150px;
    }
}

/* ========================================
   SAFE AREA INSETS (iPhone X+)
   ======================================== */

@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* ========================================
   SMOOTH SCROLLING & TOUCH OPTIMIZATION
   ======================================== */

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Smooth scrolling on mobile */
@media (max-width: 768px) {
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    body {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
}

/* Improve touch targets for mobile */
@media (max-width: 768px) {

    a,
    button,
    .btn,
    .nav-link {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nav-link {
        justify-content: flex-start;
    }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* GPU acceleration for smooth animations */
.header-carousel,
.explore-product-item,
.owl-item,
.owl-stage {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Optimize images for mobile */
@media (max-width: 768px) {
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

/* Better focus states for keyboard navigation */
@media (min-width: 992px) {

    a:focus,
    button:focus,
    .btn:focus {
        outline: 2px solid #667eea;
        outline-offset: 2px;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {

    .header-carousel,
    .owl-nav,
    .owl-dots,
    .navbar-toggler,
    .marquee-container {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    .container-fluid {
        max-width: 100%;
    }
}

/* ========================================
   FOOTER RESPONSIVE (if exists)
   ======================================== */

@media (max-width: 991px) {

    footer .col-lg-3,
    footer .col-lg-4 {
        margin-bottom: 2rem;
    }
}

@media (max-width: 575px) {
    footer {
        font-size: 14px;
    }

    footer h4,
    footer h5 {
        font-size: 16px;
    }

    footer .btn {
        font-size: 12px;
        padding: 8px 16px;
    }
}

/* ========================================
   LANDSCAPE MODE OPTIMIZATIONS
   ======================================== */

@media (max-width: 768px) and (orientation: landscape) {

    .header-carousel .owl-item,
    .header-carousel-item {
        height: 80vh !important;
        max-height: 450px !important;
    }

    .container-fluid.bg-light,
    .container-fluid.bg-white {
        padding-top: 20px !important;
        padding-bottom: 20px !important;
    }
}

/* ========================================
   TABLET SPECIFIC OPTIMIZATIONS
   ======================================== */

@media (min-width: 768px) and (max-width: 1024px) {

    /* iPad and similar tablets */
    .container-fluid {
        max-width: 100%;
    }

    .explore-product-item {
        padding: 20px 15px !important;
    }

    .header-carousel .owl-item,
    .header-carousel-item {
        height: 480px !important;
    }
}

/* ========================================
   FOLDABLE & DUAL-SCREEN DEVICES
   ======================================== */

@media (min-width: 540px) and (max-width: 720px) {

    /* Surface Duo and similar foldables */
    .container-fluid {
        max-width: 100%;
    }
}

/* ========================================
   EDGE CASES & FIXES
   ======================================== */

/* Fix for very narrow screens */
@media (max-width: 320px) {
    body {
        font-size: 14px;
    }

    .container-fluid.bg-light h1,
    .container-fluid.bg-white h1 {
        font-size: 18px !important;
    }

    .explore-product-item h5 {
        font-size: 8px !important;
    }

    .container-fluid.px-0 .col-6 p {
        font-size: 7px !important;
    }
}

/* Fix for ultra-wide screens */
@media (min-width: 3840px) {
    .container {
        max-width: 3200px;
        margin: 0 auto;
    }
}

/* ========================================
   DARK MODE SUPPORT (Optional)
   ======================================== */

@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed in future */
}

/* ========================================
   REDUCED MOTION SUPPORT
   ======================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .header-carousel {
        scroll-behavior: auto !important;
    }
}

/* ========================================
   HIGH CONTRAST MODE SUPPORT
   ======================================== */

@media (prefers-contrast: high) {

    .explore-product-item,
    .owl-nav button,
    .owl-dot {
        border-width: 2px !important;
    }
}