/*
 * WHMCS Six RTL Mega Menu
 * Scoped CSS to avoid conflicts with WHMCS, Bootstrap, and third-party modules.
 */

.mm6-megamenu-wrap,
.mm6-megamenu-wrap *,
.mm6-megamenu-wrap *::before,
.mm6-megamenu-wrap *::after {
    box-sizing: border-box;
}

.mm6-megamenu-wrap {
    --mm6-bg: #ffffff;
    --mm6-text: var(--mm6-link-color, #172033);
    --mm6-muted: #667085;
    --mm6-border: #e4e7ec;
    --mm6-soft: #f7fbfb;
    --mm6-accent-soft: #e6fffb;
    --mm6-accent: #0f766e;
    --mm6-accent-dark: #115e59;
    --mm6-shadow: 0 22px 60px rgba(15, 23, 42, .14);
    position: relative;
    z-index: 80;
    width: 100%;
    direction: rtl;
    color: var(--mm6-text);
    background: var(--mm6-bg);
    border-bottom: 1px solid rgba(15, 118, 110, .12);
    font-family: var(--mm6-font-family, Tahoma, Arial, sans-serif);
}

.mm6-megamenu-wrap a,
.mm6-megamenu-wrap button,
.mm6-megamenu-wrap input,
.mm6-megamenu-wrap h3,
.mm6-megamenu-wrap strong,
.mm6-megamenu-wrap span,
.mm6-megamenu-wrap p {
    font-family: var(--mm6-font-family, Tahoma, Arial, sans-serif) !important;
}

.mm6-megamenu-wrap a {
    color: inherit;
    text-decoration: none;
}

.mm6-megamenu-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 28px;
    width: min(1440px, calc(100% - 60px));
    min-height: 94px;
    margin: 0 auto;
}

.mm6-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    min-width: 0;
    color: var(--mm6-text);
}

.mm6-brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: #fff;
    background: var(--mm6-accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
}

.mm6-brand-logo {
    display: block;
    width: auto;
    max-width: 238px;
    height: 64px;
    object-fit: contain;
}

.mm6-brand-text {
    overflow: hidden;
    max-width: 170px;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.mm6-menu {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    margin: 0;
    list-style: none;
}

.mm6-item {
    position: static;
    margin: 0;
}

.mm6-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    color: var(--mm6-text);
    background: transparent;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.mm6-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 18px;
    margin-left: 6px;
    color: var(--mm6-accent);
    font-style: normal;
    font-size: 18px;
    line-height: 1;
}

.mm6-link .mm6-icon {
    font-size: 19px;
}

.mm6-link:hover,
.mm6-link:focus,
.mm6-has-panel.mm6-open > .mm6-link {
    color: var(--mm6-accent-dark);
    background: var(--mm6-soft);
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .12);
    transform: translateY(-1px);
    outline: none;
}

.mm6-has-panel.mm6-open > .mm6-panel-toggle::after {
    content: "";
    position: absolute;
    right: 50%;
    bottom: -17px;
    width: 14px;
    height: 14px;
    border-top: 1px solid var(--mm6-border);
    border-right: 1px solid var(--mm6-border);
    background: var(--mm6-bg);
    transform: translateX(50%) rotate(-45deg);
    z-index: 3;
}

.mm6-caret {
    width: 7px;
    height: 7px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform .18s ease;
}

.mm6-has-panel.mm6-open .mm6-caret {
    transform: rotate(135deg);
}

.mm6-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    display: none;
    width: 100%;
    padding: 30px 30px 26px;
    border: 1px solid var(--mm6-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, .985);
    box-shadow: 0 18px 45px rgba(15, 23, 42, .12);
    backdrop-filter: blur(14px);
}

.mm6-panel-wide {
    padding-right: 16px;
    padding-left: 16px;
}

.mm6-panel-compact {
    right: auto;
    left: 50%;
    width: min(860px, 100%);
    transform: translateX(-50%);
}

.mm6-panel::before {
    display: none;
}

