@font-face {
    font-family: "Myfont";
    src: url("fonts/Parastoo.woff") format("woff");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Myfont";
    src: url("fonts/Parastoo_Bold.woff") format("woff");
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: "Myfont", sans-serif;
    direction: rtl;
    margin: 0;
    background: #d1cccc;
}

/* wrapper جدید برای محدود کردن عرض */
.wrapper {
    width: 100%;
    max-width: 100vw; /* 1000px */
    margin: 0 auto;
    padding: 0 10px;
}
:root {
    --main-color1: rgb(190, 181, 233);
}
/* هدر */
header {
    background: rgb(229, 233, 235);
    padding: 20px;
    border: 2px solid var(--main-color1);
    margin: 10px auto;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    background-image: url('/images/header.png');
    background-size: auto;
    background-position: left;
    background-repeat: no-repeat;
    background-color: #fff;
    color: rgb(9, 156, 9);
	width: 88%;
    max-width: 88vw;
}

/* کانتینر اصلی */
.main-container {
    display: flex;
    gap: 12px;
    margin: 10px auto;
	width: 90%;
    max-width: 90vw;
}

/* سایدبار */
aside {
    width: 200px;
	height: 1500px;
	overflow-y: auto; /* اسکرول */
    flex-shrink: 0;
    background: #fff;
    border: 2px solid var(--main-color1);
    padding: 15px;
}

#content-area {
    flex: 1;
    background: #fff;
    border: 2px solid var(--main-color1);
    padding: 20px;
    min-height: 400px;
}

footer {
    background: #fff;
    border: 2px solid var(--main-color1);
    padding: 20px;
    margin: 10px auto;
    text-align: center;
	width: 88%;
    max-width: 88vw;
}

/* بقیه استایل‌های قبلی (theme, buttons, etc.) رو هم نگه دار */

aside a {
    text-decoration: none;
    color: #000;
}

aside a:hover {
    text-decoration: underline; /* اگر خواستی هنگام هاور خط بیاید */
}
.side-buttons {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* دکمه‌های ساده و کلاسیک در سایدبار */
.classic-btn {
    display: block;
    padding: 8px 10px;
    margin-bottom: 10px;
    text-decoration: none;
    color: #333;
    background-color: #f8f8f8;
    border: 1px solid #ccc;
    border-radius: 4px;

    font-size: 14px;
    font-family: inherit;

    transition: background-color 0.2s, border-color 0.2s;
}

.classic-btn:hover {
    background-color: #e9e9e9;
    border-color: #999;
}

/* نمایش موبایل / عرض کمتر از 768px */
@media (max-width: 768px) {

    .main-container {
        flex-direction: column;      /* تبدیل از دو ستون → یک ستون 768*/
    }

    aside {
        width: 100%;
        height: auto;       /* مهم: ارتفاع رو خودکار کن */
        max-height: none;   /* هر محدودیتی رو بردار */
        order: 2;
        margin-top: 20px;   /* فاصله از محتوا */
    }

    #content-area {
        order: 1;                    /* محتوا بیاید بالا */
    }
}



aside ul li {
    margin-bottom: 12px;   /* فاصله بیشتر */
}

/*   */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* 250px */
    gap: 16px;
    margin-top: 10px;
}

.product-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
}

.product-link {
    display: block;
    padding: 12px;
    text-decoration: none;
    color: inherit;
}

.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    display: block;
    background: rgba(255, 255, 255, 0); /* اختیاری: اگر دور عکس خالی ماند */
}

.product-title {
    font-size: 15px;
    margin: 0 0 6px;
    line-height: 1.4;
}

.product-desc {
    font-size: 13px;
    color: #666;
    margin: 0 0 12px;
    min-height: 34px;
}

.product-btn {
    display: inline-block;
    padding: 8px 12px;
    background: #2d7ff9;
    color: #fff;
    border-radius: 6px;
    font-size: 13px;
}

.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

.page-link {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    background: #fff;
}

.page-link.active {
    background: #2d7ff9;
    color: #fff;
    border-color: #2d7ff9;
}
/*   */
.product-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.product-excerpt {
    text-align: center;
}

.product-btn {
    display: inline-block;
    margin: 0 auto;
}

/* استایل نوار منوی نازک */
/* کانتینر اصلی برای وسط‌چین کردن منو */
.menu-container {
    width: 90%;
    max-width: 100vw; /* این عدد رو با عرض کانتینر اصلی سایتت هماهنگ کن */
    margin: 0 auto; /* وسط‌چین کردن کانتینر */
    padding: 0 2px; /* کمی فاصله از کناره‌ها برای موبایل */
    box-sizing: border-box;
}

/* استایل نوار منوی نازک */
.simple-nav {
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
    padding: 0;
    margin: 0;
    font-family: inherit;
}

.simple-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: flex-start;
}

.simple-nav li {
    position: relative;
}

/* استایل دکمه‌های اصلی */
.simple-nav a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: background 0.2s;
}

.simple-nav a:hover {
    background-color: #e0e0e0;
    color: #000;
}

.dropdown-menu {
    display: none !important; /* !important اضافه شد تا مطمئن بشیم هیچ استایل دیگه‌ای روی این اعمال نمیشه */
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    min-width: 180px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
    z-index: 1000;
    padding: 0;
    margin: 0;
    opacity: 0; /* برای انیمیشن نرم (اختیاری) */
    transition: opacity 0.2s ease;
}

/* نمایش زیرمنو فقط وقتی موس روی آیتم والد هست */
.has-dropdown:hover .dropdown-menu {
    display: block !important;
    opacity: 1;
}

/* استایل لینک‌های داخل زیرمنو */
.dropdown-menu li a {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-menu li:last-child a {
    border-bottom: none;
}

.dropdown-menu li a:hover {
    background-color: #f9f9fa;
    color: #007bff;
}

/* استایل نوار منوی نازک پایان */