/* ═══════════════════════════════════════════════════════════
   سایت عمومی سبزینه‌ها — نسخه بازطراحی (داینامیک)
   تم: متصل به متغیرهای پنل مدیریت
   ═══════════════════════════════════════════════════════════ */

/* ─── متغیرها ─── */
:root {
    /* این مقادیر به صورت پیش‌فرض هستند، اما توسط site.php به صورت داینامیک مقداردهی می‌شوند */
    --header-color: #059669;
    --primary: var(--header-color);
    --primary-dark: #065f46;
    
    --hero-start: #22c55e;
    --hero-end: #16a34a;
    
    --btn-login-bg: #ffffff;
    --btn-login-text: #059669;

    --primary-hover: #047857;
    --primary-light: #d1fae5;
    --accent: #f59e0b;
    --bg: #f8fafc;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 16px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow: 0 4px 15px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.12);
}

/* ─── ریست ─── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Vazir', 'Vazirmatn', Tahoma, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.7;
    direction: rtl;
    min-height: 100vh;
    user-select: none;
    -webkit-user-select: none;
    -webkit-font-smoothing: antialiased;
}

input, textarea, select { user-select: text !important; -webkit-user-select: text !important; }
img { pointer-events: none; -webkit-user-drag: none; display: block; max-width: 100%; }
a { text-decoration: none; color: var(--primary); transition: color 0.2s; }
a:hover { color: var(--primary-hover); }

/* ─── تایپوگرافی ─── */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; color: var(--text); }
h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }
small { font-size: 0.85rem; color: var(--text-muted); }

/* ─── کانتینر ─── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ─── هدر ─── */
.site-header { position: sticky; top: 0; z-index: 9999; }

.main-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    padding: 16px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.site-logo { display: flex; align-items: center; gap: 12px; cursor: pointer; color: #fff; }
.site-logo:hover { color: #fff; text-decoration: none; }
.leaf-icon { stroke: var(--accent) !important; }
.logo-text { color: #fff !important; font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }

.site-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.site-nav a,
.site-nav .nav-link {
    color: #fff !important;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 14px;
    border-radius: 8px;
    transition: background 0.2s;
    cursor: pointer;
}
.site-nav a:hover,
.site-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff !important;
    text-decoration: none;
}

.cart-icon { display: inline-flex; align-items: center; padding: 8px !important; }
.cart-icon svg { stroke: var(--accent) !important; transition: transform 0.2s; }
.cart-icon:hover svg { transform: scale(1.1); }

/* 🟢 دکمه ورود با رنگ‌های داینامیک از پنل */
.btn-login {
    background: var(--btn-login-bg) !important;
    color: var(--btn-login-text) !important;
    padding: 10px 20px !important;
    border-radius: 50px !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
}
.btn-login:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    text-decoration: none;
}

.user-name { color: var(--accent) !important; font-weight: 700; padding: 0 10px; }

/* ─── نوار شعار ─── */
.slogan-bar {
    background-color: #fff;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    width: 100%;
    direction: ltr;
    position: relative;
}
.marquee-text {
    display: inline-block;
    white-space: nowrap;
    color: var(--primary); /* رنگ شعار از متغیر اصلی استفاده می‌کند */
    font-weight: 700;
    font-size: 1.05rem;
    animation: scroll-left-to-right 18s linear infinite;
    padding-left: 100%;
}
@keyframes scroll-left-to-right {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(0); }
}

/* ─── محتوای اصلی ─── */
.site-main { min-height: calc(100vh - 300px); padding-bottom: 40px; }

/* ─── عنوان صفحه ─── */
.page-title {
    text-align: center;
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-dark);
    margin: 40px 0 30px;
    position: relative;
    letter-spacing: -0.5px;
}
.page-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--primary));
    margin: 15px auto 0;
    border-radius: 2px;
}

/* ─── عنوان دسته (در صفحه اصلی و صفحات دیگر) ─── */
.category-title {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: inline-block;
    padding: 10px 24px;
    border-radius: 30px;
    margin: 0 20px 24px 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* ─── اسکرول افقی ─── */
.categories-scroll {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scroll-behavior: smooth !important;
    scroll-snap-type: x mandatory !important;
    gap: 20px !important;
    padding: 20px 20px 30px 20px !important;
    max-width: 1200px !important;
    margin: 0 auto 40px !important;
    direction: rtl !important;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-light) transparent;
}
.categories-scroll::-webkit-scrollbar { height: 8px; }
.categories-scroll::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px; }
.categories-scroll::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }
.categories-scroll::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }

