/* Shared Alpha search-card system
 * One visual layer for Supplier Gateway (.aasg-*) and vehicle catalogue (.aavc-*).
 * Plugin CSS remains a functional fallback; this file is the storefront source of truth.
 */

/* Main product card */
.alpha-site :is(.aasg-card,.aasg-product-card,.aavc-card,.aavc-product-card) {
    position: relative;
    display: grid;
    grid-template-columns: 96px minmax(0,1fr) 210px;
    gap: 14px;
    align-items: center;
    margin: 0;
    padding: 14px;
    border: 1px solid var(--alpha-line);
    border-radius: var(--alpha-radius-sm);
    background: #fff;
    box-shadow: 0 4px 14px rgba(20,28,38,.03);
    transform: none;
}
.alpha-site :is(.aasg-card,.aasg-product-card,.aavc-card,.aavc-product-card):hover {
    border-color: var(--alpha-line);
    box-shadow: 0 4px 14px rgba(20,28,38,.03);
    transform: none;
}
.alpha-site :is(.aasg-card-image,.aavc-image) {
    width: 88px;
    height: 88px;
    border: 0;
    border-radius: var(--alpha-radius-sm);
    background: #f5f7f8;
    overflow: hidden;
}
.alpha-site :is(.aasg-card-image,.aavc-image) img {
    display: block;
    width: 100%;
    height: 100%;
    padding: 7px;
    object-fit: contain;
    box-sizing: border-box;
}
.alpha-site :is(.aasg-card-main,.aavc-main) { min-width: 0; }
.alpha-site :is(.aasg-name,.aavc-main h3) {
    margin: 0 0 6px;
    color: var(--alpha-ink);
    font-size: 16px;
    line-height: 1.2;
    font-weight: var(--alpha-font-weight-semibold);
}
.alpha-site :is(.aasg-badges,.aavc-badges) {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 6px;
}
.alpha-site :is(.aasg-badge,.aavc-badge) {
    min-height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 8px;
    line-height: 20px;
    font-weight: var(--alpha-font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.alpha-site :is(.aasg-tags,.aavc-tags) {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.alpha-site :is(.aasg-tags,.aavc-tags) span {
    padding: 3px 6px;
    border-radius: 5px;
    background: #f3f5f7;
    color: #5e6873;
    font-size: 10px;
}
.alpha-site :is(.aasg-muted,.aavc-muted,.aavc-fitment) {
    margin-top: 6px;
    color: var(--alpha-muted);
    font-size: 11px;
    line-height: 1.4;
}
.alpha-site :is(.aasg-card-side,.aavc-side) {
    min-width: 0;
    padding-left: 14px;
    border-left: 1px solid #edf0f2;
    text-align: left;
}
.alpha-site :is(.aasg-price,.aavc-price) {
    margin: 0 0 6px;
    color: var(--alpha-ink);
    font-size: 24px;
    line-height: 1;
    font-weight: var(--alpha-font-weight-semibold);
    letter-spacing: -.03em;
}
.alpha-site :is(.aasg-stock,.aasg-delivery,.aavc-stock,.aavc-delivery) {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.3;
}

/* Quantity controls — same geometry everywhere. */
.alpha-site :is(.aasg-quantity,.aavc-quantity) {
    display: grid !important;
    grid-template-columns: 38px minmax(46px,1fr) 38px !important;
    align-items: stretch !important;
    min-height: 40px !important;
    height: 40px;
    border: 1px solid var(--alpha-line-strong) !important;
    border-radius: 6px !important;
    background: #fff !important;
    overflow: hidden !important;
    box-sizing: border-box;
}
.alpha-site :is(.aasg-quantity,.aavc-quantity) button,
.alpha-site :is(.aasg-quantity,.aavc-quantity) input {
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
    line-height: 38px !important;
    text-align: center !important;
}
.alpha-site :is(.aasg-quantity,.aavc-quantity) button {
    display: grid !important;
    place-items: center !important;
    width: 38px !important;
    min-width: 38px !important;
    border: 0 !important;
    background: #f2f4f6 !important;
    color: var(--alpha-ink) !important;
    font-size: 17px !important;
    font-weight: var(--alpha-font-weight-semibold) !important;
    line-height: 1 !important;
    box-shadow: none !important;
}
.alpha-site :is(.aasg-quantity,.aavc-quantity) input {
    width: 100% !important;
    min-width: 0 !important;
    border: 0 !important;
    border-left: 1px solid var(--alpha-line) !important;
    border-right: 1px solid var(--alpha-line) !important;
    background: #fff !important;
    color: var(--alpha-ink) !important;
    font-weight: var(--alpha-font-weight-semibold) !important;
    appearance: textfield;
    -moz-appearance: textfield;
}
.alpha-site :is(.aasg-quantity,.aavc-quantity) input::-webkit-outer-spin-button,
.alpha-site :is(.aasg-quantity,.aavc-quantity) input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Alternative offers — common six-column structure. */
.alpha-site :is(.aasg-offer-row,.aavc-offer-row) {
    display: grid !important;
    grid-template-columns: minmax(180px,1.35fr) minmax(120px,.78fr) minmax(130px,.82fr) 126px 96px 126px !important;
    grid-template-areas: "part stock delivery quantity price action" !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 12px !important;
    border: 1px solid var(--alpha-line) !important;
    border-radius: 7px !important;
    background: #f8f9fa !important;
    color: #59636e;
    font-size: 12px;
    box-sizing: border-box;
}
.alpha-site :is(.aasg-offer-row,.aavc-offer-row) > :is(.aasg-offer-part,.aavc-offer-part) { grid-area: part; }
.alpha-site :is(.aasg-offer-row,.aavc-offer-row) > :is(.aasg-offer-stock,.aavc-offer-stock) { grid-area: stock; }
.alpha-site :is(.aasg-offer-row,.aavc-offer-row) > :is(.aasg-offer-delivery,.aavc-offer-delivery) { grid-area: delivery; }
.alpha-site :is(.aasg-offer-row,.aavc-offer-row) > :is(.aasg-offer-price,.aavc-offer-price) {
    grid-area: price;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    text-align: center !important;
    white-space: nowrap;
}
.alpha-site :is(.aasg-offer-row,.aavc-offer-row) > :is(.aasg-offer-price,.aavc-offer-price) strong {
    color: var(--alpha-ink);
    font-size: 18px;
    line-height: 1;
    font-weight: var(--alpha-font-weight-semibold);
    letter-spacing: -.02em;
}
.alpha-site :is(.aasg-offer-row,.aavc-offer-row) > :is(.aasg-offer-buy,.aavc-offer-buy) { display: contents !important; }
.alpha-site :is(.aasg-offer-row,.aavc-offer-row) :is(.aasg-buy-controls.is-compact,.aavc-buy-compact) {
    display: contents !important;
    margin: 0 !important;
}
.alpha-site :is(.aasg-offer-row,.aavc-offer-row) :is(.aasg-buy-controls.is-compact,.aavc-buy-compact) > :is(.aasg-quantity,.aavc-quantity) {
    grid-area: quantity;
    width: 126px !important;
    min-width: 126px !important;
    max-width: 126px !important;
    grid-template-columns: 40px 46px 40px !important;
}
.alpha-site :is(.aasg-offer-row,.aavc-offer-row) :is(.aasg-buy-controls.is-compact,.aavc-buy-compact) > :is(.aasg-quantity,.aavc-quantity) button {
    width: 40px !important;
    min-width: 40px !important;
}
.alpha-site :is(.aasg-offer-row,.aavc-offer-row) :is(.aasg-buy-controls.is-compact,.aavc-buy-compact) > :is(.aasg-add,.aavc-button) {
    grid-area: action;
    width: 126px !important;
    min-width: 126px !important;
    max-width: 126px !important;
    height: 40px !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    white-space: nowrap;
}
.alpha-site :is(.aasg-offer-part,.aavc-offer-part) {
    min-width: 0;
    display: grid;
    gap: 2px;
}
.alpha-site :is(.aasg-offer-part,.aavc-offer-part) strong {
    color: var(--alpha-ink);
    font-size: 12px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.alpha-site :is(.aasg-offer-part,.aavc-offer-part) span {
    color: var(--alpha-muted);
    font-size: 10px;
    line-height: 1.3;
}

@media (max-width: 1100px) {
    .alpha-site :is(.aasg-card,.aasg-product-card,.aavc-card,.aavc-product-card) {
        grid-template-columns: 88px minmax(0,1fr) 200px;
        gap: 12px;
        padding: 13px;
    }
    .alpha-site :is(.aasg-card-image,.aavc-image) { width: 80px; height: 80px; }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) {
        grid-template-columns: minmax(160px,1.2fr) minmax(110px,.75fr) minmax(115px,.78fr) 122px 88px 122px !important;
    }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) :is(.aasg-buy-controls.is-compact,.aavc-buy-compact) > :is(.aasg-quantity,.aavc-quantity) {
        width: 122px !important;
        min-width: 122px !important;
        max-width: 122px !important;
        grid-template-columns: 38px 46px 38px !important;
    }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) :is(.aasg-buy-controls.is-compact,.aavc-buy-compact) > :is(.aasg-quantity,.aavc-quantity) button {
        width: 38px !important;
        min-width: 38px !important;
    }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) :is(.aasg-buy-controls.is-compact,.aavc-buy-compact) > :is(.aasg-add,.aavc-button) {
        width: 122px !important;
        min-width: 122px !important;
        max-width: 122px !important;
    }
}

