/* ===== تم روشن ایرانی (مدرن) ===== */
:root {
    --bg-body: #F8F5F0;
    --bg-card: #FFFFFF;
    --text-primary: #3D2A1F;
    --text-secondary: #7B5E4A;
    --border: #EDE3D6;
    --accent: #9E7B5C;        /* قهوه‌ای-سفالی */
    --accent-dark: #7D5A3E;
    --accent-light: #C5A17E;
    --secondary: #6B8C5C;      /* سبز دودی (اصالت ایرانی) */
    --shadow: 0 6px 18px rgba(0,0,0,0.06);
    --header-bg: #FFFFFF;
}

/* ===== تم تیره ایرانی (مدرن) ===== */
body.dark {
    --bg-body: #1A1714;
    --bg-card: #2C2520;
    --text-primary: #F2EBE4;
    --text-secondary: #C7B7AA;
    --border: #40362F;
    --accent: #B58B6C;
    --accent-dark: #906E53;
    --accent-light: #D4A882;
    --secondary: #8AAE7A;
    --shadow: 0 6px 18px rgba(0,0,0,0.3);
    --header-bg: #2C2520;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    direction: rtl;
    line-height: 1.5;
}

.persian-screen {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-body);
}

/* ========== هدر (مینیمال) ========== */
.persian-header {
    background: var(--header-bg);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.header-logo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--secondary);
}
.header-text {
    text-align: right;
    flex: 1;
}
.header-text h1 {
    font-size: 1.3rem;
    margin: 0;
    line-height: 1.3;
}
.header-text p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 4px 0 0;
}
@media (max-width: 380px) {
    .header-logo { width: 48px; height: 48px; }
    .header-text h1 { font-size: 1.1rem; }
}

/* ========== جستجو ========== */
.persian-search {
    margin: 16px;
    position: relative;
}
.persian-search i {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    font-size: 1.2rem;
}
.persian-search input {
    width: 100%;
    padding: 12px 45px 12px 16px;
    border: 1px solid var(--border);
    border-radius: 60px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.95rem;
}
.persian-search input:focus {
    outline: none;
    border-color: var(--accent);
}

/* ========== دسته‌بندی (دکمه‌های بزرگ با آیکون) ========== */
.persian-categories {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 8px 16px 16px;
    margin-bottom: 8px;
    scrollbar-width: none;
}
.persian-categories::-webkit-scrollbar {
    display: none;
}
.cat-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 60px;
    padding: 10px 24px;
    white-space: nowrap;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    box-shadow: var(--shadow);
}
.cat-btn i {
    font-size: 1.3rem;
    color: var(--accent);
}
.cat-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}
.cat-btn.active i {
    color: white;
}

/* ========== پروموشن (اختیاری) ========== */
.persian-promo {
    margin: 16px;
    background: linear-gradient(135deg, var(--secondary), var(--accent-dark));
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    color: white;
}
.promo-content { flex: 1; }
.promo-content h3 { font-size: 1rem; margin-bottom: 6px; }
.promo-content p { font-size: 0.8rem; margin-bottom: 12px; opacity: 0.9; }
.promo-btn {
    background: white;
    color: var(--accent-dark);
    padding: 6px 16px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: bold;
}
.promo-img {
    width: 140px;
    height: 120px;
    object-fit: cover;
    border-radius: 20px;
    margin-right: 12px;
    border: 2px solid white;
}

/* ========== محصولات – تصویر دایره، کارت عمودی ========== */
.persian-products {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 16px;
}
.product-card {
    background: var(--bg-card);
    border-radius: 28px;
    overflow: hidden;
    padding: 16px 12px 12px;
    text-align: center;
    transition: 0.2s;
    border: 1px solid var(--border);
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}
.product-img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: block;
    border: 3px solid var(--secondary);
}
.product-name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 6px;
}
.product-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-price {
    font-weight: 800;
    color: var(--accent);
    font-size: 1rem;
    margin: 8px 0;
}
.product-price del {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-left: 6px;
}
.discount-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #E67E22;
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 30px;
}
.details-btn {
    background: transparent;
    border: 1.5px solid var(--accent);
    border-radius: 40px;
    padding: 6px 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
    margin-top: 6px;
}
.details-btn:hover {
    background: var(--accent);
    color: white;
}
.empty-state {
    text-align: center;
    padding: 60px;
    color: var(--text-secondary);
    display: none;
}

/* ========== فوتر ========== */
.persian-footer {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    margin-top: 24px;
}
.persian-footer a {
    color: var(--accent);
    text-decoration: none;
}

/* ========== مودال (مشابه قبل) ========== */
.persian-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: var(--bg-card);
    max-width: 90%;
    width: 350px;
    border-radius: 32px;
    padding: 20px;
    position: relative;
}
.modal-close {
    position: absolute;
    left: 15px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-primary);
}
.modal-content img {
    width: 100%;
    border-radius: 20px;
    margin-bottom: 16px;
}
.share-buttons {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    justify-content: center;
}
.share-buttons button, .share-buttons a {
    background: var(--bg-body);
    padding: 6px 12px;
    border-radius: 30px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.8rem;
    border: none;
    cursor: pointer;
}

/* ========== پرلودر ========== */
#preloader {
    position: fixed;
    inset: 0;
    background: var(--bg-body);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}
.loader-persian {
    width: 55px;
    height: 55px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 0.8s infinite alternate;
    margin: 0 auto 16px;
}
@keyframes pulse {
    from { transform: scale(0.8); opacity: 0.6; }
    to { transform: scale(1.1); opacity: 1; }
}
.loader-box { text-align: center; }
.loader-logo { width: 60px; height: 60px; border-radius: 50%; margin-bottom: 16px; }
#preloader.hide { opacity: 0; visibility: hidden; }

/* ========== برچسب تخفیف و تمام شد ========== */
.discount-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #E67E22;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 30px;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.soldout-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #7F8C8D;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 30px;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.product-card {
    position: relative; /* برای قرارگیری برچسب‌ها به صورت absolute نسبت به کارت */
}
