/* ========== RESPONSIVE STYLES ========== */

/* ========== 1024px - SERVICES GRID ========== */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== 1200px - PROCESS & CHIPS ========== */
@media (max-width: 1200px) {
    .process-wrapper { gap: 60px; }
    .process-title { font-size: 48px; }
    .process-card { padding: 32px; gap: 24px; }

    .chip-web { left: 5%; }
    .chip-auto { right: 5%; }
}

/* ========== 991px - TABLET & MOBILE ========== */
@media (max-width: 991px) {

    /* --- Workflow (Automation Pipeline) --- */
    .wf-pipeline {
        flex-direction: column;
        align-items: center;
        gap: 60px;
    }
    .wf-svg-layer {
        display: none;
    }
    .wf-step {
        width: 100%;
    }
    .wf-arrow {
        top: auto;
        bottom: -40px;
        right: 50%;
        transform: translateX(50%) rotate(90deg);
    }
    .wf-step:last-child .wf-arrow {
        display: none;
    }

    /* --- Old process section (legacy) --- */
    .process { padding: 100px 0; }
    .process-wrapper { grid-template-columns: 1fr; gap: 60px; }
    .process-visual-side { position: relative; top: 0; order: -1; margin-bottom: 20px; }
    .process-image { max-width: 480px; }
    .process-content-side { text-align: center; }
    .process-header { margin-bottom: 40px; }
    .process-title { font-size: 42px; margin: 0 auto 20px; }
    .process-desc { margin: 0 auto; }
    .process-cards-stack { gap: 20px; padding-bottom: 0; }
    .stats-bar { grid-template-columns: repeat(2, 1fr); padding: 40px 20px; margin-top: 80px; }

    /* --- Hero --- */
    .hero { padding: 140px 0 60px; min-height: 700px; }
    .orb-main { width: 300px; height: 300px; }
    .ethereal-orb { width: 300px; height: 300px; }
    .ring-2, .ring-3 { display: none; }

    .chip { position: relative; inset: auto !important; transform: none !important; margin: 10px; }
    .service-chips {
        position: relative;
        inset: auto;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 40px;
    }
    .hero-logo-strip { margin-top: 60px; }

    /* --- About --- */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .about-image-side {
        order: -1;
    }

    /* --- Process v2 (New Stacked Cards Section Header) --- */
    .process-header-v2 {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
        margin-bottom: 40px;
    }

    /* --- CTA --- */
    .cta-content {
        flex-direction: column;
        text-align: center;
        gap: 32px;
    }
    .cta-left {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* --- Utility Classes --- */
    .hidden-on-mobile {
        display: none !important;
    }
    .visible-on-mobile {
        display: block !important;
    }

    /* --- Custom Cursor (hide on touch devices) --- */
    .custom-cursor, .cursor-dot {
        display: none !important;
    }
    body, a, button, .cursor-pointer {
        cursor: auto !important;
    }

    /* --- Process card mobile tweaks --- */
    .process-card {
        padding: 30px;
        text-align: left;
        gap: 24px;
        background: #ffffff;
    }
    .card-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    .process-card .step-number {
        font-size: 50px;
    }
    .process-card .step-icon {
        position: absolute;
        top: 30px;
        right: 30px;
        width: 60px;
        height: 60px;
        font-size: 24px;
        border-radius: 16px;
    }

    /* --- Pinned Card Stacking (GSAP absolute positioning) --- */
    .pinned-stack-container {
        padding: 10px !important;
        position: relative !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .pinned-card {
        width: 100% !important;
        padding: 24px !important;
        border-radius: 20px !important;
        top: 100px !important;
    }

    /* --- Why Staqtix card inner layout --- */
    .why-card-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .why-icon-box {
        width: 50px;
        height: 50px;
        font-size: 20px;
        border-radius: 14px;
    }
    .why-content h3 {
        font-size: 18px;
    }
    .why-content p {
        font-size: 15px;
    }

    /* --- Section sizing --- */
    .section-title { font-size: 32px !important; }
    .section-desc { font-size: 15px !important; }

    .why-title { font-size: 36px !important; line-height: 1.1 !important; }
    .why-subtitle { font-size: 16px !important; }

    /* --- Hero Buttons --- */
    .hero-btns { flex-direction: column; gap: 12px !important; width: 100%; align-items: center; margin-top: 30px !important; }
    .hero-btns .btn { width: 100%; max-width: 320px; text-align: center; justify-content: center; height: 56px !important; }

    /* --- Projects Carousel (Mobile Fix) --- */
    .projects-carousel { height: 650px !important; padding-top: 40px !important; }
    .project-card.active {
        width: 100% !important;
        max-width: 380px !important;
        height: 500px !important;
        transform: translate(-50%, -50%) scale(1) !important;
        animation: none !important;
    }
    .project-card.left, .project-card.right { display: none !important; }
    .slider-nav-btn { width: 50px !important; height: 50px !important; }
    .prev-btn { left: 10px !important; }
    .next-btn { right: 10px !important; }
    .slider-dots { bottom: 0 !important; }

    /* --- Why Staqtix Section Fixes --- */
    .why-header { margin-bottom: 60px !important; }
    .why-grid { gap: 20px !important; }
    .why-card { padding: 32px 24px !important; }
    .why-divider { width: 80% !important; max-width: 300px !important; }

    /* --- Footer (Overrides moved to style.css to prevent conflicts) --- */

    /* --- Workflow Section (Mobile stack) --- */
    .wf-content { transform: none !important; opacity: 1 !important; }
    .wf-arrow { display: none; }
}

/* ========== 768px - TABLET ========== */
@media (max-width: 768px) {
    .hero-title { font-size: clamp(40px, 10vw, 64px); }
    .hero-desc { font-size: 16px; padding: 0 20px; }

    .tech-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* ========== 640px - SERVICES GRID (MOBILE) ========== */
@media (max-width: 640px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
    .services {
        padding: 80px 0;
    }
}

/* ========== 576px - MOBILE ADJUSTMENTS ========== */
@media (max-width: 576px) {
    .port-card {
        flex: 0 0 310px;
    }

    .testi-card {
        flex: 0 0 300px;
        padding: 32px;
        height: auto;
    }

    .process-title { font-size: 36px; }
    .process-desc { font-size: 16px; }

    .stats-bar { grid-template-columns: 1fr; padding: 30px 20px; }
    .stat-item { border-left: none !important; border-bottom: 1px solid #F3F4F6; padding: 24px 0 !important; }
    .stat-item:last-child { border-bottom: none; }
    .stat-value { font-size: 36px; }
    .stat-label { font-size: 11px; }

    .hero { padding: 120px 0 40px; min-height: 600px; }
    .hero-title { font-size: 42px; line-height: 1.1; margin-bottom: 24px; }
    .hero-desc { font-size: 18px; margin-bottom: 40px; }
    .hero-actions { flex-direction: column; width: 100%; max-width: 300px; margin: 0 auto 40px; }
    .hero-actions .btn { width: 100%; }

    .chip-inner { padding: 8px 16px; }
    .chip-inner i { font-size: 16px; }
    .chip-inner span { font-size: 12px; }

    .logos-grid { gap: 20px; }
    .logo-item { font-size: 1.2rem; }

    /* Hero Section Spacing Fix */
    .hero-section-main {
        height: auto !important;
        min-height: 100vh;
        padding-bottom: 80px;
    }

    /* Hero Buttons */
    .hero-buttons {
        display: flex;
        flex-direction: column;
        gap: 16px;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }
    .hero-buttons > a {
        width: 100%;
        justify-content: center;
    }

    .hero-buttons .secondary-btn {
        position: relative;
        overflow: hidden;
        background: rgba(255, 255, 255, 0.7) !important;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.5);
        box-shadow: 0 8px 32px rgba(107, 47, 255, 0.1);
    }

    .hero-buttons .secondary-btn::after {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 50%;
        height: 100%;
        background: linear-gradient(
            to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.8) 50%,
            rgba(255, 255, 255, 0) 100%
        );
        transform: skewX(-20deg);
        animation: shine 3s infinite;
    }

    #stactx-chat-widget {
        width: calc(100vw - 32px);
        right: 16px;
        bottom: 88px;
    }

    #stactx-chat-trigger, .trigger-pulse {
        right: 16px;
        bottom: 16px;
    }

    .trigger-badge {
        right: 16px;
    }
}

/* ========== 480px - SMALL MOBILE ========== */
@media (max-width: 480px) {
    .hero-title { font-size: 34px !important; }
    .why-title { font-size: 30px !important; }
    .section-title { font-size: 28px !important; }
    .why-footer-bar { padding: 30px 15px !important; }
    .why-stat-item h4 { font-size: 18px !important; }

    .tech-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 20px 10px !important;
    }
}

/* ========== KEYFRAMES ========== */
@keyframes shine {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}