@media (max-width: 900px) {
    .alpha-site :is(.aasg-card,.aasg-product-card,.aavc-card,.aavc-product-card) {
        grid-template-columns: 76px minmax(0,1fr);
        gap: 11px;
        padding: 12px;
    }
    .alpha-site :is(.aasg-card-image,.aavc-image) { width: 68px; height: 68px; }
    .alpha-site :is(.aasg-card-side,.aavc-side),
    .alpha-site :is(.aasg-product-card,.aavc-product-card) > :is(.aasg-offers,.aavc-offers) {
        grid-column: 1 / -1;
    }
    .alpha-site :is(.aasg-card-side,.aavc-side) {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px 12px;
        padding: 11px 0 0;
        border-left: 0;
        border-top: 1px solid #edf0f2;
    }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) {
        grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important;
        grid-template-areas: "part part" "stock delivery" "price price" "quantity action" !important;
        gap: 8px 10px !important;
    }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) > :is(.aasg-offer-price,.aavc-offer-price) {
        justify-content: flex-start;
        text-align: left !important;
    }
}

@media (max-width: 680px) {
    .alpha-site :is(.aasg-card,.aasg-product-card,.aavc-card,.aavc-product-card) {
        grid-template-columns: 60px minmax(0,1fr);
        gap: 9px;
        padding: 11px;
    }
    .alpha-site :is(.aasg-card-image,.aavc-image) { width: 54px; height: 54px; }
    .alpha-site :is(.aasg-name,.aavc-main h3) { font-size: 14px; line-height: 1.18; }
    .alpha-site :is(.aasg-card-side,.aavc-side) { grid-template-columns: 1fr; padding-top: 10px; }
    .alpha-site :is(.aasg-price,.aavc-price) { font-size: 22px; }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) {
        grid-template-columns: 126px minmax(0,1fr) !important;
        grid-template-areas: "part part" "stock delivery" "price price" "quantity action" !important;
        gap: 7px 8px !important;
        padding: 9px !important;
    }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) > :is(.aasg-offer-price,.aavc-offer-price) strong { font-size: 17px; }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) :is(.aasg-buy-controls.is-compact,.aavc-buy-compact) > :is(.aasg-quantity,.aavc-quantity) {
        width: 126px !important;
        min-width: 126px !important;
        max-width: 126px !important;
        grid-template-columns: 40px 46px 40px !important;
    }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) :is(.aasg-buy-controls.is-compact,.aavc-buy-compact) > :is(.aasg-quantity,.aavc-quantity) button {
        width: 40px !important;
        min-width: 40px !important;
    }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) :is(.aasg-buy-controls.is-compact,.aavc-buy-compact) > :is(.aasg-add,.aavc-button) {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
    }
}