/* ─── کارت اپ ─── */
.app-card {
    flex: 0 0 240px !important;
    scroll-snap-align: start !important;
    background: #fff !important;
    border-radius: var(--radius) !important;
    overflow: hidden !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    border: 1.5px solid var(--border) !important;
    text-decoration: none;
    color: inherit;
    position: relative;
}
.app-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0; left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.3s;
}
.app-card:hover {
    transform: translateY(-6px) !important;
    box-shadow: var(--shadow-lg) !important;
    border-color: var(--primary) !important;
    color: inherit;
    text-decoration: none;
}
.app-card:hover::before { opacity: 1; }

@media (max-width: 600px) { .app-card { flex: 0 0 75vw !important; } }
@media (min-width: 1024px) { .app-card { flex: 0 0 260px !important; } }

.app-card-image {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%) !important;
    margin: 12px 12px 0 12px !important;
    border-radius: var(--radius-sm) !important;
    padding: 16px !important;
    height: 200px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}
.app-card-image img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    border-radius: 8px !important;
}
.app-card-body {
    padding: 16px !important;
    text-align: center !important;
    background: transparent !important;
    flex-grow: 1 !important;
}
.app-card-body h3 {
    color: var(--text) !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    margin-bottom: 4px !important;
    line-height: 1.5;
}
.app-card-body p {
    color: var(--primary) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
}

/* ─── فوتر ─── */
.site-footer {
    background: linear-gradient(180deg, var(--primary-dark) 0%, #022c22 100%);
    color: #d1fae5;
    padding: 60px 24px 20px;
    margin-top: 80px;
    border-top: 4px solid var(--accent);
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
}
.footer-col h4 {
    color: #fff;
    margin-bottom: 16px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.2px;
}
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 10px; font-size: 13px; }
.footer-links a { color: #a7f3d0; cursor: pointer; transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }
.footer-trust { text-align: center; }
.footer-trust .trust-badge { display: inline-block; }
.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
    color: #6ee7b7;
}

/* ─── دکمه‌ها ─── */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.btn-primary:hover { color: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25); }

.btn-secondary { background: #e2e8f0; color: #334155; }
.btn-secondary:hover { background: #cbd5e1; color: #1e293b; }

.btn-danger { background: linear-gradient(135deg, #dc2626, #b91c1c); color: #fff; }
.btn-danger:hover { color: #fff; }

.btn[disabled], .btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ─── کارت عمومی ─── */
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 16px;
}
.card-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 12px; color: var(--primary-dark); }

/* ─── فرم ─── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text); }
.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 11px 14px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: #fff;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1); /* سایه فوکوس */
}
.form-textarea { min-height: 100px; resize: vertical; }

/* ─── هشدارها ─── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13.5px;
    border: 1px solid transparent;
    border-right-width: 4px;
    font-weight: 500;
}
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; border-right-color: #10b981; }
.alert-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; border-right-color: #dc2626; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; border-right-color: #f59e0b; }

/* ─── گرید ─── */
.grid { display: grid; gap: 16px; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ─── کمکی ─── */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-danger { color: #dc2626; }
.text-success { color: var(--primary); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }

/* ─── دکمه برگشت بالا ─── */
#backToTop {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
    z-index: 1000;
}
#backToTop:hover {
    background: var(--primary-dark);
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* ─── ریسپانسیو ─── */
@media (max-width: 992px) {
    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    html { font-size: 15px; }
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.35rem; }
    h3 { font-size: 1.15rem; }
    .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
    .header-inner { flex-direction: column; align-items: flex-start; }
    .site-nav { width: 100%; justify-content: flex-end; }
    .footer-grid { grid-template-columns: 1fr; }
    .card { padding: 16px; }
    .page-title { font-size: 24px; margin: 30px 0 20px; }
}
@media (max-width: 480px) {
    .btn { display: block; width: 100%; padding: 12px 16px; }
    .site-nav { justify-content: space-between; }
    .site-nav a, .site-nav .nav-link { font-size: 13px; padding: 6px 10px; }
}
