/* Responsive fixes: header nav + industry tabs (all screen sizes) */

/* --- Header: tablet uses mobile menu (768px–1024px was breaking) --- */
@media (max-width: 1024px) {
    .main-header {
        position: fixed;
    }

    .header-container {
        position: relative;
        width: 100%;
        padding: 0 20px;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block;
    }

    .menu-toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
    }

    .menu-toggle img,
    .menu-toggle picture img {
        width: 38px;
        height: 38px;
    }

    .nav-capsule {
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        border-radius: 18px;
        padding: 20px;
        display: none;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        padding-bottom: 30px;
    }

    .nav-capsule.active {
        display: block;
        background: rgb(0 0 0 / 85%);
        backdrop-filter: blur(18px);
        border-radius: 0;
        border: none;
    }

    .nav-menu {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .nav-menu > li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding-bottom: 8px;
    }

    .nav-menu > li:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .nav-menu .nav-menu-main {
        padding: 14px 20px;
        white-space: nowrap;
        display: flex;
        align-items: center;
        min-height: 48px;
    }

    .services-menu,
    .industry-mega {
        position: static;
        transform: none;
        width: 100%;
        margin-top: 8px;
        display: none;
    }

    .dropdown.active .services-menu,
    .dropdown.active .industry-mega {
        display: block;
    }

    .services-menu li {
        margin-bottom: 8px;
    }

    .industry-grid {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .cnt-mobile-only {
        display: inline-flex;
        margin-top: 24px;
        width: 100%;
        justify-content: center;
        min-height: 48px;
    }
}

/* Desktop nav: prevent awkward text wrap between 1025px–1200px */
@media (min-width: 1025px) and (max-width: 1280px) {
    .nav-menu .nav-menu-main {
        padding: 16px 12px;
        font-size: 15px;
        white-space: nowrap;
    }

    .nav-capsule {
        padding: 12px 16px;
    }

    .header-container .btn {
        padding: 12px 18px;
        font-size: 15px;
    }
}

/* --- Industry tabs: desktop = original single row; smaller screens = grid --- */
@media (min-width: 1101px) {
    .industry-tabs {
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 18px;
        padding: 20px 40px;
        overflow-x: auto;
    }

    .industry-tab {
        min-width: 120px;
        flex: 0 0 auto;
        width: auto;
        text-align: center;
        display: block;
    }

    .industry-tab p {
        font-size: 20px;
        line-height: 24px;
        font-weight: 500;
    }

    .industry-tab .icon-wrap {
        width: 60px;
        height: 60px;
        margin: 0 auto 10px;
    }

    .industry-tab .icon-wrap img,
    .industry-tab .icon-wrap picture img {
        width: 46px;
        height: 46px;
    }
}

/* Large tablet / small laptop */
@media (max-width: 1100px) {
    .industry-tabs {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 12px 8px;
        padding: 16px 16px;
        overflow-x: visible;
    }

    .industry-tab {
        min-width: 0;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
    }

    .industry-tab p {
        font-size: 15px;
        line-height: 18px;
        word-break: normal;
    }

    .industry-tab .icon-wrap img,
    .industry-tab .icon-wrap picture img {
        width: 46px;
        height: 46px;
        object-fit: contain;
    }
}

/* Tablet portrait & large phones */
@media (max-width: 768px) {
    .industry-tabs {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px 6px;
        padding: 14px 10px;
    }

    .industry-tab p {
        font-size: 13px;
        line-height: 16px;
    }

    .industry-tab .icon-wrap {
        width: 36px;
        height: 36px;
        margin-bottom: 8px;
    }

    .industry-tab .icon-wrap img,
    .industry-tab .icon-wrap picture img {
        width: 28px;
        height: 28px;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .industry-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 8px;
        padding: 14px 12px;
    }

    .industry-tab p {
        font-size: 14px;
        line-height: 17px;
    }
}

@media (max-width: 360px) {
    .industry-tab p {
        font-size: 12px;
        line-height: 15px;
    }
}