/* v0.1.46 — strict shared geometry: vehicle search matches parts search. */
.alpha-site :is(.aasg-card-side,.aavc-side) {
    font-size: 12px !important;
    line-height: 1.3 !important;
}
.alpha-site .aavc-side > div:not(.aavc-price):not(.aavc-buy),
.alpha-site :is(.aasg-stock,.aasg-delivery,.aavc-stock,.aavc-delivery) {
    margin-top: 4px !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
}
.alpha-site :is(.aasg-stock.is-available,.aavc-stock.is-available) {
    color: var(--alpha-success) !important;
    font-weight: var(--alpha-font-weight-semibold) !important;
}
.alpha-site :is(.aasg-stock.is-empty,.aavc-stock.is-empty) {
    color: var(--alpha-danger) !important;
    font-weight: var(--alpha-font-weight-semibold) !important;
}
.alpha-site :is(.aasg-card-side .aasg-buy-controls,.aavc-side .aavc-buy) {
    display: grid !important;
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
    gap: 8px !important;
    margin: 6px 0 0 !important;
}
.alpha-site :is(.aasg-card-side .aasg-buy-controls,.aavc-side .aavc-buy) > :is(.aasg-quantity,.aavc-quantity) {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 40px !important;
    min-height: 40px !important;
    margin: 0 !important;
}
.alpha-site :is(.aasg-card-side .aasg-add,.aavc-side .aavc-button) {
    width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 18px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    font-size: 13px !important;
    line-height: 1 !important;
}
.alpha-site :is(.aasg-product-card,.aavc-product-card) > :is(.aasg-offers,.aavc-offers) {
    grid-column: 1 / -1 !important;
    margin: 0 !important;
    padding: 10px 0 0 !important;
    border-top: 1px solid var(--alpha-line) !important;
}
.alpha-site :is(.aasg-offers,.aavc-offers) > summary {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    min-height: 36px !important;
    margin: 0 !important;
    padding: 8px 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--alpha-ink) !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    font-weight: var(--alpha-font-weight-semibold) !important;
    list-style: none !important;
}
.alpha-site :is(.aasg-offers,.aavc-offers) > summary:hover,
.alpha-site :is(.aasg-offers,.aavc-offers) > summary:focus-visible,
.alpha-site :is(.aasg-offers,.aavc-offers)[open] > summary {
    color: var(--alpha-red-deep) !important;
}
.alpha-site :is(.aasg-offers,.aavc-offers) > summary::before { font-size: 10px !important; }
.alpha-site :is(.aasg-offers-list,.aavc-offers-list) {
    display: grid !important;
    gap: 8px !important;
    padding: 4px 0 8px !important;
}
.alpha-site :is(.aasg-offer-row,.aavc-offer-row) {
    min-height: 62px !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
}
.alpha-site :is(.aasg-offer-stock,.aavc-offer-stock,.aasg-offer-delivery,.aavc-offer-delivery) {
    font-size: 12px !important;
    line-height: 1.3 !important;
    color: #59636e !important;
}
.alpha-site :is(.aasg-offer-row,.aavc-offer-row) > :is(.aasg-offer-price,.aavc-offer-price) strong {
    font-size: 18px !important;
    line-height: 1 !important;
}
.alpha-site .aavc-image .aavc-placeholder-image,
.alpha-site .aavc-image img.is-placeholder {
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    object-fit: contain !important;
}
.alpha-site .aavc-product-card > .aavc-catalog-detail {
    grid-column: 1 / -1 !important;
    margin: 0 !important;
    padding-top: 10px !important;
    border-top: 1px solid var(--alpha-line) !important;
}
@media (max-width: 900px) {
    .alpha-site :is(.aasg-card-side .aasg-buy-controls,.aavc-side .aavc-buy) { margin-top: 6px !important; }
}


