/* Public Miracle Engine header polish. Kept separate so theme updates do not
 * overwrite the product-specific brand and responsive layout rules. */
#header-container #header {
    height: 76px;
    border-bottom: 1px solid rgba(99, 104, 166, 0.12);
    box-shadow: 0 4px 18px rgba(28, 35, 68, 0.06);
}

#header-container #header > .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 76px;
    padding: 0 28px;
}

#header-container #header .left-side,
#header-container #header .right-side {
    float: none;
    position: static;
    width: auto;
    height: auto;
    min-height: 0;
}

#header-container #header .left-side {
    display: flex;
    align-items: center;
}

#header-container #header .right-side {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    background: transparent;
    text-align: right;
}

#header-container #logo {
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
}

#header-container .miracle-header-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: auto;
    color: #20274a;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

#header-container .miracle-header-brand:hover {
    color: #6368a6;
}

#header-container .miracle-header-logo-image {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: contain;
    position: static !important;
    top: auto !important;
    transform: none !important;
}

#header-container .miracle-header-wordmark {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    line-height: 1;
}

#header-container .miracle-header-wordmark-top,
#header-container .miracle-header-wordmark-bottom {
    color: #60698f;
    font-size: 0.78em;
    font-weight: 500;
}

#header-container .miracle-header-wordmark strong {
    color: #6368a6;
    font-weight: 800;
}

#header-container .header-widget {
    display: flex;
    align-items: center;
    float: none;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
}

#header-container .header-widget.d-flex {
    gap: 8px !important;
}

#header-container .header-widget .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 10px;
    padding: 10px 18px;
    box-shadow: none;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    top: auto;
    transform: none;
}

#header-container .header-widget .button:not(.miracle-signup-button) {
    color: #4b477f !important;
    background: #fff !important;
    border: 1px solid #d9d8ef !important;
    box-shadow: 0 3px 10px rgba(76, 70, 137, 0.06) !important;
}

#header-container .header-widget .button:not(.miracle-signup-button):hover {
    color: #3f3b78 !important;
    background: #f5f3ff !important;
    border-color: #bdb8e8 !important;
}

#header-container .header-widget .miracle-signup-button {
    color: #fff !important;
    background: linear-gradient(135deg, #5c4fd0 0%, #3f8eb7 100%) !important;
    border: 1px solid transparent !important;
    box-shadow: 0 7px 16px rgba(76, 70, 180, 0.26) !important;
}

#header-container .header-widget .miracle-signup-button:hover {
    color: #fff !important;
    background: linear-gradient(135deg, #5144c1 0%, #327ca8 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 9px 18px rgba(76, 70, 180, 0.34) !important;
}

#header-container .language-switcher .dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: auto;
    min-width: 66px;
    height: 42px !important;
    min-height: 42px !important;
    border: 1px solid #d9d8ef !important;
    border-radius: 10px;
    padding: 0 13px;
    color: #4b477f !important;
    background: #fff !important;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    top: auto !important;
    transform: none !important;
}

#header-container .language-switcher {
    top: auto !important;
    transform: none !important;
}

#header-container .language-switcher .dropdown-toggle:hover,
#header-container .language-switcher.open .dropdown-toggle {
    border-color: #aaa4df !important;
    color: #5148a0 !important;
    background: #faf9ff !important;
}

#header-container .language-switcher .caret {
    margin: 0;
    border-top-color: #5b55a0 !important;
}

#header-container .language-switcher .dropdown-menu {
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    min-width: 140px;
    overflow: hidden;
    border: 1px solid #e7e8f2;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(35, 42, 77, 0.14);
}

@media (max-width: 767px) {
    #header-container #header,
    #header-container #header > .container {
        height: auto;
        min-height: 72px;
    }

    #header-container #header > .container {
        gap: 14px;
        padding: 14px 18px;
    }

    #header-container #header .right-side {
        flex-wrap: wrap;
        gap: 8px;
    }

    #header-container .miracle-header-brand {
        gap: 8px;
        font-size: 14px;
    }

    #header-container .miracle-header-logo-image {
        width: 30px;
        height: 30px;
    }

    #header-container .header-widget .button {
        min-height: 38px;
        padding: 9px 11px;
        font-size: 11px;
    }

    #header-container .language-switcher .dropdown-toggle {
        min-width: 58px;
        height: 38px !important;
        min-height: 38px !important;
        padding: 0 10px;
    }
}

@media (max-width: 520px) {
    #header-container #header > .container {
        align-items: flex-start;
    }

    #header-container #header .right-side {
        justify-content: flex-end;
    }

    #header-container .miracle-header-wordmark-top,
    #header-container .miracle-header-wordmark-bottom {
        display: none;
    }
}
