/* ═══════════════════════════════════════════════════════════════════
 *  NATIVE FEEL — Tüm sayfalarda EXE hissiyat (web tabanlı izleri sil)
 *  Tarayıcı varsayılan davranışlarını kapatır:
 *    • Metin seçimini engelle (input/textarea hariç)
 *    • Sürükleme (resim/link) engelle
 *    • Tap-highlight transparan
 *    • Focus outline (klavye dışı tıklamalarda) sıfırla
 *    • Default cursor (metin üstünde I-beam yok)
 *  Bu dosya tüm sayfalara dahil edildiği için tek nokta kontrol sağlar.
 * ═══════════════════════════════════════════════════════════════════ */

/* ── Global: metin seçimini kapat (input/textarea/contenteditable hariç) ── */
*,
*::before,
*::after {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* ── Yazılabilir alanlarda seçim serbest ── */
input,
textarea,
select,
[contenteditable="true"],
[contenteditable=""],
.tg-allow-select,
.tg-allow-select * {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    cursor: text;
}

/* select için pointer cursor */
select {
    cursor: pointer;
}

/* ── Default cursor (metin değil) ── */
html, body {
    cursor: default;
    touch-action: pan-y;
}

/* ── Sürükleme engelle: resim, link, ikon ── */
img,
svg,
a,
[draggable] {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    -webkit-touch-callout: none;
}

/* ── Buton ve link odak çerçevesini sadece klavye navigasyonunda göster ── */
button,
a,
[role="button"],
[tabindex] {
    outline: none;
}
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid rgba(237, 95, 127, 0.65);
    outline-offset: 2px;
}

/* ── Tıklanabilir öğelerde el cursor'ı ── */
button,
a,
[role="button"],
.clickable,
.t-box,
.table-box,
.product-card,
.cat-chip,
.st-nav-item {
    cursor: pointer;
}

/* ── Disabled elementlerde devre dışı cursor ── */
button:disabled,
[disabled],
.disabled {
    cursor: not-allowed;
}

/* ── Scrollbar — koyu temaya uyumlu, ince ── */
*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
*::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}
*::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
    background: rgba(237, 95, 127, 0.45);
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* ── Yazıyıcı font-smoothing ── */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ── Animasyonları daha akıcı (GPU layer ipucu) ── */
.t-box,
.table-box,
.product-card,
.st-nav-item,
.menu-card,
.order-item,
.oi-qty-btn,
.filter-btn,
.si,
.bnav-btn,
.switch-btn,
.cat-chip,
button {
    will-change: transform;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* ── Anında tıklama tepkisi (300ms mobile delay yok) ── */
button,
a,
[role="button"],
.clickable,
.t-box,
.table-box,
.menu-card,
.si,
.bnav-btn,
.switch-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* ── Hızlı geçişler — POS'ta her şey anında olmalı ── */
button,
.switch-btn,
.filter-btn,
.cat-chip,
.si,
.bnav-btn {
    transition-duration: 80ms !important;
    transition-timing-function: cubic-bezier(0.2, 0, 0, 1) !important;
}

/* ── Active state: anında basılı his (native button gibi) ── */
button:active:not(:disabled),
.t-box:active,
.table-box:active,
.menu-card:active,
.product-card:active,
.si:active,
.switch-btn:active,
.filter-btn:active {
    transform: scale(0.97) translateZ(0) !important;
    transition-duration: 30ms !important;
}

/* ── Layout containment: tarayıcı sadece değişen bileşeni yeniden çizsin ── */
.sidebar,
.topbar,
.top-bar,
.bottom-nav,
.order-panel,
.product-area,
.categories,
.hesap-view,
.detail-panel,
.main-content {
    contain: layout style;
}

/* ── Sayfa genelinde 60fps smooth scroll ── */
.order-list,
.product-grid,
.cat-list,
.hesap-items,
.hesap-products-grid,
.activity-list,
.order-table-wrap,
.panel-slider {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scroll-behavior: auto; /* smooth yerine auto — POS'ta anında tepki */
}

/* Dokunmatik POS ekranlarında parmakla kaydırma güvenilirliği.
   tg-touch sınıfı bir nedenle uygulanmasa bile (örn. Tauri detect gecikmesi)
   bu kapsayıcıların pan-y'si daima aktif olsun — pan-y sadece touch davranışını
   etkiler, mouse'a etkisi yok. */
.main-content,
.st-content,
.dashboard-page,
.order-list,
.product-grid,
.products-grid,
.cat-list,
.categories,
.product-area,
.order-panel,
.hesap-items,
.hesap-products-grid,
.activity-list,
.order-table-wrap,
.detail-items,
.detail-body,
.chart-body,
.act-body,
.dp-body,
.modal-body,
.om-body,
.stk-modal__body,
.z-modal__body,
.tg-pp-modal__body,
[data-touch-scroll] {
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y !important;
    overscroll-behavior: contain;
}

html.tg-touch .panel-slider,
html.tg-touch .st-nav,
html.tg-touch .tg-routing-wrap {
    touch-action: pan-x !important;
}

/* ── Overscroll glow/bounce efektini tamamen kaldır (web hissiyatı) ── */
html, body {
    overscroll-behavior: none;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

/* ── SPA geçiş animasyonu ── */
@keyframes tgFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
body.tg-spa-entering {
    animation: tgFadeIn 120ms ease-out;
}

/* ── Loading spinner olmadan anlık geçiş hissi ── */
#_spaLoader {
    backdrop-filter: blur(1px) !important;
    -webkit-backdrop-filter: blur(1px) !important;
}

/* ── Tooltip / title delay kaldır (native hissiyat) ── */
[title] {
    position: relative;
}
