/* ========================================
   COMPREHENSIVE RESPONSIVE ENHANCEMENT
   For Business Contracts, Loan & Debt Tribunal, Document Attestation
   ======================================== */

/* ===== GLOBAL RESPONSIVE FIXES ===== */
* {
    box-sizing: border-box !important;
}

html, body {
    width: 100% !important;
    overflow-x: hidden !important;
}

.container {
    width: 100% !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* ===== HERO SECTION RESPONSIVE ===== */
.contracts-hero,
.tribunal-hero,
.attestation-hero,
section[style*="min-height: 45vh"] {
    min-height: 50vh !important;
    padding: 100px 0 60px !important;
    text-align: center !important;
}

/* Hero Content Responsive */
.hero-content h1 {
    font-size: clamp(1.8rem, 5vw, 3.5rem) !important;
    line-height: 1.2 !important;
    margin-bottom: 1rem !important;
    word-wrap: break-word !important;
}

.hero-content p {
    font-size: clamp(0.9rem, 2.5vw, 1.3rem) !important;
    line-height: 1.5 !important;
    margin-bottom: 2rem !important;
}

/* Hero Buttons Responsive */
.hero-content div[style*="display: flex; gap: 1rem"] {
    display: flex !important;
    gap: 1rem !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    margin-top: 2rem !important;
}

/* ===== SECTIONS RESPONSIVE ===== */
section {
    padding: 60px 0 !important;
    width: 100% !important;
}

/* Content Cards */
.content-card,
div[style*="background: white"] {
    margin-bottom: 2rem !important;
    padding: 2rem !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1) !important;
}

/* Grid Layouts */
div[style*="display: grid"] {
    display: grid !important;
    gap: 2rem !important;
}

/* ===== TABLET RESPONSIVE (1024px and below) ===== */
@media (max-width: 1024px) {
    .container {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
    
    section {
        padding: 50px 0 !important;
    }
    
    .hero-content h1 {
        font-size: clamp(1.6rem, 4vw, 2.8rem) !important;
    }
    
    .hero-content p {
        font-size: clamp(0.9rem, 2.2vw, 1.1rem) !important;
    }
    
    /* Grid adjustments */
    div[style*="grid-template-columns: 1fr 1fr 1fr"],
    div[style*="grid-template-columns: repeat(3"] {
        grid-template-columns: 1fr 1fr !important;
    }
    
    .content-card {
        padding: 1.5rem !important;
    }
}

/* ===== MOBILE RESPONSIVE (768px and below) ===== */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    section {
        padding: 40px 0 !important;
    }
    
    .contracts-hero,
    .tribunal-hero,
    .attestation-hero,
    section[style*="min-height: 45vh"] {
        min-height: 40vh !important;
        padding: 80px 0 40px !important;
    }
    
    .hero-content h1 {
        font-size: clamp(1.5rem, 6vw, 2.5rem) !important;
        margin-bottom: 1rem !important;
    }
    
    .hero-content p {
        font-size: clamp(0.9rem, 3vw, 1rem) !important;
        margin-bottom: 1.5rem !important;
    }
    
    /* All grids become single column */
    div[style*="grid-template-columns"],
    div[style*="display: grid"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    .content-card {
        padding: 1.2rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    /* Button adjustments */
    .hero-content a {
        padding: 0.8rem 1.5rem !important;
        font-size: 0.9rem !important;
        width: auto !important;
        min-width: 140px !important;
    }
    
    /* Breadcrumb responsive */
    .breadcrumb {
        font-size: 0.8rem !important;
        flex-wrap: wrap !important;
        gap: 0.3rem !important;
    }
}

/* ===== SMALL MOBILE RESPONSIVE (480px and below) ===== */
@media (max-width: 480px) {
    .container {
        padding-left: 0.8rem !important;
        padding-right: 0.8rem !important;
    }
    
    section {
        padding: 30px 0 !important;
    }
    
    .contracts-hero,
    .tribunal-hero,
    .attestation-hero,
    section[style*="min-height: 45vh"] {
        min-height: 35vh !important;
        padding: 70px 0 30px !important;
    }
    
    .hero-content h1 {
        font-size: clamp(1.3rem, 7vw, 2rem) !important;
        line-height: 1.1 !important;
    }
    
    .hero-content p {
        font-size: clamp(0.8rem, 4vw, 0.95rem) !important;
        line-height: 1.4 !important;
    }
    
    .content-card {
        padding: 1rem !important;
        margin-bottom: 1.2rem !important;
    }
    
    /* Hero buttons stack vertically */
    .hero-content div[style*="display: flex; gap: 1rem"] {
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.8rem !important;
    }
    
    .hero-content a {
        width: 80% !important;
        max-width: 250px !important;
        text-align: center !important;
        padding: 0.8rem 1rem !important;
        font-size: 0.85rem !important;
    }
}

/* ===== TEXT AND TYPOGRAPHY RESPONSIVE ===== */
h2 {
    font-size: clamp(1.3rem, 3vw, 2rem) !important;
    line-height: 1.3 !important;
    margin-bottom: 1rem !important;
}

h3 {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem) !important;
    line-height: 1.4 !important;
    margin-bottom: 0.8rem !important;
}

h4 {
    font-size: clamp(1rem, 2vw, 1.2rem) !important;
    line-height: 1.4 !important;
    margin-bottom: 0.6rem !important;
}

p, li {
    font-size: clamp(0.9rem, 2vw, 1rem) !important;
    line-height: 1.6 !important;
    margin-bottom: 1rem !important;
}

/* ===== IMAGE AND MEDIA RESPONSIVE ===== */
img {
    max-width: 100% !important;
    height: auto !important;
}

/* ===== LIST RESPONSIVE ===== */
ul, ol {
    padding-left: 1.2rem !important;
}

li {
    margin-bottom: 0.5rem !important;
}

/* ===== ANIMATION FIXES ===== */
.floating-animation {
    display: none !important;
}

@media (min-width: 768px) {
    .floating-animation {
        display: block !important;
    }
}

/* ===== EMERGENCY FALLBACKS ===== */
@media (max-width: 1200px) {
    .hamburger {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .nav-menu {
        position: fixed !important;
        left: -100% !important;
        top: 80px !important;
        width: 100vw !important;
        height: calc(100vh - 80px) !important;
        background: rgba(255,255,255,0.98) !important;
        transition: left 0.3s ease !important;
        flex-direction: column !important;
        padding: 2rem !important;
    }
    
    .nav-menu.active {
        left: 0 !important;
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
* {
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

section {
    will-change: transform !important;
}
