/* ============================================================
   BASE — مشترک بین فرانت و ادمین
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #ffffff;
    --soft: #f6f6f4;
    --text: #141414;
    --muted: #8a8a8a;
    --line: #ececec;

    --accent: #ff5a1f;
    --accent-soft: #fff1eb;
    --accent-dark: #e64a12;

    --primary: var(--accent);
    --primary-dark: var(--accent-dark);
    --primary-light: var(--accent-soft);
    --text-dark: var(--text);
    --text-muted: var(--muted);
    --border: var(--line);

    --r: 14px;
    --radius: 14px;

    --shadow-sm: 0 2px 8px rgba(0,0,0,.05);
    --shadow-md: 0 8px 24px rgba(0,0,0,.08);
    --shadow-lg: 0 16px 40px rgba(0,0,0,.1);
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 14px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ============================================================
   FRONTEND — TOP BAR
   ============================================================ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255,255,255,.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.topbar-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.brand-logo-ph {
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 1.1rem;
}

.brand-text { min-width: 0; }

.brand-text h1 {
    font-size: .95rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-hours {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .7rem;
    color: var(--muted);
}

.brand-hours i { font-size: .7rem; }

.topbar-nav { display: flex; gap: 4px; flex-shrink: 0; }

.tb-link {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 1rem;
    transition: all .2s;
}

.tb-link.active,
.tb-link:hover {
    background: var(--text);
    color: #fff;
}

/* ============================================================
   FRONTEND — FILTER
   ============================================================ */
.filter-bar {
    position: sticky;
    top: 61px;
    z-index: 30;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    padding: 10px 16px;
    transition: box-shadow .25s;
}

.filter-bar.stuck {
    box-shadow: 0 4px 16px rgba(0,0,0,.04);
}

.filter-inner {
    max-width: 1080px;
    margin: 0 auto;
}

/* پوشش fade دو طرف */
.pills-wrap {
    position: relative;
}

.pills-wrap::before,
.pills-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 24px;
    pointer-events: none;
    z-index: 2;
    opacity: 1;
    transition: opacity .25s;
}

.pills-wrap::before {
    right: 0;
    background: linear-gradient(to left, rgba(255,255,255,1), rgba(255,255,255,0));
}

.pills-wrap::after {
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0));
}

.pills-wrap.at-start::before { opacity: 0; }
.pills-wrap.at-end::after    { opacity: 0; }
.pills-wrap.no-scroll::before,
.pills-wrap.no-scroll::after { opacity: 0; }

.pills {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    padding: 2px 24px;
    scroll-behavior: smooth;
}

.pills::-webkit-scrollbar { display: none; }

.pill {
    flex-shrink: 0;
    padding: 7px 15px;
    border-radius: 999px;
    background: var(--soft);
    border: 1px solid transparent;
    font-size: .78rem;
    font-weight: 600;
    color: var(--muted);
    transition: all .2s;
    white-space: nowrap;
    cursor: pointer;
}

.pill:hover:not(.active) {
    color: var(--text);
    background: #eeeeec;
}

.pill.active {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
}

/* ============================================================
   FRONTEND — MENU GRID
   ============================================================ */
.menu-section {
    max-width: 1080px;
    margin: 0 auto;
    padding: 16px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* ============================================================
   FRONTEND — CARD
   ============================================================ */
.card-item {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color .2s, transform .2s, box-shadow .2s;
}

.card-item:hover {
    border-color: #d8d8d8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.06);
}

.card-item .card-img {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--soft);
    overflow: hidden;
}

.card-item .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s;
}

.card-item:hover .card-img img { transform: scale(1.04); }

.card-noimg {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #c8c8c8;
    font-size: 1.5rem;
}

