/* Main site header: jade green, readable, no white hover/highlight */
.site-main-header {
    z-index: 3000;
    /* کارود: پس‌زمینه واقعی پل اهواز در هدر؛ جایگزین زمینه سبز */
    background-image:
        linear-gradient(90deg, rgba(2,20,38,.92) 0%, rgba(3,37,65,.78) 42%, rgba(3,37,65,.56) 70%, rgba(2,20,38,.78) 100%),
        url('../images/7pel-ahvaz-header.png') !important;
    background-size: cover !important;
    background-position: center 48% !important;
    background-repeat: no-repeat !important;
    border-bottom: 2px solid rgba(34,211,238,.85);
    box-shadow: 0 4px 18px rgba(2,20,38,.30);
    position: relative;
    overflow: visible;
}
.site-main-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(2,20,38,.12), rgba(2,20,38,.24));
    pointer-events: none;
}
.site-main-header > .container {
    position: relative;
    z-index: 1;
}
.site-main-header .navbar-brand,
.site-main-header .nav-link,
.site-main-header .navbar-text {
    color: #ffffff !important;
    opacity: 1 !important;
}
.site-main-header .navbar-brand { font-weight: 900; }
.site-main-header .nav-link {
    font-weight: 700;
    border-radius: 9px;
    padding: .55rem .75rem !important;
    transition: background-color .16s ease, transform .16s ease;
}
.site-main-header .nav-link:hover,
.site-main-header .nav-link:focus,
.site-main-header .nav-link.active {
    color: #ffffff !important;
    background: #115e59 !important;
    box-shadow: none !important;
    outline: none !important;
}
.site-main-header .navbar-toggler {
    border: 1px solid rgba(255,255,255,.35);
    background: #115e59;
    box-shadow: none !important;
}
.site-main-header .navbar-toggler:focus {
    box-shadow: 0 0 0 .15rem rgba(255,255,255,.18) !important;
}
.site-main-header .navbar-toggler-icon {
    filter: brightness(0) invert(1);
}
/* LoginPartial buttons: colored fills, never white hover backgrounds */
.site-main-header .btn {
    color: #ffffff !important;
    border-width: 1px;
    box-shadow: none !important;
    font-weight: 800;
}
.site-main-header .btn:hover,
.site-main-header .btn:focus,
.site-main-header .btn:active {
    color: #ffffff !important;
    box-shadow: none !important;
    outline: none !important;
}
.site-main-header .btn-outline-light {
    background: #115e59 !important;
    border-color: #99f6e4 !important;
}
.site-main-header .btn-outline-light:hover,
.site-main-header .btn-outline-light:focus {
    background: #0d5a55 !important;
    border-color: #5eead4 !important;
}
.site-main-header .btn-outline-info {
    background: #0e7490 !important;
    border-color: #67e8f9 !important;
}
.site-main-header .btn-outline-warning {
    background: #b45309 !important;
    border-color: #fcd34d !important;
}
.site-main-header .btn-outline-success {
    background: #15803d !important;
    border-color: #86efac !important;
}
.site-main-header .btn-outline-danger {
    background: #b91c1c !important;
    border-color: #fca5a5 !important;
}
.site-main-header .btn-primary {
    background: #2563eb !important;
    border-color: #93c5fd !important;
}
.site-main-header .btn-outline-info:hover { background:#0c637b !important; }
.site-main-header .btn-outline-warning:hover { background:#92400e !important; }
.site-main-header .btn-outline-success:hover { background:#166534 !important; }
.site-main-header .btn-outline-danger:hover { background:#991b1b !important; }
.site-main-header .btn-primary:hover { background:#1d4ed8 !important; }
.site-main-header .border-info { border-color: #5eead4 !important; }

/* Animated premium header: golden key + lightweight icon motion */
.switch-brand { display:inline-flex !important; align-items:center; gap:.55rem; text-decoration:none; }
.switch-brand-key {
    display:inline-flex; align-items:center; justify-content:center;
    width:40px; height:40px; flex:0 0 40px;
    border-radius:13px;
    font-size:24px;
    background:linear-gradient(145deg,#fff4a8 0%,#f6c945 35%,#d89b16 72%,#fff0a0 100%);
    border:1px solid rgba(255,229,115,.85);
    box-shadow:0 0 10px rgba(255,205,57,.28),0 6px 16px rgba(0,0,0,.16),inset 0 1px 0 rgba(255,255,255,.85);
    filter:saturate(1.08);
    transform-origin:50% 50%;
    animation:switchBrandKeySway 3.6s ease-in-out infinite;
}
.switch-brand-key::after {
    content:''; position:absolute; width:40px; height:40px; border-radius:13px;
    box-shadow:0 0 0 0 rgba(255,205,57,0); pointer-events:none;
}
.switch-brand-text { white-space:nowrap; }
.site-main-header .nav-link { display:inline-flex; align-items:center; gap:.32rem; }
.header-icon { display:inline-block; transform-origin:50% 55%; transition:transform .2s ease, filter .2s ease; }
.site-main-header .nav-link:hover .header-icon,
.site-main-header .nav-link:focus .header-icon { animation:headerIconFloat .65s ease-in-out 1; filter:drop-shadow(0 0 5px rgba(255,190,55,.45)); }
.site-main-header .nav-link:nth-child(2) .header-icon { animation-duration:.7s; }
.header-cart-icon { position:relative; }
.site-main-header .nav-link:hover .header-cart-icon { animation:headerCartBounce .55s ease-in-out 1; }
.header-menu-toggle .navbar-toggler-icon { transition:transform .25s ease; }
.header-menu-toggle:hover .navbar-toggler-icon { transform:rotate(90deg) scale(1.04); }
.global-file-picker {
    position:fixed !important; left:0 !important; top:0 !important;
    width:1px !important; height:1px !important; opacity:0 !important;
    z-index:0 !important;
}
@keyframes switchBrandKeySway {
    0%,100% { transform:rotate(-3deg) translateY(0); box-shadow:0 0 7px rgba(255,205,57,.22),0 6px 16px rgba(0,0,0,.16),inset 0 1px 0 rgba(255,255,255,.85); }
    25% { transform:rotate(3deg) translateY(-1px); }
    50% { transform:rotate(-1deg) translateY(-2px); box-shadow:0 0 16px rgba(255,205,57,.46),0 8px 18px rgba(0,0,0,.18),inset 0 1px 0 rgba(255,255,255,.9); }
    75% { transform:rotate(2deg) translateY(-1px); }
}
@keyframes headerIconFloat { 0%,100%{transform:translateY(0) rotate(0)} 45%{transform:translateY(-2px) rotate(-3deg)} 70%{transform:translateY(0) rotate(2deg)} }
@keyframes headerCartBounce { 0%,100%{transform:translateX(0) rotate(0)} 35%{transform:translateX(-2px) rotate(-7deg)} 65%{transform:translateX(2px) rotate(6deg)} }
@media (prefers-reduced-motion: reduce) {
    .switch-brand-key,.site-main-header .nav-link:hover .header-icon,.site-main-header .nav-link:focus .header-icon,.site-main-header .nav-link:hover .header-cart-icon { animation:none !important; }
    .header-menu-toggle .navbar-toggler-icon { transition:none; }
}
@media (max-width:576px) {
    .switch-brand-key { width:34px; height:34px; flex-basis:34px; font-size:21px; border-radius:11px; }
    .switch-brand { gap:.4rem; }
    .switch-brand-text { font-size:.95rem; }
}


/* Animated login / registration actions */
.animated-auth-action {
    display:inline-flex !important;
    align-items:center;
    justify-content:center;
    gap:.35rem;
    transform-origin:50% 55%;
}
.auth-action-icon {
    display:inline-grid;
    place-items:center;
    min-width:1.25rem;
    transform-origin:50% 55%;
    animation:authIconFloat 3.4s ease-in-out infinite;
}
.animated-auth-action:hover .auth-action-icon,
.animated-auth-action:focus-visible .auth-action-icon {
    animation:authIconWiggle .7s ease-in-out 1;
    filter:drop-shadow(0 0 5px rgba(255,205,57,.5));
}
@keyframes authIconFloat {
    0%,100% { transform:translateY(0) rotate(-2deg); }
    50% { transform:translateY(-3px) rotate(2deg); }
}
@keyframes authIconWiggle {
    0%,100% { transform:translateY(0) rotate(0); }
    25% { transform:translateY(-2px) rotate(-7deg); }
    50% { transform:translateY(0) rotate(6deg); }
    75% { transform:translateY(-1px) rotate(-4deg); }
}
@media (prefers-reduced-motion: reduce) {
    .auth-action-icon { animation:none !important; }
}

/* Mobile voice assistant placement */
@media (max-width: 575px) {
    .site-main-links {
        direction: rtl;
        flex-direction: column !important;
    }
    .site-main-header .navbar-nav .nav-item {
        order: initial;
    }
    .site-main-header .navbar-nav .nav-item:nth-child(1) { order: 1; }
    .site-main-header .navbar-nav .nav-item:nth-child(2) { order: 2; }
    .site-main-header .navbar-nav .nav-item:nth-child(3) { order: 3; }
    .site-main-header .navbar-nav .nav-item:nth-child(4) { order: 4; }
    .site-main-header .navbar-nav .nav-item:nth-child(5) { order: 5; }
    .site-main-header .navbar-nav .nav-item:nth-child(6) { order: 6; }
    .site-main-header .navbar-nav .nav-item:nth-child(7) { order: 7; }
    .site-main-header .navbar-nav .nav-item:nth-child(8) { order: 8; }
    #switchVoiceAssistant {
        left: 12px !important;
        right: auto !important;
        bottom: 12px !important;
    }
    #switchVoiceAssistant { width:64px; max-width:64px; }
    #switchVoiceAssistant .mobile-assistant-label {
        white-space: nowrap;
        font-size: .68rem;
        line-height: 1.2;
        padding: 3px 7px;
        margin-bottom: 6px;
    }
}

/* ترتیب قطعی منوی اصلی کارود — راست به چپ: خانه، املاک، خودرو، ویلا، فروشگاه‌ها، خدمات شهری، پیشنهادهای ویژه، تماس با ما. */
.site-main-links {
    direction: rtl;
    flex-direction: row;
}
.site-main-links > .nav-item:nth-child(1) { order: 1; }
.site-main-links > .nav-item:nth-child(2) { order: 2; }
.site-main-links > .nav-item:nth-child(3) { order: 3; }
.site-main-links > .nav-item:nth-child(4) { order: 4; }
.site-main-links > .nav-item:nth-child(5) { order: 5; }
.site-main-links > .nav-item:nth-child(6) { order: 6; }
.site-main-links > .nav-item:nth-child(7) { order: 7; }
.site-main-links > .nav-item:nth-child(8) { order: 8; }

/* کارود — لوگوی جدید: پل کوچک + نخل؛ جایگزین نماد کلید در برند عمومی */
.switch-brand-mark{display:inline-flex;align-items:center;justify-content:center;width:52px;height:40px;flex:0 0 52px;}
.seven-pel-logo{display:block;width:52px;height:auto;overflow:visible;}
.switch-brand-mark .seven-pel-logo{filter:drop-shadow(0 3px 7px rgba(0,0,0,.2));transition:transform .2s ease,filter .2s ease;}
.switch-brand:hover .switch-brand-mark .seven-pel-logo{transform:translateY(-1px) scale(1.04);filter:drop-shadow(0 5px 10px rgba(0,0,0,.28));}
@media(max-width:575px){.switch-brand-mark{width:44px;flex-basis:44px}.switch-brand-mark .seven-pel-logo{width:44px}.switch-brand-text{font-size:.95rem;}}


/* Compact, orderly کارود header */
.site-main-header .container{
    max-width:1400px;
}
.site-main-header{
    min-height:62px;
}
.switch-brand{
    gap:.38rem !important;
    margin-inline-end:.65rem;
}
.switch-brand-mark{
    width:42px !important;
    height:34px !important;
    flex-basis:42px !important;
}
.switch-brand-mark .seven-pel-logo{
    width:42px !important;
}
.switch-brand-text{
    font-size:1.16rem !important;
    line-height:1;
    font-weight:900;
}
.switch-brand-seven{
    display:inline-block;
    font-weight:1000;
    font-size:1.28em;
    line-height:.9;
    transform-origin:50% 50%;
    animation:switchBrandSevenSpin 6s ease-in-out infinite;
}
@keyframes switchBrandSevenSpin{
    0%,78%{transform:rotate(0deg);}
    84%{transform:rotate(360deg);}
    90%,100%{transform:rotate(360deg);}
}
.site-main-links{
    gap:.12rem !important;
    margin-bottom:0 !important;
    flex-wrap:nowrap;
}
.site-main-header .nav-link{
    font-size:.86rem;
    padding:.38rem .48rem !important;
    gap:.2rem;
    white-space:nowrap;
}
.header-icon{
    font-size:.92rem;
}
.site-main-header .navbar-collapse{
    align-items:center;
}
.site-main-header .navbar-collapse > .d-flex{
    margin-inline-start:.35rem !important;
    margin-inline-end:.35rem !important;
}
#switchInstallApp{
    font-size:.78rem;
    padding:.34rem .65rem !important;
    white-space:nowrap;
}
.site-main-header .navbar-brand{
    margin-inline-end:.25rem !important;
}
@media(max-width:1199.98px){
    .site-main-header .nav-link{font-size:.79rem;padding:.34rem .38rem !important;}
    .switch-brand-text{font-size:1.05rem !important;}
    #switchInstallApp{font-size:.72rem;}
}
@media(max-width:991.98px){
    .site-main-header .navbar-collapse{
        padding-top:.55rem;
    }
    .site-main-links{
        gap:.18rem !important;
        flex-direction:column !important;
        align-items:stretch !important;
    }
    .site-main-header .nav-link{
        justify-content:flex-start;
        padding:.48rem .7rem !important;
        font-size:.9rem;
    }
    .site-main-header .navbar-collapse > .d-flex{
        margin-top:.45rem;
    }
}
@media(max-width:575px){
    .site-main-header .container{padding-inline:.65rem;}
    .site-main-header{min-height:56px;}
    .switch-brand-mark{width:38px !important;flex-basis:38px !important;height:31px !important;}
    .switch-brand-mark .seven-pel-logo{width:38px !important;}
    .switch-brand-text{font-size:1rem !important;}
}

/* Final کارود compact public header */
.switch-brand-slogan{
    display:block;
    margin-top:.12rem;
    font-size:.48rem;
    line-height:1;
    font-weight:500;
    color:rgba(255,255,255,.82);
    white-space:nowrap;
}
.seven-pel-water{
    animation: sevenPelWaterMove 2.6s linear infinite;
    transform-origin:center;
}
@keyframes sevenPelWaterMove{
    0%{transform:translateX(-4px);}
    50%{transform:translateX(2px);}
    100%{transform:translateX(-4px);}
}
.contact-menu > .nav-link{
    cursor:pointer;
}
.contact-dropdown{
    min-width:190px;
    margin-top:.35rem !important;
    padding:.35rem;
    border:1px solid rgba(15,118,110,.18);
    border-radius:12px;
    box-shadow:0 12px 28px rgba(15,23,42,.16);
}
.contact-dropdown .dropdown-item{
    display:flex;
    align-items:center;
    gap:.55rem;
    direction:rtl;
    text-align:right;
    font-weight:700;
    border-radius:9px;
    padding:.55rem .65rem;
}
.contact-dropdown .dropdown-item:hover,
.contact-dropdown .dropdown-item:focus{
    background:#ecfdf5;
    color:#0f766e;
}
.site-main-header .dropdown-toggle::after{
    margin-right:.25rem;
    vertical-align:.12em;
}
@media(max-width:991.98px){
    .switch-brand-slogan{font-size:.43rem;}
    .switch-brand-seven{font-size:1.22em;}
    .contact-dropdown{
        position:static !important;
        width:100%;
        box-shadow:none;
        margin-top:.1rem !important;
    }
}
@media(prefers-reduced-motion:reduce){
    .switch-brand-seven{animation:none !important;}
    .seven-pel-water{animation:none !important;}
}

/* کارود — هدر نهایی: برند خواناتر و شعار همیشه قابل مشاهده، مخصوصاً موبایل */
.site-main-header .navbar-brand.switch-brand{
    display:inline-flex;
    align-items:center;
    flex:0 1 auto;
    min-width:0;
    gap:.55rem !important;
    padding:.15rem 0;
}
.site-main-header .switch-brand-mark{
    width:60px !important;
    height:48px !important;
    flex:0 0 60px !important;
}
.site-main-header .switch-brand-mark .seven-pel-logo{
    width:60px !important;
    max-width:none;
}
.site-main-header .switch-brand-text{
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:flex-start;
    font-size:1.38rem !important;
    line-height:1.05;
    min-width:0;
}
.site-main-header .switch-brand-seven{
    font-size:1.22em;
}
.site-main-header .switch-brand-slogan{
    display:block !important;
    margin-top:.28rem !important;
    font-size:.62rem !important;
    line-height:1.2 !important;
    font-weight:600;
    color:rgba(255,255,255,.92);
    white-space:nowrap;
    overflow:visible;
}
@media(max-width:991.98px){
    .site-main-header .navbar-brand.switch-brand{
        flex-shrink:1;
    }
    .site-main-header .switch-brand-mark{
        width:58px !important;
        height:46px !important;
        flex-basis:58px !important;
    }
    .site-main-header .switch-brand-mark .seven-pel-logo{
        width:58px !important;
    }
    .site-main-header .switch-brand-text{
        font-size:1.28rem !important;
    }
    .site-main-header .switch-brand-slogan{
        font-size:.59rem !important;
        margin-top:.25rem !important;
    }
}
@media(max-width:575px){
    .site-main-header{
        min-height:76px !important;
    }
    .site-main-header .container{
        padding-inline:.7rem;
    }
    .site-main-header .navbar-brand.switch-brand{
        gap:.42rem !important;
        padding:.2rem 0;
    }
    .site-main-header .switch-brand-mark{
        width:54px !important;
        height:44px !important;
        flex-basis:54px !important;
    }
    .site-main-header .switch-brand-mark .seven-pel-logo{
        width:54px !important;
    }
    .site-main-header .switch-brand-text{
        font-size:1.22rem !important;
        line-height:1.05;
    }
    .site-main-header .switch-brand-seven{
        font-size:1.2em;
    }
    .site-main-header .switch-brand-slogan{
        font-size:.56rem !important;
        line-height:1.25 !important;
        margin-top:.24rem !important;
        white-space:nowrap !important;
    }
    .site-main-header .navbar-toggler{
        margin-inline-start:.3rem;
        flex-shrink:0;
    }
}

/* Stable desktop header: authenticated users must never push navigation over the کارود brand. */
.site-main-header .container{
    display:flex;
    flex-wrap:nowrap;
    align-items:center;
    min-width:0;
}
.site-main-header .navbar-brand{
    flex:0 0 auto;
    min-width:max-content;
}
.site-main-header .navbar-collapse{
    flex:1 1 auto;
    min-width:0;
}
.site-main-header .site-main-links{
    flex:1 1 auto;
    min-width:0;
    justify-content:center;
    margin-inline:clamp(.25rem,1vw,1rem) !important;
}
.header-account-zone{
    flex:0 0 auto;
    min-width:0;
    max-width:220px;
    margin-inline-start:.35rem;
}
.header-account-zone > ul{
    margin:0 !important;
    padding:0 !important;
}
.header-user-menu{position:relative;z-index:3050;}
.header-user-trigger{
    display:inline-flex !important;
    align-items:center;
    gap:.42rem;
    max-width:190px;
    padding:.28rem .48rem !important;
    border:1px solid rgba(153,246,228,.65) !important;
    background:#115e59 !important;
    border-radius:999px !important;
    white-space:nowrap;
    overflow:hidden;
}
.header-user-trigger::after{margin-inline-start:.15rem;}
.header-user-avatar{
    width:34px;height:34px;flex:0 0 34px;
    object-fit:cover;border-radius:50%;
    border:2px solid #67e8f9;
}
.header-user-name{
    max-width:105px;
    overflow:hidden;
    text-overflow:ellipsis;
    color:#fff;
    font-size:.78rem;
    font-weight:800;
}
.header-user-dropdown{
    min-width:245px;
    z-index:4000 !important;
}
.header-user-dropdown .dropdown-item{
    color:#26313d !important;
    padding:.58rem .7rem;
}
.header-user-dropdown .dropdown-item:hover,
.header-user-dropdown .dropdown-item:focus{
    background:#e8f7f4 !important;
    color:#07574f !important;
}
@media(max-width:1199.98px){
    .site-main-header .nav-link{font-size:.76rem;padding-inline:.34rem !important;}
    .header-account-zone{max-width:180px;}
    .header-user-trigger{max-width:155px;}
    .header-user-name{max-width:78px;}
}
@media(max-width:991.98px){
    .site-main-header .container{flex-wrap:wrap;}
    .site-main-header .navbar-toggler{margin-inline-start:auto;}
    .site-main-header .navbar-collapse{flex-basis:100%;width:100%;}
    .site-main-header .site-main-links{margin:0 !important;justify-content:stretch;}
    .header-account-zone{width:100%;max-width:none;margin:.45rem 0 0;}
    .header-account-zone > ul{justify-content:flex-start !important;}
    .header-user-trigger{max-width:100%;}
}

/* Final header refinement: remove slogan, enlarge navigation, increase height, add official system date/time. */
.site-main-header {
    min-height: 86px !important;
    padding-top: .65rem !important;
    padding-bottom: .65rem !important;
}
.site-main-header .switch-brand-slogan { display:none !important; }
.site-main-header .switch-brand-text {
    font-size: 1.62rem !important;
    line-height: 1.05 !important;
    font-weight: 900 !important;
}
.site-main-header .switch-brand-seven { font-size: 1.2em !important; }
.site-main-header .switch-brand-mark {
    width: 68px !important;
    height: 54px !important;
    flex-basis: 68px !important;
}
.site-main-header .switch-brand-mark .seven-pel-logo { width:68px !important; }
.site-main-header .site-main-links { gap:.28rem !important; }
.site-main-header .nav-link {
    font-size: 1rem !important;
    font-weight: 800 !important;
    padding: .55rem .65rem !important;
}
.header-system-datetime {
    flex: 0 0 auto;
    min-width: 172px;
    margin-inline: .35rem .15rem;
    padding: .34rem .65rem;
    border: 1px solid rgba(125,211,252,.55);
    border-radius: 14px;
    background: rgba(2,20,38,.58);
    backdrop-filter: blur(6px);
    box-shadow: 0 5px 16px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.08);
    text-align: center;
    line-height: 1.15;
}
.header-system-date-label {
    color: #fde68a;
    font-size: .68rem;
    font-weight: 900;
    margin-bottom: .14rem;
}
.header-system-date {
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
}
.header-system-time {
    color: #67e8f9;
    font-size: 1rem;
    font-weight: 900;
    direction: ltr;
    letter-spacing: .04em;
    margin-top: .1rem;
    white-space: nowrap;
}
@media(max-width:1199.98px){
    .site-main-header { min-height: 82px !important; }
    .site-main-header .switch-brand-text { font-size:1.42rem !important; }
    .site-main-header .switch-brand-mark { width:60px !important; flex-basis:60px !important; }
    .site-main-header .switch-brand-mark .seven-pel-logo { width:60px !important; }
    .site-main-header .nav-link { font-size:.9rem !important; padding-inline:.46rem !important; }
    .header-system-datetime { min-width:150px; }
}
@media(max-width:991.98px){
    .site-main-header { min-height: 76px !important; }
    .header-system-datetime {
        order: 20;
        width:100%;
        min-width:0;
        margin:.55rem 0 0;
    }
    .header-system-date { font-size:.82rem; }
    .header-system-time { font-size:1rem; }
}
@media(max-width:575px){
    .site-main-header { min-height: 78px !important; }
    .site-main-header .switch-brand-mark { width:52px !important; flex-basis:52px !important; height:43px !important; }
    .site-main-header .switch-brand-mark .seven-pel-logo { width:52px !important; }
    .site-main-header .switch-brand-text { font-size:1.2rem !important; }
    .site-main-header .nav-link { font-size:.96rem !important; }
    .header-system-datetime { padding:.42rem .55rem; }
    .header-system-date { font-size:.78rem; }
    .header-system-time { font-size:.98rem; }
}


/* کارود — Header-only Ahvaz background.
   این تصویر فقط برای نوار هدر است؛ اسلایدر اصلی از تصویر خودش استفاده می‌کند. */
.site-main-header{
    min-height: 78px !important;
    background-position: center 52% !important;
    background-size: cover !important;
}
.site-main-header::after{
    content:"";
    position:absolute;
    inset:0;
    background:linear-gradient(90deg,rgba(1,10,18,.78),rgba(1,18,30,.38) 48%,rgba(1,10,18,.62));
    pointer-events:none;
    z-index:0;
}
.site-main-header > .container{z-index:2 !important;}
.site-main-header .nav-link{
    font-size: .98rem !important;
    font-weight: 900 !important;
    text-shadow: 0 2px 5px rgba(0,0,0,.85);
}
@media(max-width:991.98px){
    .site-main-header{min-height:72px !important;}
}
@media(max-width:575.98px){
    .site-main-header{min-height:68px !important;}
}

/* Password eye: داخل خود کادر، بدون پوشاندن متن رمز */
.password-input-shell{
    position:relative;
    flex:1 1 auto;
    min-width:0;
}
.password-input-shell > .form-control{
    width:100%;
    padding-left:3.15rem !important;
}
.password-eye-toggle{
    position:absolute;
    left:.45rem;
    top:50%;
    transform:translateY(-50%);
    width:2.35rem;
    height:2.35rem;
    border:0;
    border-radius:.65rem;
    background:rgba(37,99,235,.12);
    color:#2563eb;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    z-index:5;
    font-size:1.15rem;
    line-height:1;
    padding:0;
    box-shadow:none;
    transition:background-color .15s ease,color .15s ease,transform .15s ease;
}
.password-eye-toggle:hover,
.password-eye-toggle:focus-visible{
    background:rgba(37,99,235,.2);
    color:#1d4ed8;
    outline:2px solid rgba(37,99,235,.2);
    outline-offset:1px;
}
.password-eye-toggle.is-visible{
    background:rgba(16,185,129,.16);
    color:#059669;
}
.password-eye-toggle .eye-icon{
    display:block;
    font-size:1.12rem;
}
.password-eye-toggle .eye-icon::before{content:"👁️";}
.password-eye-toggle.is-visible .eye-icon::before{content:"🙈";}
@media(max-width:575.98px){
    .password-eye-toggle{width:2.15rem;height:2.15rem;font-size:1.05rem;left:.35rem;}
    .password-input-shell > .form-control{padding-left:2.85rem !important;}
}


/* کارود: لوگوی نخل + پل + رود */
.switch-brand-mark{width:58px !important;height:40px !important;flex:0 0 58px !important;overflow:visible;}
.karood-logo{display:block;width:58px;height:auto;overflow:visible;filter:drop-shadow(0 3px 7px rgba(0,0,0,.2));}
.karood-water{transform-origin:center;animation:karoodWaterFlow 2.8s linear infinite;}
.karood-palm{transform-origin:22px 40px;animation:karoodPalmBreeze 10s ease-in-out infinite;}
@keyframes karoodWaterFlow{0%{transform:translateX(-3px)}50%{transform:translateX(2px)}100%{transform:translateX(-3px)}}
@keyframes karoodPalmBreeze{0%,84%,100%{transform:translate(3px,5px) rotate(0deg)}88%{transform:translate(3px,5px) rotate(-5deg)}92%{transform:translate(3px,5px) rotate(4deg)}96%{transform:translate(3px,5px) rotate(-2deg)}}
@media(max-width:575px){.switch-brand-mark{width:50px !important;flex-basis:50px !important;height:36px !important}.karood-logo{width:50px}}
@media(prefers-reduced-motion:reduce){.karood-water,.karood-palm{animation:none !important}}

/* =========================================================
   Karoud Header Stability Patch
   - خانه هرگز روی برند قرار نمی‌گیرد
   - منوی کاربر در لپ‌تاپ 15 اینچ از viewport خارج نمی‌شود
   - چیدمان بین Chrome / Edge / Firefox پایدارتر است
   ========================================================= */
.site-main-header .container{
    position:relative;
    box-sizing:border-box;
    gap:0;
}
.site-main-header .navbar-brand.switch-brand{
    position:relative;
    z-index:5;
    flex:0 0 auto !important;
    width:auto;
    max-width:none;
    margin-inline-end:clamp(.35rem,1vw,.9rem) !important;
}
.site-main-header .navbar-collapse{
    position:relative;
    z-index:4;
    flex:1 1 0 !important;
    width:auto;
    min-width:0 !important;
}
.site-main-header .site-main-links{
    flex:1 1 auto !important;
    min-width:0 !important;
    overflow:visible;
    justify-content:center;
}
.site-main-header .site-main-links > .nav-item{
    flex:0 1 auto;
    min-width:0;
}
.site-main-header .site-main-links > .nav-item > .nav-link{
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
}

/* در عرض‌های لپ‌تاپ، تاریخ/ساعت فضا را از منوی اصلی نمی‌گیرد. */
@media (min-width:992px) and (max-width:1399.98px){
    .site-main-header .switch-brand-text{font-size:1.28rem !important;}
    .site-main-header .switch-brand-mark{
        width:54px !important;
        flex-basis:54px !important;
    }
    .site-main-header .switch-brand-mark .seven-pel-logo,
    .site-main-header .switch-brand-mark .karood-logo{width:54px !important;}
    .site-main-header .site-main-links{gap:.08rem !important;}
    .site-main-header .nav-link{
        font-size:.90rem !important;
        padding-inline:.30rem !important;
    }
    .site-main-header .header-icon{font-size:.92rem;}
    .header-system-datetime{
        min-width:132px;
        padding:.28rem .4rem;
        margin-inline:.2rem .1rem;
    }
    .header-system-date{font-size:.68rem;}
    .header-system-time{font-size:.86rem;}
    .header-account-zone{max-width:170px;}
    .header-user-trigger{max-width:145px;}
    .header-user-name{max-width:66px;}
}

/* لپ‌تاپ‌های 1366px و مشابه: اگر فضا کم شد تاریخ جمع‌وجور می‌شود،
   اما برند و خانه هرگز روی هم نمی‌افتند. */
@media (min-width:992px) and (max-width:1249.98px){
    .header-system-datetime{min-width:0;width:118px;}
    .header-system-date-label{font-size:.6rem;}
    .header-system-date{font-size:.62rem;}
    .header-system-time{font-size:.78rem;}
    .header-account-zone{max-width:145px;}
    .header-user-trigger{max-width:125px;gap:.25rem;}
    .header-user-avatar{width:30px;height:30px;flex-basis:30px;}
    .header-user-name{max-width:52px;font-size:.72rem;}
}

/* منوی کاربر همیشه داخل viewport باز شود؛ در RTL لبه راست به عنوان مرجع است. */
.header-user-menu{position:relative !important;}
.header-user-dropdown{
    position:absolute !important;
    top:calc(100% + .35rem) !important;
    right:0 !important;
    left:auto !important;
    transform:none !important;
    width:min(285px, calc(100vw - 24px));
    max-width:calc(100vw - 24px);
    min-width:230px;
    box-sizing:border-box;
    margin:0 !important;
    z-index:10000 !important;
}
.header-user-dropdown .dropdown-item{
    white-space:normal;
}
@media (max-width:991.98px){
    .header-user-dropdown{
        position:absolute !important;
        right:0 !important;
        left:auto !important;
        width:min(300px, calc(100vw - 24px));
        max-width:calc(100vw - 24px);
    }
}

/* از هر نوع clip شدن dropdown توسط هدر جلوگیری شود. */
.site-main-header,
.site-main-header .container,
.site-main-header .navbar-collapse,
.site-main-header .header-account-zone{
    overflow:visible !important;
}

/* اگر Bootstrap در یک مرورگر dropdown را با inline transform جابه‌جا کرد،
   لبه راست همچنان محدود به viewport می‌ماند. */
.header-user-menu .dropdown-menu.show{
    inset-inline-end:0 !important;
    inset-inline-start:auto !important;
}

/* Final mobile header stability: brand + menu stay on one row; collapsed content gets its own row. */
@media (max-width: 575px){
  .site-main-header .container{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto !important;
    align-items:center !important;
    gap:.45rem !important;
    width:100% !important;
    flex-wrap:initial !important;
  }
  .site-main-header .navbar-brand.switch-brand{
    grid-column:1 !important;
    grid-row:1 !important;
    min-width:0 !important;
    max-width:100% !important;
    margin:0 !important;
    overflow:hidden !important;
  }
  .site-main-header .switch-brand-text{
    font-size:1.15rem !important;
    white-space:nowrap !important;
  }
  .site-main-header .switch-brand-mark{
    width:48px !important;
    flex-basis:48px !important;
    height:40px !important;
  }
  .site-main-header .switch-brand-mark .seven-pel-logo{width:48px !important;}
  .site-main-header .navbar-toggler{
    grid-column:2 !important;
    grid-row:1 !important;
    margin:0 !important;
    flex:0 0 auto !important;
    padding:.42rem .55rem !important;
  }
  .site-main-header .navbar-collapse{
    grid-column:1 / -1 !important;
    grid-row:2 !important;
    width:100% !important;
    flex-basis:auto !important;
    min-width:0 !important;
  }
  .site-main-header .site-main-links{
    width:100% !important;
    margin:0 !important;
  }
  .site-main-header .header-system-datetime{
    width:100% !important;
    min-width:0 !important;
    margin:.4rem 0 0 !important;
  }
  .site-main-header .header-account-zone{
    width:100% !important;
    max-width:none !important;
    margin:.4rem 0 0 !important;
  }
}

/* =========================================================
   کارود — Mobile App Header
   فقط موبایل؛ هدر دسکتاپ عمداً دست‌نخورده می‌ماند.
   ========================================================= */
.karoud-mobile-header,
.karoud-mobile-menu { display:none; }

@media (max-width: 767.98px) {
    /* هدر قدیمی در موبایل و تبلت باریک مخفی می‌شود تا جستجوی یکپارچه همیشه قابل مشاهده باشد. */
    header > .site-main-header { display:none !important; }

    .karoud-mobile-header {
        display:flex;
        position:relative;
        z-index:1100;
        min-height:58px;
        align-items:center;
        justify-content:space-between;
        gap:.45rem;
        padding:.42rem .65rem;
        background:rgba(15,23,42,.97);
        border-bottom:1px solid rgba(255,255,255,.10);
        box-shadow:0 3px 14px rgba(15,23,42,.18);
    }
    .karoud-mobile-brand {
        display:inline-flex;
        align-items:center;
        gap:.32rem;
        min-width:0;
        color:#fff !important;
        text-decoration:none !important;
        flex:0 0 auto;
    }
    .karoud-mobile-logo {
        display:inline-flex;
        align-items:center;
        justify-content:center;
        width:38px;
        height:34px;
        overflow:hidden;
    }
    .karoud-mobile-logo .seven-pel-logo {
        width:40px !important;
        height:auto;
        filter:drop-shadow(0 2px 5px rgba(0,0,0,.25));
    }
    .karoud-mobile-brand-name {
        font-size:1.02rem;
        font-weight:900;
        white-space:nowrap;
    }
    .karoud-mobile-actions {
        display:flex;
        align-items:center;
        justify-content:flex-end;
        gap:.18rem;
        min-width:0;
    }
    .karoud-mobile-icon-btn {
        width:36px;
        height:36px;
        flex:0 0 36px;
        display:inline-flex;
        align-items:center;
        justify-content:center;
        border:0;
        border-radius:11px;
        background:rgba(255,255,255,.08);
        color:#fff !important;
        text-decoration:none !important;
        font-size:1.05rem;
        line-height:1;
        padding:0;
        -webkit-tap-highlight-color:transparent;
    }
    .karoud-mobile-icon-btn:active,
    .karoud-mobile-icon-btn:focus-visible {
        background:rgba(14,165,233,.28);
        outline:none;
        transform:scale(.95);
    }
    .karoud-mobile-menu-btn { font-size:1.28rem; cursor:pointer; }

    .karoud-mobile-menu {
        position:relative;
        z-index:1099;
        display:grid;
        grid-template-columns:repeat(3, 1fr);
        gap:.45rem;
        padding:.6rem .65rem .7rem;
        background:#fff;
        border-bottom:1px solid #e2e8f0;
        box-shadow:0 6px 16px rgba(15,23,42,.10);
    }
    .karoud-mobile-menu[hidden] { display:none !important; }
    .karoud-mobile-menu a {
        min-height:48px;
        display:flex;
        flex-direction:column;
        align-items:center;
        justify-content:center;
        gap:.18rem;
        border:1px solid #e2e8f0;
        border-radius:12px;
        background:#f8fafc;
        color:#0f172a;
        text-decoration:none;
        font-size:.72rem;
        font-weight:700;
    }
    .karoud-mobile-menu a span:first-child { font-size:1.05rem; line-height:1; }
}


/* کارود — جستجوی یکپارچه موبایل: همیشه در عرض‌های موبایلی قابل مشاهده و لمس است. */
@media (max-width: 767.98px) {
    .karoud-mobile-header {
        display:flex !important;
        flex-wrap:wrap !important;
        align-items:center !important;
        width:100% !important;
        box-sizing:border-box !important;
    }
    .karoud-mobile-header .karoud-mobile-global-search {
        display:flex !important;
        flex:0 0 100% !important;
        width:100% !important;
        order:3 !important;
    }
}
