﻿/* ==========================================================
   B2B Portal - Ortak stiller (Bootstrap 5.3 üzerine)
   ========================================================== */
:root {
    --brand: #0d6efd;
    --brand-dark: #0a58ca;
    --sidebar-w: 250px;
    --bottom-nav-h: 62px;
}

html, body { min-height: 100%; }
body { background: #f4f6f9; font-size: .95rem; -webkit-tap-highlight-color: transparent; }
a { text-decoration: none; }
.text-brand { color: var(--brand) !important; }
.bg-brand { background: var(--brand) !important; color: #fff; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.card { border: 0; box-shadow: 0 1px 3px rgba(16,24,40,.08); border-radius: .75rem; }
.card-header { background: #fff; border-bottom: 1px solid #eef0f3; font-weight: 600; border-radius: .75rem .75rem 0 0 !important; }
.form-label { font-weight: 500; font-size: .85rem; color: #475467; margin-bottom: .25rem; }
.page-title { font-size: 1.35rem; font-weight: 700; margin: 0; }
.page-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.min-w-0 { min-width: 0; }
.fs-7 { font-size: .8rem; }
.cursor-pointer { cursor: pointer; }

/* ---------- Giriş sayfaları ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: linear-gradient(135deg, var(--brand) 0%, #1e293b 100%); }
.auth-card { width: 100%; max-width: 440px; }
.auth-card .card { border-radius: 1rem; }
.auth-logo { width: 56px; height: 56px; border-radius: 14px; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; }

/* ---------- Bayi üst menü ---------- */
.dealer-top { background: var(--brand); }
.dealer-top .navbar-brand { font-weight: 700; color: #fff; }
.dealer-top .nav-icon { color: #fff; position: relative; font-size: 1.35rem; padding: .25rem .5rem; }
.dealer-top .search-box { max-width: 520px; }
.dealer-top .search-box input { border: 0; }
.dealer-menu { background: #fff; border-bottom: 1px solid #e5e7eb; }
.dealer-menu .nav-link { color: #344054; font-weight: 500; padding: .75rem .9rem; border-bottom: 2px solid transparent; }
.dealer-menu .nav-link.active, .dealer-menu .nav-link:hover { color: var(--brand); border-bottom-color: var(--brand); }
.badge-dot { position: absolute; top: -2px; right: -4px; font-size: .65rem; }

/* Mobil alt menü */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: var(--bottom-nav-h); background: #fff; border-top: 1px solid #e5e7eb; display: flex; z-index: 1030; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #667085; font-size: .7rem; position: relative; }
.bottom-nav a i { font-size: 1.3rem; line-height: 1.1; }
.bottom-nav a.active { color: var(--brand); }
.bottom-nav .badge { position: absolute; top: 6px; left: 55%; font-size: .6rem; }
@media (max-width: 991.98px) { body.has-bottom-nav { padding-bottom: calc(var(--bottom-nav-h) + 12px); } }

/* ---------- Yönetim paneli ---------- */
.admin-sidebar { width: var(--sidebar-w); color: #cbd5e1; --bs-offcanvas-width: 270px; }
.admin-sidebar .sidebar-inner { background: #111827; min-height: 100vh; width: 100%; padding-bottom: 2rem; }
.admin-sidebar .brand { color: #fff; font-weight: 700; font-size: 1.1rem; padding: 1rem 1.25rem; display: block; border-bottom: 1px solid rgba(255,255,255,.06); }
.admin-sidebar .nav-link { color: #cbd5e1; padding: .55rem 1.25rem; border-radius: 0; display: flex; align-items: center; gap: .65rem; font-size: .9rem; }
.admin-sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.05); }
.admin-sidebar .nav-link.active { color: #fff; background: var(--brand); }
.admin-sidebar .nav-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: #64748b; padding: 1rem 1.25rem .35rem; }
.admin-sidebar .count { margin-left: auto; }
@media (min-width: 992px) {
    .admin-sidebar.offcanvas-lg { position: fixed; top: 0; bottom: 0; left: 0; overflow-y: auto; visibility: visible !important; transform: none !important; }
    .admin-main { margin-left: var(--sidebar-w); }
}
@media (max-width: 991.98px) { .admin-sidebar.offcanvas-lg { background: #111827; } }
.admin-topbar { background: #fff; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 1020; }
.admin-content { padding: 1.25rem; }
@media (max-width: 575.98px) { .admin-content { padding: .75rem; } }

/* ---------- İstatistik kartları ---------- */
.stat-card .icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; }
.stat-card .value { font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.stat-card .label { color: #667085; font-size: .8rem; }

/* ---------- Ürün kartları ---------- */
.product-card { height: 100%; transition: box-shadow .15s; }
.product-card:hover { box-shadow: 0 6px 18px rgba(16,24,40,.12); }
.product-card .img-wrap { aspect-ratio: 1/1; background: #fff; display: flex; align-items: center; justify-content: center; border-radius: .75rem .75rem 0 0; overflow: hidden; position: relative; }
.product-card .img-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; }
.product-card .title { font-weight: 600; font-size: .9rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; color: #101828; }
.product-card .price { font-size: 1.1rem; font-weight: 700; color: #101828; }
.product-card .old-price { text-decoration: line-through; color: #98a2b3; font-size: .8rem; }
.product-card .ribbons { position: absolute; top: .5rem; left: .5rem; display: flex; flex-direction: column; gap: .25rem; }
.product-card .fav-btn { position: absolute; top: .4rem; right: .4rem; background: rgba(255,255,255,.9); border: 0; border-radius: 50%; width: 34px; height: 34px; color: #e11d48; }
.product-list-row img { width: 56px; height: 56px; object-fit: contain; background: #fff; border-radius: .5rem; }

.qty-group { max-width: 140px; flex-wrap: nowrap; }
.qty-group .form-control { text-align: center; padding-left: .25rem; padding-right: .25rem; min-width: 50px; }
.qty-group .btn { padding-left: .6rem; padding-right: .6rem; }

/* ---------- Mobilde tablo -> kart ---------- */
@media (max-width: 767.98px) {
    .table-cards thead { display: none; }
    .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
    .table-cards tr { background: #fff; border: 1px solid #eaecf0; border-radius: .6rem; margin-bottom: .6rem; padding: .35rem .25rem; }
    .table-cards td { border: 0 !important; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .3rem .6rem !important; text-align: right; }
    .table-cards td::before { content: attr(data-label); font-weight: 600; color: #667085; font-size: .78rem; text-align: left; flex-shrink: 0; }
    .table-cards td[data-label=""]::before, .table-cards td:not([data-label])::before { display: none; }
    .table-cards td.td-main { display: block; text-align: left; font-weight: 600; border-bottom: 1px solid #f2f4f7 !important; margin-bottom: .2rem; }
    .table-cards td.td-main::before { display: none; }
    .table-cards td.td-actions { justify-content: flex-end; }
    .table-cards tfoot { display: block; }
    .table-cards tfoot tr { display: flex; flex-direction: column; }
}
.table > :not(caption) > * > * { vertical-align: middle; }
.table thead th { font-size: .78rem; text-transform: uppercase; color: #667085; letter-spacing: .03em; font-weight: 600; background: #f9fafb; white-space: nowrap; }

/* ---------- Diğer ---------- */
.timeline { list-style: none; padding-left: 1rem; border-left: 2px solid #e5e7eb; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem .75rem; }
.timeline li::before { content: ""; position: absolute; left: -1.43rem; top: .3rem; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--brand); }
.chat-msg { max-width: 85%; border-radius: .8rem; padding: .6rem .85rem; margin-bottom: .6rem; }
.chat-msg.me { background: var(--brand); color: #fff; margin-left: auto; }
.chat-msg.other { background: #fff; border: 1px solid #eaecf0; }
.chat-msg .meta { font-size: .72rem; opacity: .8; }
.campaign-card { background: linear-gradient(135deg, var(--brand), #6366f1); color: #fff; }
.empty-state { text-align: center; padding: 3rem 1rem; color: #667085; }
.empty-state i { font-size: 3rem; display: block; margin-bottom: .5rem; color: #d0d5dd; }
.toast-container { z-index: 1090; }
.sticky-summary { position: sticky; top: 1rem; }
@media (max-width: 991.98px) { .sticky-summary { position: static; } }
.mobile-checkout-bar { display: none; }
@media (max-width: 991.98px) {
    .mobile-checkout-bar { display: flex; position: fixed; left: 0; right: 0; bottom: var(--bottom-nav-h); background: #fff; border-top: 1px solid #e5e7eb; padding: .6rem 1rem; z-index: 1025; align-items: center; justify-content: space-between; box-shadow: 0 -4px 12px rgba(0,0,0,.05); }
    body.has-checkout-bar { padding-bottom: calc(var(--bottom-nav-h) + 80px); }
}

/* ---------- Yazdırma ---------- */
@media print {
    .no-print, .dealer-top, .dealer-menu, .bottom-nav, .admin-sidebar, .admin-topbar, .btn, .alert, footer, .mobile-checkout-bar { display: none !important; }
    .admin-main { margin-left: 0 !important; }
    body { background: #fff; padding: 0 !important; font-size: 11pt; }
    .card { box-shadow: none; border: 1px solid #ddd; }
    .print-only { display: block !important; }
    .table-cards thead { display: table-header-group !important; }
    .table-cards tr { display: table-row !important; }
    .table-cards td { display: table-cell !important; }
    .table-cards td::before { display: none !important; }
}
.print-only { display: none; }

/* asp:CheckBox / RadioButton için */
.chk { display: inline-flex; align-items: center; gap: .45rem; }
.chk input { width: 1.1em; height: 1.1em; margin: 0; accent-color: var(--brand); flex-shrink: 0; }
.chk label { margin: 0; cursor: pointer; }
.chk-list td { padding: .15rem 1rem .15rem 0; }
.chk-list input { margin-right: .35rem; accent-color: var(--brand); }