/* v0.1.49 — tablet card geometry: keep Catalog and Parts Search identical.
 * Mobile (<=680px) remains untouched because its compact layout is already correct.
 */
@media (min-width: 681px) and (max-width: 980px) {
    .alpha-site :is(.aasg-card-side,.aavc-side) {
        display: grid !important;
        grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important;
        grid-template-areas:
            "price stock"
            "delivery buy" !important;
        align-items: start !important;
        gap: 8px 18px !important;
        padding: 12px 0 0 !important;
        border-left: 0 !important;
        border-top: 1px solid #edf0f2 !important;
        text-align: left !important;
    }
    .alpha-site :is(.aasg-card-side,.aavc-side) > :is(.aasg-price,.aavc-price) {
        grid-area: price !important;
        align-self: start !important;
        margin: 0 !important;
    }
    .alpha-site :is(.aasg-card-side,.aavc-side) > :is(.aasg-stock,.aavc-stock) {
        grid-area: stock !important;
        align-self: start !important;
        margin: 0 !important;
    }
    .alpha-site :is(.aasg-card-side,.aavc-side) > :is(.aasg-delivery,.aavc-delivery) {
        grid-area: delivery !important;
        align-self: start !important;
        margin: 0 !important;
    }
    .alpha-site .aasg-card-side > .aasg-buy-controls,
    .alpha-site .aavc-side > .aavc-buy {
        grid-area: buy !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        align-items: stretch !important;
        gap: 8px !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }
    .alpha-site .aasg-card-side > .aasg-buy-controls > .aasg-quantity,
    .alpha-site .aavc-side > .aavc-buy > .aavc-quantity,
    .alpha-site .aasg-card-side > .aasg-buy-controls > .aasg-add,
    .alpha-site .aavc-side > .aavc-buy > .aavc-button {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
    }
    .alpha-site .aasg-card-side > .aasg-buy-controls > .aasg-add,
    .alpha-site .aavc-side > .aavc-buy > .aavc-button {
        height: 44px !important;
        min-height: 44px !important;
    }
}

