@font-face {
    font-family: 'IRANYekanX';
    src: url('https://adin1.ir/c/assets/fonts/IRANYekanX-Regular.woff2') format('woff2');
    font-weight: 400;
}

@font-face {
    font-family: 'IRANYekanX';
    src: url('https://adin1.ir/c/assets/fonts/IRANYekanX-Medium.woff2') format('woff2');
    font-weight: 500;
}

@font-face {
    font-family: 'IRANYekanX';
    src: url('https://adin1.ir/c/assets/fonts/IRANYekanX-Bold.woff2') format('woff2');
    font-weight: 700;
}

@font-face {
    font-family: 'IRANYekanX';
    src: url('https://adin1.ir/c/assets/fonts/IRANYekanX-ExtraBlack.woff2') format('woff2');
    font-weight: 800;
}


/* ===========================================================
   آدین کاتالوگ — استایل اصلی
   پالت: سفید/کرم گرم + طلایی برند + سبز(افزایش) و قرمز(افزودن به سبد)
   =========================================================== */

:root {
    --bg: #FAF8F4;
    --bg-soft: #F1ECE1;
    --surface: #FFFFFF;
    --ink: #1C1B19;
    --ink-soft: #6B6560;
    --line: #E7E1D3;

    --gold: #C9A227;
    --gold-deep: #A9812A;
    --gold-tint: #F6ECC9;

    --red: #D64545;
    --red-tint: #FBE7E7;
    --green: #2E8B57;
    --green-tint: #E4F3EA;

    --always-white: #FFFFFF;
    --always-black: #1C1B19;

    /* برای appbar/هدر/تگ قیمت: همیشه یک سطح تیره‌ی ثابت، مستقل از تم، تا با چرخش --ink خراب نشود */
    --bar: #1C1B19;
    --bar-ink: #FFFFFF;

    --radius-s: 8px;
    --radius-m: 14px;
    --radius-l: 22px;
    --shadow-1: 0 2px 10px rgba(28, 27, 25, .06);
    --shadow-2: 0 10px 30px rgba(28, 27, 25, .12);
}

:root[data-theme="dark"] {
    --bg: #16151A;
    --bg-soft: #1E1D24;
    --surface: #211F26;
    --ink: #F3F1EC;
    --ink-soft: #A7A29C;
    --line: #33313A;

    --gold: #E0B93C;
    --gold-deep: #C9A227;
    --gold-tint: #3A331A;

    --red-tint: #3A2020;
    --green-tint: #1B2E24;
    --bar: #0E0D11;
    --bar-ink: #F3F1EC;
    --shadow-1: 0 2px 10px rgba(0, 0, 0, .35);
    --shadow-2: 0 10px 30px rgba(0, 0, 0, .5);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
}

* {
    -webkit-tap-highlight-color: transparent;
}

/* --- انیمیشن دایره‌ای تعویض تم (مثل تلگرام) با View Transition API --- */
::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}
::view-transition-old(root) {
    z-index: 1;
}
::view-transition-new(root) {
    z-index: 2;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: "IRANYekanX", Tahoma, sans-serif;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color .35s ease, color .35s ease;
}

/* تغییر تم روشن/تاریک نرم و آرام باشد، شبیه انیمیشن تعویض صفحات */
*, *::before, *::after {
    transition: background-color .35s ease, color .35s ease, border-color .35s ease, box-shadow .35s ease;
}

button {
    font-family: inherit;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

::selection {
    background: var(--gold);
    color: var(--always-black);
}

.num {
    font-feature-settings: "tnum" 1;
    font-variant-numeric: tabular-nums;
}

/* ---------- ساختار کلی صفحات ---------- */
.page {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px) scale(.985);
    transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
    pointer-events: none;
    z-index: 1;
}

.page.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition: opacity .24s ease, transform .24s ease;
    pointer-events: auto;
    z-index: 2;
}

.page-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.container {
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
}

/* ---------- اسپلش ---------- */
#page-splash {
    align-items: center;
    justify-content: center;
}

.splash-mark {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(155deg, var(--gold) 0%, var(--gold-deep) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--always-white);
    font-weight: 800;
    font-size: 26px;
    box-shadow: var(--shadow-2);
    animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.06);
    }
}

/* ---------- اینترو ---------- */
.intro-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
    flex: 1;
    padding: 32px 24px;
    gap: 6px;
}

