/*
 * GSMUnlockUSA Products & Services - Search Result Grid V115
 * ----------------------------------------------------------
 * Scope: ONLY #service-search-live-results.
 * Purpose: make live/server-first Search results use the same deterministic
 * six-column geometry as the approved Products & Services V109 browse grid.
 *
 * This file does not change Search filtering, service order, pricing, links,
 * cart routing, lazy loading or the normal browse grid.
 */

#service-search-live-results .table-service.gsm-search-grid-v115-table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

#service-search-live-results .table-service.gsm-search-grid-v115-table
> tbody > tr > td {
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box !important;
}

/* Desktop V109 contract: 6 + 58 + 8 + 5 + 13 + 10 = 100. */
@media (min-width: 768px) {
    #service-search-live-results .table-service.gsm-search-grid-v115-table
    col.gsm-service-col-logo-v105 {
        width: 6% !important;
    }

    #service-search-live-results .table-service.gsm-search-grid-v115-table
    col.gsm-service-col-main-v105 {
        width: 58% !important;
    }

    #service-search-live-results .table-service.gsm-search-grid-v115-table
    col.gsm-service-col-price-v105 {
        width: 8% !important;
    }

    #service-search-live-results .table-service.gsm-search-grid-v115-table
    col.gsm-service-col-type-v105 {
        width: 5% !important;
    }

    #service-search-live-results .table-service.gsm-search-grid-v115-table
    col.gsm-service-col-delivery-v105 {
        width: 13% !important;
    }

    #service-search-live-results .table-service.gsm-search-grid-v115-table
    col.gsm-service-col-order-v105 {
        width: 10% !important;
    }

    /* Long names/descriptions stay inside the 58% Service column. */
    #service-search-live-results .table-service.gsm-search-grid-v115-table
    .col-style-1 {
        min-width: 0 !important;
        overflow: hidden !important;
    }

    #service-search-live-results .table-service.gsm-search-grid-v115-table
    .col-style-1 > a:first-of-type {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow-wrap: break-word !important;
        word-break: normal !important;
    }

    #service-search-live-results .table-service.gsm-search-grid-v115-table
    .col-style-1 > a.hidden-xs {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    #service-search-live-results .table-service.gsm-search-grid-v115-table
    .col-style-2,
    #service-search-live-results .table-service.gsm-search-grid-v115-table
    .col-style-3,
    #service-search-live-results .table-service.gsm-search-grid-v115-table
    .col-style-4,
    #service-search-live-results .table-service.gsm-search-grid-v115-table
    > tbody > .tr-detail-list > td:last-child {
        overflow: hidden !important;
        text-overflow: ellipsis;
        white-space: nowrap !important;
    }

    /* Price header and values intentionally share the same right alignment. */
    #service-search-live-results .table-service.gsm-search-grid-v115-table
    > tbody > .tr-header > td:nth-child(3):not([colspan]),
    #service-search-live-results .table-service.gsm-search-grid-v115-table
    .tr-detail-list .col-style-2 {
        text-align: right !important;
    }

    #service-search-live-results .table-service.gsm-search-grid-v115-table
    > tbody > .tr-header > td:nth-child(4):not([colspan]),
    #service-search-live-results .table-service.gsm-search-grid-v115-table
    > tbody > .tr-header > td:nth-child(5):not([colspan]),
    #service-search-live-results .table-service.gsm-search-grid-v115-table
    > tbody > .tr-header > td:nth-child(6):not([colspan]) {
        text-align: center !important;
    }
}

/* Mobile: retain the already-approved compact V109 proportions. */
@media (max-width: 767px) {
    #service-search-live-results .table-service.gsm-search-grid-v115-table
    col.gsm-service-col-logo-v105 {
        width: 8% !important;
    }

    #service-search-live-results .table-service.gsm-search-grid-v115-table
    col.gsm-service-col-main-v105 {
        width: 51% !important;
    }

    #service-search-live-results .table-service.gsm-search-grid-v115-table
    col.gsm-service-col-price-v105 {
        width: 9% !important;
    }

    #service-search-live-results .table-service.gsm-search-grid-v115-table
    col.gsm-service-col-type-v105 {
        width: 6% !important;
    }

    #service-search-live-results .table-service.gsm-search-grid-v115-table
    col.gsm-service-col-delivery-v105 {
        width: 16% !important;
    }

    #service-search-live-results .table-service.gsm-search-grid-v115-table
    col.gsm-service-col-order-v105 {
        width: 10% !important;
    }

    #service-search-live-results .table-service.gsm-search-grid-v115-table
    .col-style-1 {
        min-width: 0 !important;
        overflow: hidden !important;
    }

    #service-search-live-results .table-service.gsm-search-grid-v115-table
    .col-style-1 > a:first-of-type {
        display: block !important;
        max-width: 100% !important;
        overflow-wrap: break-word !important;
        word-break: normal !important;
    }

    #service-search-live-results .table-service.gsm-search-grid-v115-table
    .tr-detail-list .col-style-2 {
        text-align: center !important;
    }
}
