/**
 * Theme Name: Best4u Media Child
 * Description: Best4u Media Child theme
 * Author: Best4u Media B.V.
 * Author URI: https://www.best4u.nl/website-laten-maken
 * Template: blocksy
 * Text Domain: blocksy
 */

/* Do not use this file. Just use the assets > src > sass folder for Sass/PostCSS */

/* ============================================
   Mega menu – both header-menu-1 and header-menu-2
   Real structure: li > .entry-content > .mega-menu-locations-box (panel hidden by default, open on hover)
   ============================================ */

/* Hide native sub-menu when mega locations box is present */
#header-menu-1 [class*='ct-mega-menu']:has(> .mega-menu-locations-box) > .sub-menu,
#header-menu-2 [class*='ct-mega-menu']:has(> .mega-menu-locations-box) > .sub-menu,
#header-menu-1 li:has(> .entry-content > .mega-menu-locations-box) > .sub-menu,
#header-menu-2 li:has(> .entry-content > .mega-menu-locations-box) > .sub-menu {
    display: none !important;
}

/* Hide the native .sub-menu only when the item has a custom mega menu panel */
#header-menu-1 .menu-item-has-children:has(> .entry-content > .mega-menu-locations-box) > .sub-menu,
#header-menu-1 .menu-item-has-children:has(> .entry-content.bb-has-mega) > .sub-menu {
    display: none !important;
}

/* Compatibility scope: keep fallback behavior only in header menu containers,
   do not force all desktop submenus site-wide after WP/Blocksy updates. */
#header-menu-1 [class*="animated-submenu"]:hover > .sub-menu,
#header-menu-2 [class*="animated-submenu"]:hover > .sub-menu {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translate3d(0, 0, 0) !important;
}

/* Parent li: positioning context and overflow so dropdown is visible */
#header-menu-1 [class*='ct-mega-menu'],
#header-menu-2 [class*='ct-mega-menu'],
#header-menu-1 li:has(> .entry-content > .mega-menu-locations-box),
#header-menu-2 li:has(> .entry-content > .mega-menu-locations-box),
#header-menu-1 li.is-mega-open,
#header-menu-2 li.is-mega-open {
    position: relative;
    overflow: visible;
}

/* Wrapper .entry-content: dropdown under menu item; hidden by default, open via .is-mega-open (JS) */
#header-menu-1 li > .entry-content:has(> .mega-menu-locations-box),
#header-menu-2 li > .entry-content:has(> .mega-menu-locations-box),
#header-menu-1 li > .entry-content.bb-has-mega,
#header-menu-2 li > .entry-content.bb-has-mega {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    z-index: 99999;
    max-width: none !important;
    width: auto !important;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
#header-menu-1 li.is-mega-open > .entry-content,
#header-menu-2 li.is-mega-open > .entry-content {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Panel .mega-menu-locations-box: match header dropdown; overflow visible so flyout is not clipped */
#header-menu-1 li > .entry-content > .mega-menu-locations-box,
#header-menu-2 li > .entry-content > .mega-menu-locations-box {
    --theme-link-initial-color: var(--paletteColor4);
    --theme-font-weight: 600;
    --theme-font-size: 14px;
    position: relative;
    margin: 0;
    overflow: visible;
    min-width: 220px;
    background: #fff;
    box-shadow: var(--theme-box-shadow, 0 12px 28px rgba(0, 0, 0, 0.12));
    border-radius: var(--theme-border-radius, 4px);
}

/* Keep top menu row horizontal */
#header-menu-1 li:has(> .entry-content > .mega-menu-locations-box) > a,
#header-menu-2 li:has(> .entry-content > .mega-menu-locations-box) > a,
#header-menu-1 li.is-mega-open > a,
#header-menu-2 li.is-mega-open > a {
    white-space: nowrap;
}

