/* Receptai Equipment Prices — small additions on top of the theme's price-list styles. */

/* --- Editor fallback layout ------------------------------------------------
   The theme stylesheet is not loaded inside the block editor iframe, so the
   essential price-list layout is repeated here, scoped to the block. Values
   mirror the theme; on the frontend these are no-ops (same declarations). */
.ingredient-prices .price-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--line, #e8e8e8);
}

.ingredient-prices .price-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line, #e8e8e8);
    margin: 0;
}

.ingredient-prices .price-row.price-row--hidden {
    display: none;
}

.ingredient-prices .price-row__main {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.3;
}

.ingredient-prices .price-row__name {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: #111;
    text-decoration: none;
}

.ingredient-prices .price-row__price {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    flex: 0 0 auto;
    min-width: 80px;
    text-align: right;
}

.ingredient-prices .price-row__final {
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    color: #d9381e;
}

.ingredient-prices .price-row__action {
    flex: 0 0 auto;
}

.ingredient-prices .price-row__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 6px;
    background: #f5b041;
    color: #111;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.ingredient-prices .price-row__btn-text--mobile {
    display: none;
}

/* Product thumbnail inside the name column: fixed square, padded, rounded. */
.ingredient-prices .price-row__main {
    align-items: center;
    flex-wrap: nowrap;
    gap: 12px;
}

.price-row__thumb {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--bg-soft, #f5f4f2);
    flex: 0 0 56px;
    margin: 0;
    padding: 4px;
    box-sizing: border-box;
}

/* Name stays beside the image, max two lines; store + stock stacked under it. */
.ingredient-prices .price-row__body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.ingredient-prices .price-row__name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-width: 0;
}

.ingredient-prices .price-row__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: 12px;
    line-height: 1.3;
    color: var(--muted, #666);
}

.ingredient-prices .price-row__meta .price-row__store {
    font-weight: 600;
}

.ingredient-prices .price-row__meta .price-row__size {
    font-size: 12px;
}

.ingredient-prices .price-row__meta .price-row__size::before {
    content: '·';
    margin: 0 6px;
}

/* Action column: "Pirkti" button with the store logo stacked under it. */
.ingredient-prices .price-row__action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.ingredient-prices .price-row__logo {
    max-width: 90px;
    max-height: 26px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Mobile: product line on top, price + button on a second line. */
@media (max-width: 700px) {
    .ingredient-prices .price-row {
        flex-wrap: wrap;
        row-gap: 8px;
    }
    .ingredient-prices .price-row__main {
        flex: 1 1 100%;
    }
    .ingredient-prices .price-row__price {
        flex: 1 1 auto;
        justify-content: flex-start;
        min-width: 0;
        text-align: left;
    }
    .ingredient-prices .price-row__action {
        align-items: flex-end;
    }
}

/* Out-of-stock rows: subdued, but still clickable. */
.price-row--oos .price-row__name,
.price-row--oos .price-row__final {
    opacity: 0.55;
}

/* Admin: offers curation metabox. */
.receptai-ep-offer--hidden td {
    opacity: 0.45;
}

.receptai-ep-offers td {
    vertical-align: middle;
}

@media (max-width: 700px) {
    .price-row__thumb {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }
}
