
/*
 * Masana Responsive Header block
 * Simple, flexible header with desktop + mobile layouts.
 */

.crh-header {
    --crh-bg: #ffffff;
    --crh-text: #111111;
    --crh-link: #111111;
    --crh-link-hover: #ffbc0d;
    --crh-cta-bg: #ffbc0d;
    --crh-cta-text: #111111;

    width: 100%;
    background-color: var(--crh-bg);
    color: var(--crh-text);
    border-bottom: 4px solid var(--crh-link-hover);
    font-family: "Montserrat Alternates", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    box-sizing: border-box;
}

/* Desktop layout --------------------------------------------------------- */

.crh-desktop-header {
    display: none;
}

.crh-row {
    max-width: 1168px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

/* Logo */

.crh-logo-area {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.crh-logo-link {
    display: inline-flex;
    align-items: center;
}

.crh-logo-img {
    max-height: none;   /* size is controlled by the "Logo height" setting */
    width: auto;
    display: block;
}

.crh-logo-text {
    font-weight: 700;
    font-size: 1.25rem;
}

/* Navigation */

.crh-main-nav {
    flex: 1 1 auto;
}

.crh-main-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
}

.crh-main-nav-item {
    position: relative;
}

.crh-main-nav-link {
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--crh-link);
    padding: 4px 0;
    position: relative;
    display: inline-block;
}

.crh-main-nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background-color: var(--crh-link-hover);
    transition: width 0.18s ease;
}

.crh-main-nav-link:hover::after,
.crh-main-nav-link.is-current::after {
    width: 100%;
}

.crh-main-nav-link:hover,
.crh-main-nav-link.is-current {
    color: var(--crh-link-hover);
}

/* Actions / CTA */

.crh-header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.crh-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 999px;
    border: none;
    background-color: var(--crh-cta-bg);
    color: var(--crh-cta-text);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.crh-cta:hover {
    filter: brightness(1.02);
}

/* Mobile layout ---------------------------------------------------------- */

.crh-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.crh-mobile-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.crh-mobile-burger {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    cursor: pointer;
    padding: 0;
}

.crh-burger-line {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background-color: var(--crh-link);
    margin: 2px 0;
}

.crh-mobile-logo .crh-logo-img {
    max-height: none;   /* mobile size is controlled by the "Logo height - mobile" setting */
}

.crh-mobile-logo .crh-logo-text {
    font-size: 1.1rem;
}

/* Mobile CTA */

.crh-mobile-right {
    flex: 0 0 auto;
}

.crh-cta-mobile {
    font-size: 0.9rem;
    padding-inline: 12px;
}

/* Mobile menu panel */

.crh-mobile-menu-panel {
    display: none;
    background-color: var(--crh-bg);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.crh-mobile-menu-open .crh-mobile-menu-panel {
    display: block;
}

.crh-mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px 16px;
}

.crh-mobile-nav-item {
    text-decoration: none;
    color: var(--crh-link);
    font-weight: 500;
    font-size: 0.98rem;
    padding: 4px 0;
}

/* Breakpoints ------------------------------------------------------------ */

@media (min-width: 960px) {
    .crh-desktop-header {
        display: block;
    }

    .crh-mobile-header,
    .crh-mobile-menu-panel {
        display: none;
    }
}

/* Block editor specific tweaks ------------------------------------------ */

.wp-block-custom-responsive-header {
    max-width: 100%;
}


@media (min-width: 960px) {
    .crh-main-nav-link {
        margin-top: 10px;
    }
}

/* Desktop mega menu dropdown --------------------------------------------- */

.crh-header {
    position: relative;
    z-index: 1000;
}

.crh-main-nav-item.crh-menu-has-mega {
    position: static;
}

.crh-menu-has-mega > .crh-main-nav-link {
    border: 0;
    border-radius: 0;
    padding: 4px 0;
    font-weight: 600;
    line-height: inherit;
}

/* The Menu item no longer carries a PERMANENT underline. The underline now
   marks the CURRENT page (.is-current) and appears on hover, just like the
   other links. Keep it underlined only while the mega-menu is actually open. */
