/**
 * Mobile layout v2: отдельная разметка карточек (article), не CSS-хаки table.
 * Откат: local/php_interface/lvt_offers_layout_config.php → mobile_layout_v2_enabled = false
 */

.lvt-offers-layout--mobile .getchips-offers__table-wrap {
    overflow: visible;
}

.lvt-offers-layout--mobile .lvt-offers-cards__list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
}

.lvt-offers-layout--mobile .lvt-offer-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "head head"
        "mid actions";
    gap: 0.35rem 0.5rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--stroke_black, #e8ecf0);
    border-radius: var(--border-radius, 8px);
    background: var(--card_bg_black, #fff);
    min-width: 0;
}

.lvt-offers-layout--mobile .lvt-offer-card__head {
    grid-area: head;
    min-width: 0;
}

.lvt-offers-layout--mobile .lvt-offer-card__part {
    font-weight: 600;
    font-size: 0.8125rem;
    line-height: 1.25;
    word-break: break-word;
}

.lvt-offers-layout--mobile .lvt-offer-card__meta {
    margin-top: 0.15rem;
    font-size: 0.6875rem;
    line-height: 1.2;
    color: var(--light_basic_text_black, #888);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lvt-offers-layout--mobile .lvt-offer-card__mid {
    grid-area: mid;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.1rem;
    min-width: 0;
}

.lvt-offers-layout--mobile .lvt-offer-card__price {
    font-weight: 600;
    font-size: 0.8125rem;
}

.lvt-offers-layout--mobile .lvt-offer-card__stock {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--light_basic_text_black, #666);
}

.lvt-offers-layout--mobile .lvt-offer-card__actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}

.lvt-offers-layout--mobile .getchips-offers__order-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    width: 100%;
}

.lvt-offers-layout--mobile .getchips-offers__qty-input-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem;
}

.lvt-offers-layout--mobile .getchips-offers__counter {
    width: 96px;
    min-width: 96px;
    max-width: 96px;
    height: 32px;
    min-height: 32px;
}

.lvt-offers-layout--mobile .getchips-offers__cart-btn-wrap .btn {
    min-height: 32px;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

.lvt-offers-layout--mobile .getchips-offers__qty-meta {
    display: none;
}

.lvt-offers-layout--mobile .lvt-offers-cards__list.getchips-offers__table--collapsible:not(.is-expanded) .js-getchips-offer-row:nth-child(n+6) {
    display: none !important;
}

.lvt-offers-layout--mobile .lvt-offers-cards__list.getchips-offers__table--collapsible.is-expanded .js-getchips-offer-row {
    display: grid !important;
}

@media (max-width: 420px) {
    .lvt-offers-layout--mobile .lvt-offer-card {
        grid-template-columns: 1fr;
        grid-template-areas:
            "head"
            "mid"
            "actions";
    }

    .lvt-offers-layout--mobile .lvt-offer-card__actions {
        justify-content: stretch;
    }

    .lvt-offers-layout--mobile .getchips-offers__qty-input-row {
        width: 100%;
        justify-content: space-between;
    }
}