.mm6-has-panel.mm6-open > .mm6-panel {
    display: block;
}

.mm6-panel-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
}

.mm6-panel-grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.mm6-panel-col {
    display: grid;
    align-content: start;
    gap: 7px;
    min-width: 0;
    padding: 0 26px;
}

.mm6-panel-wide .mm6-panel-col {
    padding-right: 18px;
    padding-left: 18px;
}

.mm6-panel-wide .mm6-panel-col:first-child {
    padding-right: 8px;
}

.mm6-panel-col:not(:last-child),
.mm6-domain-search:not(:last-child) {
    border-left: 1px solid rgba(148, 163, 184, .22);
}

.mm6-panel h3 {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 34px;
    margin: 2px 0 18px;
    padding: 0 0 10px;
    color: var(--mm6-text);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.5;
    text-align: right;
}

.mm6-panel h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 34px;
    height: 2px;
    border-radius: 999px;
    background: var(--mm6-accent);
    transform: none;
}

.mm6-panel p {
    margin: 0;
    color: var(--mm6-muted);
    font-size: 13px;
    line-height: 1.9;
}

.mm6-panel-col > a {
    display: block;
    position: relative;
    min-width: 0;
    padding: 9px 62px 9px 8px;
    border-radius: 12px;
    border: 1px solid transparent;
    text-align: right;
    transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.mm6-panel-col > a:hover,
.mm6-panel-col > a:focus {
    background: var(--mm6-soft);
    border-color: var(--mm6-border);
    box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
    transform: translateY(-2px);
    outline: none;
}

.mm6-panel strong,
.mm6-panel span {
    display: block;
}

.mm6-panel strong {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-wrap: anywhere;
    color: var(--mm6-text);
    font-size: 14px;
    line-height: 1.6;
    text-align: right;
}

.mm6-panel strong .mm6-icon,
.mm6-panel h3 .mm6-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    margin-left: 0;
    color: var(--mm6-accent-dark);
    background: transparent;
    font-size: 31px;
    font-weight: 400;
}

.mm6-panel-col > a strong .mm6-icon {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
}

.mm6-panel-compact strong .mm6-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    font-size: 23px;
}

.mm6-panel h3 .mm6-icon {
    display: none;
}

.mm6-panel span {
    color: var(--mm6-muted);
    font-size: 12px;
    line-height: 1.85;
    text-align: right;
}

.mm6-panel-col > a span {
    padding-right: 0;
}

.mm6-panel-compact .mm6-panel-col {
    gap: 7px;
    padding: 0 22px;
}

.mm6-panel-compact .mm6-panel-col > a {
    padding: 8px 56px 8px 8px;
}

.mm6-panel-compact .mm6-panel-col > a span {
    padding-right: 0;
}

.mm6-highlight {
    position: relative;
    overflow: hidden;
    align-content: start;
    min-height: 100%;
    gap: 12px;
    padding: 26px 22px 24px;
    border-radius: 13px;
    background:
        radial-gradient(circle at 18% 92%, rgba(15, 118, 110, .14) 0 46px, transparent 47px),
        linear-gradient(145deg, #e7fffb 0%, #f7fffe 64%, #edfdfa 100%);
    border: 1px solid #bdf4ea;
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .06), 0 10px 24px rgba(15, 118, 110, .08);
}

.mm6-highlight::after {
    content: "";
    position: absolute;
    right: -52px;
    bottom: -58px;
    width: 168px;
    height: 168px;
    border-radius: 30px;
    background: rgba(15, 118, 110, .065);
    transform: rotate(45deg);
}

.mm6-highlight > * {
    position: relative;
    z-index: 1;
}

.mm6-highlight h3 {
    justify-content: flex-start;
    min-height: auto;
    width: max-content;
    margin: 0 auto 18px 0;
    padding: 6px 14px;
    border-radius: 999px;
    color: var(--mm6-accent-dark);
    background: rgba(15, 118, 110, .1);
    text-align: right;
    font-size: 12px;
}