/* v0.1.51 — shared tablet/mobile purchase layout.
 * Tablet: product identity stays left; commercial block stays compact on the right.
 * Mobile: identity is the upper block; commercial details form two columns below.
 * Best and alternative offers use the same information hierarchy at different scales.
 */

/* Tablet — keep the product card as a left information group + fixed right purchase column. */
@media (min-width: 681px) and (max-width: 980px) {
    .alpha-site :is(.aasg-card,.aasg-product-card,.aavc-card,.aavc-product-card) {
        grid-template-columns: 76px minmax(0,1fr) 224px !important;
        gap: 12px !important;
        align-items: stretch !important;
        padding: 12px !important;
    }
    .alpha-site :is(.aasg-card-image,.aavc-image) {
        width: 68px !important;
        height: 68px !important;
        align-self: start !important;
    }
    .alpha-site :is(.aasg-card-main,.aavc-main) {
        align-self: start !important;
    }
    .alpha-site :is(.aasg-card-side,.aavc-side) {
        grid-column: 3 !important;
        grid-row: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0 !important;
        min-width: 0 !important;
        height: 100% !important;
        padding: 0 0 0 14px !important;
        border-top: 0 !important;
        border-left: 1px solid #edf0f2 !important;
        text-align: left !important;
    }
    .alpha-site :is(.aasg-card-side,.aavc-side) > :is(.aasg-price,.aavc-price) {
        margin: 0 0 7px !important;
    }
    .alpha-site :is(.aasg-card-side,.aavc-side) > :is(.aasg-stock,.aavc-stock),
    .alpha-site :is(.aasg-card-side,.aavc-side) > :is(.aasg-delivery,.aavc-delivery) {
        margin: 0 0 5px !important;
    }
    .alpha-site .aasg-card-side > .aasg-buy-controls,
    .alpha-site .aavc-side > .aavc-buy {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        width: 100% !important;
        margin: auto 0 0 !important;
    }
    .alpha-site .aavc-side > .aavc-button,
    .alpha-site .aasg-card-side > .aasg-add {
        width: 100% !important;
        margin-top: auto !important;
    }
    .alpha-site .aasg-card-side > .aasg-buy-controls > .aasg-quantity,
    .alpha-site .aavc-side > .aavc-buy > .aavc-quantity {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 40px !important;
        margin: 0 !important;
    }
    .alpha-site .aasg-card-side > .aasg-buy-controls > .aasg-add,
    .alpha-site .aavc-side > .aavc-buy > .aavc-button {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 44px !important;
        min-height: 44px !important;
        margin: 0 !important;
    }

    /* Alternative offers mirror the best-offer hierarchy, only more compact. */
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) {
        grid-template-columns: minmax(0,1fr) 224px !important;
        grid-template-areas:
            "part price"
            "part stock"
            "part delivery"
            "part quantity"
            "part action" !important;
        grid-template-rows: auto auto auto 40px 40px !important;
        align-items: start !important;
        gap: 5px 14px !important;
        min-height: 154px !important;
        padding: 11px 12px !important;
    }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) > :is(.aasg-offer-part,.aavc-offer-part) {
        align-self: start !important;
        padding-top: 1px !important;
    }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) > :is(.aasg-offer-price,.aavc-offer-price) {
        justify-content: flex-start !important;
        align-self: start !important;
        text-align: left !important;
    }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) > :is(.aasg-offer-stock,.aavc-offer-stock),
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) > :is(.aasg-offer-delivery,.aavc-offer-delivery) {
        align-self: start !important;
    }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) :is(.aasg-buy-controls.is-compact,.aavc-buy-compact) > :is(.aasg-quantity,.aavc-quantity) {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 40px !important;
        grid-template-columns: 38px minmax(46px,1fr) 38px !important;
    }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) :is(.aasg-buy-controls.is-compact,.aavc-buy-compact) > :is(.aasg-add,.aavc-button) {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 40px !important;
        min-height: 40px !important;
    }
}