.card-info {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.card-title {
    font-size: .85rem;
    font-weight: 700;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-desc {
    font-size: .72rem;
    color: var(--muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-price {
    margin-top: auto;
    padding-top: 6px;
    font-size: .92rem;
    font-weight: 800;
    color: var(--text);
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.card-price span {
    font-size: .68rem;
    font-weight: 500;
    color: var(--muted);
}

/* ============================================================
   FRONTEND — EMPTY
   ============================================================ */
.empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 16px;
    color: var(--muted);
    font-size: .85rem;
}

.empty i {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
    opacity: .4;
}

/* ============================================================
   FRONTEND — CONTACT (v2)
   ============================================================ */
.contact {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 16px 56px;
    display: grid;
    gap: 16px;
}

/* ----- کارت تماس ----- */
.contact-card {
    background: var(--soft);
    border-radius: var(--r);
    padding: 24px 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    height: 100%;
}

.contact-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.contact-head-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.contact-head-text h2 {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 4px;
    line-height: 1.3;
}

.contact-sub {
    font-size: .8rem;
    color: var(--muted);
    line-height: 1.6;
}

.contact-sub strong {
    color: var(--text);
    font-weight: 700;
}

/* ----- دکمه‌های تماس ----- */
.contact-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.c-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--line);
    font-size: .84rem;
    font-weight: 600;
    transition: all .2s;
    text-align: right;
}

.c-link:hover {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
    transform: translateX(-3px);
}

.c-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.c-link span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.c-link-accent {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.c-link-accent:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

/* ----- دکمه بلد ----- */
.c-link-balad {
    background: #f0fdf4;
    color: #15803d;
    border-color: #bbf7d0;
    margin-top: 6px;
}

.c-link-balad:hover {
    background: #15803d;
    color: #fff;
    border-color: #15803d;
}

/* ----- نقشه ----- */
.contact-map {
    border-radius: var(--r);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--soft);
    min-height: 320px;
    height: 100%;
    display: flex;
}

.contact-map iframe {
    width: 100%;
    height: 100%;
    min-height: 320px;
    border: 0;
    display: block;
    flex: 1;
}

/* ============================================================
   FRONTEND — FOOTER
   ============================================================ */
.footer {
    text-align: center;
    padding: 16px;
    font-size: .72rem;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

/* ============================================================
   FRONTEND — FAB (Floating Call)
   ============================================================ */
.fab {
    position: fixed;
    bottom: 16px;
    left: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    box-shadow: 0 6px 20px rgba(255,90,31,.35);
    z-index: 60;
    transition: transform .2s;
}

.fab:hover { transform: scale(1.06); }

/* ============================================================
   FRONTEND — RESPONSIVE
   ============================================================ */
@media (min-width: 560px) {
    .menu-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    .card-title { font-size: .88rem; }
    .card-desc { -webkit-line-clamp: 2; }
}

@media (min-width: 900px) {
    .menu-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
    }
    .contact {
        grid-template-columns: 1fr 1.2fr;
        align-items: stretch;
    }
    .contact-card {
        text-align: right;
    }
}

@media (max-width: 899px) {
    .contact-card {
        text-align: center;
    }
    .contact-head {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .menu-grid { gap: 8px; }
    .card-info { padding: 8px 10px 10px; }
    .card-title { font-size: .8rem; }
    .card-price { font-size: .85rem; }
}

/* ============================================================
   ADMIN PANEL
   ============================================================ */
.admin-body {
    background: var(--soft);
    min-height: 100vh;
}

.admin-header {
    background: var(--accent);
    color: #fff;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-header a {
    color: #fff;
    text-decoration: none;
    opacity: .9;
}

.admin-header a:hover { opacity: 1; }

.admin-nav {
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 4px;
    padding: 0 24px;
    overflow-x: auto;
    scrollbar-width: none;
}

.admin-nav::-webkit-scrollbar { display: none; }

.admin-nav a {
    padding: 14px 16px;
    text-decoration: none;
    color: var(--muted);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color .2s, border-color .2s;
}

.admin-nav a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 700;
}

.admin-nav a:hover:not(.active) { color: var(--text); }

.admin-container {
    max-width: 900px;
    margin: 24px auto;
    padding: 0 20px 60px;
}

/* ============================================================
   ADMIN — CARD
   ============================================================ */
.admin-container .card,
.login-wrap {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 24px;
    margin-bottom: 20px;
}

.admin-container .card h2 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 17px;
    font-weight: 700;
}

/* ============================================================
   ADMIN — FORM ELEMENTS
   ============================================================ */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
}

.form-group input[type=text],
.form-group input[type=number],
.form-group input[type=password],
.form-group input[type=url],
.form-group input[type=email],
.form-group input[type=file],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ============================================================
   ADMIN — BUTTONS
   ============================================================ */
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 11px 24px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, transform .15s;
}

.btn:hover { background: var(--accent-dark); }

.btn.secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--line);
}

.btn.secondary:hover { background: var(--soft); }

.btn.danger {
    background: #dc2626;
}

.btn.danger:hover { background: #b91c1c; }

.btn.small {
    padding: 6px 14px;
    font-size: 13px;
}

/* ============================================================
   ADMIN — TABLE
   ============================================================ */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    text-align: right;
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    vertical-align: middle;
}

.admin-table th {
    font-weight: 700;
    color: var(--muted);
    font-size: 13px;
}

.admin-table img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
}

.actions-cell {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ============================================================
   ADMIN — ALERTS
   ============================================================ */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
}

/* ============================================================
   ADMIN — LOGIN
   ============================================================ */
.login-wrap {
    max-width: 380px;
    margin: 80px auto;
    padding: 32px;
}

.login-wrap h1 {
    text-align: center;
    font-size: 20px;
    margin-bottom: 24px;
    font-weight: 800;
}

/* ============================================================
   ADMIN — CURRENT THUMB
   ============================================================ */
.current-thumb {
    display: block;
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 8px;
    border: 1px solid var(--line);
}

/* ============================================================
   ADMIN — COLOR PICKER
   ============================================================ */
.color-palette-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.color-pick-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.color-pick-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 12px;
    background: #fff;
}

.color-pick-swatch {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 2px solid var(--line);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.color-pick-swatch input[type=color] {
    position: absolute;
    inset: -4px;
    width: calc(100% + 8px);
    height: calc(100% + 8px);
    border: none;
    cursor: pointer;
    padding: 0;
    background: none;
}

.color-pick-hex {
    flex: 1;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    direction: ltr;
    text-align: left;
    background: transparent;
}

.color-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.color-preset {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 2px solid var(--line);
    cursor: pointer;
    transition: transform .15s, border-color .15s;
}

.color-preset:hover {
    transform: scale(1.12);
    border-color: var(--text);
}

/* ============================================================
   ADMIN — RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
    .color-palette-group { grid-template-columns: 1fr; }
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--soft);
    border: 1px solid transparent;
    font-size: .78rem;
    font-weight: 600;
    color: var(--muted);
    transition: all .2s;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
}

.pill i {
    font-size: .95rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.pill:hover:not(.active) {
    color: var(--text);
    background: #eeeeec;
}

.pill.active {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
}