/* Linked to GK Tokens — Do not hardcode color/size/shadow/radius. */

/*
 * Header Layout
 */
.gk-header {
    position: sticky;
    top: 0;
    background: var(--gk-color-surface);
    z-index: var(--gk-z-header);
    border-bottom: var(--gk-border-width) solid var(--gk-border-color);
}

.gk-header .container {
    max-width: var(--gk-site-width); /* Specific override */
    margin: 0 auto;
    padding-inline: var(--gk-container-gap);
}

.menu-container {
    display: flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
}

.menu-container button {
    font-size: 14px;
    font-weight: 900;
}

.category-menu a {
    text-decoration: none;
}

.custom-logo {
    width: 180px;
    height: auto;
    vertical-align: middle;
}

.header-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.header-start {
    display: flex;
    align-items: center;
    gap: 20px;
}

.gk-header .header-top {
    height: 72px;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.gk-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    color: var(--gk-color-danger);
}

.gk-header .logo-mark {
    width: 34px;
    height: 34px;
    border-radius: var(--gk-radius-round);
    background: var(--gk-color-danger);
    display: grid;
    place-items: center;
    color: var(--gk-color-white);
    font-weight: 700;
}

.gk-header .logo-text {
    font-weight: 800;
    font-size: 22px;
    color: var(--gk-color-danger);
}

/*
 * Header Search
 */
.gk-search {
    flex: 0 1 clamp(280px, 40vw, 560px);
    min-width: 220px;
    margin-inline-start: 12px;
}

.gk-search .search-wrap {
    position: relative;
}

.gk-search .search-input {
    width: 100%;
    height: 44px;
    border: none;
    background: var(--gk-color-100);
    border-radius: var(--gk-radius-md);
    padding: 0 48px;
    padding-inline-start: 16px;
    text-align: start;
    outline: none;
    transition: background var(--gk-duration) var(--gk-ease-standard);
    font-family: inherit;
}

.gk-search .search-input:focus {
    background: var(--gk-color-surface);
}

.gk-search .search-input::placeholder {
    color: transparent;
}

.gk-search .search-input:not(:focus):placeholder-shown {
    padding-inline-start: 140px;
}

.gk-search .search-ico {
    position: absolute;
    inset-inline-end: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    pointer-events: none;
}

.gk-search .search-clear {
    position: absolute;
    inset-inline-end: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: var(--gk-radius-round);
    border: none;
    background: transparent;
    display: none;
    cursor: pointer;
}

.gk-search .search-clear:hover {
    background: var(--gk-color-200);
}

.gk-search .search-brand {
    position: absolute;
    inset-inline-start: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    cursor: text;
    user-select: none;
    white-space: nowrap;
    opacity: .9;
    transition: opacity var(--gk-duration-fast) var(--gk-ease-standard), visibility var(--gk-duration-fast) var(--gk-ease-standard);
}

.gk-search .search-brand__label,
.gk-search .search-brand__text {
    font-size: 14px;
    color: var(--gk-color-500);
}

.gk-search .search-brand__logo img {
    height: 18px;
    width: auto;
    display: block;
}

.gk-search .search-brand__text {
    font-weight: 700;
}

.gk-search .search-brand__logo,
.gk-search .search-brand__label {
    display: none;
}

.gk-search .search-brand::before {
    content: 'جستجو';
    font-size: 14px;
    color: var(--gk-color-500);
}

.gk-search .search-input:not(:focus):placeholder-shown {
    padding-inline-start: 85px !important;
}

.gk-search .search-input:focus ~ .search-brand,
.gk-search .search-input:not(:placeholder-shown) ~ .search-brand {
    opacity: 0;
    visibility: hidden;
}

/*
 * Header Actions
 */
.gk-header .actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-inline-start: auto;
}

.gk-header .action-btn {
    display: inline-flex;
    align-items: center;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--gk-color-900);
}

.gk-header .action-btn .label {
    display: none;
}

.gk-header .icon {
    width: 24px;
    height: 24px;
    display: inline-block;
}

.gk-header .badge {
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: var(--gk-radius-md);
    background: var(--gk-color-danger);
    color: var(--gk-color-white);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    transform: translate(6px, -8px);
}

.gk-header .divider {
    height: 24px;
    width: 1px;
    background: var(--gk-border-color);
    margin: 0 4px;
}

/*
 * Header Navigation (Bottom Row)
 */
.gk-header .header-bottom {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gk-header .gk-main-nav {
    display: flex;
    align-items: center;
}

.gk-header .menu-button {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: var(--gk-border-width) solid var(--gk-border-color);
    border-radius: var(--gk-radius-lg);
    background: var(--gk-color-surface);
    cursor: pointer;
}

.gk-header .location {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--gk-color-700);
    font-size: 13px;
    cursor: pointer;
    background: transparent;
    border: 0;
}

