﻿/* ===========================
   theme-shop.css — Responsive + Polished
   =========================== */
:root {
    --brand: #6366f1;
    --brand-600: #5458e9;
    --brand-700: #454ae2;
    --ink: #0f172a;
    --muted: #64748b;
    --page: #f8fafc;
    --surface: #fff;
    --border: #e5e7eb;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px rgba(15,23,42,.08);
    --shadow-soft: 0 6px 18px rgba(15,23,42,.06);
    /*--topbar-h: 64px;*/
    --topbar-h: 0px;
    --sidebar-w: 260px;
    --sidebar-bg: #0b1220;
    --sidebar-ink: #e5e7eb;
    --sidebar-muted: #9aa3b2;
    --sidebar-active: #111a2e;
}

    :root[data-bs-theme="dark"] {
        --brand: #7c89ff;
        --brand-600: #6b79ff;
        --brand-700: #5a66ff;
        --ink: #e5e7eb;
        --muted: #97a3b6;
        --page: #050a13;
        --surface: #0b1220;
        --border: #1e293b;
        --shadow: 0 14px 40px rgba(0,0,0,.55);
        --shadow-soft: 0 10px 26px rgba(0,0,0,.45);
    }

/* ---------- Base & Type (fluid) ---------- */
html {
    scroll-behavior: smooth;
}

body {
    background: var(--page);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: clamp(14px, .95vw, 18px);
}

h1 {
    font-size: clamp(1.6rem,2.6vw,2rem)
}

h2 {
    font-size: clamp(1.4rem,2.2vw,1.7rem)
}

h3 {
    font-size: clamp(1.2rem,2vw,1.45rem)
}

h4 {
    font-size: clamp(1.05rem,1.6vw,1.2rem)
}

.text-muted, .form-text {
    color: var(--muted) !important;
}

a {
    color: var(--brand);
    text-decoration: none
}

    a:hover {
        color: var(--brand-600)
    }

/* ---------- Layout (Topbar/Sidebar/Main) ---------- */
.app-topbar {
    height: var(--topbar-h);
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: var(--shadow-soft)
}

.navbar.box-shadow {
    box-shadow: none !important
}

.app-sidebar {
    position: fixed;
    inset-block-start: var(--topbar-h);
    inset-inline-start: 0;
    width: var(--sidebar-w);
    height: calc(100vh - var(--topbar-h));
    background: var(--sidebar-bg);
    color: var(--sidebar-ink);
    border-inline-end: 1px solid rgba(255,255,255,.06);
    overflow-y: auto;
    transform: translateX(0);
    transition: .2s ease;
    top:0;
}

    .app-sidebar .nav {
        padding: 16px 10px
    }

    .app-sidebar .nav-link {
        color: var(--sidebar-muted);
        border-radius: 10px;
        display: flex;
        align-items: center;
        gap: .6rem;
        padding: .65rem .8rem;
        transition: .15s ease;
    }

        .app-sidebar .nav-link i {
            font-size: 1.05rem;
            opacity: .9
        }

        .app-sidebar .nav-link:hover {
            background: rgba(255,255,255,.06);
            color: #fff
        }

        .app-sidebar .nav-link.active {
            background: var(--sidebar-active);
            color: #fff;
            box-shadow: inset 0 0 0 1px rgba(255,255,255,.06)
        }

.app-main {
    margin-inline-start: var(--sidebar-w);
    margin-top: var(--topbar-h);
    min-height: calc(100vh - var(--topbar-h))
}

.app-content {
    padding: clamp(14px,1.6vw,28px)
}

.page-bottom-space {
    padding-bottom: 10vh
}

/* Mobile: sidebar offcanvas */
@media (max-width: 991.98px) {
    :root {
        --sidebar-w: 82vw;
    }
    /* عرض مناسب موبایل */
    .app-sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow);
    }

    body.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    body.sidebar-open::before { /* backdrop */
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(2,6,23,.45);
        backdrop-filter: saturate(120%) blur(2px);
        z-index: 1029;
    }

    .app-main {
        margin-inline-start: 0;
    }
}

/* ---------- Cards ---------- */
.card {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow) !important
}

.card-header {
    background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 8%, transparent), transparent);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
}

/* ---------- Buttons (modern) ---------- */
.btn {
    border-radius: 12px;
    transition: .15s ease;
    line-height: 1.25
}

    .btn:active {
        transform: translateY(1px)
    }

.btn-sm {
    border-radius: 10px;
    padding: .35rem .6rem
}

.btn-lg {
    border-radius: 14px;
    padding: .7rem 1.1rem
}

.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-600);
    --bs-btn-hover-border-color: var(--brand-600);
    --bs-btn-active-bg: var(--brand-700);
    --bs-btn-active-border-color: var(--brand-700);
    box-shadow: 0 8px 20px rgba(99,102,241,.25);
}

.btn-outline-primary {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-border-color: var(--brand);
}

