/* product-modal — product-modal.php dosyasindan ayrildi (satir ici kod kaldirildi).

   KATMAN ÖLÇEĞİ (tüm tenant menüleri için tek kaynak; bu dosya her temada yüklenir).
   Yapışkan kategori şeridi < yüzen düğmeler < karartma < alttan açılan pencere < bildirim.
   Önceden şerit z-index:100, pencereler 80–95 idi; şerit garson çağır / sepet
   pencerelerinin üstünde kalıp düğmeleri örtüyordu. Diğer dosyalar
   var(--z-*, yedek) ile aynı değerleri kullanır. */
:root {
  --z-sticky: 100;   /* kategori şeridi / sekmeler */
  --z-fab: 200;      /* yüzen sepet düğmesi, dil seçici */
  --z-overlay: 1000; /* pencere arkası karartma */
  --z-sheet: 1010;   /* alttan açılan pencereler (ürün, sepet, garson, geri bildirim, wifi) */
  --z-toast: 2000;   /* kısa bildirimler */
}
body.product-modal-open .categories-sticky {
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
  }
  .pm-overlay {
    position: fixed;
    inset: 0;
    background: var(--pm-overlay-bg, rgba(30, 42, 31, 0.6));
    backdrop-filter: blur(4px);
    z-index: var(--z-overlay, 1000);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  .pm-overlay.show { opacity: 1; pointer-events: auto; }
  .pm-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 560px;
    margin: 0 auto;
    background: var(--pm-paper, #fff);
    color: var(--pm-ink, #1e2a1f);
    border-radius: 24px 24px 0 0;
    z-index: var(--z-sheet, 1010);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
    max-height: 92vh;
    max-height: 92dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 0 8px 24px rgba(16, 26, 48, .12);
  }
  .pm-sheet.show { transform: translateY(0); }
  .pm-sheet.is-dragging { transition: none; }
  .pm-drag-header {
    height: 44px;
    padding: 10px 16px 0;
    touch-action: none;
    cursor: grab;
    flex-shrink: 0;
  }
  .pm-sheet .pm-handle {
    width: 44px;
    height: 5px;
    background: var(--pm-line, #e8e3d8);
    border-radius: 4px;
    margin: 0 auto;
  }
  /* Kapat (X): masaüstünde sürükleme yok; her zaman görünür bir çıkış. */
  .pm-x {
    position: absolute;
    top: 1px;
    inset-inline-end: 8px;
    z-index: 3;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    color: var(--pm-soft, #5a6b5d);
    display: grid;
    place-items: center;
    cursor: pointer;
  }
  .pm-x svg { width: 20px; height: 20px; }
  .pm-x:hover { background: var(--pm-bg, #f6f3ed); }
  .pm-img-wrap {
    position: relative;
    flex-shrink: 0;
    touch-action: none;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    padding: 8px 16px 0;
  }
  .pm-img-wrap.is-grabbing { cursor: grabbing; }
  .pm-sheet.noimg .pm-img-wrap { display: none; }
  /* Fotoğraf yüksekliği sınırlı: masaüstünde pencere ekrana sığsın
     (önceden 760px genişlikte 16:9'dan uzun fotoğraf taşıyordu). */
  .pm-sheet .pm-img {
    width: 100%;
    aspect-ratio: 500 / 365;
    max-height: min(36vh, 320px);
    background-color: var(--pm-bg, #f6f3ed);
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    display: block;
    pointer-events: none;
  }
  .pm-body { padding: 18px 20px 8px; }
  .pm-body .pm-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 8px;
  }
  .pm-sheet.noimg .pm-body .pm-top { padding-inline-end: 36px; }
  .pm-body h3 {
    font-family: var(--pm-title-font, inherit);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.15;
    flex: 1;
    color: var(--pm-ink, #1e2a1f);
  }
  .pm-body .pm-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--pm-ink, #1e2a1f);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    padding-top: 2px;
  }
  .pm-body .pm-desc {
    color: var(--pm-soft, #5a6b5d);
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 16px;
  }
  .pm-body .pm-desc:empty { display: none; }
  .pm-meta-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
  }
  .pm-meta-pills:empty { display: none; }
  .pm-meta-pills span {
    background: var(--pm-bg, #f6f3ed);
    color: var(--pm-ink, #1e2a1f);
    border: 1px solid var(--pm-line, #e8e3d8);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
  }
  [data-cat][data-name],
  [data-cat][data-item] { cursor: pointer; }
  .pm-nutri { margin-bottom: 16px; display: grid; gap: 12px; }
  .pm-nutri:empty { display: none; }
  .pm-cal {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--pm-bg, #f6f3ed); color: var(--pm-ink, #1e2a1f);
    border: 1px solid var(--pm-line, #e8e3d8);
    padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 700;
    font-variant-numeric: tabular-nums;
  }
  .pm-cal svg { width: 16px; height: 16px; color: var(--pm-soft, #5a6b5d); }
  .pm-nutri-block .t,
  .pm-opt-group .t {
    font-size: 13px; color: var(--pm-ink, #1e2a1f); margin-bottom: 8px; font-weight: 700;
  }
  .pm-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
  .pm-chip-row span {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--pm-bg, #f6f3ed); color: var(--pm-ink, #1e2a1f);
    border: 1px solid var(--pm-line, #e8e3d8);
    padding: 5px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600;
  }
  .pm-chip-row.alg span { background: #fef4e2; color: #8a4a06; border-color: #f6d699; }
  .pm-chip-row.alg svg { width: 14px; height: 14px; flex: 0 0 auto; }
  .pm-options { margin-bottom: 16px; display: grid; gap: 14px; }
  .pm-options:empty { display: none; }
  /* Parmakla seçilecek: iki sütun ızgara, 48px'lik dokunma yüksekliği. */
  .pm-opt-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pm-opt-pill {
    display: flex; align-items: center; gap: 10px; min-height: 52px;
    background: var(--pm-bg, #f6f3ed); border: 1.5px solid var(--pm-line, #e8e3d8);
    border-radius: 12px; padding: 12px 14px; font-size: 15px; font-weight: 600;
    color: var(--pm-ink, #1e2a1f); cursor: pointer;
    transition: border-color .14s ease, background .14s ease;
  }
  .pm-opt-pill input {
    accent-color: var(--pm-accent, #c4632d); margin: 0; flex: none;
    width: 20px; height: 20px;
  }
  .pm-opt-pill.sel { border-color: var(--pm-accent, #c4632d); background: var(--pm-accent-soft, #f3e4d6); }
  /* Marka rengi override'ı açık bir --pm-accent-soft veriyor; koyu temalarda (noir)
     açık ton üstünde açık yazı okunmuyordu. Zemin kâğıt renginden türetilir. */
  @supports (background: color-mix(in srgb, red 10%, white)) {
    .pm-opt-pill.sel { background: color-mix(in srgb, var(--pm-accent, #c4632d) 14%, var(--pm-paper, #fff)); }
  }
  .pm-opt-pill:has(input:focus-visible) { outline: 2px solid var(--pm-ink, #1e2a1f); outline-offset: 2px; }
  /* Uzun seçenek adlarında tek sütuna düş. */
  @media (max-width: 360px) { .pm-opt-row { grid-template-columns: 1fr; } }

  /* Alt eylem çubuğu: adet seçici + sepete ekle. Kaydırınca da görünür kalır. */
  .pm-foot {
    position: sticky;
    bottom: 0;
    background: var(--pm-paper, #fff);
    border-top: 1px solid var(--pm-line, #e8e3d8);
    padding: 12px 20px calc(14px + env(safe-area-inset-bottom, 0px));
    display: grid;
    gap: 10px;
  }
  .pm-order { display: flex; gap: 10px; align-items: stretch; }
  .pm-order[hidden], .pm-blocked[hidden], .pm-close-btn[hidden] { display: none; }
  .pm-qty {
    display: flex; align-items: center; flex: 0 0 auto;
    border: 1px solid var(--pm-line, #e8e3d8); border-radius: 12px;
    background: var(--pm-bg, #f6f3ed);
  }
  .pm-qty button {
    width: 44px; height: 48px; border: 0; background: transparent; cursor: pointer;
    color: var(--pm-ink, #1e2a1f); display: grid; place-items: center; padding: 0;
    border-radius: 12px;
  }
  .pm-qty button svg { width: 18px; height: 18px; }
  .pm-qty button:disabled { opacity: .35; cursor: default; }
  .pm-qty output {
    min-width: 26px; text-align: center; font-weight: 800; font-size: 16px;
    font-variant-numeric: tabular-nums; color: var(--pm-ink, #1e2a1f);
  }
  .pm-add-btn {
    flex: 1; min-width: 0; border: 0; min-height: 48px; padding: 10px 16px; border-radius: 12px;
    font-family: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
    background: var(--pm-accent, #c4632d); color: var(--pm-on-accent, #fff);
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
  }
  .pm-add-btn .pm-add-total { font-variant-numeric: tabular-nums; white-space: nowrap; }
  .pm-add-btn .pm-add-total:empty { display: none; }
  .pm-blocked {
    display: flex; gap: 12px; align-items: flex-start;
    background: var(--pm-bg, #f6f3ed); border: 1px solid var(--pm-line, #e8e3d8);
    border-radius: 12px; padding: 12px 14px; color: var(--pm-ink, #1e2a1f);
  }
  .pm-blocked .ic-closed, .pm-blocked.closed .ic-scan { display: none; }
  .pm-blocked.closed .ic-closed { display: block; }
  .pm-sheet:focus { outline: none; }
  .pm-blocked svg { width: 22px; height: 22px; flex: 0 0 auto; margin-top: 1px; color: var(--pm-soft, #5a6b5d); }
  .pm-blocked strong { display: block; font-size: 14.5px; font-weight: 700; line-height: 1.35; }
  .pm-blocked span { display: block; font-size: 13px; line-height: 1.45; color: var(--pm-soft, #5a6b5d); margin-top: 2px; }
  .pm-blocked span:empty { display: none; }
  /* Yalnız uyarı (paket servis kapalı): "Sepete ekle"nin üstünde ince not. */
  .pm-foot .pm-blocked.warn { order: -1; padding: 10px 12px; }
  .pm-blocked.warn strong { font-size: 13.5px; }
  .pm-close-btn {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--pm-line, #e8e3d8);
    padding: 12px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    background: transparent;
    color: var(--pm-ink, #1e2a1f);
  }
  .pm-x:focus-visible, .pm-qty button:focus-visible, .pm-add-btn:focus-visible, .pm-close-btn:focus-visible {
    outline: 2px solid var(--pm-ink, #1e2a1f); outline-offset: 2px;
  }

  /* "Sepete eklendi" bildirimi */
  .pm-toast {
    position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    transform: translate(-50%, 12px); z-index: var(--z-toast, 2000);
    display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px);
    background: #1b2a4a; color: #fff;
    padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 600;
    box-shadow: 0 8px 24px rgba(16, 26, 48, .12);
    opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  }
  .pm-toast svg { width: 18px; height: 18px; flex: 0 0 auto; color: #4ade80; }
  .pm-toast span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pm-toast.show { opacity: 1; transform: translate(-50%, 0); }

  @media (prefers-reduced-motion: reduce) {
    .pm-sheet, .pm-overlay, .pm-toast { transition: none; }
  }