.gk-header .location .dot {
    width: 6px;
    height: 6px;
    background: var(--gk-color-danger);
    border-radius: var(--gk-radius-round);
}

/*
 * Mobile Drawer
 */
#gkOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, var(--gk-opacity-overlay, 0.35));
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--gk-duration) var(--gk-ease-standard), visibility var(--gk-duration) var(--gk-ease-standard);
    z-index: 40;
}

#gkOverlay.show {
    opacity: 1;
    visibility: visible;
}

#gkDrawer {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    width: 320px;
    background: var(--gk-color-surface);
    box-shadow: var(--gk-shadow);
    transform: translateX(-100%);
    transition: transform var(--gk-duration) var(--gk-ease-standard);
    z-index: 45;
    display: flex;
    flex-direction: column;
}

html[dir="rtl"] #gkDrawer {
    transform: translateX(100%);
}

#gkDrawer.show {
    transform: translateX(0);
}

#gkDrawer header {
    position: sticky;
    top: 0;
}

#gkDrawer .drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: var(--gk-border-width) solid var(--gk-border-color);
}

#gkDrawer .drawer-body {
    padding: 12px 8px;
    overflow: auto;
}

#gkDrawer .drawer-nav a,
.gk-drawer-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--gk-radius-lg);
    color: var(--gk-color-700);
}

#gkDrawer .drawer-nav a:hover,
.gk-drawer-nav a:hover {
    background: var(--gk-color-100);
}

/*
 * Location Dialog (Modal)
 */
.location-dialog {
    border: none;
    border-radius: var(--gk-radius-xl);
    padding: 0;
    box-shadow: var(--gk-shadow);
    width: min(560px, 92vw);
}

.location-dialog::backdrop {
    background: rgba(0, 0, 0, var(--gk-opacity-overlay, 0.35));
}

.location-dialog .ld-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: var(--gk-border-width) solid var(--gk-border-color);
}

.location-dialog .ld-body {
    padding: 16px;
}

.location-dialog .cities {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.location-dialog .city {
    padding: 10px 12px;
    border: var(--gk-border-width) solid var(--gk-border-color);
    border-radius: var(--gk-radius-lg);
    cursor: pointer;
    text-align: center;
}

.location-dialog .city:hover {
    background: var(--gk-color-100);
}

/*
 * Account Dropdown
 */
.gk-account {
    position: relative;
}

.gk-account .gk-caret {
    transition: transform var(--gk-duration-fast) var(--gk-ease-standard);
    width: 10px;
}

.gk-acc-menu {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 8px);
    min-inline-size: 240px;
    max-inline-size: min(320px, 90vw);
    background: var(--gk-color-surface);
    border: var(--gk-border-width) solid var(--gk-border-color);
    border-radius: var(--gk-radius-lg);
    box-shadow: var(--gk-shadow-lg);
    padding: 8px;
    z-index: var(--gk-z-dropdown);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(.98);
    transform-origin: top;
    transition: opacity var(--gk-duration-fast) var(--gk-ease-standard), transform var(--gk-duration-fast) var(--gk-ease-standard), visibility var(--gk-duration-fast) var(--gk-ease-standard);
}

.gk-account.is-open .gk-acc-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.gk-account.is-open .gk-caret {
    transform: rotate(180deg);
}

.gk-acc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--gk-radius-lg);
    color: var(--gk-color-700);
    text-decoration: none;
    font-size: 14px;
}

.gk-acc-item:hover {
    background: var(--gk-color-100);
}

.gk-acc-item--profile {
    font-weight: 700;
    color: var(--gk-color-900);
    border-bottom: 1px dashed var(--gk-color-100);
    margin-bottom: 6px;
}

.gk-acc-item--logout {
    color: var(--gk-color-danger);
}

.gk-acc-item--logout:hover {
    background: var(--gk-color-100); /* No token for light danger, using neutral */
}

/*
 * Responsive Design
 */
@media (max-width: 992px) {
    .gk-header .gk-menu {
        display: none;
    }
    .gk-header .menu-button {
        display: inline-flex;
    }
    .gk-search {
        flex-basis: clamp(260px, 44vw, 520px);
    }
}

