/* ==========================================================================
   ShokoMall / Anahit — global stylesheet
   Loaded on every page via base.html. This file defines the CSS variables
   several templates already reference (--card-bg, --text-secondary, etc.)
   but that were never declared anywhere, plus shared admin-panel styles and
   site-wide mobile responsiveness fixes.
   ========================================================================== */

/* ---- Design tokens (dark theme = default) ------------------------------ */
:root {
    --bg-body: #08090b;
    --bg-card: #0c0e11;
    --card-bg: #0c0e11;          /* alias used by some templates */
    --bg-elevated: #14171b;
    --border-color: rgba(98, 107, 121, 0.2);
    --card-border: rgba(98, 107, 121, 0.2); /* alias used by some templates */
    --text-primary: #eef0f2;
    --text-secondary: #b8bfc8;
    --text-muted: #7c8593;
    --accent: #c9a96e;
    --accent-hover: #d4b87a;
    --success: #2ecc71;
    --danger: #e74c3c;
    --danger-hover: #c0392b;
    --info: #4fc3f7;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

body.light-mode {
    --bg-body: #faf6eb;
    --bg-card: #ffffff;
    --card-bg: #ffffff;
    --bg-elevated: #f3ede0;
    --border-color: rgba(0, 0, 0, 0.08);
    --card-border: rgba(0, 0, 0, 0.08);
    --text-primary: #1a1a1a;
    --text-secondary: #4a453c;
    --text-muted: #8a7a6a;
    --accent: #b8894f;
    --accent-hover: #a67a44;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* ---- Accessibility & touch basics --------------------------------------- */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

a, button, .icon-btn, .btn, [role="button"] {
    -webkit-tap-highlight-color: transparent;
}

/* Every tappable control should meet the ~44px minimum touch target. */
button, .btn, .btn-sm, .icon-btn, input[type="submit"], input[type="button"] {
    min-height: 38px;
}

/* Inputs at 16px prevent iOS Safari from zooming in on focus. */
input, select, textarea {
    font-size: 16px;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}

/* ---- Any table anywhere in the site becomes horizontally scrollable ---- */
table {
    max-width: 100%;
}

/* ==========================================================================
   Admin panel — shared across every /shop/manage/ page.
   admin_category_list.html, admin_brand_list.html and admin_coupon_list.html
   ship with no <style> block at all and rely entirely on these class names.
   ========================================================================== */
.admin-panel {
    padding: 2.5rem 0 4rem;
}
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.admin-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.admin-header h1 i {
    color: var(--accent);
}

.btn-primary-new {
    background: var(--accent);
    color: #14110a;
    padding: 0.65rem 1.4rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: 'Vazirmatn', sans-serif;
    text-decoration: none;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
}
.btn-primary-new:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(201, 169, 110, 0.25);
    background: var(--accent-hover);
}

.admin-table-wrap,
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 0.5rem;
}
.admin-table {
    width: 100%;
    min-width: 560px; /* forces horizontal scroll instead of squashing on phones */
    border-collapse: collapse;
    font-size: 0.9rem;
    color: var(--text-primary);
}
.admin-table th {
    text-align: right;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}
.admin-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
.admin-table tbody tr {
    transition: background 0.2s;
}
.admin-table tbody tr:hover {
    background: rgba(201, 169, 110, 0.06);
}
.admin-table tbody tr:last-child td {
    border-bottom: none;
}
.admin-table td[colspan] {
    text-align: center;
    color: var(--text-muted);
    padding: 2.5rem 1rem;
}

.btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    transition: 0.25s;
    cursor: pointer;
    background: transparent;
}
.btn-edit {
    color: var(--info);
}
.btn-edit:hover {
    background: rgba(79, 195, 247, 0.12);
    border-color: var(--info);
}
.btn-delete {
    color: var(--danger);
}
.btn-delete:hover {
    background: rgba(231, 76, 60, 0.12);
    border-color: var(--danger);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.status-pending { background: rgba(243, 156, 18, 0.15); color: #f39c12; }
.status-paid, .status-confirmed, .status-answered { background: rgba(46, 204, 113, 0.15); color: var(--success); }
.status-shipped, .status-in_progress { background: rgba(79, 195, 247, 0.15); color: var(--info); }
.status-delivered, .status-completed, .status-closed { background: rgba(120, 130, 145, 0.18); color: var(--text-muted); }
.status-canceled { background: rgba(231, 76, 60, 0.15); color: var(--danger); }
.status-open { background: rgba(201, 169, 110, 0.15); color: var(--accent); }

/* Shared "are you sure" confirmation card (categories/products/brands/coupons + support tickets) */
.confirm-delete-box {
    max-width: 420px;
    margin: 3rem auto;
    text-align: center;
    background: var(--bg-card);
    border-radius: 28px;
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}
.confirm-delete-box h1, .confirm-delete-box h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}
.confirm-delete-box p {
    color: var(--text-secondary);
    font-weight: 300;
    font-size: 1rem;
    margin: 1rem 0 1.5rem;
}
.confirm-delete-box strong {
    color: var(--text-primary);
}
.confirm-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}
.btn-delete-confirm {
    padding: 0.7rem 2rem;
    border: none;
    border-radius: 40px;
    background: var(--danger);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: 'Vazirmatn', sans-serif;
    cursor: pointer;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.btn-delete-confirm:hover {
    background: var(--danger-hover);
    transform: translateY(-2px);
}
.btn-cancel {
    padding: 0.7rem 2rem;
    border-radius: 40px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    transition: 0.3s;
}
.btn-cancel:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

.btn-back {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    transition: 0.3s;
}
.btn-back:hover {
    color: var(--accent);
}

/* Generic empty-state used on order/appointment/ticket list pages */
.empty-state {
    text-align: center;
    padding: 4rem 1.5rem;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: 24px;
    color: var(--text-secondary);
}
.empty-state i {
    font-size: 2.6rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: block;
}
.empty-state h3 {
    color: var(--text-primary);
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.empty-state .btn-primary-new {
    margin-top: 1.2rem;
}

/* ==========================================================================
   Site-wide mobile responsiveness
   ========================================================================== */
@media (max-width: 576px) {
    .auth-card {
        padding: 2rem 1.3rem !important;
        border-radius: 20px !important;
    }
    .admin-header {
        flex-direction: column;
        align-items: stretch;
    }
    .admin-header .btn-primary-new {
        justify-content: center;
    }
    .confirm-delete-box {
        margin: 1.5rem 0.75rem;
        padding: 2rem 1.3rem;
    }
    .confirm-actions {
        flex-direction: column;
    }
    .confirm-actions a,
    .confirm-actions button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 70px;
    }
    .logo-text {
        font-size: 1.4rem !important;
    }
}

/* ---- main.js helpers ---------------------------------------------------- */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: none;
}
@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

.back-to-top {
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--accent);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}
.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}
.back-to-top:hover {
    color: #14110a;
    background: var(--accent);
}
@media (max-width: 480px) {
    .back-to-top {
        bottom: 4.25rem; /* clear space above any sticky mobile nav */
        left: 0.85rem;
        width: 42px;
        height: 42px;
    }
}