/* Mobile — upper identity block; lower commercial block in two columns. */
@media (max-width: 680px) {
    .alpha-site :is(.aasg-card,.aasg-product-card,.aavc-card,.aavc-product-card) {
        grid-template-columns: 60px minmax(0,1fr) !important;
        gap: 9px !important;
        align-items: start !important;
        padding: 11px !important;
    }
    .alpha-site :is(.aasg-card-side,.aavc-side) {
        grid-column: 1 / -1 !important;
        display: grid !important;
        grid-template-columns: 130px minmax(0,1fr) !important;
        grid-template-areas:
            "stock price"
            "delivery price"
            "quantity action" !important;
        align-items: end !important;
        gap: 7px 10px !important;
        width: 100% !important;
        min-width: 0 !important;
        padding: 11px 0 0 !important;
        border-top: 1px solid #edf0f2 !important;
        border-left: 0 !important;
        text-align: left !important;
    }
    .alpha-site :is(.aasg-card-side,.aavc-side) > :is(.aasg-price,.aavc-price) {
        grid-area: price !important;
        align-self: start !important;
        justify-self: start !important;
        margin: 0 !important;
        font-size: 22px !important;
    }
    .alpha-site :is(.aasg-card-side,.aavc-side) > :is(.aasg-stock,.aavc-stock) {
        grid-area: stock !important;
        align-self: start !important;
        margin: 0 !important;
    }
    .alpha-site :is(.aasg-card-side,.aavc-side) > :is(.aasg-delivery,.aavc-delivery) {
        grid-area: delivery !important;
        align-self: start !important;
        margin: 0 !important;
    }
    .alpha-site .aasg-card-side > .aasg-buy-controls,
    .alpha-site .aavc-side > .aavc-buy {
        display: contents !important;
        margin: 0 !important;
    }
    .alpha-site .aasg-card-side > .aasg-buy-controls > .aasg-quantity,
    .alpha-site .aavc-side > .aavc-buy > .aavc-quantity {
        grid-area: quantity !important;
        width: 130px !important;
        min-width: 130px !important;
        max-width: 130px !important;
        height: 44px !important;
        min-height: 44px !important;
        grid-template-columns: 42px 46px 42px !important;
        align-self: end !important;
        margin: 0 !important;
    }
    .alpha-site .aasg-card-side > .aasg-buy-controls > .aasg-quantity button,
    .alpha-site .aavc-side > .aavc-buy > .aavc-quantity button {
        width: 42px !important;
        min-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
    }
    .alpha-site .aasg-card-side > .aasg-buy-controls > .aasg-quantity input,
    .alpha-site .aavc-side > .aavc-buy > .aavc-quantity input {
        height: 42px !important;
        min-height: 42px !important;
        line-height: 42px !important;
    }
    .alpha-site .aasg-card-side > .aasg-buy-controls > .aasg-add,
    .alpha-site .aavc-side > .aavc-buy > .aavc-button,
    .alpha-site .aavc-side > .aavc-button {
        grid-area: action !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 44px !important;
        min-height: 44px !important;
        align-self: end !important;
        margin: 0 !important;
    }

    /* Alternative offers use the same lower two-column commercial layout. */
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) {
        grid-template-columns: 130px minmax(0,1fr) !important;
        grid-template-areas:
            "part part"
            "stock price"
            "delivery price"
            "quantity action" !important;
        grid-template-rows: auto auto auto 44px !important;
        align-items: end !important;
        gap: 7px 10px !important;
        min-height: 0 !important;
        padding: 10px !important;
    }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) > :is(.aasg-offer-part,.aavc-offer-part) {
        align-self: start !important;
        margin-bottom: 1px !important;
    }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) > :is(.aasg-offer-price,.aavc-offer-price) {
        justify-content: flex-start !important;
        align-self: start !important;
        text-align: left !important;
    }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) > :is(.aasg-offer-price,.aavc-offer-price) strong {
        font-size: 18px !important;
    }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) > :is(.aasg-offer-stock,.aavc-offer-stock),
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) > :is(.aasg-offer-delivery,.aavc-offer-delivery) {
        align-self: start !important;
    }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) :is(.aasg-buy-controls.is-compact,.aavc-buy-compact) > :is(.aasg-quantity,.aavc-quantity) {
        width: 130px !important;
        min-width: 130px !important;
        max-width: 130px !important;
        height: 44px !important;
        min-height: 44px !important;
        grid-template-columns: 42px 46px 42px !important;
        align-self: end !important;
        margin: 0 !important;
    }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) :is(.aasg-buy-controls.is-compact,.aavc-buy-compact) > :is(.aasg-quantity,.aavc-quantity) button {
        width: 42px !important;
        min-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
    }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) :is(.aasg-buy-controls.is-compact,.aavc-buy-compact) > :is(.aasg-quantity,.aavc-quantity) input {
        height: 42px !important;
        min-height: 42px !important;
        line-height: 42px !important;
    }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) :is(.aasg-buy-controls.is-compact,.aavc-buy-compact) > :is(.aasg-add,.aavc-button) {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 44px !important;
        min-height: 44px !important;
        align-self: end !important;
        margin: 0 !important;
    }
}

