/* 🎯 SECTORS PAGE - COMPLETE STYLES */

/* 🔒 Fix Horizontal Scroll & Layout Issues */
html {
    width: 100%;
    overflow-x: clip !important; /* Use clip instead of hidden - supports sticky */
}

body {
    width: 100%;
    max-width: 100vw;
    overflow-x: clip !important; /* clip allows sticky, hidden doesn't */
}

/* ⚠️ CRITICAL FIX: Override all header position rules */
html body header.header,
html body #mainHeader,
body.page-sectors header,
body.page-sectors .header {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 999999 !important;
    background: rgba(11, 16, 32, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    transform: translateZ(0) !important;
}

/* Mobile sticky with maximum specificity */
@media (max-width: 768px) {
    html body header.header,
    html body #mainHeader,
    body.page-sectors header,
    body.page-sectors .header {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 999999 !important;
        background: rgba(11, 16, 32, 0.98) !important;
        transform: translateZ(0) !important;
    }
}

.container {
    max-width: 1280px;
    width: 100%;
    padding-left: 16px;
    padding-right: 16px;
    margin: 0 auto;
    box-sizing: border-box;
}

section {
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* Professional CTA Buttons */
.professional-cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 🎯 Sectors Page Footer Logo Customization */
.page-sectors .footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-sectors .footer-logo__img {
    height: 56px !important;
    width: auto;
    max-width: 100%;
    filter: brightness(1.2) drop-shadow(0 4px 12px rgba(0, 229, 255, 0.4));
    transition: all 0.3s ease;
}

.page-sectors .footer-logo__img:hover {
    transform: scale(1.05);
    filter: brightness(1.3) drop-shadow(0 6px 20px rgba(0, 229, 255, 0.6));
}

/* 📱 Mobile Responsive - Sectors Page */
@media (max-width: 768px) {
    /* Prevent horizontal overflow on mobile */
    * {
        box-sizing: border-box;
    }
    
    /* NEVER use overflow-x: hidden on html/body - it breaks position: sticky */
    body, html {
        max-width: 100vw;
    }
    
    .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
        max-width: 100% !important;
    }
    
    /* Adjust key benefits grid on mobile */
    section div[style*="grid-template-columns: repeat(auto-fit, minmax(200px, 1fr))"] {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    /* Smaller padding for mobile sections */
    section[style*="padding: 100px 0"],
    section[style*="padding: 140px 0"] {
        padding: 60px 0 !important;
    }
    
    /* Mobile button sizing */
    .btn-lg, .btn-primary, .btn-secondary {
        width: 100% !important;
        text-align: center;
        justify-content: center;
    }
    
    /* Professional CTA mobile */
    .professional-cta-buttons {
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    /* Sectors page footer logo - smaller on mobile */
    .page-sectors .footer-logo__img {
        height: 48px !important;
    }
    
    /* Card images from grid section */
    .card img {
        height: auto !important;
        min-height: 280px !important;
    }
}

/* MODERN MOBILE CARD DESIGN - All Sectors */
@media (max-width: 768px) {
    /* Main sector cards (Lawyer, Doctor, Dentist) - Card structure */
    article.section .container > div[style*="grid-template-columns: 1fr 1fr"] {
        display: flex !important;
        flex-direction: column !important;
        background: rgba(255, 255, 255, 0.03) !important;
        border: 1px solid rgba(0, 229, 255, 0.15) !important;
        border-radius: 16px !important;
        overflow: hidden !important;
        padding: 0 !important;
        gap: 0 !important;
    }
    
    /* Image container - ALWAYS ON TOP */
    article.section div[style*="border-radius: 20px"][style*="overflow: hidden"] {
        order: -1 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        margin: 0 !important;
        width: 100% !important;
    }
    
    article.section div[style*="border-radius: 20px"] img {
        width: 100% !important;
        height: 300px !important;
        max-height: 300px !important;
        object-fit: cover !important;
        display: block !important;
    }
    
    /* Text content - ALWAYS ON BOTTOM */
    article.section .container > div[style*="grid-template-columns: 1fr 1fr"] > div:not([style*="border-radius"]) {
        order: 1 !important;
        padding: 32px 24px 40px 24px !important;
    }
    
    /* Statistics cards (doctor section %280, Top 3 etc) */
    article.section div[style*="grid-template-columns: 1fr 1fr"][style*="gap: 16px"][style*="margin-bottom: 24px"] {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    /* Small screen padding */
    .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    
    /* Image height */
    article.section div[style*="border-radius: 20px"] img {
        height: 250px !important;
    }
    
    /* Card internal padding reduction */
    article.section .container > div[style*="grid-template-columns: 1fr 1fr"] > div:not([style*="border-radius"]) {
        padding: 24px 20px 32px 20px !important;
    }
    
    /* Smaller heading sizes */
    h1[style*="clamp"] {
        font-size: 28px !important;
        line-height: 1.2 !important;
    }
    
    h2[style*="clamp"] {
        font-size: 24px !important;
        line-height: 1.2 !important;
    }
    
    /* Adjust text sizes */
    p[style*="font-size: 18px"],
    p[style*="font-size: 20px"] {
        font-size: 16px !important;
    }
}
