/* ================================================================
   smart-menu.css
   Smart Mega Menu — Desktop hover | Mobile tap accordion
   
   HOW TO INCLUDE:
   Add this line inside <head> of your layout (e.g. app.blade.php):
   <link rel="stylesheet" href="{{ asset('css/smart-menu.css') }}">
   ================================================================ */

/* ============================================================
   SMART MENU — All rules scoped to header.rs-nav
   Prevents ANY bleed into page content
   ============================================================ */

header.rs-nav .nav > li { position: relative; }

/* Chevron */
header.rs-nav .nav > li > a > i.fa-chevron-down {
    font-size: 10px;
    margin-left: 5px;
    display: inline-block;
    transition: transform 0.25s ease;
    vertical-align: middle;
}
header.rs-nav .nav > li.sm-active > a > i.fa-chevron-down {
    transform: rotate(180deg);
}

/* ======================
   DESKTOP (≥ 992px)
   ====================== */
@media (min-width: 992px) {

    header.rs-nav .smart-menu {
        position: absolute;
        top: calc(100% + 2px);
        background: #fff;
        box-shadow: 0 10px 40px rgba(0,0,0,0.12);
        border-top: 3px solid #1a73e8;
        border-radius: 0 0 8px 8px;
        z-index: 9999;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
        overflow: visible;
        height: auto;
    }

    header.rs-nav .smart-menu.single-col {
        left: 0;
        min-width: 220px;
        transform: translateY(6px);
    }

    header.rs-nav .smart-menu.two-col {
        left: 50%;
        transform: translateX(-50%) translateY(6px);
        width: 520px;
        max-width: 90vw;
    }

    header.rs-nav .smart-menu.sm-open {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        display: block;
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0s;
    }
    header.rs-nav .smart-menu.single-col.sm-open { transform: translateY(0); }
    header.rs-nav .smart-menu.two-col.sm-open    { transform: translateX(-50%) translateY(0); }

    header.rs-nav .smart-menu .mega-menu-inner {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
    }

    header.rs-nav .smart-menu .mega-col {
        flex: 1;
        padding: 14px 16px;
        min-width: 180px;
        height: auto;
        overflow: visible;
        display: block;
    }
    header.rs-nav .smart-menu .mega-col + .mega-col {
        border-left: 1px solid #f0f0f0;
    }
    header.rs-nav .smart-menu .single-col-inner {
        padding: 10px 8px;
    }

    /* Links */
    header.rs-nav .smart-menu ul {
        list-style: none;
        padding: 0;
        margin: 0;
        display: block;
    }
    header.rs-nav .smart-menu ul li {
        margin: 0;
        padding: 0;
        display: block;
        height: auto;
    }
    header.rs-nav .smart-menu ul li a {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 6px 10px;
        font-size: 13.5px;
        color: #333;
        border-radius: 5px;
        text-decoration: none;
        font-weight: 400;
        white-space: normal;
        overflow: hidden;
        text-overflow: ellipsis;
        height: auto;
        line-height: normal;
        transition: background 0.15s, color 0.15s, padding-left 0.15s;
        background: transparent;
    }
    header.rs-nav .smart-menu ul li a::before {
        content: '';
        width: 5px;
        height: 5px;
        border-radius: 50%;
        background: #c5d8f9;
        flex-shrink: 0;
        display: inline-block;
        transition: background 0.15s;
    }
    header.rs-nav .smart-menu ul li a:hover {
        background: #e8f0fe;
        color: #1a73e8;
        padding-left: 16px;
    }
    header.rs-nav .smart-menu ul li a:hover::before {
        background: #1a73e8;
    }
}

/* ======================
   MOBILE / TABLET (< 992px)
   All rules scoped to header.rs-nav — zero bleed risk
   ====================== */
@media (max-width: 991px) {

    /* Hidden by default — ONLY affects .smart-menu inside our header */
    header.rs-nav .smart-menu {
        display: none;
        position: static;
        visibility: visible;
        opacity: 1;
    }

    /* Open state */
    header.rs-nav .smart-menu.sm-open {
        display: block;
        position: static;
        float: none;
        clear: both;
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
        margin: 2px 0 8px 0;
        padding: 6px 0 8px 0;
        background: #eef3ff;
        border-left: 3px solid #1a73e8;
        border-top: none;
        border-right: none;
        border-bottom: none;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
        transform: none;
        transition: none;
        z-index: 100;
    }

    header.rs-nav .smart-menu.sm-open .mega-menu-inner {
        display: block;
        width: 100%;
        height: auto;
        overflow: visible;
    }

    header.rs-nav .smart-menu.sm-open .mega-col {
        display: block;
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
        padding: 6px 10px;
        margin: 0;
        overflow: visible;
        float: none;
        flex: none;
        box-sizing: border-box;
    }
    header.rs-nav .smart-menu.sm-open .mega-col + .mega-col {
        border-top: 1px solid #d0dcf8;
        border-left: none;
        padding-top: 6px;
    }

    header.rs-nav .smart-menu.sm-open .single-col-inner {
        display: block;
        width: 100%;
        height: auto;
        padding: 4px 8px;
        overflow: visible;
    }

    header.rs-nav .smart-menu.sm-open ul {
        display: block;
        list-style: none;
        padding: 0;
        margin: 0;
        height: auto;
        overflow: visible;
        width: 100%;
    }

    header.rs-nav .smart-menu.sm-open ul li {
        display: block;
        height: auto;
        min-height: 0;
        max-height: none;
        overflow: visible;
        padding: 0;
        margin: 0;
        width: 100%;
        float: none;
        clear: both;
    }

    header.rs-nav .smart-menu.sm-open ul li a {
        display: flex;
        align-items: flex-start;
        gap: 7px;
        padding: 8px 10px;
        font-size: 13px;
        color: #333;
        text-decoration: none;
        font-weight: 400;
        white-space: normal;
        word-break: break-word;
        line-height: 1.4;
        height: auto;
        min-height: 0;
        max-height: none;
        width: 100%;
        box-sizing: border-box;
        overflow: visible;
        border-radius: 4px;
        background: transparent;
    }

    header.rs-nav .smart-menu.sm-open ul li a::before {
        content: '';
        display: inline-block;
        width: 5px;
        height: 5px;
        min-width: 5px;
        border-radius: 50%;
        background: #93b4ef;
        flex-shrink: 0;
        margin-top: 5px;
    }

    header.rs-nav .smart-menu.sm-open ul li a:active {
        background: #dce8ff;
        color: #1a73e8;
    }

    header.rs-nav .sm-toggle { cursor: pointer; }
    header.rs-nav .sm-toggle i.fa-chevron-down { pointer-events: none; }
}