﻿/* =============================
   PREMIUM NAV + MEGA MENU
   prefix: ag-nav-
   ============================= */

.ag-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    font-family: Peyda;
    direction:rtl;
}

.ag-nav__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.06);
}

/* Brand */
.ag-nav__brand {
    display: grid;
    grid-template-columns: 34px auto;
    column-gap: 10px;
    row-gap: 2px;
    align-items: center;
    text-decoration: none;
    color: #0f172a;
    padding: 6px 8px;
    border-radius: 12px;
    transition: 0.25s ease;
}

    .ag-nav__brand:hover {
        background: rgba(0,0,0,0.04);
    }

.ag-nav__brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: #fff;
    font-size: 18px;
    box-shadow: 0 6px 18px rgba(14,165,233,0.25);
}

.ag-nav__brand-name {
    font-weight: 800;
    font-size: 15px;
}

.ag-nav__brand-sub {
    grid-column: 2 / 3;
    font-size: 10px;
    color: #64748b;
}

/* Links */
.ag-nav__links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ag-nav__link {
    position: relative;
    text-decoration: none;
    color: #0f172a;
    font-size: 12.5px;
    font-weight: 600;
    padding: 10px 12px;
    border-radius: 12px;
    transition: 0.25s ease;
    white-space: nowrap;
}

    .ag-nav__link:hover {
        background: rgba(2,6,23,0.05);
        transform: translateY(-1px);
    }

    /* A hot link */
    .ag-nav__link.is-hot {
        background: linear-gradient(135deg, rgba(14,165,233,0.14), rgba(99,102,241,0.14));
        border: 1px solid rgba(14,165,233,0.18);
    }

.ag-nav__spark {
    position: absolute;
    inset-inline-start: 8px;
    inset-block-start: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34,197,94,0.18);
    animation: ag-nav-pulse 1.8s ease infinite;
}

@keyframes ag-nav-pulse {
    0%,100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.25);
        opacity: 0.55;
    }
}

/* Dropdown trigger as button */
.ag-nav__link--btn {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.ag-nav__chev {
    display: inline-block;
    margin-inline-start: 6px;
    font-size: 10px;
    opacity: 0.6;
    transition: 0.25s ease;
}

/* Actions */
.ag-nav__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ag-nav__primary,
.ag-nav__ghost {
    text-decoration: none;
    font-size: 11.5px;
    font-weight: 700;
    border-radius: 12px;
    padding: 10px 12px;
    transition: 0.25s ease;
}

.ag-nav__primary {
    color: #fff;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    box-shadow: 0 8px 20px rgba(99,102,241,0.25);
}

    .ag-nav__primary:hover {
        transform: translateY(-1px);
        filter: saturate(1.1);
    }

.ag-nav__ghost {
    color: #0f172a;
    background: rgba(0,0,0,0.04);
}

    .ag-nav__ghost:hover {
        background: rgba(0,0,0,0.08);
    }

/* =============================
   MEGA MENU PANEL
   prefix: ag-mega-
   ============================= */

.ag-nav__dropdown {
    position: relative;
}

.ag-mega {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 10px);
    width: min(980px, 92vw);
    display: grid;
    grid-template-columns: 210px 1fr 240px;
    gap: 14px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.98);
    transform-origin: top right;
    transition: 0.22s ease;
    /* برای اینکه با بقیه سکشن‌ها تداخل نداشته باشه */
    z-index: 60;
    left: -250px;
}

/* show on hover desktop */
@media (min-width: 980px) {
    .ag-nav__dropdown:hover .ag-mega {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
    }

    .ag-nav__dropdown:hover .ag-nav__chev {
        transform: rotate(180deg);
    }
}

/* Column base */
.ag-mega__col {
    border-radius: 14px;
}

/* Right categories */
.ag-mega__col--cats {
    background: linear-gradient(180deg, #0b1324 0%, #111827 100%);
    padding: 12px;
    color: #fff;
}

.ag-mega__title {
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 10px;
}

.ag-mega__cat {
    width: 100%;
    border: 0;
    background: rgba(255,255,255,0.05);
    color: #fff;
    cursor: pointer;
    padding: 10px 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    font-weight: 600;
    transition: 0.22s ease;
    margin-bottom: 6px;
    text-align: right;
}

.ag-mega__cat-ico {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,0.12);
    font-size: 12px;
}

.ag-mega__cat:hover {
    background: rgba(255,255,255,0.12);
    transform: translateX(-2px);
}

.ag-mega__cat.is-active {
    background: linear-gradient(135deg, rgba(14,165,233,0.22), rgba(99,102,241,0.22));
    outline: 1px solid rgba(255,255,255,0.12);
}

.ag-mega__cat-pill {
    margin-inline-start: auto;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
}

/* Middle panels */
.ag-mega__col--lists {
    background: #f8fafc;
    padding: 12px;
}

.ag-mega__panel {
    display: none;
    animation: ag-mega-fade 0.22s ease;
}

    .ag-mega__panel.is-active {
        display: block;
    }

@keyframes ag-mega-fade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ag-mega__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 10px;
}

.ag-mega__block {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 14px;
    padding: 12px;
    transition: 0.22s ease;
}

    .ag-mega__block:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(0,0,0,0.06);
    }