.intro-mark {
    width: 96px;
    height: 96px;
    border-radius: 26px;
    background: linear-gradient(155deg, var(--gold) 0%, var(--gold-deep) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--always-white);
    font-weight: 800;
    font-size: 38px;
    box-shadow: var(--shadow-2);
    margin-bottom: 22px;
}

.intro-title {
    font-size: 20px;
    font-weight: 800;
    margin: 2px 0;
}

.intro-store {
    font-size: 18px;
    font-weight: 800;
    color: var(--gold-deep);
    margin: 2px 0 18px;
}

.intro-status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink-soft);
    font-size: 13px;
    margin-top: 8px;
}

.spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2.5px solid var(--gold-tint);
    border-top-color: var(--gold);
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.intro-footer {
    padding: 14px;
    text-align: center;
    background: var(--bar);
    color: var(--bar-ink);
    font-size: 12px;
}

.intro-footer a {
    color: var(--gold);
    font-weight: 700;
}

/* ---------- دکمه‌ها ---------- */
.btn {
    border: none;
    cursor: pointer;
    border-radius: 999px;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform .12s ease, filter .12s ease, opacity .12s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
    outline: none;
}

.btn:active {
    transform: scale(.97);
}

.btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.btn-gold {
    background: linear-gradient(155deg, var(--gold) 0%, var(--gold-deep) 100%);
    color: var(--always-black);
    box-shadow: 0 6px 16px rgba(201, 162, 39, .35);
}

.btn-red {
    background: var(--red);
    color: var(--always-white);
    box-shadow: 0 6px 16px rgba(214, 69, 69, .30);
}

.btn-border {
    background: transparent;
    border: 1.5px solid var(--line);
    color: var(--ink-soft);
}

.btn-ghost {
    background: transparent;
    color: var(--gold-deep);
    padding: 6px 10px;
}

.btn-block {
    width: 100%;
}

.btn:hover {
    filter: brightness(1.04);
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: inherit;
    transition: background .15s ease;
}

.icon-btn:hover {
    background: rgba(0, 0, 0, .06);
}

:root[data-theme="dark"] .icon-btn:hover {
    background: rgba(255, 255, 255, .08);
}

/* ---------- بارگذاری/خطا ---------- */
.error-box {
    border: 1.5px solid var(--red);
    color: var(--red);
    border-radius: var(--radius-m);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    cursor: pointer;
    max-width: 320px;
}

/* ================= صفحه لیست ================= */
.appbar {
    height: 56px;
    min-height: 56px;
    background: var(--bar);
    color: var(--bar-ink);
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 4px;
}

.appbar-title {
    font-weight: 800;
    font-size: 16px;
    flex: 1;
    padding-right: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.appbar .icon-btn {
    color: var(--bar-ink);
    position: relative;
}

.appbar .icon-btn:hover {
    background: rgba(255, 255, 255, .12);
}

.filter-dot {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red);
    border: 1.5px solid var(--bar);
}

/* --- دیالوگ فیلتر گروه --- */
.filter-group-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 60vh;
    overflow-y: auto;
    margin-top: 10px;
}

.filter-group-btn {
    text-align: right;
    border: 1.5px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    border-radius: var(--radius-s);
    padding: 10px 14px;
    font-family: inherit;
    font-size: 13.5px;
    cursor: pointer;
}

.filter-group-btn.sub {
    margin-right: 18px;
    font-size: 12.5px;
    color: var(--ink-soft);
}

.filter-group-btn.active {
    border-color: var(--gold);
    background: var(--gold-tint);
    color: var(--gold-deep);
    font-weight: 700;
}

.filter-sub-title {
    font-size: 12px;
    color: var(--ink-soft);
    margin: 14px 2px 2px;
    font-weight: 700;
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .08);
    border-radius: 8px;
    padding: 0 10px;
    height: 38px;
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--always-white);
    font-family: inherit;
    font-size: 14px;
    flex: 1;
}

.search-box .search-icon {
    display: flex;
    color: rgba(255, 255, 255, .55);
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, .5);
}

.empty-ui {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
    gap: 10px;
    padding: 60px 20px;
    text-align: center;
}

/* --- دکمه‌ی شناور بازگشت به بالا --- */
.scroll-top-btn {
    position: absolute;
    bottom: 100px;
    right: 16px;
    z-index: 10;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--gold);
    color: var(--always-black);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-2);
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px) scale(.9);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.scroll-top-btn.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* --- لیست کالا: حالت لیستی --- */
#list-view-list {
    padding: 6px 10px 190px;
}

