/* =====================================================
   BIODEBLOOM GLOBAL HEADER
===================================================== */

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-width: 100%;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: "DM Sans", sans-serif;
}

a {
    text-decoration: none;
}


/* =====================================================
   HEADER
===================================================== */

.bd-header {
    position: fixed;
    inset: 0 0 auto 0;
    width: 100%;
    z-index: 1000;

    padding: 18px 0;

    background: #173f2b;

    box-shadow: 0 6px 24px rgba(0,0,0,.10);

    transition: box-shadow .3s ease;
}



/* =====================================================
   CONTAINER
===================================================== */

.bd-header-container {
    width: min(1240px, calc(100% - 64px));
    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 28px;
}


/* =====================================================
   LOGO
===================================================== */

.bd-logo {
    display: inline-flex;
    align-items: center;

    flex: 0 0 auto;

    min-width: 145px;
}

.bd-logo img {
    display: block;

    width: 245px;
    height: auto;

    filter: brightness(0) invert(1);
}

.bd-logo-fallback {
    display: none;

    color: #fff;

    font-family: "Playfair Display", serif;
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -.03em;
}

/* =====================================================
   NAV
===================================================== */

.bd-navbar {
    display: flex;
    align-items: center;
    gap: 28px;
}

.bd-nav-link {
    position: relative;

    color: #fff;

    font-size: 14px;
    font-weight: 600;

    white-space: nowrap;

    transition: color .25s ease;
}

/* =====================================================
   CTA
===================================================== */

.bd-header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    padding: 12px 18px;

    border-radius: 999px;

    color: #123a2a;
    background: #fff;

    font-size: 12px;
    font-weight: 700;

    white-space: nowrap;

    transition: transform .25s ease, box-shadow .25s ease;
}

.bd-header-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0,0,0,.12);
}


/* =====================================================
   MOBILE
===================================================== */

.bd-menu-btn {
    display: none;

    width: 42px;
    height: 42px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: #fff;

    cursor: pointer;
}

.bd-menu-btn span {
    display: block;

    width: 20px;
    height: 2px;

    margin: 4px auto;

    background: #123a2a;
}


@media (max-width: 1050px) {

    .bd-header-container {
        width: calc(100% - 40px);
    }

    .bd-navbar {
        gap: 17px;
    }

    .bd-header-btn {
        padding: 11px 15px;
    }
}


@media (max-width: 850px) {

    .bd-header {
        padding: 14px 0;
    }

    .bd-header-container {
        width: calc(100% - 30px);
    }

    .bd-logo img {
        width: 135px;
    }

    .bd-header-btn {
        display: none;
    }

    .bd-menu-btn {
        display: block;
    }

    .bd-navbar {
        position: fixed;
        top: 70px;
        right: 15px;

        width: min(320px, calc(100% - 30px));

        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;

        padding: 12px;

        background: #fff;

        border-radius: 18px;

        box-shadow: 0 18px 55px rgba(0,0,0,.16);
    }

    .bd-navbar.open {
        display: flex;
    }

    .bd-nav-link {
        padding: 13px 11px;

        color: #14241c;

        font-size: 13px;
    }

    .bd-nav-link::after {
        display: none;
    }
}


/* =====================================================
   MOBILE MENU — FULL WIDTH
   ===================================================== */

@media (max-width: 850px) {

    .bd-navbar {
        top: 70px;
        left: 0;
        right: 0;

        width: 100%;
        max-width: none;

        padding: 12px 18px 18px;

        border-radius: 0 0 18px 18px;
        box-shadow: 0 18px 45px rgba(0,0,0,.16);
    }

    .bd-nav-link {
        padding: 14px 10px;
    }

}



/* =====================================================
   PRODUCTS CATEGORY DROPDOWN
===================================================== */
.bd-nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.bd-nav-dropdown-top {
    display: flex;
    align-items: center;
    gap: 7px;
}

.bd-nav-dropdown > .bd-nav-dropdown-top > .bd-nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
}

/* Desktop visibility is controlled by JS to support reliable dismissal and a
   forgiving pointer path from the Products label into the dropdown. */