.btn-light {
    background: color-mix(in srgb, var(--brand) 8%, #fff);
    border-color: color-mix(in srgb, var(--brand) 12%, var(--border))
}

/* Block buttons on mobile for easier tap */
@media (max-width:575.98px) {
    .btn.w-25, .btn.w-50, .btn.w-75 {
        width: 100% !important;
    }

    .btn-group, .btn-toolbar {
        flex-wrap: wrap;
        gap: .4rem
    }
}

/* ---------- Forms (clean focus) ---------- */
.form-control, .form-select {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--border);
    border-radius: 12px
}

    .form-control:focus, .form-select:focus {
        border-color: var(--brand);
        box-shadow: 0 0 0 .25rem rgba(99,102,241,.15)
    }

.input-group-text {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px
}

.form-check-input {
    border-radius: 6px;
    border: 1px solid var(--border)
}

    .form-check-input:checked {
        background-color: var(--brand);
        border-color: var(--brand);
        box-shadow: 0 0 0 .2rem rgba(99,102,241,.18)
    }

@media (max-width:767.98px) {
    .form-label {
        font-size: .95rem
    }

    .form-control, .form-select {
        font-size: 1rem
    }
}

/* ---------- Tables ---------- */
.table {
    background: var(--surface);
    border-color: var(--border);
    border-radius: 14px;
    justify-content: center !important;
    text-align:center !important;
    overflow: hidden
}

    .table thead th {
        background: color-mix(in srgb, var(--brand) 9%, #fff);
        color: #1f2937;
        border-bottom: 1px solid var(--border);
        font-weight: 700;
    }

[data-bs-theme="dark"] .table thead th {
    background: color-mix(in srgb, var(--brand) 12%, #0b1220);
    color: #e5e7eb;
}

.table td, .table th {
    border-color: var(--border);
    vertical-align: middle
}

.table-hover tbody tr:hover {
    background: color-mix(in srgb, var(--brand) 6%, transparent)
}

table {
    border-radius: 5px 5px 5px 5px !important;
}

th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap
}

    th.sortable .sort-ind {
        opacity: .6;
        font-size: .8rem;
        margin-inline-start: .35rem
    }

    th.sortable.asc .sort-ind::after {
        content: "▲"
    }

    th.sortable.desc .sort-ind::after {
        content: "▼"
    }

/* Table density & responsiveness */
@media (max-width:1199.98px) {
    .table td, .table th {
        padding: .55rem .6rem
    }
}

@media (max-width:575.98px) {
    .table td, .table th {
        padding: .5rem .55rem;
        font-size: .95rem
    }

    .table .btn {
        padding: .28rem .5rem;
        font-size: .9rem
    }
}

/* اگر در بعضی صفحات table-responsive نیست، کمک کن */
.table:not(:has(thead)) {
    border-radius: 12px
}
/* امن */

/* ---------- Navs / Pills ---------- */
.nav-pills .nav-link {
    border-radius: 999px;
    color: var(--muted)
}

    .nav-pills .nav-link.active {
        background: var(--brand);
        color: #fff;
        box-shadow: 0 8px 20px rgba(99,102,241,.25)
    }

/* ---------- Alerts & Badges ---------- */
.alert {
    border-radius: 14px;
    border-color: var(--border)
}

.badge {
    border-radius: 999px;
    padding: .45em .7em
}

/* ---------- Accordion ---------- */
.accordion-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: var(--shadow-soft)
}

.accordion-button {
    background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 7%, transparent), transparent);
    color: var(--ink);
}

    .accordion-button:not(.collapsed) {
        color: #111
    }

/* ---------- Modals ---------- */
.modal-content {
    background: var(--surface);
    color: var(--ink);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow)
}

.modal-header, .modal-footer {
    border-color: var(--border)
}

/* ---------- Toastr ---------- */
#toast-container > .toast {
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    direction: rtl
}

/* ---------- Scrollbars ---------- */
* {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--brand) 35%, #b9c2d1) transparent
}

    *::-webkit-scrollbar {
        height: 10px;
        width: 10px
    }

    *::-webkit-scrollbar-thumb {
        background: color-mix(in srgb, var(--brand) 35%, #b9c2d1);
        border-radius: 999px;
        border: 2px solid transparent;
        background-clip: padding-box;
    }

    *::-webkit-scrollbar-track {
        background: transparent
    }

/* ---------- Utilities ---------- */
.shadow-soft {
    box-shadow: var(--shadow-soft) !important
}

.round-10 {
    border-radius: 10px !important
}

.round-12 {
    border-radius: 12px !important
}

/* ---------- Helper for sticky tables ---------- */
.sticky-head thead th {
    position: sticky;
    top: 0;
    z-index: 2
}

/* ---------- Improve clickable rows on small screens ---------- */
@media (hover:hover) {
    .table tbody tr {
        transition: background .15s ease
    }

        .table tbody tr:hover {
            background: color-mix(in srgb, var(--brand) 8%, transparent)
        }
}