@media (max-width: 768px) {
    .gk-header .logo,
    .gk-header .custom-logo-link,
    .gk-header .custom-logo {
        display: none !important;
    }
    .gk-header .header-top {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 10px;
        height: auto;
        padding-block: 8px;
    }
    .gk-search {
        min-width: 0;
        margin-inline-start: 0;
    }
    .gk-search .search-input {
        height: 40px;
        padding-inline-start: 16px;
    }
    .gk-search .search-input:not(:focus):placeholder-shown {
        padding-inline-start: 140px;
    }
    .gk-search .search-brand__logo img {
        height: 16px;
    }
    .gk-search .search-input:focus {
        font-size: 16px; /* Prevents auto-zoom on mobile */
    }
    .gk-search .search-brand__logo,
    .gk-search .search-brand__label {
        display: inline-block;
    }
    .gk-search .search-brand::before {
        display: none;
    }
    .gk-search .search-input:not(:focus):placeholder-shown {
        padding-inline-start: 140px !important;
    }
    .gk-header .actions {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 4px;
        margin-inline-start: 0;
    }
    .gk-header .actions > * {
        display: none !important;
    }
    .gk-header .actions > [aria-label*="اعلان"],
    .gk-header .actions > [aria-label*="notification" i],
    .gk-header .actions > [class*="notif" i] {
        display: inline-flex !important;
    }
    .gk-header .menu-button,
    .gk-header .divider,
    .gk-header .gk-account,
    .gk-header #gkAccountToggle,
    .gk-header .location,
    .gk-header .header-bottom,
    .gk-header .gk-main-nav {
        display: none !important;
    }
    .gk-header {
        transition: transform var(--gk-duration) var(--gk-ease-standard);
        will-change: transform;
        backface-visibility: hidden;
    }
    .gk-header.gk-hide {
        transform: translateY(-100%);
    }
}

@media (min-width: 993px) {
    .gk-header .header-bottom {
        transition: transform var(--gk-duration) var(--gk-ease-standard), opacity var(--gk-duration) var(--gk-ease-standard), margin var(--gk-duration) var(--gk-ease-standard);
        will-change: transform, opacity, margin;
    }
    .gk-header.gk-bottom-hidden .header-bottom {
        transform: translateY(-100%);
        margin-top: calc(var(--gk-hb-h, 44px) * -1);
        opacity: 0;
        pointer-events: none;
    }
}

/*
 * Accessibility
 */
:focus-visible {
    outline-color: var(--gk-focus-color);
    outline-width: var(--gk-focus-width);
    outline-offset: var(--gk-focus-offset);
    outline-style: var(--gk-focus-style);
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0ms !important;
        animation-duration: 0ms !important;
    }
}



/* Notification Badge */
.gk-notif-badge {
    position: absolute;
    top: -2px;
    right: -2px; /* در سایت RTL اگر چپ چین بود right به left تغییر کند */
    width: 8px;
    height: 8px;
    background-color: var(--gk-color-danger, #ef394e);
    border-radius: 50%;
    border: 1px solid #fff; /* حاشیه سفید برای خوانایی بهتر */
    z-index: 10;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

html[dir="ltr"] .gk-notif-badge {
    right: auto;
    left: -2px;
}

/* انیمیشن کوچک برای جلب توجه */
.gk-notif-badge {
    animation: gkPulse 2s infinite;
}

@keyframes gkPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 57, 78, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 4px rgba(239, 57, 78, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 57, 78, 0); }
}



/* --- Smart Hide Effect for Elementor Sections --- */
.gk-smart-hide {
    transition: transform 0.3s ease, opacity 0.3s ease, margin 0.3s ease !important;
    transform-origin: top;
    will-change: transform, margin;
    z-index: 9; /* اطمینان از اینکه زیر هدر اصلی (اگر باشد) نرود */
}

/* وقتی کلاس is-hidden توسط JS اضافه شد */
.gk-smart-hide.is-hidden {
    transform: translateY(-100%); /* به سمت بالا خارج شود */
    margin-bottom: -50px; /* جمع کردن فضای خالی (عدد تقریبی، بسته به ارتفاع سکشن) */
    opacity: 0;
    pointer-events: none;
}

/* اصلاح برای اینکه اگر هدر چسبان (Sticky) است، درست کار کند */
.elementor-sticky--active .gk-smart-hide.is-hidden {
    margin-bottom: 0; /* در حالت استیکی مارجین منفی نیاز نیست */
}



/* =========================================================================
   GanjehKala Header & Menu Styles (Optimized)
   ========================================================================= */

/* متغیرهای رنگی (در صورتی که سراسری تعریف نشده باشند) */
:root {
    --gk-menu-color: #333;
    --gk-menu-hover: #149494;
    --gk-menu-border: #eee;
    --gk-menu-bg: #fff;
    --gk-menu-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

/* 1. کانتینر اصلی منو (ul.gk-menu) */
.gk-menu {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 15px; /* فاصله افقی بین آیتم‌های اصلی */
    position: relative;
    z-index: 100;
}

/* 2. آیتم‌های سطح اول (li) */
.gk-menu > li {
    display: inline-flex;
    align-items: center; /* تراز عمودی وسط */
    position: relative;  /* مرجع پوزیشن برای زیرمنو */
    height: 100%;        /* پر کردن ارتفاع هدر */
}

/* 3. لینک‌های سطح اول (a) */
.gk-menu > li > a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* فاصله آیکون و متن */
    padding: 0 8px;
    height: 100%; /* ارتفاع کامل */
    min-height: 50px; /* حداقل ارتفاع تاچ */
    font-weight: 500;
    font-size: 14px;
    color: var(--gk-menu-color);
    text-decoration: none;
    transition: color 0.3s ease;
    line-height: 1; /* حذف فاصله‌های اضافی فونت */
}