.crh-menu-has-mega.is-open > .crh-main-nav-link::after {
    display: block;
    width: 100%;
    height: 2px;
    bottom: -1px;
    background-color: var(--crh-link-hover);
}

/* Safety: older cached markup may still contain the old caret. Hide it. */
.crh-menu-caret {
    display: none !important;
}

.crh-menu-has-mega.is-open > .crh-main-nav-link,
.crh-menu-has-mega > .crh-main-nav-link:hover {
    color: var(--crh-link-hover);
    background: transparent;
}

.crh-mega-menu-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: #ffffff;
    border-top: 2px solid var(--crh-link-hover);
    border-bottom: 2px solid var(--crh-link-hover);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.10);
    padding: 42px 40px 32px;
    box-sizing: border-box;
    z-index: 9999;
}

.crh-menu-has-mega.is-open > .crh-mega-menu-panel {
    display: block;
}

.crh-mega-menu-inner {
    max-width: 1080px;
    margin: 0 auto;
}

.crh-mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 76px;
    row-gap: 30px;
}

.crh-mega-menu-item {
    display: flex;
    align-items: center;
    gap: 20px;
    color: #111111;
    text-decoration: none;
    min-height: 72px;
    line-height: 1.2;
    transition: transform 0.16s ease, color 0.16s ease;
}

.crh-mega-menu-item:hover {
    color: var(--crh-link-hover);
    transform: translateX(2px);
}

.crh-mega-menu-image-wrap {
    flex: 0 0 82px;
    width: 82px;
    height: 66px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
    background: #f3ece1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.16s ease, transform 0.16s ease;
}

.crh-mega-menu-item:hover .crh-mega-menu-image-wrap {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.crh-mega-menu-image {
    width: 82px;
    height: 66px;
    object-fit: cover;
    display: block;
}

.crh-mega-menu-label {
    font-size: 16px;
    font-weight: 500;
}

.crh-mega-menu-footer {
    text-align: center;
    margin-top: 42px;
}

.crh-mega-full-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 26px;
    border: 1px solid #222222;
    border-radius: 999px;
    background: #ffffff;
    color: #111111;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.crh-mega-full-menu-button:hover {
    background: var(--crh-link-hover);
    border-color: var(--crh-link-hover);
    color: #111111;
}

/* Mobile menu category dropdown ------------------------------------------ */

.crh-mobile-menu-trigger {
    font-weight: 700;
}


/* Mobile: mark the current page in the hamburger panel. */
.crh-mobile-nav-item.is-current {
    color: var(--crh-link-hover);
    display: inline-block;
    width: fit-content;
    border-bottom: 2px solid var(--crh-link-hover);
    padding-bottom: 2px;
}

.crh-mobile-mega-panel {
    display: none;
    padding: 8px 0 12px 10px;
}

.crh-mobile-mega-panel.is-open {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.crh-mobile-mega-item {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--crh-link);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 4px 0;
}

.crh-mobile-mega-image {
    width: 52px;
    height: 42px;
    object-fit: cover;
    border-radius: 9px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.14);
    flex: 0 0 auto;
}

.crh-mobile-mega-full-menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    max-width: 180px;
    padding: 10px 16px;
    border: 1px solid #222222;
    border-radius: 999px;
    color: #111111;
    background: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
}

@media (max-width: 1100px) and (min-width: 960px) {
    .crh-mega-menu-grid {
        column-gap: 42px;
    }
}

@media (max-width: 959px) {
    .crh-mega-menu-panel {
        display: none !important;
    }
}

/* Version 1.9 responsive safety fix ---------------------------------------
   If the hamburger menu is opened in mobile/tablet width and the browser is
   expanded to desktop width, force the mobile dropdown panel to disappear.
   This prevents duplicate nav items showing under the desktop header. */
@media (min-width: 960px) {
    .crh-header.crh-mobile-menu-open .crh-mobile-menu-panel,
    .crh-mobile-menu-panel,
    .crh-mobile-mega-panel,
    .crh-mobile-mega-panel.is-open {
        display: none !important;
    }
}