@media (min-width: 851px) {
    .bd-nav-dropdown.is-open > .bd-products-menu {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, 0);
        pointer-events: auto;
    }
}

.bd-products-menu {
    position: absolute;
    top: calc(100% - 1px);
    left: 50%;
    z-index: 1200;
    width: 310px;
    max-height: min(70vh, 560px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 12px;
    border: 1px solid rgba(20, 63, 43, .10);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 20px 55px rgba(10, 35, 23, .20);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.bd-products-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -10px;
    height: 10px;
}

.bd-products-menu-heading {
    flex: 0 0 auto;
    padding: 9px 12px 11px;
    color: #7b897f;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.bd-products-menu-list {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 2px;
}

.bd-products-menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 11px 10px calc(11px + (var(--bd-category-depth, 0) * 12px));
    border-radius: 9px;
    color: #233b2d;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    transition: color .18s ease, background .18s ease;
}

.bd-products-menu-link span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.bd-products-menu-link i {
    flex: 0 0 auto;
    color: #7c9a83;
    font-size: 10px;
    opacity: 0;
    transform: translateX(-3px);
    transition: opacity .18s ease, transform .18s ease;
}

.bd-products-menu-link:hover,
.bd-products-menu-link:focus-visible,
.bd-products-menu-link.active {
    color: #174b32;
    background: #edf4ee;
    outline: none;
}

.bd-products-menu-link:hover i,
.bd-products-menu-link:focus-visible i,
.bd-products-menu-link.active i {
    opacity: 1;
    transform: translateX(0);
}

.bd-products-menu-all {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    padding: 13px 12px 7px;
    border-top: 1px solid #e8eee9;
    color: #174b32;
    font-size: 12px;
    font-weight: 700;
}

.bd-products-menu-empty {
    margin: 0;
    padding: 10px 12px 16px;
    color: #7b897f;
    font-size: 12px;
}

.bd-products-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: inherit;
    background: transparent;
    cursor: pointer;
}

.bd-products-toggle i {
    font-size: 10px;
    transition: transform .2s ease;
}

@media (max-width: 850px) {
    .bd-nav-dropdown {
        display: block;
        width: 100%;
    }

    .bd-nav-dropdown-top {
        display: flex;
        width: 100%;
        align-items: center;
        gap: 4px;
    }

    .bd-nav-dropdown-top > .bd-nav-link {
        flex: 1 1 auto;
        min-width: 0;
    }

    .bd-products-toggle {
        display: inline-flex;
        flex: 0 0 38px;
        height: 38px;
        color: #173f2b;
    }

    .bd-nav-dropdown.mobile-open .bd-products-toggle i {
        transform: rotate(180deg);
    }

    .bd-products-menu::before {
        display: none;
    }

    .bd-products-menu {
        position: static;
        width: 100%;
        max-height: 0;
        padding: 0 8px;
        margin: 0;
        border: 0;
        border-radius: 10px;
        box-shadow: none;
        background: #f3f7f3;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
        transition: max-height .25s ease, padding .25s ease, margin .25s ease;
    }

    .bd-nav-dropdown.mobile-open .bd-products-menu {
        max-height: 48vh;
        padding: 8px;
        margin: 2px 0 8px;
    }

    .bd-products-menu-heading {
        padding: 8px 10px;
        font-size: 9px;
    }

    .bd-products-menu-link {
        font-size: 12px;
        padding-top: 10px;
        padding-bottom: 10px;
        padding-left: calc(10px + (var(--bd-category-depth, 0) * 10px));
    }

    .bd-products-menu-link i {
        opacity: 1;
        transform: none;
    }

    .bd-products-menu-all {
        padding: 12px 10px 6px;
    }
}