/* Top-level menu link color so items are always visible (avoid white-on-white / blank text). */
#header-menu-1 > ul > li > a,
#header-menu-2 > ul > li > a,
#header-menu-1 > .menu > li > a,
#header-menu-2 > .menu > li > a,
#header-menu-1 > li > a,
#header-menu-2 > li > a,
#header-menu-1 .ct-menu-link,
#header-menu-2 .ct-menu-link,
.header-menu-1 .ct-menu-link,
.header-menu-2 .ct-menu-link,
[data-id="menu"] .ct-menu-link,
[data-id="menu-secondary"] .ct-menu-link {
    color: var(--theme-link-initial-color, var(--paletteColor4, #1d2939)) !important;
}
#header-menu-1 > ul > li > a:hover,
#header-menu-2 > ul > li > a:hover,
#header-menu-1 > .menu > li > a:hover,
#header-menu-2 > .menu > li > a:hover,
#header-menu-1 > li > a:hover,
#header-menu-2 > li > a:hover,
#header-menu-1 .ct-menu-link:hover,
#header-menu-2 .ct-menu-link:hover,
.header-menu-1 .ct-menu-link:hover,
.header-menu-2 .ct-menu-link:hover,
[data-id="menu"] .ct-menu-link:hover,
[data-id="menu-secondary"] .ct-menu-link:hover {
    color: var(--theme-link-hover-color, var(--paletteColor4, #1d2939)) !important;
}

/* Panel: column stack (header + provinces bar) */
#header-menu-1 .mega-menu-locations-box,
#header-menu-2 .mega-menu-locations-box {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

/* Provinces bar: vertical list; no overflow so flyout is never clipped */
#header-menu-1 .mega-menu-provinces-bar,
#header-menu-2 .mega-menu-provinces-bar {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}
#header-menu-1 .mega-menu-province-item,
#header-menu-2 .mega-menu-province-item {
    position: relative;
    border-top: 1px dashed rgba(57, 78, 101, 0.1);
}
#header-menu-1 .mega-menu-province-item:first-child,
#header-menu-2 .mega-menu-province-item:first-child {
    border-top: none;
}
/* Province label: same font, color and hover as main menu */
#header-menu-1 .mega-menu-province-label,
#header-menu-2 .mega-menu-province-label {
    display: block;
    padding: var(--dropdown-items-spacing, 13px) calc(var(--dropdown-items-spacing, 13px) * 1.5);
    font-size: var(--theme-font-size, 14px);
    font-weight: var(--theme-font-weight, 600);
    text-decoration: none;
    color: var(--theme-link-initial-color, inherit);
    letter-spacing: inherit;
    transition: color 0.2s ease, background 0.2s ease;
}
#header-menu-1 .mega-menu-province-label:hover,
#header-menu-2 .mega-menu-province-label:hover {
    color: var(--theme-link-hover-color, inherit);
    background: var(--dropdown-background-hover-color, rgba(255, 255, 255, 0.03));
}
/* Flyout: to the right of province row; hidden by default, open via .is-flyout-open (JS) */
#header-menu-1 .mega-menu-province-flyout,
#header-menu-2 .mega-menu-province-flyout {
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 4px;
    min-width: 200px;
    padding: 0;
    background: #fff;
    box-shadow: var(--theme-box-shadow, 0 12px 28px rgba(0, 0, 0, 0.12));
    border-radius: var(--theme-border-radius, 4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 50;
    pointer-events: none;
}
#header-menu-1 .mega-menu-province-item.is-flyout-open > .mega-menu-province-flyout,
#header-menu-2 .mega-menu-province-item.is-flyout-open > .mega-menu-province-flyout {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
/* Flyout city links: same font, color and hover as main menu */
#header-menu-1 .mega-menu-province-flyout a,
#header-menu-2 .mega-menu-province-flyout a {
    display: block;
    padding: var(--dropdown-items-spacing, 13px) calc(var(--dropdown-items-spacing, 13px) * 1.5);
    font-size: var(--theme-font-size, 14px);
    font-weight: var(--theme-font-weight, 600);
    text-decoration: none;
    color: var(--theme-link-initial-color, inherit);
    letter-spacing: inherit;
    transition: color 0.2s ease, background 0.2s ease;
    border-top: 1px dashed rgba(57, 78, 101, 0.1);
}
#header-menu-1 .mega-menu-province-flyout a:first-child,
#header-menu-2 .mega-menu-province-flyout a:first-child {
    border-top: none;
}
#header-menu-1 .mega-menu-province-flyout a:hover,
#header-menu-2 .mega-menu-province-flyout a:hover {
    color: var(--theme-link-hover-color, inherit);
    background: var(--dropdown-background-hover-color, rgba(255, 255, 255, 0.03));
}

@media (max-width: 640px) {
    #header-menu-1 .mega-menu-province-flyout,
    #header-menu-2 .mega-menu-province-flyout {
        left: 0;
        top: 100%;
        margin-left: 0;
        margin-top: 0;
    }
}

/* bb-* location page styles: see blocksy-child/inc/enqueue.php (inline, single source of truth) */
/* FORCE the benefits layout to actually fill the row */
.bb-location-benefits,
.bb-location-benefits .bb-benefits-grid {
    width: 100% !important;
    max-width: 100% !important;
}

/* Make it a real grid that stretches columns */
.bb-location-benefits .bb-benefits-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 24px !important;
    align-items: stretch !important;
    justify-items: stretch !important;
}

/* Ensure cards don’t “content-shrink” */
.bb-location-benefits .bb-benefits-card {
    width: 100% !important;
    min-width: 0 !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .bb-location-benefits .bb-benefits-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    .bb-location-benefits .bb-benefits-grid {
        grid-template-columns: 1fr !important;
    }
}