/* DF Mobile Menu – Frontend Styles */

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

/* === Hamburger Button === */
/* Frosted-glass circle (45x45, translucent white fill + blur), matching
   the Figma mobile-nav spec and the .dfmm-close button it swaps places
   with — same treatment, just the three-line icon instead of an X. */
.dfmm-hamburger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 45px;
    height: 45px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.16) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--dfmm-hamburger-color, currentColor);
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 100;
}

.dfmm-hamburger__line {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--dfmm-hamburger-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);
    background-image: var(--dfmm-bg-image, none);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    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: 16px !important;
    margin: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    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;
}

/* Frosted-glass circular close button (45x45, translucent white fill + blur),
   matching the Figma mobile-nav spec instead of a flat 36px icon button. */
.dfmm-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.16) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    cursor: pointer;
    color: var(--dfmm-close-color, #333);
    border-radius: 50%;
    transition: opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.dfmm-close svg {
    width: 24px !important;
    height: 24px !important;
}

.dfmm-close:hover,
.dfmm-close:focus-visible {
    background: rgba(255, 255, 255, 0.16) !important;
    opacity: 0.7;
}

/* === 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;
}

/* Top-level menu lays out as a column of hug-width "pill" items with a
   consistent 24px gap, instead of full-width flush rows.
   Selector is qualified with the .dfmm-panel__nav ancestor (not just
   #dfmm-panel .dfmm-menu) so its specificity (1 id + 2 classes) beats
   class-df-mobile-menu-compat.php's Elementor-compat inline override
   (#dfmm-panel .dfmm-menu, ... { padding-left: 0 !important }), which is
   injected in wp_footer — after this stylesheet — at equal specificity
   otherwise, and would win on source order alone. That compat file lives
   outside the sandbox and can't be edited directly. */
#dfmm-panel .dfmm-panel__nav .dfmm-menu {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 24px !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;
    width: auto !important;
    display: block;
}

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

/* Each link is its own frosted-glass pill: translucent white fill + blur,
   fully rounded, bold uppercase label — matches the Figma nav-item spec. */
#dfmm-panel a.dfmm-menu-link {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    width: auto;
    padding: 10px 12px !important;
    margin: 0 !important;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 999px;
    color: var(--dfmm-item-color, #333) !important;
    font-size: var(--dfmm-item-size, 16px) !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.1667em;
    line-height: 15.96px !important;
    white-space: nowrap;
    text-decoration: none !important;
    border: none !important;
    /* Hover colour change removed per brief: the menu item colour stays constant on hover. */
}

/* Active (current page) menu item — uses the "Active Menu Item Color" setting,
   and becomes bold when the "Active Menu Item Weight" option is enabled. */
#dfmm-panel .dfmm-menu-item.current-menu-item > .dfmm-menu-item-row > a.dfmm-menu-link,
#dfmm-panel .dfmm-menu-item.current-menu-ancestor > .dfmm-menu-item-row > a.dfmm-menu-link,
#dfmm-panel .dfmm-menu-item.current-menu-parent > .dfmm-menu-item-row > a.dfmm-menu-link {
    color: var(--dfmm-item-active, #0073aa) !important;
    font-weight: var(--dfmm-active-weight, inherit) !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(255, 255, 255, 0.3) !important;
    border-radius: 0 !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(255, 255, 255, 0.12) !important;
}

.dfmm-chevron {
    display: block;
    width: 18px;
    height: 18px;
}

/* === Sub-menus (horizontal slide panels) === */
/* Same specificity-bump rationale as .dfmm-panel__nav .dfmm-menu above:
   .dfmm-sub-menu is itself a <ul> nested inside .dfmm-menu, so it's also
   matched (and its padding-left zeroed) by the compat.php inline override. */
#dfmm-panel .dfmm-panel__nav .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: 24px !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: flex-start;
}

#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;
    width: auto !important;
}

#dfmm-panel .dfmm-back-btn {
    display: flex !important;
    align-items: center;
    gap: 8px;
    width: auto;
    padding: 10px 12px !important;
    margin: 0 !important;
    background: rgba(255, 255, 255, 0.16) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 999px !important;
    border: none !important;
    cursor: pointer;
    color: var(--dfmm-item-color, #333);
    font-size: 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.1667em;
    line-height: 1.5 !important;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.2s ease;
    font-family: inherit;
}

#dfmm-panel .dfmm-back-btn:hover,
#dfmm-panel .dfmm-back-btn:focus-visible {
    opacity: 0.8;
}

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

/* Sub-menu items match the top-level pill treatment and hug their content. */
#dfmm-panel .dfmm-sub-menu .dfmm-menu-item,
#dfmm-panel .dfmm-sub-menu .dfmm-menu-item-row {
    width: auto !important;
}

#dfmm-panel .dfmm-sub-menu a.dfmm-menu-link {
    padding: 10px 12px !important;
    font-size: var(--dfmm-item-size, 16px) !important;
    width: auto;
}

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

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

/* Centered text + arrow icon pair (Figma: justify-content center, 12px gap),
   the arrow itself is a sized ::after background-image so no template/markup
   change is needed to add it. */
#dfmm-panel a.dfmm-cta-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100% !important;
    padding: 16px 40px !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: 700 !important;
    font-size: 11px !important;
    text-transform: uppercase;
    letter-spacing: 0.1818em;
    line-height: 11px !important;
    transition: opacity 0.2s ease;
    border: none !important;
}

#dfmm-panel a.dfmm-cta-btn::after {
    content: "";
    display: block;
    flex: 0 0 auto;
    width: 24px;
    height: 12px;
    background-image: url("https://sea-sky.digitalfolddevelopment.co.za/wp-content/uploads/2026/07/Arrow-SeaSky.svg");
    background-repeat: no-repeat;
    background-size: contain;
}

#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: 24px;
    padding: 12px 24px 24px !important;
    margin: 0 !important;
    flex-shrink: 0;
    border-top: 1px solid rgba(254, 248, 237, 0.5);
}

/* Each icon sits inside its own solid coral circle (36x36), matching the
   Figma social-button spec, rather than a bare icon glyph. */
#dfmm-panel a.dfmm-social-link {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #F2705D;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    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;
}

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

#dfmm-panel a.dfmm-social-link svg,
#dfmm-panel a.dfmm-social-link img {
    display: block;
    width: var(--dfmm-social-size, 20px) !important;
    height: var(--dfmm-social-size, 20px) !important;
}

/* === 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;
}