/* انیمیشن ورود نرم برای آیتم‌های لیست/گرید هنگام ظاهر شدن */
@keyframes itemFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- تیک نمایش فقط کالاهای موجود --- */
.instock-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 4px;
    font-size: 12.5px;
    color: var(--ink-soft);
    cursor: pointer;
    user-select: none;
    width: fit-content;
}
.instock-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.instock-toggle-box {
    width: 17px;
    height: 17px;
    border-radius: 5px;
    border: 1.5px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s ease, border-color .15s ease;
}
.instock-toggle-box svg {
    width: 12px;
    height: 12px;
    color: var(--always-white);
    opacity: 0;
    transition: opacity .12s ease;
}
.instock-toggle input:checked + .instock-toggle-box {
    background: var(--gold);
    border-color: var(--gold);
}
.instock-toggle input:checked + .instock-toggle-box svg {
    opacity: 1;
}
.list-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.list-count-pill {
    font-size: 11px;
    font-weight: 700;
    color: var(--gold-deep);
    background: var(--gold-tint);
    border-radius: 999px;
    padding: 4px 12px;
    white-space: nowrap;
}

.row-item {
    animation: itemFadeIn .3s ease both;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border-radius: var(--radius-m);
    padding: 8px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-1);
    cursor: pointer;
    content-visibility: auto;
    contain-intrinsic-size: 0 88px;
}

.row-item:hover {
    box-shadow: var(--shadow-2);
}

/* --- افکت لودینگ آرام (shimmer) قبل از بارگذاری تصویر کالا --- */
@keyframes imgShimmer {
    0% { background-position: -135% 0; }
    100% { background-position: 135% 0; }
}
.row-thumb, .grid-thumb, .detail-img {
    background-image: linear-gradient(90deg, var(--bg-soft) 20%, var(--line) 45%, var(--bg-soft) 70%);
    background-size: 250% 100%;
    animation: imgShimmer 1.7s ease-in-out infinite;
}
.row-thumb.img-loaded, .grid-thumb.img-loaded, .detail-img.img-loaded {
    animation: none;
    background-image: none;
}
/* آیکن جایگزین وقتی کالا عکس ندارد — نسبت به قبل حدود ۳۰٪ بزرگ‌تر و هم‌رنگ با آیکن‌های دیگر سایت */
.no-image-icon {
    width: 34%;
    height: 34%;
    opacity: .8;
}
@media (prefers-reduced-motion: reduce) {
    .row-thumb, .grid-thumb, .detail-img { animation: none; }
}

.row-thumb {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    flex-shrink: 0;
    overflow: hidden;
    background-color: var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
}

.row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    position: relative;
    z-index: 1;
    transition: opacity .45s ease;
}

.row-info {
    flex: 1;
    min-width: 0;
}

.row-name {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
}

.item-group-label {
    font-size: 11px;
    color: var(--gold-deep);
    background: var(--gold-tint);
    border-radius: 6px;
    padding: 1px 7px;
    display: inline-block;
    margin-bottom: 4px;
}

.row-price {
    font-size: 13px;
}

.row-trailing {
    flex-shrink: 0;
    padding-left: 4px;
}

/* --- لیست کالا: حالت گرید --- */
#list-view-grid {
    padding: 4px 8px 190px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.grid-card {
    animation: itemFadeIn .3s ease both;
    background: var(--surface);
    border-radius: var(--radius-m);
    overflow: hidden;
    box-shadow: var(--shadow-1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    padding-bottom: 10px;
    content-visibility: auto;
    contain-intrinsic-size: 0 230px;
}

.grid-card:hover {
    box-shadow: var(--shadow-2);
}

.grid-thumb {
    width: 100%;
    aspect-ratio: 1/1;
    background-color: var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
    overflow: hidden;
}

.grid-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    position: relative;
    z-index: 1;
    transition: opacity .45s ease;
}

.grid-name {
    font-weight: 700;
    font-size: 13px;
    text-align: center;
    padding: 8px 8px 2px;
}

.grid-price {
    text-align: center;
    font-size: 13px;
    margin-bottom: 8px;
}

.grid-picker {
    display: flex;
    justify-content: center;
    margin-top: auto;
    padding: 0 8px;
}
.grid-picker .qty-add, .grid-picker .qty-pill, .grid-picker .qty-oos {
    width: 100%;
    max-width: 116px;
}

/* --- انتخاب‌گر تعداد --- */
/* هر سه حالت (افزودن / پیل تعداد / عدم موجودی) دقیقا هم‌اندازه‌اند */
.qty-add, .qty-pill, .qty-oos {
    width: 116px;
    height: 38px;
    box-sizing: border-box;
}