@media (max-width: 390px) {
    .alpha-site :is(.aasg-card-side,.aavc-side),
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) {
        grid-template-columns: 116px minmax(0,1fr) !important;
    }
    .alpha-site .aasg-card-side > .aasg-buy-controls > .aasg-quantity,
    .alpha-site .aavc-side > .aavc-buy > .aavc-quantity,
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) :is(.aasg-buy-controls.is-compact,.aavc-buy-compact) > :is(.aasg-quantity,.aavc-quantity) {
        width: 116px !important;
        min-width: 116px !important;
        max-width: 116px !important;
        grid-template-columns: 36px 44px 36px !important;
    }
    .alpha-site .aasg-card-side > .aasg-buy-controls > .aasg-quantity button,
    .alpha-site .aavc-side > .aavc-buy > .aavc-quantity button,
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) :is(.aasg-buy-controls.is-compact,.aavc-buy-compact) > :is(.aasg-quantity,.aavc-quantity) button {
        width: 36px !important;
        min-width: 36px !important;
    }
}


/* v0.1.52 — right-align commercial text on tablet/mobile.
 * Prices and the commercial metadata in the right purchase column share one visual edge.
 */
@media (min-width: 681px) and (max-width: 980px) {
    .alpha-site :is(.aasg-card-side,.aavc-side) {
        text-align: right !important;
    }
    .alpha-site :is(.aasg-card-side,.aavc-side) > :is(.aasg-price,.aavc-price,.aasg-stock,.aavc-stock,.aasg-delivery,.aavc-delivery) {
        width: 100% !important;
        text-align: right !important;
        justify-self: stretch !important;
    }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) > :is(.aasg-offer-price,.aavc-offer-price) {
        justify-content: flex-end !important;
        text-align: right !important;
    }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) > :is(.aasg-offer-stock,.aavc-offer-stock,.aasg-offer-delivery,.aavc-offer-delivery) {
        width: 100% !important;
        text-align: right !important;
        justify-self: stretch !important;
    }
}

@media (max-width: 680px) {
    /* The mobile commercial block keeps stock/delivery on the left,
       while the price aligns with the right edge above the CTA. */
    .alpha-site :is(.aasg-card-side,.aavc-side) > :is(.aasg-price,.aavc-price) {
        justify-self: end !important;
        text-align: right !important;
    }
    .alpha-site :is(.aasg-offer-row,.aavc-offer-row) > :is(.aasg-offer-price,.aavc-offer-price) {
        justify-content: flex-end !important;
        text-align: right !important;
    }
}


/* v0.1.55 — Parts Search / tablet: compact, intact best-offer purchase controls.
 * Scope is intentionally AASG-only; vehicle-search cards keep their already-approved layout.
 */
