/**
 * @package     Wma.Module.WmaMenumax
 * @subpackage  mod_wmamenumax
 *
* @author      Team Developer by WMA Web Maker Agency <wmaextension@gmail.com>
 * @copyright   (C) 2026 WMA Web Maker Agency. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 * @version     1.0.11
 * @date        20/08/2026
 * @file        media/css/wmamenumax.css
 */

.wma-mm {
    --wma-mm-bg: #ffffff;
    --wma-mm-text: #212529;
    --wma-mm-link: #212529;
    --wma-mm-link-hover: #046aca;
    --wma-mm-link-current: #046aca;
    --wma-mm-accent: #046aca;
    --wma-mm-border: #e9ecef;
    --wma-mm-mega-bg: #ffffff;
    --wma-mm-coltitle: var(--wma-mm-accent);
    --wma-mm-mega-border: var(--wma-mm-accent);
    --wma-mm-mega-outline: var(--wma-mm-border);
    --wma-mm-item-bg: var(--wma-mm-bg);
    --wma-mm-mobile-bg: var(--wma-mm-bg);
    --wma-mm-child-color: var(--wma-mm-link);
    --wma-mm-child-hover-bg: var(--wma-mm-border);
    --wma-mm-row-h: 40px;
    --wma-mm-panel-gap: 24px;

    position: relative;
    background: var(--wma-mm-item-bg);
    color: var(--wma-mm-text);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
}

/* ── Toggle (mobile) ─────────────────────────────────────────── */
.wma-mm-toggle {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: var(--wma-mm-bg);
    color: var(--wma-mm-link);
    border: 0;
    border-bottom: 1px solid var(--wma-mm-border);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.wma-mm-toggle-icon {
    position: relative;
    width: 20px;
    height: 16px;
    flex-shrink: 0;
}

.wma-mm-toggle-icon::before,
.wma-mm-toggle-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: currentColor;
    transition: transform 0.2s ease;
}

.wma-mm-toggle-icon::before {
    top: 0;
    box-shadow: 0 7px 0 currentColor;
}

.wma-mm-toggle-icon::after {
    bottom: 0;
}

.wma-mm-toggle[aria-expanded="true"] .wma-mm-toggle-icon::before {
    box-shadow: none;
    transform: translateY(7px) rotate(45deg);
}

.wma-mm-toggle[aria-expanded="true"] .wma-mm-toggle-icon::after {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Bar ─────────────────────────────────────────────────────── */
.wma-mm-bar {
    display: flex;
    align-items: stretch;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wma-mm-item {
    position: relative;
    margin: 0;
    background: var(--wma-mm-item-bg);
}

.wma-mm-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    color: var(--wma-mm-link);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease, background-color 0.15s ease;
}

a.wma-mm-link:hover,
a.wma-mm-link:focus {
    color: var(--wma-mm-link-hover);
}

.wma-mm-item.current > a.wma-mm-link {
    color: var(--wma-mm-link-current);
}

.wma-mm-item.has-mega > .wma-mm-link::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 6px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid currentColor;
    vertical-align: middle;
}

.wma-mm-link.is-title {
    cursor: default;
    font-weight: 600;
}

