/* Depom (saha) ve mal kabul yeniden tasarimi (27 Kasim 2026). app.css degiskenlerini kullanir. */
/* Yalniz .fd-* (Depom) ve .gr-* (mal kabul) siniflari: app.css'teki .field-* kurallari baska sayfalar icin oldugu gibi kalir. */

.i-fd-chevron { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
.i-fd-repeat { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12a8 8 0 0 1 14-5l2 2 M20 4v5h-5 M20 12a8 8 0 0 1-14 5l-2-2 M4 20v-5h5'/%3E%3C/svg%3E"); }

/* ---------- Depom: baslik ve ambar secimi ---------- */
.fd-head { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.fd-head-title { min-width: 0; }
.fd-head h1 { margin: 2px 0 0; overflow-wrap: anywhere; }
.fd-where { flex-shrink: 0; }
.fd-where > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 1px solid var(--slate-300); border-radius: var(--radius); background: var(--surface); color: var(--slate-700); font-weight: 650; cursor: pointer; user-select: none; }
.fd-where > summary::-webkit-details-marker { display: none; }
.fd-where > summary:hover { border-color: #9db0c3; color: var(--blue-700); }
.fd-where[open] > summary .ico { transform: rotate(180deg); }
.fd-where-panel { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; width: min(340px, 100%); max-height: 60vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 8px; background: var(--surface); border: 1px solid var(--slate-300); border-radius: var(--radius); box-shadow: var(--shadow-lift); }
.fd-where-group { display: flex; flex-direction: column; gap: 2px; }
.fd-where-group + .fd-where-group { border-top: 1px solid var(--line); padding-top: 8px; }
.fd-where-label { padding: 2px 10px; font-size: 12px; font-weight: 700; color: var(--slate-700); }
.fd-where-group a { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 4px 10px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; font-weight: 600; overflow-wrap: anywhere; }
.fd-where-group a:hover { background: var(--slate-50); }
.fd-where-group a.current { background: var(--accent-soft); color: var(--blue-700); font-weight: 700; }
.fd-where-group .count-soft { flex-shrink: 0; min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--slate-100); color: var(--slate-700); font-size: 12px; font-weight: 700; text-align: center; }

/* ---------- Depom: bolum gezinmesi (genis ekranda sekme satiri, telefonda alta sabit) ---------- */
.fd-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.fd-nav a { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 6px; border-radius: var(--radius-sm); color: var(--slate-700); text-decoration: none; font-weight: 600; font-size: 0.9rem; text-align: center; }
.fd-nav a:hover { color: var(--blue-700); }
.fd-nav a.active { background: var(--accent); color: var(--accent-ink); }
.fd-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #7a4500; color: #fff; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Depom: stok bolumu ---------- */
.fd-banner { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 14px; margin-bottom: 12px; background: var(--wait-bg); border: 1px solid #f3dca8; border-radius: var(--radius); color: #3d2600; text-decoration: none; font-weight: 600; }
.fd-banner:hover { border-color: #d9a94a; }
.fd-banner-count { flex-shrink: 0; padding: 2px 9px; border-radius: 12px; background: #7a4500; color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }
.fd-banner-text { flex: 1 1 auto; }

.fd-search { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.fd-search label, .fd-cart-fields label > span, .gr-entry label, .gr-note label { font-size: 12px; font-weight: 600; color: var(--slate-700); }
.fd-search-row { display: flex; gap: 8px; }
.fd-search-row input, .fd-cart-fields input, .fd-cart-fields select, .gr-note input { min-width: 0; height: 48px; padding: 0 12px; border: 1px solid var(--slate-300); border-radius: var(--radius); background: #fff; color: var(--ink); font: inherit; font-size: 16px; }
.fd-search-row input { flex: 1 1 auto; }
.fd-search-row .btn { min-height: 48px; }

.fd-repeat { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 48px; padding: 6px 12px; margin-bottom: 14px; border: 1px solid var(--slate-300); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.fd-repeat:hover { border-color: #9db0c3; background: var(--slate-50); }
.fd-repeat-text { display: flex; flex-direction: column; min-width: 0; }
.fd-repeat-text strong { color: var(--blue-700); font-weight: 650; }
.fd-repeat-text span { font-size: 12px; color: var(--slate-600); overflow-wrap: anywhere; }
.fd-repeat .ico { color: var(--blue-700); }
.fd-section-title { margin: 0 0 2px; font-size: 12px; font-weight: 600; color: var(--slate-700); overflow-wrap: anywhere; }

/* ---------- Depom: kartlar (stok, talep, gelen) ---------- */
.fd-items { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.fd-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.fd-item.in-cart { background: var(--blue-100); border-color: #8fb5e3; }
.fd-item.ready { border-left: 4px solid var(--violet); }
.fd-item-text { display: flex; flex-direction: column; gap: 3px; flex: 1 1 0; min-width: 0; }
.fd-item-text strong { font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.fd-item-text .chip { align-self: flex-start; white-space: normal; }
.fd-item-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.fd-item-top .chip { flex-shrink: 0; }
.fd-item-meta { font-size: 12.5px; color: var(--slate-700); overflow-wrap: anywhere; }
.fd-item-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.fd-item-add { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.fd-add { min-height: 44px; }
.fd-item-actions { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.fd-item-actions .btn { min-height: 44px; }
.fd-item-actions .fd-confirm { min-height: 48px; padding: 0 18px; font-size: 1rem; }

ul.fd-lines, .fd-lines ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--slate-700); }
.fd-lines li { overflow-wrap: anywhere; }
details.fd-lines > summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--blue-700); font-size: 13px; font-weight: 600; cursor: pointer; }

/* ---------- Miktar: - / + dugmeleri (Depom ve mal kabul). Dugmeler betikle acilir; betik yoksa kutuya yazilir. ---------- */
.fd-stepper { display: flex; align-items: center; gap: 2px; }
.fd-stepper input { width: 76px; height: 44px; padding: 0 4px; border: 1px solid var(--slate-300); border-radius: var(--radius); background: #fff; color: var(--ink); font: inherit; font-size: 16px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.fd-stepper input::placeholder { font-weight: 400; color: var(--slate-600); }
.fd-step { display: inline-grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 1px solid var(--slate-300); border-radius: var(--radius); background: #fff; color: var(--blue-700); font: inherit; font-size: 20px; font-weight: 700; line-height: 1; cursor: pointer; touch-action: manipulation; user-select: none; }
.fd-step[hidden] { display: none; }
.fd-step:hover { background: var(--slate-50); border-color: #9db0c3; }
/* Dugmeler gorunurken tarayicinin kendi artir/azalt oklari gizlenir. */
.fd-step:not([hidden]) + input { -moz-appearance: textfield; appearance: textfield; }
.fd-step:not([hidden]) + input::-webkit-outer-spin-button, .fd-step:not([hidden]) + input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Depom: sepet (ozet cubugu + acilir ayrinti) ---------- */
.fd-cart { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 16px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius) var(--radius) 0 0; box-shadow: 0 -6px 20px rgba(18, 46, 76, 0.12); }
.fd-cart-details { flex: 1 1 0; min-width: 0; }
.fd-cart-details[open] { flex-basis: 100%; }
.fd-cart-details > summary { list-style: none; display: flex; flex-direction: column; justify-content: center; min-height: 44px; cursor: pointer; }
.fd-cart-details > summary::-webkit-details-marker { display: none; }
.fd-cart-title { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.fd-cart-title .ico { color: var(--slate-600); transform: rotate(180deg); }
.fd-cart-details[open] .fd-cart-title .ico { transform: none; }
.fd-cart-sum { font-size: 12px; color: var(--slate-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-cart-details[open] .fd-cart-sum { display: none; }
.fd-cart-body { max-height: min(50vh, 420px); overflow: auto; padding-top: 4px; }
.fd-cart-body ul { list-style: none; margin: 0 0 10px; padding: 0; }
.fd-cart-body li { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; align-items: center; gap: 8px; min-height: 48px; border-bottom: 1px solid var(--line-soft); }
.fd-cart-line { display: flex; flex-direction: column; min-width: 0; }
.fd-cart-line b { font-weight: 650; overflow-wrap: anywhere; }
.fd-cart-body .num { white-space: nowrap; font-weight: 650; }
.fd-remove { width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--radius); background: none; color: var(--slate-600); font: inherit; font-size: 16px; cursor: pointer; }
.fd-remove:hover { background: var(--bad-bg); color: var(--bad); }
.fd-cart-fields { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px; margin-bottom: 10px; }
.fd-cart-fields label { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fd-cart-fields input, .fd-cart-fields select { width: 100%; }
.fd-empty { min-height: 44px; }
.fd-send { flex: 0 0 auto; min-height: 48px; padding: 0 18px; font-size: 1rem; }
.fd-cart-details[open] + .fd-send { flex: 1 1 100%; }

/* ---------- Mal kabul ---------- */
.gr { max-width: 900px; }
.gr-back { min-height: 44px; }
.gr-summary { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.gr-summary strong { font-size: 15px; font-weight: 700; }
.gr-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.gr-line { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 320px; align-items: center; gap: 10px 18px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.gr-line.missing { border-color: #e6c27a; }
.gr-line.over { border-color: #eba9b0; }
.gr-line.done { background: var(--slate-50); }
.gr-line-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; min-width: 0; }
.gr-line-head .chip { flex-shrink: 0; }
.gr-line-title { display: flex; flex-direction: column; min-width: 0; }
.gr-line-title strong { font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.gr-line-code { font-size: 12px; color: var(--slate-700); overflow-wrap: anywhere; }
.gr-facts { display: flex; gap: 18px; margin: 0; }
.gr-facts div { display: flex; flex-direction: column; min-width: 0; }
.gr-facts dt { font-size: 12px; font-weight: 600; color: var(--slate-600); }
.gr-facts dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.gr-entry { display: flex; align-items: center; gap: 8px; }
.gr-entry label { flex: 1 1 auto; }
.gr-line.missing .fd-stepper input { border-color: #b97a00; }
.gr-line.over .fd-stepper input { border-color: var(--bad); }
.gr-unit { flex: 0 0 auto; min-width: 34px; font-size: 13px; color: var(--slate-700); }
.gr-note { display: flex; flex-direction: column; gap: 3px; margin-top: 12px; }
.gr-submit { display: flex; align-items: center; gap: 8px 14px; margin-top: 12px; padding: 12px 0; }
.gr-submit .btn { flex-shrink: 0; min-height: 52px; padding: 0 22px; font-size: 16px; white-space: normal; }
.gr-submit p { color: var(--slate-600); }

/* ---------- Telefon ---------- */
@media (max-width: 760px) {
    /* Alta sabit cubuklarin arkasinda icerik kalmasin: gezinme 57px, sepet cubugu ~76px + guvenli alan. */
    .fd { padding-bottom: calc(57px + 24px + env(safe-area-inset-bottom, 0px)); }
    .fd.has-cart { padding-bottom: calc(57px + 76px + 24px + env(safe-area-inset-bottom, 0px)); }

    .fd-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; gap: 0; margin: 0; padding: 0 0 env(safe-area-inset-bottom, 0px); border: 0; border-top: 1px solid var(--line); border-radius: 0; }
    .fd-nav a { flex-direction: column; gap: 2px; min-height: 56px; padding: 0 2px; border-top: 3px solid transparent; border-radius: 0; font-size: 12px; }
    .fd-nav a.active { background: none; color: var(--blue-700); border-top-color: var(--accent); font-weight: 700; }
    .fd-nav a:focus-visible { outline-offset: -3px; }
    .fd-nav .fd-badge { position: absolute; top: 5px; left: calc(50% + 6px); }

    .fd-cart { position: fixed; left: 0; right: 0; bottom: calc(57px + env(safe-area-inset-bottom, 0px)); z-index: 29; margin: 0; padding: 10px 16px; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
    .fd-cart-body { max-height: 46vh; }

    .gr-line { grid-template-columns: minmax(0, 1fr); }
    .gr-facts { gap: 22px; }
    .gr-submit { position: sticky; bottom: 0; z-index: 5; flex-direction: column; align-items: stretch; margin: 12px 0 0; padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--bg); border-top: 1px solid var(--line); }
    .gr-submit p { text-align: center; }
}

@media (max-width: 560px) {
    .fd-head { align-items: flex-start; }
    .fd-stock, .fd-request, .fd-delivery { flex-direction: column; align-items: stretch; }
    .fd-item-add { justify-content: space-between; }
    .fd-add { flex: 1 1 auto; max-width: 140px; }
    .fd-item-actions .btn { flex: 1 1 auto; }
    .fd-cart-fields { grid-template-columns: minmax(0, 1fr); }
}

/* Süreç yönetimi (3 Aralık 2026): satın almada "Teklif ekle" ana düğme; tek fiyatla hızlı sipariş katlanmış. */
.process-actions .process-quick { flex-basis: 100%; text-align: right; }
.process-actions .process-quick summary { cursor: pointer; }
.process-quick-row { display: inline-flex; gap: 6px; align-items: center; margin-top: 6px; }
.process-quick-row input { width: 160px; }

/* Süreç yönetimi (3 Aralık 2026): siparişe hazır kayıtlar üstte ve vurgulu; süzgeç sekmeleri. */
.process-filter { margin: 4px 0 12px; flex-wrap: wrap; }
.process-filter .count { opacity: .75; margin-left: 4px; }
.process-items .process-item.ready { border-left-color: var(--ok); background: var(--ok-bg); }