/* هاور لینک سطح اول */
.gk-menu > li:hover > a,
.gk-menu > li.current-menu-item > a {
    color: var(--gk-menu-hover);
}

/* 4. استایل آیکون‌ها (عمومی) */
.gk-menu .gk-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* جلوگیری از له شدن */
    line-height: 0; /* حذف فاصله زیر SVG */
    /* ابعاد پیش‌فرض اگر در ادمین ست نشود */
    width: 20px;
    height: 20px;
}

.gk-menu .gk-icon svg,
.gk-menu .gk-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    vertical-align: middle;
}

/* رنگ‌پذیری SVG از متن والد */
.gk-menu .gk-icon-svg svg,
.gk-menu .gk-icon-svg svg * {
    fill: currentColor;
    transition: fill 0.3s ease;
}

/* تراز متن فارسی */
.gk-menu .gk-title {
    display: inline-block;
    padding-top: 2px; /* اصلاح نوری فونت‌های فارسی */
}

/* =========================================================================
   Sub Menu Styles (Dropdowns)
   ========================================================================= */

/* کانتینر زیرمنو (.sub-menu یا .gk-sub-menu) */
.gk-menu .sub-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 240px; /* عرض استاندارد */
    background: var(--gk-menu-bg);
    box-shadow: var(--gk-menu-shadow);
    border-radius: 0 0 8px 8px;
    padding: 10px 0;
    margin: 0;
    list-style: none;
    z-index: 999;

    /* انیمیشن باز شدن */
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transform-origin: top center;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);

    /* خط رنگی بالا */
    border-top: 3px solid var(--gk-menu-hover);
}

/* نمایش زیرمنو با هاور */
.gk-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* آیتم‌های داخل زیرمنو */
.gk-menu .sub-menu li {
    display: block;
    position: relative; /* مرجع برای زیرمنوی سطح ۳ */
}

/* لینک‌های زیرمنو */
.gk-menu .sub-menu li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    font-size: 13.5px;
    color: #555;
    text-decoration: none;
    transition: all 0.2s ease;
    margin: 0 5px; /* فاصله از لبه‌ها */
    border-radius: 4px;
}

/* هاور آیتم زیرمنو */
.gk-menu .sub-menu li a:hover {
    background-color: #f7f7f7;
    color: var(--gk-menu-hover);
    padding-right: 20px; /* افکت حرکت به چپ */
}

/* =========================================================================
   Level 3+ Menus (Nested Dropdowns)
   ========================================================================= */

.gk-menu .sub-menu .sub-menu {
    top: -3px; /* کمی بالاتر برای زیبایی */
    right: 100%; /* باز شدن در سمت چپ والد */
    margin-right: 5px; /* فاصله کوچک */
    border-top: none; /* حذف خط رنگی برای سطوح داخلی */
    border-radius: 8px; /* گردی کامل */

    /* انیمیشن افقی */
    transform: translateX(10px);
}

.gk-menu .sub-menu li:hover > .sub-menu {
    transform: translateX(0);
}

/* =========================================================================
   Indicators (Arrows)
   ========================================================================= */

/* فلش رو به پایین برای سطح اول */
.gk-menu > li.menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-left: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
    margin-right: 4px;
    margin-top: -3px;
    opacity: 0.7;
}

/* فلش رو به چپ برای زیرمنوها */
.gk-menu .sub-menu li.menu-item-has-children > a::after {
    content: '';
    position: absolute;
    left: 15px;
    top: 50%;
    width: 5px;
    height: 5px;
    border-left: 1.5px solid #999;
    border-bottom: 1.5px solid #999;
    transform: translateY(-50%) rotate(45deg);
    transition: border-color 0.3s;
}

.gk-menu .sub-menu li.menu-item-has-children > a:hover::after {
    border-color: var(--gk-menu-hover);
}

/* =========================================================================
   Badge Styles
   ========================================================================= */
.gk-menu .gk-badge {
    font-size: 10px;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 4px;
    background: var(--gk-menu-hover);
    color: #fff;
    margin-right: auto; /* چسبیدن به چپ در زیرمنو */
    margin-left: 0;
    white-space: nowrap;
}

/* بج در سطح اول بالا قرار گیرد */
.gk-menu > li > a .gk-badge {
    position: absolute;
    top: 2px;
    left: 0;
    margin: 0;
    font-size: 9px;
    padding: 1px 4px;
}




