/* ═══════════════════════════════════════════════════════════════════════════
   Pricing Module — Recipe Cost Calculator
   Added in v1.6.0.  Fully additive — remove this file to revert.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Footer row: shared row for "View all nutrients" (left) + pricing (right) ── */
.mipb-card-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0 0;
}

/* ── Inline pricing block (sits on the right of footer row) ──────────────── */
.mipb-price-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;          /* push right when no nutrients btn */
    font-size: 13px;
    white-space: nowrap;
}

/* Price tag: value + source */
.mipb-price-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.mipb-price-lbl {
    font-size: 12px;
    font-weight: 600;
    color: #6b8f6b;
}
.mipb-price-val {
    font-weight: 700;
    font-size: 14px;
    color: #1a7a1a;
}

/* Edit / Add price links */
.mipb-price-edit-btn,
.mipb-price-add-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 11px;
    color: #6b8f6b;
    text-decoration: underline;
    padding: 0;
    line-height: 1;
}
.mipb-price-edit-btn:hover,
.mipb-price-add-btn:hover {
    color: #2d5a27;
}
.mipb-price-add-btn {
    font-size: 12px;
    color: #8a6d3b;
}
.mipb-price-add-btn:hover {
    color: #6b5020;
}

/* ── Inline editing controls ─────────────────────────────────────────────── */
.mipb-price-inline--editing {
    flex-wrap: wrap;
    gap: 4px;
}
.mipb-price-inp {
    width: 70px;
    padding: 3px 6px;
    border: 1px solid #d4c5a0;
    border-radius: 5px;
    font-size: 12px;
    background: #fff;
    color: #333;
}
.mipb-price-inp:focus {
    border-color: #2d5a27;
    outline: none;
    box-shadow: 0 0 0 2px rgba(45,90,39,0.15);
}
.mipb-price-unit-sel {
    padding: 3px 4px;
    border: 1px solid #d4c5a0;
    border-radius: 5px;
    font-size: 12px;
    background: #fff;
    color: #333;
    min-width: 50px;
}
.mipb-price-unit-sel:focus {
    border-color: #2d5a27;
    outline: none;
}
.mipb-price-apply-btn {
    padding: 3px 10px;
    border: none;
    border-radius: 5px;
    background: #2d5a27;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.mipb-price-apply-btn:hover {
    background: #3d7a37;
}
.mipb-price-cancel-btn {
    padding: 3px 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #f8f8f8;
    color: #666;
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.mipb-price-cancel-btn:hover {
    background: #eee;
    border-color: #999;
}

/* ── Cost totals section ──────────────────────────────────────────────────── */
#mipb-cost-section {
    margin-top: 16px;
    margin-bottom: 1.5rem;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f0faf0 0%, #e8f5e8 100%);
    border: 1px solid #c5dfc5;
    border-radius: 12px;
}
#mipb-cost-section .mipb-cost-title {
    font-size: 14px;
    font-weight: 700;
    color: #2d5a27;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.mipb-cost-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.mipb-cost-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mipb-cost-item .mipb-cost-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b8f6b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.mipb-cost-item .mipb-cost-value {
    font-size: 22px;
    font-weight: 800;
    color: #1a7a1a;
    line-height: 1.2;
}
.mipb-cost-item .mipb-cost-value .mipb-cost-currency {
    font-size: 14px;
    font-weight: 600;
    vertical-align: super;
    margin-right: 2px;
}
.mipb-cost-note {
    font-size: 11px;
    color: #6b8f6b;
    margin-top: 8px;
    font-style: italic;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .mipb-card-footer-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .mipb-price-inline {
        margin-left: 0;
        align-self: flex-end;
    }
    .mipb-price-inline--editing {
        width: 100%;
        justify-content: flex-end;
    }
    .mipb-cost-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .mipb-cost-item .mipb-cost-value {
        font-size: 18px;
    }
}
