{{--
  Shared item/add-on "materials" editor: bilingual description + a media list.
  $ns = field name prefix (e.g. "items[0]" or "addons[0]"), $item, $mediaText.
--}}
{{-- Read-only "inherited from the linked product" preview (filled by JS). --}}
<div class="bms-inherit-preview" style="display:none; margin:4px 0 10px; padding:8px 10px; background:#f0f6ff; border:1px solid #d4e3f7; border-radius:5px; font-size:.85em">
  <strong class="text-muted"><i class="fa fas fa-link"></i> @lang('bms::lang.inherits_from_product')</strong>
  <small class="text-muted"> — @lang('bms::lang.inherits_hint')</small>
  <div class="bms-inherit-body" style="margin-top:6px"></div>
</div>
<div class="row" style="margin-top:6px">
  <div class="col-sm-6 form-group">
    <label class="text-muted">@lang('bms::lang.description') (EN)</label>
    <textarea name="{{ $ns }}[description]" class="form-control input-sm" rows="2">{{ $item->description ?? '' }}</textarea>
  </div>
  <div class="col-sm-6 form-group">
    <label class="text-muted">@lang('bms::lang.description') (AR)</label>
    <textarea name="{{ $ns }}[description_ar]" class="form-control input-sm" rows="2" dir="rtl">{{ $item->description_ar ?? '' }}</textarea>
  </div>
</div>
<div class="form-group" style="margin-bottom:4px">
  <label class="text-muted">@lang('bms::lang.materials') <small class="text-muted">— @lang('bms::lang.materials_hint')</small></label>
  <textarea name="{{ $ns }}[media_text]" class="form-control input-sm" rows="3" placeholder="image|https://…|Title&#10;360|https://…|Tour&#10;video|https://…">{{ $mediaText }}</textarea>
</div>
@php
  $optionsText = (!empty($item) && is_array($item->options))
    ? collect($item->options)->map(fn ($o) => ($o['label'] ?? '').'|'.($o['label_ar'] ?? '').'|'.($o['price_delta'] ?? 0))->implode("\n")
    : '';
@endphp
<div class="form-group" style="margin-bottom:4px">
  <label class="text-muted">@lang('bms::lang.variants') <small class="text-muted">— @lang('bms::lang.variants_hint')</small></label>
  <textarea name="{{ $ns }}[options_text]" class="form-control input-sm" rows="2" placeholder="Kosha #2|كوشة رقم 2|5000&#10;Kosha #3|كوشة رقم 3|-2000">{{ $optionsText }}</textarea>
</div>
