/* ==========================================================================
   COMPREHENSIVE HOMEPAGE RESPONSIVE FIXES
   Mobile-First Approach with Specific Breakpoints
   ========================================================================== */

/* 
   BREAKPOINT SYSTEM:
   - Mobile: 320px - 480px
   - Large Mobile: 481px - 767px
   - Tablet: 768px - 1023px
   - Desktop: 1024px - 1439px
   - Large Desktop: 1440px+
*/

/* ==========================================================================
   GLOBAL RESPONSIVE FIXES (Mobile First)
   ========================================================================== */

html,
body {
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Ensure all images are responsive by default */
img {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.container {
    width: 100% !important;
    max-width: 1240px !important;
    margin: 0 auto !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
}

/* Fluid Typography Base */
h1 {
    font-size: clamp(32px, 8vw, 64px);
}

h2 {
    font-size: clamp(24px, 6vw, 42px);
}

h3 {
    font-size: clamp(20px, 4vw, 32px);
}

/* Common Section Spacing */
section {
    padding: 40px 0 !important;
}

/* ==========================================================================
   MOBILE VIEW (Primary Styles & Overrides)
   ========================================================================== */

/* Header / Navbar Mobile */
.site-header {
    padding: 12px 0 !important;
}

.header-container {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    justify-content: space-between !important;
}

.custom-logo {
    height: 35px !important;
    max-width: 100px !important;
    flex-shrink: 0 !important;
}

.header-cta {
    display: none !important;
    /* Hide on small mobile header to save space */
}

.menu-toggle {
    display: flex !important;
    order: 2 !important;
}

/* Hero Section Mobile */
.hero-section {
    padding: 40px 0 !important;
    text-align: center !important;
}

.hero-container {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 24px !important;
}

.hero-image {
    order: -1 !important;
}

.hero-main-image {
    max-width: 280px !important;
    margin: 0 auto !important;
}

.hero-title {
    line-height: 1.2 !important;
    margin-bottom: 16px !important;
}

.hero-content .btn {
    width: 100% !important;
    max-width: 280px !important;
}

/* Grids: 1 column on mobile */
.why-choose-container,
.connecting-container,
.static-reviews-grid,
.register-lawyer-container,
.banner-container,
.why-choose-features {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 32px !important;
}

.why-choose-image,
.connecting-image,
.register-lawyer-image,
.banner-image-wrapper {
    order: -1 !important;
}

/* Categories Carousel Mobile Peek Effect */
.categories-paging-wrapper {
    margin: 20px -16px 0 !important;
    /* Bleed to edges */
    padding: 0 16px !important;
    overflow: hidden !important;
}

.categories-paging-grid {
    display: flex !important;
    gap: 16px !important;
}

.category-paging-item {
    flex: 0 0 90% !important;
    /* 90% width for peek effect */
    min-width: 90% !important;
    box-sizing: border-box !important;
}

/* App Banner Mobile */
.banner-image-premium {
    width: 85% !important;
    max-width: 250px !important;
}

.app-store-buttons-premium {
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
}

.app-store-link img {
    height: 40px !important;
}

.urdu-tagline-wrapper {
    border-top: 3px solid #FFA500;
    padding-top: 15px !important;
}

/* ==========================================================================
   LARGE MOBILE (481px - 767px)
   ========================================================================== */

@media (min-width: 481px) {
    section {
        padding: 50px 0 !important;
    }

    .custom-logo {
        height: 40px !important;
        max-width: 120px !important;
    }

    .header-cta {
        display: flex !important;
        order: 3 !important;
        width: auto !important;
    }

    .header-cta .btn {
        padding: 8px 16px !important;
        font-size: 12px !important;
    }

    .hero-main-image {
        max-width: 320px !important;
    }

    .why-choose-features {
        grid-template-columns: 1fr 1fr !important;
    }

    .category-paging-item {
        flex: 0 0 calc(50% - 10px) !important;
        min-width: calc(50% - 10px) !important;
    }

    .app-store-buttons-premium {
        flex-direction: row !important;
        justify-content: center !important;
    }
}

/* ==========================================================================
   TABLET (768px - 1023px)
   ========================================================================== */

@media (min-width: 768px) {
    section {
        padding: 60px 0 !important;
    }

    .container {
        padding: 0 24px !important;
    }

    .custom-logo {
        height: 45px !important;
        max-width: 140px !important;
    }

    .menu-toggle {
        display: none !important;
    }

    .main-navigation .menu {
        display: flex !important;
        flex-direction: row !important;
        gap: 20px !important;
    }

    .hero-container {
        grid-template-columns: 1fr 1fr !important;
        text-align: left !important;
        align-items: center !important;
    }

    .hero-image {
        order: 1 !important;
    }

    .hero-main-image {
        max-width: 100% !important;
    }

    .hero-content .btn {
        width: auto !important;
    }

    .category-paging-item {
        flex: 0 0 calc(33.33% - 12px) !important;
        min-width: calc(33.33% - 12px) !important;
    }
}

/* ==========================================================================
   DESKTOP (1024px - 1439px)
   ========================================================================== */

@media (min-width: 1024px) {
    section {
        padding: 80px 0 !important;
    }

    .main-navigation .menu {
        gap: 32px !important;
    }

    .why-choose-container,
    .connecting-container,
    .register-lawyer-container,
    .banner-container,
    .static-reviews-grid {
        grid-template-columns: 1fr 1fr !important;
        align-items: center !important;
    }

    .why-choose-image,
    .connecting-image,
    .register-lawyer-image,
    .banner-image-wrapper {
        order: auto !important;
    }

    .connecting-image {
        order: 2 !important;
    }

    .connecting-content {
        order: 1 !important;
    }

    .category-paging-item {
        flex: 0 0 calc(33.33% - 12px) !important;
        min-width: calc(33.33% - 12px) !important;
    }

    .app-store-buttons-premium {
        justify-content: flex-start !important;
    }
}

/* ==========================================================================
   LARGE DESKTOP (1440px+)
   ========================================================================== */

@media (min-width: 1440px) {
    .category-paging-item {
        flex: 0 0 calc(25% - 12px) !important;
        min-width: calc(25% - 12px) !important;
    }
}

/* ==========================================================================
   HORIZONTAL SCROLL PREVENTION & FINAL FIXES
   ========================================================================== */

* {
    box-sizing: border-box;
}

/* Fix any overflowing absolute elements */
.why-choose-circle-frame,
.banner-bg-glow {
    max-width: 100% !important;
    overflow: hidden !important;
}

/* Ensure no horizontal scroll on all screen sizes */
body,
html {
    overflow-x: hidden !important;
    position: relative !important;
}