/* Global Mobile Optimization */
html,
body {
    overflow-x: hidden;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

/* Ensure minimum touch target size */
/* Ensure minimum touch target size only on mobile */
@media (max-width: 768px) {

    a,
    button,
    input[type="submit"],
    .btn {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Fix text sizing on mobile */
@media (max-width: 768px) {

    p,
    li,
    span,
    a {
        font-size: 14px;
        line-height: 1.6;
    }

    h1 {
        font-size: 28px !important;
    }

    h2 {
        font-size: 24px !important;
    }

    h3 {
        font-size: 20px !important;
    }

    /* Prevent horizontal scroll on specific containers */
    .container,
    .row {
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Allow scroll only on designated wrappers */
    .scroll-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        display: block;
    }
}

/* Table Responsive Wrapper */
.table-responsive-mobile {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Prevent layout shifts */
img {
    height: auto;
    max-width: 100%;
    display: block;
}

/* Portfolio Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .gallery-grid img {
        height: 180px !important;
        object-fit: contain;
    }
}