/* DF Mobile Menu Pro – Frontend Styles */

/* === Reset === */
#dfmm-panel,
#dfmm-panel *,
#dfmm-panel *::before,
#dfmm-panel *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* === Hamburger Button === */
.dfmm-hamburger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 100;
}

.dfmm-hamburger__line {
    display: block;
    width: 22px;
    height: 2px;
    background-color: currentColor;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

.dfmm-hamburger[aria-expanded="true"] .dfmm-hamburger__line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.dfmm-hamburger[aria-expanded="true"] .dfmm-hamburger__line:nth-child(2) {
    opacity: 0;
}
.dfmm-hamburger[aria-expanded="true"] .dfmm-hamburger__line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* === Overlay === */
.dfmm-overlay {
    position: fixed;
    inset: 0;
    z-index: 999998;
    background-color: var(--dfmm-overlay-color, #000);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.dfmm-overlay--active {
    opacity: var(--dfmm-overlay-opacity, 0.6);
    visibility: visible;
}

/* === Off-Canvas Panel === */
#dfmm-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 999999;
    width: 85vw;
    max-width: 380px;
    background-color: var(--dfmm-bg, #fff);
    font-family: var(--dfmm-font, inherit);
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s ease;
    visibility: hidden;
    display: flex;
    flex-direction: column;
}

#dfmm-panel.dfmm-panel--left {
    left: 0;
    right: auto;
    transform: translateX(-100%);
}

#dfmm-panel.dfmm-panel--right {
    right: 0;
    left: auto;
    transform: translateX(100%);
}

#dfmm-panel.dfmm-panel--open {
    transform: translateX(0);
    visibility: visible;
}

/* === Panel Header === */
#dfmm-panel .dfmm-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 20px !important;
    margin: 0 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.dfmm-logo-link {
    display: inline-block;
    line-height: 0;
}

.dfmm-logo {
    max-width: var(--dfmm-logo-max-w, 150px);
    height: auto;
    display: block;
}

.dfmm-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--dfmm-item-color, #333);
    border-radius: 4px;
    transition: background-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.dfmm-close:hover,
.dfmm-close:focus-visible {
    background-color: rgba(0, 0, 0, 0.06);
}

/* === Navigation (slide viewport) === */
#dfmm-panel .dfmm-panel__nav {
    flex: 1 1 auto;
    overflow: hidden;
    position: relative;
    padding: 0 !important;
    margin: 0 !important;
}

#dfmm-panel .dfmm-menu,
#dfmm-panel .dfmm-menu ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

#dfmm-panel .dfmm-menu {
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 0 !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#dfmm-panel .dfmm-menu-item {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

#dfmm-panel .dfmm-menu-item-row {
    display: flex;
    align-items: center;
}

#dfmm-panel a.dfmm-menu-link {
    flex: 1 1 auto;
    display: block;
    padding: 14px 24px !important;
    margin: 0 !important;
    color: var(--dfmm-item-color, #333) !important;
    font-size: var(--dfmm-item-size, 16px) !important;
    text-decoration: none !important;
    line-height: 1.5 !important;
    transition: color 0.2s ease;
    border: none !important;
    background: none !important;
}

#dfmm-panel a.dfmm-menu-link:hover,
#dfmm-panel a.dfmm-menu-link:focus-visible {
    color: var(--dfmm-item-hover, #0073aa) !important;
}

/* === Sub-menu Toggle (forward arrow) === */
#dfmm-panel .dfmm-submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    align-self: stretch;
    background: none !important;
    border: none !important;
    border-left: 1px solid rgba(0, 0, 0, 0.06) !important;
    cursor: pointer;
    color: var(--dfmm-arrow-color, #999);
    flex-shrink: 0;
    padding: 0 !important;
    margin: 0 !important;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.2s ease;
}

#dfmm-panel .dfmm-submenu-toggle:hover,
#dfmm-panel .dfmm-submenu-toggle:focus-visible {
    background-color: rgba(0, 0, 0, 0.04) !important;
}

.dfmm-chevron {
    display: block;
}

/* === Sub-menus (horizontal slide panels) === */
#dfmm-panel .dfmm-sub-menu {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background-color: var(--dfmm-bg, #fff);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    padding: 0 !important;
    margin: 0 !important;
}

#dfmm-panel .dfmm-sub-menu.dfmm-sub-menu--open {
    transform: translateX(0);
}

/* === Back Button === */
#dfmm-panel .dfmm-back-item {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

#dfmm-panel .dfmm-back-btn {
    display: flex !important;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px !important;
    margin: 0 !important;
    background: none !important;
    border: none !important;
    cursor: pointer;
    color: var(--dfmm-item-color, #333);
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.5 !important;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.2s ease;
    font-family: inherit;
}

#dfmm-panel .dfmm-back-btn:hover,
#dfmm-panel .dfmm-back-btn:focus-visible {
    background-color: rgba(0, 0, 0, 0.04) !important;
}

#dfmm-panel .dfmm-back-icon {
    display: block;
    flex-shrink: 0;
}

/* Sub-menu items use the same padding as top-level */
#dfmm-panel .dfmm-sub-menu a.dfmm-menu-link {
    padding: 14px 24px !important;
    font-size: var(--dfmm-item-size, 16px) !important;
}

/* === CTA Button === */
#dfmm-panel .dfmm-panel__cta {
    padding: 20px 24px 8px !important;
    margin: 0 !important;
    flex-shrink: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

#dfmm-panel .dfmm-panel__cta + .dfmm-panel__social {
    border-top: none;
}

#dfmm-panel a.dfmm-cta-btn {
    display: block !important;
    width: 100% !important;
    padding: 14px 24px !important;
    margin: 0 !important;
    text-align: center !important;
    background-color: var(--dfmm-cta-bg, #0073aa) !important;
    color: var(--dfmm-cta-color, #fff) !important;
    border-radius: var(--dfmm-cta-radius, 4px) !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    line-height: 1.3 !important;
    transition: opacity 0.2s ease;
    border: none !important;
}

#dfmm-panel a.dfmm-cta-btn:hover,
#dfmm-panel a.dfmm-cta-btn:focus-visible {
    opacity: 0.88;
}

/* === Social Icons === */
#dfmm-panel .dfmm-panel__social {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 16px 24px 32px !important;
    margin: 0 !important;
    flex-shrink: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

#dfmm-panel a.dfmm-social-link {
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: var(--dfmm-social-color, #333) !important;
    transition: opacity 0.2s ease;
    text-decoration: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: none !important;
}

#dfmm-panel a.dfmm-social-link:hover,
#dfmm-panel a.dfmm-social-link:focus-visible {
    opacity: 0.65;
}

#dfmm-panel a.dfmm-social-link svg {
    display: block;
}

/* === No-menu message === */
.dfmm-no-menu {
    padding: 20px 24px;
    color: #888;
    font-size: 14px;
}

/* === Scroll lock === */
body.dfmm-body-locked {
    overflow: hidden;
    touch-action: none;
}
