/* ============================================
   RESPONSIVE.CSS - Mobile-First Fixes
   Fixes horizontal overflow and optimizes mobile UX
   ============================================ */

/* Base Mobile Fixes */
html,
body {
    max-width: 100%;
    overflow-x: hidden !important;
}

* {
    max-width: 100%;
}

/* Container Constraints */
.container {
    width: 100%;
    max-width: var(--container-max);
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* Mobile Breakpoint (768px and below) */
@media (max-width: 768px) {

    /* Typography Scaling */
    h1 {
        font-size: clamp(2rem, 8vw, 3rem) !important;
        line-height: 1.2 !important;
    }

    h2 {
        font-size: clamp(1.75rem, 6vw, 2.5rem) !important;
        line-height: 1.3 !important;
    }

    h3 {
        font-size: clamp(1.25rem, 5vw, 1.75rem) !important;
    }

    p {
        font-size: clamp(0.9rem, 3vw, 1rem) !important;
    }

    /* Container Padding Reduction */
    .container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    /* Hero Section Fixes */
    .hero,
    .hero-section,
    .premium-hero {
        min-height: 70vh !important;
        padding-top: 100px !important;
        padding-bottom: 3rem !important;
    }

    .hero-title {
        font-size: 2.5rem !important;
    }

    .hero-subtext,
    .hero-text {
        font-size: 1rem !important;
        max-width: 100% !important;
    }

    .hero-buttons {
        flex-direction: column !important;
        gap: 0.75rem !important;
        width: 100%;
    }

    .hero-buttons a {
        width: 100%;
        text-align: center;
    }

    /* Grid Layouts - Force Stacking */
    .grid,
    .services-grid,
    .process-steps,
    .social-wall-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    /* Specific Grid Overrides */
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns: repeat(2, 1fr)"],
    [style*="grid-template-columns: repeat(3, 1fr)"],
    [style*="grid-template-columns: repeat(4, 1fr)"],
    [style*="grid-template-columns: repeat(auto-fit"],
    [style*="grid-template-columns: repeat(auto-fill"] {
        grid-template-columns: 1fr !important;
    }

    /* Header Navigation */
    header,
    .header {
        padding: 1rem 1.25rem !important;
    }

    .header .container {
        padding: 0 !important;
    }

    .nav-links {
        display: none;
        /* Hidden by default, show with hamburger menu */
    }

    .nav-links.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--black);
        padding: 2rem 1.25rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Button Adjustments */
    .btn {
        padding: 0.875rem 1.5rem !important;
        font-size: 0.95rem !important;
    }

    .btn-lg {
        padding: 1rem 2rem !important;
    }

    /* Section Spacing */
    section,
    .py-section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    /* Trust Badges */
    .trust-badges {
        flex-direction: column !important;
        gap: 1rem !important;
        align-items: flex-start !important;
    }

    /* Service Cards */
    .service-card,
    .process-step,
    .glass-panel {
        margin-bottom: 1rem;
    }

    /* Portfolio Grid */
    .masonry-grid {
        grid-template-columns: 1fr !important;
    }

    .portfolio-tabs,
    .service-tabs,
    .tabs-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Client Badges */
    .client-types,
    .client-badge {
        width: 100%;
        text-align: center;
        padding: 0.75rem 1rem !important;
    }

    /* Chat Widget */
    .chat-widget {
        bottom: 20px;
        right: 20px;
    }

    .chat-bubble {
        width: 50px;
        height: 50px;
    }

    /* Cookie Banner */
    .cookie-banner {
        max-width: calc(100% - 2rem);
        left: 1rem;
        right: 1rem;
        padding: 1.25rem;
    }

    /* Form Elements */
    input,
    textarea,
    select,
    .input-glass {
        width: 100% !important;
        font-size: 16px !important;
        /* Prevents zoom on iOS */
    }

    /* Stats/Counters */
    .stats-grid,
    [style*="grid-template-columns: repeat(3"] {
        grid-template-columns: 1fr !important;
    }

    /* Eyebrow Text */
    .eyebrow {
        font-size: 0.75rem !important;
        padding: 6px 14px !important;
    }

    /* Video Background */
    .video-bg video {
        object-fit: cover;
        object-position: center;
    }

    /* Portfolio Specific */
    .portfolio-hero {
        min-height: 50vh !important;
    }

    .tab-btn {
        font-size: 0.85rem !important;
        padding: 0.5rem 1rem !important;
        white-space: nowrap;
    }

    /* Pricing Cards */
    .pricing-card {
        margin-bottom: 1.5rem;
    }

    /* About Page Grids */
    .about .grid[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Visual Icons/Emojis */
    [style*="font-size: 150px"],
    [style*="font-size: 120px"],
    [style*="font-size: 100px"] {
        font-size: 80px !important;
    }

    [style*="font-size: 80px"],
    [style*="font-size: 64px"],
    [style*="font-size: 60px"] {
        font-size: 48px !important;
    }

    /* Aspect Ratio Boxes */
    [style*="aspect-ratio: 1"] {
        min-height: 250px;
    }

    /* Fixed Positioning Issues */
    .sticky-cta {
        padding: 0.75rem 1rem !important;
    }

    /* Overflow Hidden Wrapper */
    .hero-content,
    .section-header,
    .cta-content {
        overflow: hidden;
        width: 100%;
    }
}

/* Extra Small Mobile (425px and below) */
@media (max-width: 425px) {

    h1 {
        font-size: 1.875rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .btn {
        font-size: 0.875rem !important;
        padding: 0.75rem 1.25rem !important;
    }

    .process-step [style*="position: absolute"][style*="font-size: 60px"] {
        font-size: 40px !important;
        opacity: 0.05 !important;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {

    .hero,
    .hero-section {
        min-height: 100vh !important;
    }
}

/* Tablet Breakpoint (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {

    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .grid[style*="grid-template-columns: repeat(3"],
    .grid[style*="grid-template-columns: repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}