/* SYNIMA SERVICE GRID */

.synima-service-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    width: 100%;
}

/* Individual tile */
.synima-service-tile {
    position: relative;
    min-width: 0;
    aspect-ratio: 1 / 1;
    border-radius: 7px;
    overflow: hidden;
    margin: 2px 2px;
    isolation: isolate;
}

/* Background image */
.synima-service-tile::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--tile-image);
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease-in-out;
    z-index: -1;
}

.synima-service-tile:hover::before {
    transform: scale(1.1);
}

/* Clickable area */
.synima-service-tile > a {
    position: absolute;
    inset: 0;
    display: block;
    color: #fff;
    text-decoration: none;
}

/* Overlay */
.synima-service-tile-overlay {
    position: absolute;
    inset: 0;
    background: var(--tile-overlay, rgba(0,0,0,0.35));
    z-index: 0;
    pointer-events: none;
}

/* Text */
.synima-service-tile-content {
    position: absolute;
    top: 30px;
    left: 30px;
    right: 15px;
    z-index: 1;
    color: #fff;
}

.synima-service-tile h3 {
    color: #fff;
    font-size: 28px;
    line-height: 1.2;
    margin: 0 0 10px;
    max-width: 80%;
}

.synima-service-tile p {
    color: #fff;
    font-size: 15px;
    line-height: 20px;
    width: 75%;
    margin: 0;
}

/* Tablet landscape: horizontal scrolling */
@media (min-width: 1001px) and (max-width: 1160px) {
    .synima-service-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 12px;
        scrollbar-width: none;
    }

    .synima-service-tile {
        flex: 0 0 45vw;
        min-width: 45vw;
        aspect-ratio: 5 / 2;
    }
}

/* Tablet and mobile: horizontal scrolling */
@media (max-width: 1000px) {
    .synima-service-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 12px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .synima-service-tile {
        flex: 0 0 60vw;
        min-width: 55vw;
        aspect-ratio: 1 / 1;
    }
}

.synima-service-grid::-webkit-scrollbar {
    display: none;
}


@media (max-width: 767px) {
    .synima-service-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        max-width: 100% !important;

        overflow-x: auto;
        overflow-y: hidden;

        /* Allow normal vertical page scrolling */
        touch-action: pan-y pan-x;

        /* Prevent scroll chaining and snapping */
        overscroll-behavior-x: contain;
        scroll-snap-type: none !important;
        scroll-behavior: auto !important;

        /* Avoid unexpected padding */
        padding-left: 0 !important;
        padding-right: 0 !important;

        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .synima-service-grid::-webkit-scrollbar {
        display: none;
    }
}

@media (max-width: 767px) {

    /* Ensure the Elementor widget fills its parent */
    .elementor-widget-synima_service_grid {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
    }

    /* Ensure the widget container fills the available width */
    .elementor-widget-synima_service_grid > .elementor-widget-container {
        width: 100%;
        max-width: 100%;
    }

    /* Full-width horizontal scrolling carousel */
    .synima-service-grid {
        display: flex !important;
        flex-wrap: nowrap !important;

        width: 100% !important;
        max-width: 100% !important;

        overflow-x: auto;
        overflow-y: hidden;

        scroll-behavior: auto;
        scroll-snap-type: none;

        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .synima-service-grid::-webkit-scrollbar {
        display: none;
    }

    /* Individual cards */
    .synima-service-grid > * {
        flex: 0 0 80%;
        min-width: 80%;
    }
}