.ag-mega__block-title {
    font-weight: 800;
    font-size: 12px;
    color: #0f172a;
    margin-bottom: 8px;
}

.ag-mega__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: #334155;
    font-size: 11px;
    padding: 7px 8px;
    border-radius: 10px;
    transition: 0.2s ease;
}

    .ag-mega__item:hover {
        background: rgba(14,165,233,0.08);
        color: #0f172a;
    }

/* Last minute style row */
.ag-mega__list-row {
    display: grid;
    gap: 10px;
}

.ag-mega__deal {
    text-decoration: none;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 14px;
    padding: 12px;
    transition: 0.22s ease;
}

    .ag-mega__deal:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(0,0,0,0.06);
    }

.ag-mega__deal-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(239,68,68,0.12);
    color: #b91c1c;
    margin-bottom: 6px;
}

.ag-mega__deal-title {
    display: block;
    font-weight: 800;
    font-size: 12px;
    color: #0f172a;
}

.ag-mega__deal-sub {
    display: block;
    font-size: 10px;
    color: #64748b;
    margin-top: 2px;
}

/* Left promo */
.ag-mega__col--promo {
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 55%, #8b5cf6 100%);
    color: #fff;
    padding: 14px;
    position: relative;
    overflow: hidden;
}

.ag-mega__promo {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 14px;
    padding: 14px;
    backdrop-filter: blur(8px);
}

.ag-mega__promo-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.16);
    margin-bottom: 8px;
}

.ag-mega__promo-title {
    font-size: 14px;
    font-weight: 900;
    margin-bottom: 6px;
}

.ag-mega__promo-text {
    font-size: 10.5px;
    opacity: 0.9;
    line-height: 1.7;
    margin-bottom: 12px;
}

.ag-mega__promo-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.14);
    transition: 0.22s ease;
}

    .ag-mega__promo-cta:hover {
        background: rgba(255,255,255,0.24);
        transform: translateX(-2px);
    }

.ag-mega__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.ag-mega__stat {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 12px;
    padding: 10px;
}

.ag-mega__stat-num {
    display: block;
    font-weight: 900;
    font-size: 14px;
}

.ag-mega__stat-label {
    display: block;
    font-size: 9.5px;
    opacity: 0.9;
}

/* =============================
   MOBILE NAV
   prefix: ag-mnav-
   ============================= */

.ag-nav__burger {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.06);
    background: rgba(0,0,0,0.04);
    display: none;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
}

    .ag-nav__burger span {
        display: block;
        width: 16px;
        height: 2px;
        background: #0f172a;
        border-radius: 5px;
    }

/* Drawer */
.ag-mnav {
    position: fixed;
    inset: 0;
    z-index: 80;
    opacity: 0;
    visibility: hidden;
    transition: 0.22s ease;
}

    .ag-mnav.is-open {
        opacity: 1;
        visibility: visible;
    }

.ag-mnav__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2,6,23,0.35);
    backdrop-filter: blur(6px);
}

.ag-mnav__panel {
    position: absolute;
    top: 10px;
    right: 10px;
    width: min(360px, 92vw);
    height: calc(100dvh - 20px);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.2);
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
    transform: translateX(12px) scale(0.98);
    transition: 0.22s ease;
}

.ag-mnav.is-open .ag-mnav__panel {
    transform: translateX(0) scale(1);
}

.ag-mnav__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 10px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.ag-mnav__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.ag-mnav__close {
    border: 0;
    background: rgba(0,0,0,0.06);
    width: 32px;
    height: 32px;
    border-radius: 10px;
    cursor: pointer;
}

.ag-mnav__links {
    padding: 12px 14px;
    display: grid;
    gap: 6px;
}

    .ag-mnav__links a,
    .ag-mnav__details summary {
        font-size: 12px;
        font-weight: 700;
        color: #0f172a;
        text-decoration: none;
        padding: 10px 10px;
        border-radius: 12px;
        background: rgba(0,0,0,0.04);
    }

        .ag-mnav__links a:hover {
            background: rgba(0,0,0,0.08);
        }

.ag-mnav__details {
    background: rgba(0,0,0,0.04);
    border-radius: 12px;
    padding: 4px;
}

    .ag-mnav__details summary {
        cursor: pointer;
        list-style: none;
        background: transparent;
    }

        .ag-mnav__details summary::-webkit-details-marker {
            display: none;
        }

.ag-mnav__sub {
    display: grid;
    gap: 6px;
    padding: 8px;
}

    .ag-mnav__sub a {
        background: #fff;
        border: 1px solid rgba(0,0,0,0.05);
        font-weight: 600;
    }

.ag-mnav__cta {
    padding: 12px 14px 16px;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: grid;
    gap: 8px;
}

.ag-mnav__btn {
    text-decoration: none;
    text-align: center;
    font-size: 11.5px;
    font-weight: 800;
    padding: 11px 12px;
    border-radius: 12px;
}

.ag-mnav__btn--primary {
    color: #fff;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
}

.ag-mnav__btn--ghost {
    color: #0f172a;
    background: rgba(0,0,0,0.06);
}

/* =============================
   RESPONSIVE RULES
   ============================= */

@media (max-width: 980px) {
    .ag-nav__links {
        display: none;
    }

    .ag-nav__burger {
        display: inline-flex;
    }

    .ag-nav__container {
        border-radius: 16px;
    }
