/* Amasty Finder — Compatibility Tab Table Fix */

#amfinder-product-attribute-specs-table {
    width: 100%;
    table-layout: auto;
}

#amfinder-product-attribute-specs-table th,
#amfinder-product-attribute-specs-table td {
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
    width: auto !important;
}

/* Year column — keep narrow */
#amfinder-product-attribute-specs-table th:first-child,
#amfinder-product-attribute-specs-table td:first-child {
    width: 80px !important;
    min-width: 80px;
}

/* Make and Model — medium width */
#amfinder-product-attribute-specs-table th:nth-child(2),
#amfinder-product-attribute-specs-table td:nth-child(2),
#amfinder-product-attribute-specs-table th:nth-child(3),
#amfinder-product-attribute-specs-table td:nth-child(3) {
    width: 120px !important;
    min-width: 100px;
}

/* Trim — allow to grow */
#amfinder-product-attribute-specs-table th:nth-child(4),
#amfinder-product-attribute-specs-table td:nth-child(4) {
    min-width: 150px;
}

/* Engine — allow to grow */
#amfinder-product-attribute-specs-table th:nth-child(5),
#amfinder-product-attribute-specs-table td:nth-child(5) {
    min-width: 180px;
}

/* Drive — keep narrow */
#amfinder-product-attribute-specs-table th:nth-child(6),
#amfinder-product-attribute-specs-table td:nth-child(6) {
    width: 80px !important;
    min-width: 60px;
}

/* ── MOBILE — Card Layout ─────────────────────────────── */
@media (max-width: 768px) {

    /* Hide the header row */
    #amfinder-product-attribute-specs-table thead {
        display: none;
    }

    #amfinder-product-attribute-specs-table,
    #amfinder-product-attribute-specs-table tbody {
        display: block;
        width: 100%;
    }

    /* Each row becomes a card */
    #amfinder-product-attribute-specs-table tr {
        display: block;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        margin-bottom: 8px;
        padding: 10px 12px;
        background: #fafafa;
    }

    /* Each cell becomes inline */
    #amfinder-product-attribute-specs-table td {
        display: inline;
        padding: 0;
        white-space: normal;
        width: auto !important;
        min-width: 0;
        border: none;
        font-size: 13px;
    }

    /* Add separators between fields */
    #amfinder-product-attribute-specs-table td:not(:last-child)::after {
        content: " · ";
        color: #94a3b8;
        font-weight: 400;
    }

    /* Make year bold */
    #amfinder-product-attribute-specs-table td:first-child {
        font-weight: 700;
        width: auto !important;
        min-width: 0;
    }
}