.qty-add {
    position: relative;
    font-size: 11.5px;
    padding: 0;
    overflow: hidden;
}
/* ابتدا فقط متن دیده می‌شود؛ با hover متن به پایین می‌رود و آیکن سبد از بالا با یک حرکت غیرخطی (فنری) وارد می‌شود */
.qty-add-label, .qty-add-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qty-add-label {
    transition: transform .44s cubic-bezier(.34, 1.28, .64, 1), opacity .3s ease;
}
.qty-add-icon {
    transform: translateY(-140%);
    opacity: 0;
    transition: transform .5s cubic-bezier(.34, 1.28, .64, 1), opacity .3s ease;
}
.qty-add-icon svg {
    width: 17px;
    height: 17px;
}
.qty-add:hover .qty-add-label {
    transform: translateY(140%);
    opacity: 0;
}
.qty-add:hover .qty-add-icon {
    transform: translateY(0);
    opacity: 1;
}

.qty-pill {
    border-radius: 999px;
    border: 1.5px solid var(--green);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    overflow: hidden;
    background: var(--surface);
}

.qty-pill button {
    border: none;
    background: transparent;
    width: 36px;
    height: 100%;
    flex-shrink: 0;
    cursor: pointer;
    color: var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.qty-pill button:disabled {
    color: rgba(28, 27, 25, .25);
    cursor: not-allowed;
}

.qty-pill .qty-val {
    flex: 1;
    text-align: center;
    font-weight: 800;
    color: var(--green);
    font-size: 14px;
    display: inline-block;
    overflow: hidden;
}

.qty-max {
    font-size: 10px;
    font-weight: 800;
    color: var(--red);
    padding: 0 10px;
}

.qty-oos {
    font-size: 11px;
    color: var(--ink-soft);
    border: 1.5px solid var(--line);
    border-radius: 999px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    cursor: not-allowed;
}

/* --- انیمیشن تغییر عدد: افزایش از بالا وارد می‌شود / کاهش از پایین وارد می‌شود --- */
@keyframes qtyInFromTop {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes qtyInFromBottom {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.qty-val.bump-up {
    animation: qtyInFromTop .22s ease-out;
}

.qty-val.bump-down {
    animation: qtyInFromBottom .22s ease-out;
}

/* --- نوار پایین جمع سفارش --- */
.bottom-bar {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    z-index: 20;
    backdrop-filter: blur(10px);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}

/* برای دکمه‌های حساس (مثل تایید و تکمیل سفارش) کاملا مات باشد تا هیچ محتوایی از پشت دیده نشود */
.bottom-bar-solid {
    backdrop-filter: none;
    background: var(--surface);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
}

#btn-clear-cart {
    color: var(--ink-soft);
    flex-shrink: 0;
}

#btn-clear-cart:hover {
    color: var(--red);
    background: var(--red-tint);
}

.sum-table {
    font-size: 12px;
    color: var(--ink-soft);
    line-height: 1.5;
}

.sum-table b {
    color: var(--ink);
}

.sum-table .sum-total {
    color: var(--gold-deep);
    font-size: 14px;
}

/* ================= صفحه جزئیات کالا (کاتالوگ) ================= */
.detail-topbar {
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    background: var(--bg-soft);
    flex-shrink: 0;
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    border-radius: 14px;
}

.detail-nav {
    font-size: 11px;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-counter {
    font-size: 12px;
    color: var(--ink-soft);
    flex: 1;
    text-align: center;
}

.detail-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.detail-slide {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 90px;
}

/* انیمیشن ورود ساده هنگام رفتن به کالای بعدی/قبلی (با دکمه، کیبورد یا سوایپ) */
@keyframes detailInNext {
    from {
        opacity: 0;
        transform: translateX(18px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes detailInPrev {
    from {
        opacity: 0;
        transform: translateX(-18px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.detail-slide.anim-in-next {
    animation: detailInNext .22s ease;
}

.detail-slide.anim-in-prev {
    animation: detailInPrev .22s ease;
}

.detail-imgwrap {
    display: flex;
    justify-content: flex-start;
    padding: 18px 20px 6px;
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.detail-img {
    width: min(64vw, 340px);
    height: min(64vw, 340px);
    border-radius: 18px;
    overflow: hidden;
    background-color: var(--bg-soft);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
    cursor: zoom-in;
}

.detail-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
    opacity: 0;
    position: relative;
    z-index: 1;
    transition: opacity .45s ease;
}

.detail-info {
    padding: 10px 20px 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.detail-info .item-group-label {
    align-self: flex-start;
}

.detail-name {
    font-size: 19px;
    font-weight: 800;
    margin-bottom: 0;
}

.detail-desc-box {
    background: var(--bg-soft);
    border-radius: var(--radius-m);
    padding: 14px 16px;
    box-shadow: none;
    margin-top: 24px;
}

.detail-desc {
    font-size: 13.5px;
    color: var(--ink-soft);
    line-height: 1.9;
}

.detail-side-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 57px;
    height: 57px;
    font-size: 24px;
}

.detail-side-nav.next {
    left: 2px;
}

.detail-side-nav.prev {
    right: 2px;
}

/* --- تگ قیمت (عنصر امضادار) --- */
.price-tag {
    display: inline-flex;
    align-items: stretch;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-1);
    margin: 8px 0 0;
    height: 44px;
    align-self: flex-start;
}

.price-tag-label {
    background: var(--gold);
    color: var(--always-black);
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 14px;
    font-weight: 800;
}

.price-tag-sep {
    width: 2px;
    background-image: linear-gradient(var(--surface) 50%, transparent 0);
    background-size: 2px 8px;
    background-color: rgba(0, 0, 0, .18);
}

.price-tag-value {
    background: var(--bar);
    color: var(--bar-ink);
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 15px;
    font-weight: 800;
    gap: 5px;
}

/* --- فوتر افزودن/تعداد در صفحه جزئیات --- */
.detail-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 16px;
    display: flex;
    justify-content: center;
}

.detail-qty-box {
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    box-shadow: var(--shadow-2);
    width: 100%;
    max-width: 400px;
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 8px;
}

.detail-qty-box button {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--ink-soft);
    width: 38px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.detail-qty-mid {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.detail-qty-mid .qty-num {
    font-size: 24px;
    font-weight: 800;
}

.detail-qty-unit {
    font-size: 10px;
    color: var(--ink-soft);
}

/* ================= بازبینی سفارش ================= */
.page-header {
    height: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 6px;
    background: var(--bar);
    color: var(--bar-ink);
}

.page-header .icon-btn {
    color: var(--bar-ink);
}

.page-header .icon-btn:hover {
    background: rgba(255, 255, 255, .12);
}

.page-header h1 {
    font-size: 16px;
    font-weight: 800;
    margin: 0;
    flex: 1;
    padding-right: 4px;
}

.review-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--surface);
    border-radius: var(--radius-m);
    padding: 10px;
    margin: 0 12px 8px;
    box-shadow: var(--shadow-1);
    cursor: pointer;
}

.review-item:hover {
    box-shadow: var(--shadow-2);
}

.review-row-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.review-item .row-thumb {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.review-row-top .row-name {
    font-weight: 700;
    font-size: 14px;
}

.review-row-bottom {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 60px;
    -webkit-tap-highlight-color: transparent;
}

.review-row-bottom .row-price {
    color: var(--ink-soft);
    font-size: 13px;
}

.review-row-bottom .row-trailing {
    margin-right: auto;
}

.review-line-total {
    font-weight: 800;
    color: var(--gold-deep);
    font-size: 13px;
}

/* روی صفحه‌های خیلی کوچک، حاشیه‌ی هم‌ترازی با تصویر لازم نیست */
@media (max-width: 380px) {
    .review-row-bottom {
        padding-right: 0;
    }
}

.review-summary {
    margin: 14px 12px 90px;
    background: var(--gold-tint);
    border-radius: var(--radius-m);
    padding: 14px 16px;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.review-summary .grand {
    font-size: 16px;
    font-weight: 800;
    color: var(--gold-deep);
}

/* ================= اطلاعات کاربر ================= */
.form-wrap {
    padding: 24px 20px 60px;
    max-width: 480px;
    margin: 0 auto;
}

.form-title {
    font-weight: 800;
    font-size: 15px;
    margin-bottom: 22px;
    text-align: center;
}

.field {
    margin-bottom: 14px;
}

.field label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ink-soft);
    margin-bottom: 6px;
}
.field-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--gold-deep);
}

.field input, .field textarea {
    width: 100%;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-s);
    padding: 12px 14px;
    font-family: inherit;
    font-size: 14px;
    background: var(--surface);
    color: var(--ink);
    outline: none;
    transition: border-color .15s ease;
}

.field input:focus, .field textarea:focus {
    border-color: var(--gold);
}

.field textarea {
    resize: vertical;
    min-height: 64px;
}

.field-hint {
    font-size: 11px;
    color: var(--red);
    margin-top: 5px;
}

.code-timer {
    text-align: center;
    color: var(--ink-soft);
    font-size: 13px;
    margin-top: 14px;
}

/* ---------- دیالوگ/پاپ‌آپ ---------- */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 18, 14, .55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.overlay.active {
    display: flex;
}

.dialog {
    background: var(--surface);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-2);
    max-width: 380px;
    width: 100%;
    padding: 22px 20px;
    animation: pop .18s ease;
}

@keyframes pop {
    from {
        transform: scale(.92);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.dialog-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    font-size: 20px;
}

.dialog-icon.gold {
    background: var(--gold-tint);
    color: var(--gold-deep);
}

.dialog-icon.red {
    background: var(--red-tint);
    color: var(--red);
}

.dialog-icon.green {
    background: var(--green-tint);
    color: var(--green);
}

.dialog-title {
    font-weight: 800;
    font-size: 16px;
    margin-bottom: 8px;
}

.dialog-desc {
    font-size: 13px;
    color: var(--ink-soft);
    line-height: 1.8;
    margin-bottom: 18px;
    white-space: pre-line;
}

.dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.dialog-actions.center {
    justify-content: center;
}

.dialog-count-input {
    width: 100%;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-s);
    padding: 12px 14px;
    font-size: 16px;
    font-family: inherit;
    margin: 4px 0 8px;
    text-align: center;
    background: var(--bg-soft);
    color: var(--ink);
    outline: none;
}

.dialog-count-input:focus {
    border-color: var(--gold);
}

.dialog-count-max {
    font-size: 12px;
    color: var(--ink-soft);
    text-align: center;
    margin-bottom: 10px;
}

/* toast تصویر بزرگ */
.img-viewer {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .92);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
}

