﻿
/* ===== منوی دکمه‌ای ===== */
.custom-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
    justify-content: flex-start;
    padding: 10px 15px;
    background: #efefef;
    direction: rtl;
    width: 100%;
    box-sizing: border-box;
    min-height: 60px;
    overflow: visible;
    position: relative;
    z-index: 100;
}

/* آیتم منو */
.custom-menu .menu-item {
    position: relative;
    flex: 0 0 auto;
}

    /* لینک اصلی منو */
    .custom-menu .menu-item > a {
        display: block;
        padding: 8px 14px;
        background: #fff;
        color: #333;
        border-radius: 6px;
        border: 1px solid #ccc;
        text-decoration: none;
        font-size: 14px;
        transition: background-color 0.3s, color 0.3s;
        white-space: nowrap;
    }

        /* هاور */
        .custom-menu .menu-item > a:hover {
            background: #87CEFA;
            color: #fff;
            border-color: #87CEFA;
        }

/* زیرمنو */
.custom-menu .submenu {
    position: absolute;
    top: 100%;
    right: 0;
    display: none;
    flex-direction: column;
    min-width: 180px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    z-index: 9999;
}

/* نمایش زیرمنو */
.custom-menu .menu-item:hover > .submenu {
    display: flex;
}

/* لینک‌های داخل زیرمنو */
.custom-menu .submenu a {
    display: block;
    padding: 9px 12px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
}

    .custom-menu .submenu a:hover {
        background: #87CEFA;
        color: #fff;
    }

/* موبایل */
@media (max-width: 768px) {
    .custom-menu {
        flex-direction: column;
        align-items: stretch;
    }

        .custom-menu .menu-item {
            width: 100%;
        }

            .custom-menu .menu-item > a {
                width: 100%;
                box-sizing: border-box;
                text-align: center;
            }

        .custom-menu .submenu {
            position: static;
            display: none;
            box-shadow: none;
            background: #f7f7f7;
            margin-top: 5px;
        }

        .custom-menu .menu-item.active > .submenu {
            display: flex;
        }
}

