/* Analysis card — Figma mobile 401:2258 + desktop 479:4 */

.medagg-body--detail {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.medagg-body--detail .medagg-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-bottom: 0;
}

.medagg-detail {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
    background: var(--bb-navy, #003670);
}

@media (max-width: 767px) {
    .medagg-body--detail .medagg-v2-header {
        background: #fff;
    }

    .medagg-body--detail .medagg-v2-city {
        background: #f7fafc;
        border: 1px solid #e2e8f0;
    }

    .medagg-body--detail .medagg-v2-city__select {
        color: #2d3748;
    }

    .medagg-body--detail .medagg-v2-city__chevron {
        filter: invert(1);
    }

    .medagg-body--detail .medagg-v2-burger span {
        background: #2d3748;
    }
}

.medagg-detail-crumbs {
    display: none;
}

.medagg-detail-sheet {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 16px;
    padding: 0 0 calc(var(--medagg-tabbar-h, 64px) + env(safe-area-inset-bottom, 0px) + 88px);
    background: #fff;
    border-radius: 0 0 0 0;
}

.medagg-detail-sheet__inner {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 16px;
}

.medagg-detail-main {
    background: #fff;
    border-radius: 0 0 24px 24px;
}

.medagg-body--detail .medagg-detail-search.medagg-cat-search {
    box-sizing: border-box;
    height: 48px;
    margin: 8px 16px 0;
    padding: 0 16px;
    background: #fff;
    border: 1px solid var(--bb-line, #e2e8f0);
    border-radius: 100px;
}

.medagg-detail-intro {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 20px 24px;
}

.medagg-detail-backrow {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 23px;
}

.medagg-detail-back {
    display: inline-flex;
    flex-shrink: 0;
    line-height: 0;
}

.medagg-detail-back img {
    display: block;
    width: 19px;
    height: 23px;
    object-fit: contain;
}

.medagg-detail-labs {
    color: var(--bb-muted, #718096);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.medagg-detail-title {
    margin: 0;
    color: var(--bb-ink, #2d3748);
    font-family: var(--bb-font, inherit);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.medagg-detail-mz {
    margin: 0;
    color: var(--bb-muted, #718096);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
}

.medagg-detail-lead {
    margin: 0;
    color: var(--bb-ink, #2d3748);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
}

.medagg-detail-hero-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.medagg-detail-hero-price__now {
    color: var(--bb-navy, #003670);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.medagg-detail-hero-price__old {
    color: #999;
    font-size: 14px;
    font-weight: 400;
    text-decoration: line-through;
}

.medagg-detail-aside {
    padding: 0;
}

.medagg-detail-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
    padding: 20px;
    background: #fff;
    border-radius: 24px;
}

.medagg-detail-deal {
    display: none;
}

.medagg-detail-card-price {
    display: none;
}

.medagg-detail-labs-title {
    margin: 0;
    color: var(--bb-navy, #003670);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.medagg-detail-offers {
    display: flex;
    flex-direction: column;
}

.medagg-detail-offer {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "logo days prices"
        "sku sku prices";
    column-gap: 8px;
    row-gap: 2px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--bb-line, #e2e8f0);
}

.medagg-detail-offer:last-child {
    border-bottom: 0;
}

.medagg-detail-offer[hidden] {
    display: none !important;
}

.medagg-detail-offer__logo-wrap {
    grid-area: logo;
    display: flex;
    align-items: center;
    height: 14px;
    min-width: 0;
}

.medagg-detail-offer__logo {
    display: block;
    height: 14px;
    width: auto;
    max-width: none;
    object-fit: contain;
    object-position: left center;
}

.medagg-detail-offer__name {
    color: var(--bb-ink, #2d3748);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.medagg-detail-offer__days {
    grid-area: days;
    display: inline-flex;
    align-items: center;
    justify-self: start;
    padding: 4px 10px;
    border-radius: 100px;
    background: #edf2f7;
    color: var(--bb-muted, #718096);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.medagg-detail-offer__days--empty {
    display: none;
}

.medagg-detail-offer__sku {
    grid-area: sku;
    color: var(--bb-muted, #718096);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
}

.medagg-detail-offer__prices {
    grid-area: prices;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    min-width: 64px;
}

.medagg-detail-offer__now {
    color: var(--bb-ink, #2d3748);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.medagg-detail-offer__old {
    color: var(--bb-muted, #718096);
    font-size: 13px;
    font-weight: 400;
    text-decoration: line-through;
}

.medagg-detail-bio {
    margin: 0;
    color: var(--bb-muted, #718096);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
}

.medagg-detail-empty {
    margin: 0;
    color: #b54747;
    font-size: 14px;
    font-weight: 600;
}

.medagg-detail-prep {
    box-sizing: border-box;
    margin: 0 16px;
    padding: 20px;
    background: #fff;
    border-radius: 24px;
}

.medagg-detail-desc {
    box-sizing: border-box;
    padding: 0 20px 24px;
}

.medagg-detail-desc.is-empty {
    display: none;
}

.medagg-detail-desc__title {
    margin: 0 0 12px;
    color: var(--bb-navy, #003670);
    font-family: var(--bb-display, inherit);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.medagg-detail-desc__body {
    color: var(--bb-ink, #2d3748);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
}

.medagg-detail-desc__body p {
    margin: 0 0 10px;
}

.medagg-detail-desc__body p:last-child {
    margin-bottom: 0;
}

.medagg-detail-desc__body ul,
.medagg-detail-desc__body ol {
    margin: 0 0 10px;
    padding-left: 1.2em;
}

.medagg-detail-prep--desktop {
    display: none;
}

.medagg-detail-prep__title {
    margin: 0 0 12px;
    color: var(--bb-navy, #003670);
    font-family: var(--bb-display, inherit);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.medagg-detail-prep__text {
    color: var(--bb-ink, #2d3748);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
}

.medagg-detail-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 40px;
    padding: 10px 24px;
    border: 0;
    border-radius: 100px;
    background: var(--bb-navy, #003670);
    color: #fff;
    font-family: var(--bb-font, inherit);
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.medagg-detail-cart.is-in-cart {
    background: #e8eef6;
    color: var(--bb-navy, #003670);
}

.medagg-detail-cart:disabled {
    opacity: 0.55;
    cursor: default;
}

.medagg-detail-cart--desktop {
    display: none;
}

.medagg-detail-sticky {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--medagg-tabbar-h, 64px) + env(safe-area-inset-bottom, 0px));
    z-index: 999;
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background: #fff;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
}

@media (min-width: 768px) {
    .medagg-body--detail .medagg-cat-search,
    .medagg-detail-search {
        display: none;
    }

    .medagg-detail-crumbs {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        box-sizing: border-box;
        width: min(var(--bb-container, 1200px), calc(100% - 48px));
        margin: 0 auto;
        padding: 16px 0;
        font-size: 13px;
        line-height: 1.2;
    }

    .medagg-detail-crumbs__link,
    .medagg-detail-crumbs__sep {
        color: #93c5fd;
        text-decoration: none;
    }

    .medagg-detail-crumbs__link:hover {
        color: #fff;
    }

    .medagg-detail-crumbs__current {
        color: #fff;
        font-weight: 500;
    }

    .medagg-detail-sheet {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        width: 100%;
        margin: 0;
        padding: 0 0 40px;
        background: #fff;
        border-radius: 24px 24px 0 0;
    }

    .medagg-detail-sheet__inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 440px;
        align-items: start;
        flex: 1 1 auto;
        gap: 48px;
        box-sizing: border-box;
        width: min(var(--bb-container, 1200px), calc(100% - 48px));
        margin: 0 auto;
        padding: 40px 0 80px;
    }

    .medagg-detail--bundle .medagg-detail-sheet__inner {
        grid-template-areas:
            "main aside"
            "comp aside";
        row-gap: 28px;
        column-gap: 48px;
    }

    .medagg-detail--bundle .medagg-detail-main {
        grid-area: main;
    }

    .medagg-detail--bundle .medagg-detail-aside {
        grid-area: aside;
    }

    .medagg-detail--bundle .medagg-bundle-comp {
        grid-area: comp;
    }

    .medagg-detail-main {
        background: transparent;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        gap: 28px;
    }

    .medagg-detail-intro {
        gap: 12px;
        padding: 0;
    }

    .medagg-detail-labs {
        font-size: 14px;
    }

    .medagg-detail-title {
        font-family: var(--bb-display, inherit);
        font-size: 32px;
        font-weight: 700;
        line-height: 1.2;
    }

    .medagg-detail-mz {
        font-size: 14px;
    }

    .medagg-detail-hero-price {
        display: none;
    }

    .medagg-detail-aside {
        padding: 0;
    }

    .medagg-detail-card {
        gap: 24px;
        padding: 32px;
        background: #f2f5f7;
        border: 1px solid var(--bb-line, #e2e8f0);
        border-radius: 20px;
    }

    .medagg-detail-deal {
        display: inline-flex;
        align-self: flex-start;
        padding: 4px 10px;
        border-radius: 6px;
        background: #fed7d7;
        color: #e53e3e;
        font-size: 12px;
        font-weight: 700;
        line-height: 1.2;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .medagg-detail-card-price {
        display: flex;
        align-items: baseline;
        gap: 12px;
    }

    .medagg-detail-card-price__now {
        color: var(--bb-navy, #003670);
        font-size: 28px;
        font-weight: 700;
        line-height: 1.2;
    }

    .medagg-detail-card-price__old {
        color: var(--bb-muted, #718096);
        font-size: 16px;
        text-decoration: line-through;
    }

    .medagg-detail-labs-head {
        padding-bottom: 4px;
        border-bottom: 1px solid var(--bb-line, #e2e8f0);
    }

    .medagg-detail-labs-title {
        color: var(--bb-ink, #2d3748);
        font-family: var(--bb-display, inherit);
        font-size: 16px;
    }

    .medagg-detail-offer {
        display: grid;
        grid-template-columns: max-content max-content minmax(0, 1fr) auto;
        grid-template-areas: "logo days sku prices";
        align-items: center;
        column-gap: 16px;
        row-gap: 0;
        padding: 16px 0;
    }

    .medagg-detail-offer__logo-wrap {
        height: 16px;
        max-width: none;
    }

    .medagg-detail-offer__logo {
        height: 16px;
        width: auto;
    }

    .medagg-detail-offer__days--empty {
        display: block;
        padding: 0;
        background: transparent;
        min-height: 16px;
    }

    .medagg-detail-offer__sku {
        font-size: 14px;
    }

    .medagg-detail-offer__prices {
        flex-direction: column-reverse;
        min-width: 72px;
    }

    .medagg-detail-prep {
        margin: 0;
        padding: 0;
        background: transparent;
        border-radius: 0;
    }

    .medagg-detail-prep--desktop {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .medagg-detail-prep--mobile {
        display: none;
    }

    .medagg-detail-prep__title {
        margin: 0;
        font-size: 18px;
    }

    .medagg-detail-desc {
        padding: 0;
    }

    .medagg-detail-desc__title {
        margin: 0 0 12px;
        font-size: 18px;
    }

    .medagg-detail-cart--desktop {
        display: flex;
        height: auto;
        padding: 16px 24px;
    }

    .medagg-detail-sticky {
        display: none;
    }
}

/* Bundle composition — Figma mobile 401:2342 + desktop 483:539 */

.medagg-detail-badge {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bb-navy, #003670);
    color: #fff;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.1;
}

.medagg-detail-offer__sku:empty {
    display: none;
}

.medagg-bundle-comp {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background: #fff;
    border-radius: 16px;
}

.medagg-bundle-comp__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 22px;
}

.medagg-bundle-comp__title {
    margin: 0;
    color: var(--bb-navy, #003670);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.medagg-bundle-comp__count {
    color: #808c99;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}

.medagg-bundle-comp__items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.medagg-bundle-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 24px;
}

.medagg-bundle-item.is-na {
    opacity: 0.55;
}

.medagg-bundle-item.is-unchecked .medagg-bundle-item__name {
    color: #718096;
}

.medagg-bundle-item__box {
    display: inline-flex;
    flex-shrink: 0;
    line-height: 0;
    cursor: pointer;
}

.medagg-bundle-item__check {
    appearance: none;
    box-sizing: border-box;
    width: 20px;
    height: 20px;
    margin: 0;
    border: 2px solid #ccd1d9;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.medagg-bundle-item__check.is-empty {
    appearance: none;
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ccd1d9;
    border-radius: 4px;
    background: #fff;
}

.medagg-bundle-item__check:checked {
    border-color: var(--bb-navy, #003670);
    background: var(--bb-navy, #003670);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' d='M1.5 5.2 4.6 8.2 10.5 1.8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px 10px;
}

.medagg-bundle-item__check:disabled {
    cursor: default;
    opacity: 0.7;
}

.medagg-bundle-item__name {
    flex: 1;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #333;
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
}

.medagg-bundle-item__name:hover {
    color: var(--bb-navy, #003670);
}

.medagg-bundle-item__meta {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 6px;
}

.medagg-bundle-item__open {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    line-height: 0;
}

.medagg-bundle-item__open img {
    display: block;
    width: 16px;
    height: 16px;
}

.medagg-bundle-item__price {
    color: var(--bb-navy, #003670);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.medagg-bundle-item__days {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border: 1px solid #d9dee5;
    border-radius: 100px;
    color: #808080;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.2;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .medagg-detail-badge {
        display: none;
    }

    .medagg-detail-offer__sku:empty {
        display: block;
        min-width: 0;
    }

    .medagg-bundle-comp {
        gap: 12px;
        padding: 0;
        background: transparent;
        border-radius: 0;
    }

    .medagg-bundle-comp__title {
        font-size: 18px;
    }

    .medagg-bundle-comp__count {
        font-size: 14px;
        font-weight: 400;
    }

    .medagg-bundle-item {
        gap: 12px;
        padding: 6px 0;
        min-height: 0;
    }

    .medagg-bundle-item__check,
    .medagg-bundle-item__check.is-empty {
        width: 22px;
        height: 22px;
    }

    .medagg-bundle-item__name {
        font-size: 15px;
    }

    .medagg-bundle-item__meta {
        gap: 8px;
    }

    .medagg-bundle-item__price {
        font-size: 15px;
        font-weight: 500;
    }

    .medagg-bundle-item__days {
        padding: 3px 8px;
        border: 0;
        background: #edf2f7;
        font-size: 12px;
    }

    .medagg-bundle-item__open {
        width: 28px;
        height: 28px;
    }
}

.medagg-popup-open {
    overflow: hidden;
}

.medagg-analysis-popup[hidden] {
    display: none;
}

.medagg-analysis-popup {
    position: fixed;
    inset: 0;
    z-index: 1400;
}

.medagg-analysis-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 54, 112, 0.45);
}

.medagg-analysis-popup__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    max-height: min(88vh, 720px);
    padding: 16px 20px 24px;
    background: #fff;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
}

.medagg-analysis-popup__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.medagg-analysis-popup__title {
    margin: 0;
    color: var(--bb-ink, #2d3748);
    font-family: var(--bb-font, inherit);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.medagg-analysis-popup__close {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f2f5f7;
    cursor: pointer;
}

.medagg-analysis-popup__body {
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    padding-bottom: 8px;
}

.medagg-analysis-popup__mz {
    margin: 0;
    color: var(--bb-muted, #718096);
    font-size: 12px;
    font-weight: 500;
}

.medagg-analysis-popup__lead,
.medagg-analysis-popup__prep-text {
    margin: 0;
    color: var(--bb-ink, #2d3748);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    white-space: pre-wrap;
}

.medagg-analysis-popup__bio {
    margin: 0;
    color: var(--bb-muted, #718096);
    font-size: 11px;
    line-height: 1.4;
}

.medagg-analysis-popup__prep-title {
    margin: 0 0 8px;
    color: var(--bb-navy, #003670);
    font-size: 16px;
    font-weight: 700;
}

@media (min-width: 768px) {
    .medagg-analysis-popup__panel {
        left: 50%;
        right: auto;
        top: 50%;
        bottom: auto;
        width: min(560px, calc(100% - 48px));
        max-height: min(80vh, 720px);
        padding: 28px 32px;
        border-radius: 20px;
        transform: translate(-50%, -50%);
    }

    .medagg-analysis-popup__title {
        font-family: var(--bb-display, inherit);
        font-size: 24px;
    }
}
