body{font-family:Vazirmatn,sans-serif;background:#f6f6f6;margin:0}
a{text-decoration:none;color:#0a95ff}
header{background:#0a95ff;color:#fff;padding:10px 20px}
header a{color:#fff;margin-left:10px}
.container{max-width:1200px;margin:20px auto}
.card{background:#fff;border:1px solid #e3e6e8;border-radius:6px;padding:16px;margin-bottom:12px}
.btn{padding:6px 12px;border-radius:4px;border:0;cursor:pointer}
.btn.ok{background:#2ecc71;color:#fff}
.btn.warn{background:#f1c40f}
.btn.bad{background:#e74c3c;color:#fff}

/* ===============================
   RTL & Mobile-First Base
   =============================== */

html {
    direction: rtl;
}

body {
    text-align: right;
}

/* جلوگیری از اسکرول افقی موبایل */
body, html {
    max-width: 100%;
    overflow-x: hidden;
}

/* فونت مناسب موبایل */
body, input, textarea, button {
    font-family: Vazirmatn, system-ui, sans-serif;
    font-size: 16px;
}

/* لینک‌ها */
a {
    text-decoration: none;
}

/* ===============================
   Container & Card (Responsive)
   =============================== */

.container {
    width: 100%;
    padding: 16px;
    box-sizing: border-box;
}

.card {
    background: #ffffff;
    border: 1px solid #e3e6e8;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
}

/* دسکتاپ */
@media (min-width: 768px) {
    .container {
        max-width: 1100px;
        margin: 0 auto;
    }
}



/* ===============================
   Forms (Mobile Friendly)
   =============================== */

label {
    display: block;
    margin-top: 12px;
    margin-bottom: 4px;
    font-size: 14px;
}

input,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* دکمه‌ها */
button,
.btn {
    width: 100%;
    padding: 12px;
    margin-top: 16px;
    border-radius: 4px;
    border: none;
    background: #0a95ff;
    color: #fff;
    cursor: pointer;
}

/* دسکتاپ: دکمه‌ها کوچکتر */
@media (min-width: 768px) {
    button,
    .btn {
        width: auto;
        padding: 10px 20px;
    }
}



/* ===============================
   Header Responsive
   =============================== */

header {
    background: #0a95ff;
    color: #fff;
    padding: 12px 16px;
}

header a {
    color: #fff;
    margin-left: 8px;
    font-size: 14px;
}

/* موبایل: لینک‌ها زیر هم */
header nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* دسکتاپ */
@media (min-width: 768px) {
    header nav {
        flex-wrap: nowrap;
    }
}

/* ===============================
   MOBILE FIX (CRITICAL)
   =============================== */

/* اندازه پایه فونت */
html {
    font-size: 16px;
}

/* متن‌ها در موبایل */
body {
    font-size: 16px;
    line-height: 1.8;
}

/* تیترها */
h1 { font-size: 1.4rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }

/* منوی بالا */
header {
    padding: 14px 16px;
}

header a {
    font-size: 16px;
    padding: 6px 4px;
}

/* کارت‌ها */
.card {
    padding: 18px;
}

/* فرم‌ها */
input,
textarea,
button {
    font-size: 16px; /* جلوگیری از zoom در iOS */
}

/* ====== Desktop override ====== */
@media (min-width: 768px) {
    body {
        font-size: 15px;
    }

    header a {
        font-size: 14px;
    }
}


/* ===============================
   Responsive Header (Hamburger)
   =============================== */

.site-header {
    background: #0a95ff;
    color: #fff;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    position: relative;
    min-height: 56px;

}

/* برند */
.brand {
    font-size: 18px;
    font-weight: bold;
}

/* دکمه همبرگری */
.menu-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;      /* بزرگ‌تر */
    padding: 8px 12px;    /* فضای لمس */
    cursor: pointer;
    line-height: 1;
}


/* منو */
.site-nav {
    display: flex;
    gap: 12px;
}

.site-nav a {
    color: #fff;
    font-size: 16px;
    padding: 6px 0;
}

/* ========== MOBILE ========== */
@media (max-width: 767px) {

    .menu-toggle {
        display: block;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: #0a95ff;
        flex-direction: column;
        padding: 12px 16px;
        border-top: 1px solid rgba(255,255,255,0.2);
    }

    .site-nav.open {
        display: flex;
    }

    .site-nav a {
        padding: 10px 0;
        border-bottom: 1px solid rgba(255,255,255,0.2);
    }
}

/* ========== DESKTOP ========== */
@media (min-width: 768px) {
    .site-nav {
        position: static;
    }
}

/* =================================
   FINAL MOBILE MENU FIX (OVERRIDE)
   ================================= */

/* موبایل: منوی اصلی مخفی شود */
@media (max-width: 767px) {

    header nav,
    .site-nav {
        display: none !important;
        flex-direction: column;
        width: 100%;
    }

    /* فقط وقتی open است نشان بده */
    .site-nav.open {
        display: flex !important;
    }

    /* لینک‌ها در موبایل */
    .site-nav a {
        width: 100%;
        padding: 12px 0;
        text-align: right;
    }
}

/* دسکتاپ: منوی عادی */
@media (min-width: 768px) {

    .site-nav {
        display: flex !important;
        position: static !important;
        flex-direction: row;
    }

    .menu-toggle {
        display: none !important;
    }
}

/* ===============================
   Brand Responsive
   =============================== */

.brand {
    font-weight: bold;
    font-size: 18px;
    white-space: nowrap;
}

/* موبایل: نسخه کوتاه */
.brand-full {
    display: none;
}

.brand-short {
    display: inline;
}

/* دسکتاپ: نسخه کامل */
@media (min-width: 768px) {
    .brand-full {
        display: inline;
    }

    .brand-short {
        display: none;
    }

    .brand {
        font-size: 20px;
    }
}

.brand {
    max-width: calc(100% - 56px); /* جا برای همبرگر */
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ===============================
   HEADER HEIGHT FIX
   =============================== */

.site-header {
    padding: 0;               /* padding اضافی حذف */
}

.header-inner {
    min-height: 48px;         /* ارتفاع منطقی هدر */
    padding: 6px 12px;        /* padding کنترل‌شده */
    align-items: center;
}

/* برند */
.brand {
    font-size: 16px;          /* کوچکتر و حرفه‌ای */
    line-height: 1.2;
}

/* همبرگری */
.menu-toggle {
    font-size: 28px;          /* هنوز واضح، نه غول */
    padding: 6px 8px;
}

/* دسکتاپ کمی بزرگ‌تر */
@media (min-width: 768px) {
    .header-inner {
        min-height: 56px;
        padding: 8px 16px;
    }

    .brand {
        font-size: 18px;
    }
}
/* =================================
   HARD MOBILE HEADER HEIGHT FIX
   ================================= */

@media (max-width: 767px) {

    /* کل هدر */
    .site-header {
        padding: 0 !important;
        margin: 0 !important;
    }

    /* ظرف داخلی هدر */
    .header-inner {
        min-height: 44px !important;
        height: 44px !important;   /* اجبار */
        padding: 0 10px !important;
        align-items: center !important;
    }

    /* عنوان */
    .brand {
        font-size: 15px !important;
        line-height: 1 !important;     /* خیلی مهم */
        margin: 0 !important;
        padding: 0 !important;
        white-space: nowrap;
    }

    /* همبرگری */
    .menu-toggle {
        font-size: 26px !important;
        padding: 0 6px !important;
        line-height: 1 !important;
        height: 26px !important;
    }

    /* منو (وقتی بسته است) */
    .site-nav {
        margin: 0 !important;
        padding: 0 !important;
    }

    /* لینک‌ها داخل منو */
    .site-nav a {
        margin: 0 !important;
        padding: 10px 0 !important; /* فقط وقتی منو باز شد دیده می‌شود */
        line-height: 1.2 !important;
    }
}
/* =================================
   FINAL MOBILE HEADER HARD LOCK
   ================================= */

@media (max-width: 767px) {

    /* خود هدر */
    .site-header {
        height: 48px !important;      /* قفل ارتفاع */
        min-height: 48px !important;
        max-height: 48px !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* ظرف داخلی */
    .header-inner {
        height: 48px !important;
        padding: 0 12px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important; /* نه space-between */
    }

    /* برند */
    .brand {
        font-size: 15px !important;
        line-height: 1 !important;
        white-space: nowrap !important;
        margin: 0 !important;
        padding: 0 !important;
        flex: 1 1 auto !important; /* وسط باقی بماند */
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* نسخه کوتاه برند */
    .brand-full { display: none !important; }
    .brand-short { display: inline !important; }

    /* همبرگری */
    .menu-toggle {
        width: 40px !important;
        height: 40px !important;
        font-size: 26px !important;
        padding: 0 !important;
        margin: 0 !important;
        line-height: 40px !important;
        text-align: center !important;
        flex: 0 0 auto !important;
    }

    /* منوی بازشونده */
    .site-nav {
        top: 48px !important; /* دقیقاً زیر هدر */
    }
}
/* =================================
   MOBILE HAMBURGER MENU UX FIX
   ================================= */

@media (max-width: 767px) {

    .site-nav {
        position: absolute;
        top: 48px;
        right: 0;
        left: 0;
        background: #0a95ff;
        display: none;
        flex-direction: column;
        max-height: calc(100vh - 48px);
    }

    .site-nav.open {
        display: flex;
    }

    /* بخش اصلی منو */
    .nav-main {
        flex: 1 1 auto;
        overflow-y: auto;
        padding: 8px 16px;
    }

    /* لینک‌های ناوبری */
    .nav-main a {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid rgba(255,255,255,0.2);
    }

    /* بخش ورود/ثبت‌نام (همیشه پایین) */
    .nav-auth {
        border-top: 1px solid rgba(255,255,255,0.3);
        padding: 10px 16px;
        background: #0a95ff;
    }

    .nav-auth a {
        display: block;
        padding: 10px 0;
        font-weight: bold;
    }
}