.mm6-highlight h3::after {
    display: none;
}

.mm6-highlight h3 .mm6-icon {
    display: none;
}

.mm6-highlight p {
    color: var(--mm6-accent);
    font-size: 18px;
    font-weight: 900;
    line-height: 1.7;
    text-align: right;
}

.mm6-highlight p::first-line {
    color: var(--mm6-text);
}

.mm6-highlight > a:not(.mm6-cta) {
    min-height: 26px;
    padding: 2px 28px 2px 0;
    border: 0;
    border-radius: 0;
}

.mm6-highlight > a:not(.mm6-cta):hover,
.mm6-highlight > a:not(.mm6-cta):focus {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    transform: none;
}

.mm6-highlight > a:not(.mm6-cta) strong {
    gap: 8px;
    color: var(--mm6-muted);
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.8;
}

.mm6-highlight > a:not(.mm6-cta) .mm6-icon {
    position: absolute;
    top: 50%;
    right: 0;
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin-right: 0;
    margin-left: 0;
    color: var(--mm6-accent);
    font-size: 14px;
    transform: translateY(-50%);
}

.mm6-cta,
.mm6-client-btn,
.mm6-domain-search button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    color: var(--mm6-button-text, #fff) !important;
    background: var(--mm6-accent);
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: background-color .18s ease, transform .18s ease;
}

.mm6-cta {
    width: 100%;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 12px;
    margin-top: auto;
    box-shadow: 0 10px 22px rgba(15, 118, 110, .18);
}

.mm6-panel-col:not(.mm6-highlight) > .mm6-cta {
    width: auto;
    min-height: 28px;
    justify-content: flex-start;
    padding: 0;
    margin-top: auto;
    color: var(--mm6-accent) !important;
    background: transparent;
    box-shadow: none;
    font-size: 12.5px;
}

.mm6-panel-col:not(.mm6-highlight) > .mm6-cta::before {
    margin-left: 6px;
    color: currentColor;
    font-size: 17px;
}

.mm6-panel-col:not(.mm6-highlight) > .mm6-cta:hover,
.mm6-panel-col:not(.mm6-highlight) > .mm6-cta:focus {
    color: var(--mm6-accent-dark) !important;
    background: transparent;
    transform: none;
}

.mm6-cta::before {
    content: "\2039";
    margin-left: 8px;
    font-size: 20px;
    line-height: 1;
}

.mm6-cta:hover,
.mm6-client-btn:hover,
.mm6-domain-search button:hover,
.mm6-cta:focus,
.mm6-client-btn:focus,
.mm6-domain-search button:focus {
    background: var(--mm6-accent-dark);
    outline: none;
}

.mm6-client-btn {
    gap: 10px;
    min-height: 52px;
    padding: 0 24px;
    margin-right: 6px;
    border-radius: 14px;
    font-size: 15px;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(15, 118, 110, .18);
}

.mm6-client-btn .mm6-icon {
    min-width: 22px;
    margin-left: 0;
    color: currentColor;
    font-size: 22px;
}

.mm6-action {
    margin-right: 6px;
}

.mm6-utility-spacer {
    margin-right: auto;
}

.mm6-utility-item {
    position: relative;
}

.mm6-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: 1px solid var(--mm6-border);
    border-radius: 14px;
    color: var(--mm6-text);
    background: #fff;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.mm6-icon-btn:hover,
.mm6-icon-btn:focus,
.mm6-has-panel.mm6-open > .mm6-icon-btn {
    color: var(--mm6-accent-dark);
    border-color: #b7e4dc;
    background: var(--mm6-soft);
    outline: none;
}

.mm6-icon-btn-symbol {
    color: var(--mm6-accent-dark);
    font-size: 23px;
    line-height: 1;
}

.mm6-badge {
    position: absolute;
    top: -7px;
    left: -7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    background: #dc2626;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.mm6-utility-panel {
    right: auto;
    left: 0;
    width: 320px;
}