/* =====================================================
   CATEGORY FLY-OUTS: CHILD CATEGORIES OPEN TO THE RIGHT
===================================================== */
@media (min-width: 851px) {
    .bd-products-menu {
        overflow: visible;
    }

    .bd-products-menu-root-list,
    .bd-products-submenu-list {
        display: flex;
        flex-direction: column;
        gap: 2px;
        overflow: visible;
        padding: 0 2px;
    }

    .bd-products-menu-item {
        position: relative;
        width: 100%;
    }

    .bd-products-menu-row {
        display: flex;
        align-items: stretch;
        width: 100%;
        border-radius: 9px;
    }

    .bd-products-menu-row > .bd-products-menu-link {
        flex: 1 1 auto;
        min-width: 0;
        padding: 10px 11px;
    }

    .bd-submenu-toggle {
        display: inline-flex;
        flex: 0 0 34px;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 0 9px 9px 0;
        background: transparent;
        color: #7c9a83;
        cursor: pointer;
    }

    .bd-products-menu-item.has-children > .bd-products-menu-row:hover,
    .bd-products-menu-item.has-children:focus-within > .bd-products-menu-row {
        background: #edf4ee;
    }

    .bd-products-submenu {
        position: absolute;
        top: -8px;
        left: calc(100% + 10px);
        z-index: 1300;
        width: 280px;
        max-height: min(65vh, 480px);
        overflow: visible;
        padding: 12px;
        border: 1px solid rgba(20, 63, 43, .10);
        border-radius: 15px;
        background: #fff;
        box-shadow: 0 18px 45px rgba(10, 35, 23, .18);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateX(6px);
        transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
    }

    .bd-products-submenu::before {
        content: "";
        position: absolute;
        top: 0;
        right: 100%;
        width: 12px;
        height: 100%;
    }

    .bd-products-menu-item:hover > .bd-products-submenu,
    .bd-products-menu-item:focus-within > .bd-products-submenu {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateX(0);
    }

    .bd-products-submenu-heading {
        padding: 8px 10px 10px;
        color: #7b897f;
        font-size: 9px;
        font-weight: 800;
        letter-spacing: 1.3px;
        text-transform: uppercase;
        border-bottom: 1px solid #e8eee9;
        margin-bottom: 5px;
    }

    .bd-products-submenu .bd-products-menu-link {
        padding: 10px 11px;
    }

    .bd-products-submenu .bd-submenu-toggle {
        flex-basis: 30px;
    }

    .bd-products-submenu .bd-products-submenu {
        top: -8px;
    }

    .bd-products-menu-link i {
        display: none;
    }

    .bd-products-menu-row > .bd-products-menu-link:hover,
    .bd-products-menu-row > .bd-products-menu-link:focus-visible,
    .bd-products-menu-link.active {
        color: #174b32;
        background: #edf4ee;
        outline: none;
    }
}

@media (max-width: 850px) {
    .bd-products-menu {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .bd-products-menu-list,
    .bd-products-submenu-list {
        display: flex;
        flex-direction: column;
        gap: 2px;
        overflow: visible;
    }

    .bd-products-menu-item {
        position: relative;
        width: 100%;
    }

    .bd-products-menu-row {
        display: flex;
        align-items: center;
        width: 100%;
    }

    .bd-products-menu-row > .bd-products-menu-link {
        flex: 1 1 auto;
        min-width: 0;
        padding: 10px;
    }

    .bd-submenu-toggle {
        display: inline-flex;
        flex: 0 0 34px;
        height: 38px;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: #54765e;
        cursor: pointer;
    }

    .bd-submenu-toggle i {
        transition: transform .2s ease;
    }

    .bd-products-menu-item.submenu-open > .bd-products-menu-row .bd-submenu-toggle i {
        transform: rotate(90deg);
    }

    .bd-products-submenu {
        display: none;
        position: static;
        width: auto;
        max-height: none;
        margin: 2px 0 7px 12px;
        padding: 6px 7px;
        border-left: 2px solid #dce8dd;
        border-radius: 0 10px 10px 0;
        background: #edf4ee;
        box-shadow: none;
    }

    .bd-products-menu-item.submenu-open > .bd-products-submenu {
        display: block;
    }

    .bd-products-submenu-heading {
        padding: 5px 10px 7px;
        color: #718579;
        font-size: 9px;
        font-weight: 800;
        letter-spacing: 1px;
        text-transform: uppercase;
    }

    .bd-products-submenu .bd-products-menu-link {
        padding: 9px 10px;
        font-size: 11px;
    }

    .bd-products-submenu .bd-submenu-toggle {
        flex-basis: 30px;
        height: 34px;
    }
}