.img-viewer.active {
    display: flex;
}

.img-viewer img {
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 8px;
    touch-action: none;
    -webkit-user-drag: none;
    user-select: none;
    will-change: transform;
    cursor: zoom-in;
}

.img-viewer .icon-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    color: #fff;
    z-index: 1;
}

/* ---------- ریسپانسیو ---------- */
@media (max-width: 480px) {
    .intro-mark {
        width: 80px;
        height: 80px;
    }

    .detail-img {
        width: 70vw;
        height: 70vw;
    }

    #list-view-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

/* روی گوشی، عکس کالا وسط‌چین باشد؛ روی صفحه‌های بزرگ (دسکتاپ/تبلت) راست‌چین (مقدار پیش‌فرض بالاتر) */
.detail-group-label-top {
    margin: 14px 0 0;
    align-self: flex-start;
    max-width: 860px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: flex-start;
}

@media (max-width: 640px) {
    .detail-imgwrap {
        justify-content: center;
    }
    .detail-side-nav {
        display: none;
    }
}

/* ---------- دسترسی‌پذیری ---------- */
:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: .001s !important;
        transition-duration: .001s !important;
    }
}




/* ===== فیلتر گروه — نسخه‌ی جدید ===== */
.filter-tree {
    max-height: 62vh;
    overflow-y: auto;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 2px;
}

/* گروه اصلی: بولد و درشت */
.filter-main-btn {
    display: block;
    width: 100%;
    text-align: right;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 800;
    font-size: 16px;
    color: var(--ink);
    padding: 7px 10px;
    border-radius: 10px;
}
.filter-main-btn:hover { color: var(--gold-deep); }
.filter-main-btn.active {
    color: var(--gold-deep);
    background: var(--gold-tint);
}

/* زیرگروه‌ها: چیپ خاکستری ملایم، hover نارنجی‌طلایی */
.filter-subs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px 0;
}
.filter-sub-chip {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 12.5px;
    color: var(--ink-soft);
    background: var(--bg-soft);
    border-radius: 999px;
    padding: 7px 14px;
    transition: background .15s ease, color .15s ease;
}
.filter-sub-chip:hover {
    background: linear-gradient(135deg, #f3cf5b, #e8a13c);
    color: var(--always-black);
}
.filter-sub-chip.active {
    background: linear-gradient(135deg, var(--gold), var(--gold-deep));
    color: var(--always-black);
    font-weight: 700;
}

.filter-count {
    font-size: 10px;
    opacity: .7;
}
.filter-actions { margin-top: 16px; }