/* ── Mega panel ──────────────────────────────────────────────── */
.wma-mm-mega {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    width: max-content;
    max-width: calc(100vw - 20px);
    min-width: 280px;
    padding: 20px;
    background: var(--wma-mm-mega-bg);
    border: 1px solid var(--wma-mm-mega-outline);
    border-top: 3px solid var(--wma-mm-mega-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.wma-mm-item.has-mega:hover > .wma-mm-mega,
.wma-mm-item.has-mega:focus-within > .wma-mm-mega,
.wma-mm-item.has-mega.is-open > .wma-mm-mega {
    display: flex;
    gap: var(--wma-mm-panel-gap);
    align-items: stretch;
}

.wma-mm-cols {
    display: grid;
    grid-template-columns: repeat(var(--wma-mm-cols, 1), minmax(0, 1fr));
    gap: 24px;
    min-width: 0;
}

.wma-mm-cols[data-cols="1"] { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.wma-mm-cols[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wma-mm-cols[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wma-mm-cols[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.wma-mm-cols[data-cols="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.wma-mm-col {
    min-width: 170px;
}

.wma-mm-coltitle {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--wma-mm-coltitle);
}

.wma-mm-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.wma-mm-list-item {
    margin: 0;
}

.wma-mm-child {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    color: var(--wma-mm-child-color);
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.wma-mm-child:hover,
.wma-mm-child:focus,
.wma-mm-list-item.current > .wma-mm-child {
    background: var(--wma-mm-child-hover-bg);
    color: var(--wma-mm-link-hover);
}

.wma-mm-thumb {
    width: var(--wma-mm-thumb, 48px);
    height: var(--wma-mm-thumb, 48px);
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.wma-mm-child-title {
    flex: 1 1 auto;
    min-width: 0;
}

.wma-mm-chevron {
    flex-shrink: 0;
    color: var(--wma-mm-accent);
    font-weight: 700;
}

.wma-mm-child.is-title {
    cursor: default;
    font-weight: 600;
}

/* ── Right panel (square) ────────────────────────────────────── */
.wma-mm-panel {
    display: none;
    align-items: center;
    justify-content: center;
    width: var(--wma-panel-size, 240px);
    height: var(--wma-panel-size, 240px);
    flex-shrink: 0;
    overflow: hidden;
    background: var(--wma-mm-border);
    border-radius: 8px;
}

.wma-mm-panel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wma-mm-cols ~ .wma-mm-panel {
    display: flex;
}

/* ── Mobile / accordion ──────────────────────────────────────── */
@media (max-width: 992px) {
    .wma-mm {
        width: 100%;
        background: transparent;
    }

    .wma-mm.is-mobile-open {
        width: 100vw;
        flex-shrink: 0;
        margin-inline: calc(50% - 50vw);
        background: var(--wma-mm-mobile-bg);
        z-index: 1200;
    }

    .wma-mm-toggle {
        display: flex;
        justify-content: center;
        background: var(--wma-mm-mobile-bg);
        color: var(--wma-mm-mobile-link);
        padding: 16px;
        border-bottom: 0;
    }

    .wma-mm.is-mobile-open .wma-mm-toggle {
        background: transparent;
        border-bottom: 0;
    }

    .wma-mm-toggle-icon {
        width: 28px;
        height: 22px;
    }

    .wma-mm-toggle-icon::before {
        top: 0;
        box-shadow: 0 10px 0 currentColor;
    }

    .wma-mm-toggle[aria-expanded="true"] .wma-mm-toggle-icon::before {
        box-shadow: none;
        transform: translateY(10px) rotate(45deg);
    }

    .wma-mm-toggle[aria-expanded="true"] .wma-mm-toggle-icon::after {
        transform: translateY(-10px) rotate(-45deg);
    }

    .wma-mm-bar {
        display: none;
        flex-direction: column;
    }

    .wma-mm-toggle[aria-expanded="true"] + .wma-mm-bar {
        display: flex;
        background: transparent;
    }

    .wma-mm-item {
        width: 100%;
        background: var(--wma-mm-mobile-item-bg);
    }

    .wma-mm-link {
        justify-content: space-between;
        color: var(--wma-mm-mobile-link);
    }

    a.wma-mm-link:hover,
    a.wma-mm-link:focus {
        color: var(--wma-mm-mobile-link-hover);
    }

    .wma-mm-item.current > a.wma-mm-link {
        color: var(--wma-mm-mobile-link-current);
    }

    .wma-mm-mega {
        position: static;
        display: none;
        width: 100%;
        border: 0;
        box-shadow: none;
        padding: 16px;
        background: var(--wma-mm-mobile-mega-bg);
    }

    .wma-mm-item.has-mega:hover > .wma-mm-mega,
    .wma-mm-item.has-mega:focus-within > .wma-mm-mega {
        display: none;
    }

    .wma-mm-item.has-mega.is-open > .wma-mm-mega {
        display: flex;
        flex-direction: column;
    }

    .wma-mm-coltitle {
        color: var(--wma-mm-mobile-coltitle);
    }

    .wma-mm-child {
        color: var(--wma-mm-mobile-child-color);
    }

    .wma-mm-child:hover,
    .wma-mm-child:focus,
    .wma-mm-child:active,
    .wma-mm-list-item.current > .wma-mm-child {
        background: var(--wma-mm-mobile-child-hover-bg);
        color: var(--wma-mm-mobile-link-hover);
    }

    .wma-mm-cols,
    .wma-mm-cols[data-cols="1"],
    .wma-mm-cols[data-cols="2"],
    .wma-mm-cols[data-cols="3"],
    .wma-mm-cols[data-cols="4"],
    .wma-mm-cols[data-cols="5"] {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .wma-mm-panel,
    .wma-mm-cols ~ .wma-mm-panel {
        display: none;
    }
}