@media (min-width: 681px) and (max-width: 980px) {
    .alpha-site .aasg-card-side {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        min-height: 100% !important;
    }

    .alpha-site .aasg-card-side > .aasg-buy-controls {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        width: 210px !important;
        max-width: 100% !important;
        margin: auto 0 0 auto !important;
        padding-top: 8px !important;
        align-self: flex-end !important;
        justify-items: stretch !important;
    }

    .alpha-site .aasg-card-side > .aasg-buy-controls > .aasg-quantity {
        display: grid !important;
        grid-template-columns: 44px minmax(60px, 1fr) 44px !important;
        gap: 0 !important;
        width: 210px !important;
        max-width: 100% !important;
        height: 44px !important;
        min-height: 44px !important;
        margin: 0 !important;
        border: 1px solid var(--alpha-line-strong) !important;
        border-radius: 6px !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .alpha-site .aasg-card-side > .aasg-buy-controls > .aasg-quantity > button,
    .alpha-site .aasg-card-side > .aasg-buy-controls > .aasg-quantity > input {
        height: 42px !important;
        min-height: 42px !important;
        margin: 0 !important;
        border-radius: 0 !important;
        box-sizing: border-box !important;
        line-height: 42px !important;
        text-align: center !important;
    }

    .alpha-site .aasg-card-side > .aasg-buy-controls > .aasg-quantity > button {
        width: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        padding: 0 !important;
    }

    .alpha-site .aasg-card-side > .aasg-buy-controls > .aasg-quantity > input {
        width: 100% !important;
        min-width: 0 !important;
        padding: 0 !important;
    }

    .alpha-site .aasg-card-side > .aasg-buy-controls > .aasg-add {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 210px !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: 48px !important;
        min-height: 48px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
}


/* v0.1.56 — Parts Search tablet: keep the best-offer stepper and CTA inside the card.
 * Use a real vertical flex stack so legacy grid placement cannot push the CTA to the right.
 */
@media (min-width: 681px) and (max-width: 980px) {
    .alpha-site .aasg-card-side {
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .alpha-site .aasg-card-side > .aasg-buy-controls {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        justify-content: flex-end !important;
        gap: 8px !important;
        width: min(210px, 100%) !important;
        max-width: 210px !important;
        min-width: 0 !important;
        margin: auto 0 0 auto !important;
        padding: 8px 0 0 !important;
        position: static !important;
        inset: auto !important;
        transform: none !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }

    .alpha-site .aasg-card-side > .aasg-buy-controls > .aasg-quantity {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        position: static !important;
        inset: auto !important;
        transform: none !important;
        box-sizing: border-box !important;
    }

    .alpha-site .aasg-card-side > .aasg-buy-controls > .aasg-add {
        flex: 0 0 auto !important;
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        position: static !important;
        inset: auto !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        transform: none !important;
        float: none !important;
        clear: both !important;
        box-sizing: border-box !important;
    }
}


/* v0.1.57 — Parts Search: align commercial meta to the right on desktop/tablet. */
@media (min-width: 681px) {
    .alpha-site .aasg-card-side,
    .alpha-site .aasg-product-card .aasg-card-side {
        text-align: right !important;
    }
    .alpha-site .aasg-card-side .aasg-price,
    .alpha-site .aasg-card-side .aasg-stock,
    .alpha-site .aasg-card-side .aasg-delivery {
        width: 100% !important;
        text-align: right !important;
        justify-content: flex-end !important;
        align-self: stretch !important;
    }
}


/* v0.1.60 — Vehicle Search: right-align commercial meta in the best-offer column on desktop/tablet. */
@media (min-width: 681px) {
    .alpha-site .aavc-side,
    .alpha-site .aavc-product-card .aavc-side,
    .alpha-site .aavc-card-side,
    .alpha-site .aavc-product-card .aavc-card-side {
        text-align: right !important;
    }
    .alpha-site :is(.aavc-side,.aavc-card-side) > :is(.aavc-price,.aavc-stock,.aavc-delivery),
    .alpha-site :is(.aavc-side,.aavc-card-side) .aavc-price,
    .alpha-site :is(.aavc-side,.aavc-card-side) .aavc-stock,
    .alpha-site :is(.aavc-side,.aavc-card-side) .aavc-delivery {
        width: 100% !important;
        text-align: right !important;
        justify-content: flex-end !important;
        align-self: stretch !important;
    }
}

/* v0.1.61 — Vehicle Search: give pending/no-offer cards more vertical breathing room. */
@media (min-width: 681px) {
    .alpha-site .aavc-card:has(.aavc-price-empty),
    .alpha-site .aavc-product-card:has(.aavc-price-empty) {
        padding-top: 18px !important;
        padding-bottom: 18px !important;
    }

    .alpha-site .aavc-side:has(.aavc-price-empty) {
        min-height: 124px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    .alpha-site .aavc-side:has(.aavc-price-empty) .aavc-price-empty {
        margin: 0 0 10px !important;
        line-height: 1.12 !important;
    }

    .alpha-site .aavc-side:has(.aavc-price-empty) .aavc-stock {
        margin: 0 0 6px !important;
        line-height: 1.35 !important;
    }

    .alpha-site .aavc-side:has(.aavc-price-empty) .aavc-delivery {
        margin: 0 0 11px !important;
        line-height: 1.35 !important;
    }

    .alpha-site .aavc-side:has(.aavc-price-empty) > .aavc-button {
        min-height: 42px !important;
        margin-top: 0 !important;
    }
}