.mm6-utility-panel::before {
    right: auto;
    left: 18px;
}

.mm6-account-summary {
    display: grid;
    gap: 8px;
}

.mm6-account-summary > strong {
    color: var(--mm6-text);
    font-size: 13px;
    line-height: 1.6;
}

.mm6-account-summary a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 8px;
    background: var(--mm6-soft);
}

.mm6-account-summary span {
    color: var(--mm6-muted);
    font-size: 12px;
}

.mm6-account-summary b {
    color: var(--mm6-text);
    font-size: 13px;
    white-space: nowrap;
}

.mm6-domain-search {
    display: grid;
    align-content: start;
    gap: 12px;
    padding: 0 22px;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.mm6-domain-search form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin: 0;
    padding: 16px;
    border: 1px solid var(--mm6-border);
    border-radius: 12px;
    background: var(--mm6-soft);
}

.mm6-domain-search input {
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--mm6-border);
    border-radius: 8px;
    color: var(--mm6-text);
    background: #fff;
    direction: ltr;
    text-align: left;
}

.mm6-panel-compact .mm6-domain-search form {
    grid-template-columns: minmax(0, 1fr);
}

.mm6-panel-compact .mm6-domain-search button {
    width: 100%;
}

.mm6-domain-search input:focus {
    border-color: var(--mm6-accent);
    outline: none;
}

.mm6-toggle {
    display: none;
    align-items: center;
    gap: 9px;
    height: 42px;
    padding: 0 12px;
    margin-right: auto;
    border: 1px solid var(--mm6-border);
    border-radius: 8px;
    color: var(--mm6-text);
    background: #fff;
    font-weight: 800;
    cursor: pointer;
}

.mm6-toggle-box {
    display: grid;
    gap: 4px;
}

.mm6-toggle-box span {
    display: block;
    width: 19px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.mm6-toggle-text {
    font-size: 13px;
}

@media (max-width: 900px) {
    .mm6-megamenu-inner {
        flex-wrap: wrap;
        gap: 10px;
        width: min(100% - 24px, 720px);
        min-height: 62px;
        padding: 10px 0;
    }

    .mm6-toggle {
        display: inline-flex;
    }

    .mm6-menu {
        display: none;
        flex: 0 0 100%;
        width: 100%;
        padding: 10px 0 2px;
        border-top: 1px solid var(--mm6-border);
    }

    .mm6-megamenu-wrap.mm6-mobile-open .mm6-menu {
        display: grid;
        gap: 4px;
    }

    .mm6-item,
    .mm6-link,
    .mm6-panel-toggle,
    .mm6-client-btn {
        width: 100%;
    }

    .mm6-link,
    .mm6-panel-toggle,
    .mm6-client-btn {
        justify-content: space-between;
        min-height: 46px;
        padding: 0 12px;
    }

    .mm6-action {
        margin-right: 0;
    }

    .mm6-utility-spacer {
        margin-right: 0;
    }

    .mm6-utility-item {
        display: inline-flex;
        width: auto;
    }

    .mm6-icon-btn {
        width: 46px;
        height: 46px;
    }

    .mm6-utility-panel {
        position: static;
        width: 100%;
        margin: 3px 0 8px;
        box-shadow: none;
    }

    .mm6-client-btn {
        margin: 6px 0 0;
    }

    .mm6-panel {
        position: static;
        width: 100%;
        margin: 3px 0 8px;
        padding: 12px;
        border-radius: 8px;
        box-shadow: none;
    }

    .mm6-panel-compact {
        transform: none;
    }

    .mm6-panel::before {
        display: none;
    }

    .mm6-panel-grid,
    .mm6-panel-grid-compact {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .mm6-domain-search form {
        grid-template-columns: 1fr;
    }

    .mm6-domain-search button {
        width: 100%;
    }
}

@media (max-width: 430px) {
    .mm6-brand-text {
        max-width: 125px;
    }

    .mm6-megamenu-inner {
        width: calc(100% - 18px);
    }
}
