/* ============================================
   РайтБуфен — главная страница
   Строгий БЭМ: только классы, без каскада
   ============================================ */

/* --- Переменные и сброс --- */
:root {
    --color-primary: #c8162d;
    --color-primary-dark: #7f0201;
    --color-primary-bright: #d21b1d;
    --color-hero-deep: #370101;
    --color-dark: #0a0e13;
    --color-gray: #495467;
    --color-light: #f6f6f6;
    --color-white: #ffffff;

    --gradient-hero: linear-gradient(118deg, #370101 0%, #650101 30%, #a50102 62%, #d21b1d 100%);
    --gradient-section: linear-gradient(90deg, #7C0200 0%, #D51C1E 100%);
    --gradient-footer: linear-gradient(180deg, #FFFFFF 0%, #FFDBDC 100%);

    --font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;

    --container-width: 1240px;
    --radius-card: 30px;
    --radius-button: 40px;
}

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

body,
h1,
h2,
h3,
p,
ul,
ol {
    margin: 0;
    padding: 0;
}

ul,
ol {
    list-style: none;
}

body {
    font-family: var(--font-family);
    color: var(--color-dark);
    background-color: var(--color-white);
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

sup {
    font-size: 0.6em;
}

#advantages,
#indications,
#scheme,
#references,
#pharmacies,
#instruction {
    scroll-margin-top: 90px;
}

/* --- Контейнер --- */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.page__main {
    overflow: hidden;
}

/* --- Кнопки --- */
.btn {
    display: inline-block;
    padding: 17px 27px;
    border-radius: var(--radius-button);
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 14px;
    line-height: 100%;
    letter-spacing: 0%;
    text-transform: uppercase;
    white-space: nowrap;
    text-align: center;
    cursor: pointer;
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

.btn:hover {
    opacity: 0.88;
}

.btn_primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-white);
}

.btn_primary--white {
    background-color: var(--color-white);
    border-color: var(--color-white);
    color: var(--color-primary);
}

.btn_outline {
    background-color: transparent;
    border-color: var(--color-white);
    color: var(--color-white);
}

.btn_outline-dark {
    background-color: transparent;
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* --- Иконки (CSS-заглушки вместо изображений) --- */
.icon {
    position: relative;
    display: inline-block;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}

/* Красная обводка-основа для иконок на белом фоне */
.indications__icon,
.articles__media {}

.indications__icon {
    width: 72px;
    height: 72px;
}

/* Логотип аптеки */
.pharmacies__logo::before {
    width: 56px;
    height: 56px;
    border: 2px solid #e3e6ea;
    border-radius: 14px;
    background-color: var(--color-white);
}

.pharmacies__logo::after {
    width: 24px;
    height: 24px;
    background:
        linear-gradient(var(--color-primary), var(--color-primary)) center / 100% 5px no-repeat,
        linear-gradient(var(--color-primary), var(--color-primary)) center / 5px 100% no-repeat;
}

/* ============================================
   Шапка
   ============================================ */
.header {
    position: fixed;
    /* прилипает при прокрутке */
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: transparent;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease,
        -webkit-backdrop-filter 0.3s ease, box-shadow 0.3s ease;
}

.header_scrolled,
.header_page {
    background-color: rgba(55, 1, 1, 0.55);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding-top: 30px;
    padding-bottom: 30px;
    transition: padding 0.3s ease;
}

.header_scrolled .header__inner {
    padding-top: 16px;
    padding-bottom: 16px;
}

.header__logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-white);
    letter-spacing: 0;
    white-space: nowrap;
    text-transform: uppercase;
}

.header__nav {
    flex-grow: 1;
    max-width: 720px;
}

.nav__list {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.nav__link {
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0%;
    text-transform: uppercase;
    color: var(--color-white);
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.nav__link:hover {
    border-bottom: 2px solid var(--color-primary);
}

.nav__link_dark {
    color: var(--color-dark);
}

.header__button {
    white-space: nowrap;
}

.header__burger {
    display: none;
}

/* ============================================
   Промо
   ============================================ */
.hero {
    background-color: var(--color-primary-dark);
    background-image: url(../images/hero-bg.jpg);
    background-size: cover;
    background-position: center;
    color: var(--color-white);
    height: 100vh;
    min-height: 600px;
    max-height: 650px;
}

.hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22% minmax(0, 40%);
    column-gap: 20px;
    align-items: center;
    padding-top: 80px;
    height: 100%;
    box-sizing: border-box;
}

.hero__content {
    grid-column: 1;
}

.hero__title {
    font-family: "Onest", sans-serif;
    font-weight: 600;
    font-size: 60px;
    line-height: 1;
    letter-spacing: 5.5%;
    text-transform: uppercase;
    max-width: 470px;
    color: var(--color-white);
}

.hero__title span {
    position: relative;
    display: block;
    width: 210px;
    font-family: "Science Gothic", sans-serif;
    font-weight: 400;
    line-height: 1;
    text-transform: uppercase;
    color: var(--color-primary-bright);
    margin-top: 40px;
    z-index: 1;
}

.hero__title span::before {
    content: '';
    position: absolute;
    top: 0;
    right: -10px;
    width: 310px;
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(270deg, #FFFFFF 0%, #FFFFFF 50%, rgba(255, 255, 255, 0) 100%);
    z-index: -1;
}

.hero__actions {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 52px;
}

/* Декоративная зона фото (без изображения) */
.hero__media {
    grid-column: 3;
    grid-row: 1;
    position: relative;
}

.hero__img {
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero__features {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 48px;
    top: 50%;
    left: -256px;
    transform: translateY(-60%);
}

.hero__feature {
    position: relative;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.2;
    color: var(--color-primary);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 15px 13px;
    z-index: 0;
}

.hero__feature:first-child {
    margin-left: 20px;
}

.hero__feature::after {
    content: '';
    position: absolute;
    background: linear-gradient(90deg, #FFFFFF 0%, #FFFFFF 50%, rgba(255, 255, 255, 0) 100%);
    top: 0;
    left: 0;
    width: 400px;
    height: 100%;
    z-index: 0;
    border-radius: 10px;
}

.hero__feature strong {
    font-weight: 700;
}

.hero__feature span {
    position: relative;
    max-width: 170px;
    z-index: 2;
}

.hero__feature-icon {
    position: relative;
    z-index: 2;
    height: 74px;
    width: 74px;
}

/* ============================================
   Показания
   ============================================ */
.indications {
    padding: 50px 0;
    background-color: var(--color-white);
}

.indications__list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
}

.indications__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    text-align: center;
}

.indications__text {
    color: var(--color-dark);
    font-weight: 700;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0%;
    text-align: center;
}

/* ============================================
   Преимущества
   ============================================ */
.advantages {
    padding: 40px 0 60px;
    background-image: var(--gradient-section);
    color: var(--color-white);
}

.advantages__title {
    margin-bottom: 40px;
    color: var(--color-white);
    font-weight: 700;
    font-size: 42px;
    line-height: 1;
    letter-spacing: 0%;
}

.advantages__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.advantages__card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    background: var(--color-white);
    border-radius: var(--radius-card);
    padding: 30px;
}

.advantages__icon {
    width: 152px;
    height: 152px;
    margin: 0 auto;
}

.advantages__subtitle {
    font-weight: 700;
    font-size: 24px;
    line-height: 1;
    letter-spacing: 0%;
    color: var(--color-primary-bright);
}

.advantages__text {
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-dark);
}

/* ============================================
   Примечание
   ============================================ */
.note {
    padding: 55px 0 55px;
    background-color: var(--color-white);
}

.note__content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 30px;
    padding: 40px 60px 40px 40px;
    background-image: var(--gradient-section);
    border-radius: var(--radius-card);
    max-width: 1000px;
    margin: 0 auto;
}

.note__icon {
    width: 60px;
    height: 60px;
}

.note__text {
    font-weight: 400;
    font-size: 18px;
    line-height: 1.5;
    letter-spacing: 0;
    color: var(--color-white);
}

.note__text strong {
    display: block;
    font-weight: 700;
}

/* ============================================
   Схема применения
   ============================================ */
.scheme {
    padding: 55px 0 60px;
    background-image: var(--gradient-section);
    color: var(--color-white);
}

.scheme__title {
    margin-bottom: 30px;
    color: var(--color-white);
    font-weight: 700;
    font-size: 42px;
    line-height: 1;
}

.scheme__cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.scheme__card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 35px 40px;
    background-color: var(--color-white);
    border-radius: var(--radius-card);
}

.scheme__info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scheme__subtitle {
    color: var(--color-primary);
    font-weight: 700;
    font-size: 24px;
    line-height: 1;
    letter-spacing: 0%;
}

.scheme__text {
    font-weight: 700;
    font-size: 18px;
    line-height: 1.5;
    color: var(--color-dark);
}

.scheme__text span {
    display: block;
    font-weight: 400;
}

.scheme__icon {
    width: 124px;
    height: 124px;
}

/* ============================================
   Это интересно
   ============================================ */
.articles {
    padding: 60px 0 30px;
    background-color: var(--color-white);
}

.articles__title {
    margin-bottom: 30px;
    font-weight: 700;
    font-size: 42px;
    line-height: 1;
    letter-spacing: 0%;
}

.articles__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.articles__card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--color-white);
    border-radius: var(--radius-card);
    box-shadow: 0px 2px 15px 0px #86454526;
    overflow: hidden;
    transition: all 0.25s ease-in-out;
}

.articles__card:hover {
    box-shadow: 0px 2px 30px 0px #86454540;
}

.articles__card:hover .articles__subtitle {
    color: var(--color-primary-bright);
}

/* Заглушка вместо фото статьи */
.articles__media {
    aspect-ratio: 400 / 218;
    background: radial-gradient(circle at 78% 22%, rgba(200, 22, 45, 0.16) 0%, rgba(200, 22, 45, 0) 55%), linear-gradient(135deg, #f2f4f7 0%, #e4e8ee 100%);
}

.articles__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.articles__content {
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.articles__subtitle {
    color: var(--color-dark);
    font-weight: 700;
    font-size: 20px;
    line-height: 1;
    transition: all 0.25s ease-in-out;
}

.articles__text {
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-gray);
}

.articles__link {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
    top: 0;
    left: 0;
}

/* ============================================
   Где купить
   ============================================ */
.pharmacies {
    padding: 30px 0 65px;
    background-color: var(--color-white);
}

.pharmacies__title {
    margin-bottom: 30px;
    color: var(--color-dark);
    font-weight: 700;
    font-size: 42px;
    line-height: 1;
}

.pharmacies__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.pharmacies__card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    padding: 25px 40px;
    border-radius: var(--radius-card);
    background-color: var(--color-white);
    box-shadow: 0;
    transition: all 0.25s ease-in-out;
    box-shadow: 0px 2px 15px 0px #86454526;
}

.pharmacies__card:hover {
    box-shadow: 0px 2px 30px 0px #86454540;
}

.pharmacies__logo {
    width: 100%;
}

.pharmacies__link {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
    top: 0;
    left: 0;
}

/* ============================================
   Продукт
   ============================================ */
.product {
    padding: 50px 0;
    background-color: var(--color-light);
}

.product__inner {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 64px;
    align-items: center;
}

.product__pack {
    width: 100%;
}

.product__info {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
}

.product__content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product__name {
    color: var(--color-dark);
    font-weight: 700;
    font-size: 42px;
    line-height: 1;
}

.product__text {
    color: var(--color-gray);
    font-weight: 400;
    font-size: 18px;
    line-height: 1.2;
}

.product__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    max-width: 210px;
}

.product__actions a {
    width: 100%;
}

/* ============================================
   Ссылки
   ============================================ */
.references {
    margin: 50px 0;
}

.references .container {
    padding: 40px;
    background-color: var(--color-light);
    border-radius: var(--radius-card);
    border: 1px solid #eceff3;
}

.references__title {
    color: var(--color-dark);
    font-weight: 700;
    font-size: 42px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    user-select: none;
}

.references__title::after {
    content: '';
    background: url(../images/icon/arrow.svg);
    background-size: cover;
    width: 37px;
    height: 21px;
    transform: rotate(0deg);
    transition: transform .25s ease;
    margin-left: auto;
}

.references__title.is-open::after {
    transform: rotate(-180deg);
}

.references__panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease;
}

.references__panel.is-open {
    max-height: 2000px;
}

.references__list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-top: 30px;
    padding-left: 26px;
    list-style: decimal;
}

.references__item {
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-gray);
    font-weight: 400;
}

/* ============================================
   Предупреждение
   ============================================ */
.warning {
    background-color: var(--color-white);
}

.warning__text {
    font-family: "Alumni Sans", sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 3.6vw, 45px);
    line-height: 1;
    letter-spacing: -2px;
    margin: 0 auto;
    text-align: center;
    text-transform: uppercase;
    color: #FBD5D5;
}

/* ============================================
   Подвал
   ============================================ */
.footer {
    padding: 50px 0;
    background-image: var(--gradient-footer);
}

.footer .container {
    display: flex;
    flex-direction: column;
    gap: 44px;
}

.footer__top {
    display: flex;
    align-items: center;
    gap: 40px;
}

.footer__logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0;
    white-space: nowrap;
    text-transform: uppercase;
}

.footer__nav {
    flex-grow: 1;
}

.footer__nav .nav__link_dark {
    color: #9E8585;
}

.footer__bottom {
    display: flex;
    justify-content: space-between;
    gap: 40px;
}

.footer__text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--color-gray);
}

.footer__link {
    font-weight: 400;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-primary);
}

.footer__contacts {
    text-align: center;
}

.footer__developer {
    text-align: right;
}

.footer__developer .footer__link {
    font-weight: 700;
}

/* ============================================
   Адаптив
   ============================================ */
@media (max-width: 1200px) {
    .hero__title {
        font-size: 46px;
        letter-spacing: 0;
    }

    .hero__title span {
        margin-top: 30px;
    }

    .hero__title span::before {
        right: 40px;
    }

    .hero__actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-top: 30px;
    }
}


@media (max-width: 1169px) {

    #advantages,
    #indications,
    #scheme,
    #references,
    #pharmacies,
    #instruction {
        scroll-margin-top: 70px;
    }

    .header__nav {
        position: fixed;
        z-index: 110;
        top: 0;
        right: -100%;
        width: min(360px, 84vw);
        height: 100vh;
        padding: 110px 40px 40px;
        background-color: var(--color-primary-dark);
        transition: right 0.3s ease;
    }

    .header__nav_open {
        right: 0;
    }

    .nav__list {
        flex-direction: column;
        align-items: flex-start;
        gap: 26px;
    }

    .nav__link {
        font-size: 20px;
    }

    .header__burger {
        position: relative;
        z-index: 120;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 40px;
        height: 40px;
        margin-left: auto;
        padding: 0;
        border: none;
        background-color: transparent;
        cursor: pointer;
    }

    .burger__line {
        display: block;
        width: 26px;
        height: 2px;
        background-color: var(--color-white);
    }

    .advantages__subtitle {
        font-size: 20px;
    }

    .footer__top {
        justify-content: space-between;
    }

    .footer__nav {
        display: none;
    }
}

@media (max-width: 1024px) {

    .hero {
        height: auto;
        max-height: none;
        min-height: 500px;
    }

    .hero__inner {
        padding-top: 120px;
    }

    .hero__features {
        gap: 22px;
        left: -220px;
    }

    .hero__feature {
        font-size: 16px;
    }

    .hero__feature span {
        max-width: 145px;
    }

    .hero__feature-icon {
        height: 52px;
        width: 52px;
    }

    .hero__title {
        font-size: 32px;
    }

    .hero__title span {
        margin-top: 16px;
    }

    .hero__title span::before {
        right: 94px;
        width: 185px;
        border-radius: 5px;
    }

    .hero__actions {
        margin-top: 20px;
    }

    .indications__list {
        grid-template-columns: repeat(3, 1fr);
        row-gap: 40px;
    }

    .advantages__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .articles__grid {
        grid-template-columns: 1fr;
    }

    .pharmacies__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .advantages__subtitle br {
        display: none;
    }

    .product__inner {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .product__actions {
        justify-content: center;
    }

    .footer .container {
        gap: 30px;
    }

    .footer__top {
        flex-wrap: wrap;
    }

    .footer__bottom {
        flex-direction: column;
        gap: 22px;
    }

    .footer__bottom {
        gap: 12px;
    }

    .footer__text {
        line-height: 1;
    }

    .footer__developer,
    .footer__bottom {
        text-align: center;
    }
}

@media (max-width: 768px) {
    :root {
        --radius-card: 15px;
    }

    .header__button {
        display: none;
    }

    .hero__inner {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .hero__content {
        grid-column: auto;
    }

    .hero__actions {
        flex-direction: row;
    }

    .hero__media {
        grid-column: auto;
        grid-row: auto;
        position: relative;
    }

    .hero__img {
        position: relative;
        z-index: 2;
        width: calc(100% - 250px);
        margin-left: 250px;
    }

    .hero__features {
        left: 0;
    }

    .advantages__title,
    .scheme__title,
    .articles__title,
    .pharmacies__title,
    .product__name,
    .references__title {
        font-size: 32px;
    }

    .warning__text {
        font-size: 26px;
    }

    .scheme__cards {
        grid-template-columns: 1fr;
    }

    .indications__list {
        grid-template-columns: repeat(2, 1fr);
    }

    .note__icon {
        display: none;
    }

    .note__content {
        padding: 20px;
    }

    .product__info {
        flex-direction: column;
    }

    .product__actions {
        flex-direction: row;
        max-width: none;
    }

    .references {
        padding: 20px 0;
    }

    .references__title::after {
        width: 26px;
        height: 15px;
    }
}

@media (max-width: 520px) {

    .hero__inner {
        gap: 30px;
    }

    .hero__title {
        text-align: center;
    }

    .hero__title span {
        width: 100%;
        margin-top: 6px;
    }

    .hero__title span::before {
        left: 50%;
        right: 0;
        background: linear-gradient(90deg, #FFFFFF00 0%, #FFFFFF 25%, #FFFFFF 75%, #FFFFFF00 100%);
        transform: translateX(-50%);
    }

    .hero__media {
        overflow: hidden;
    }

    .hero__img {
        position: relative;
        z-index: 2;
        width: 80%;
        height: 100%;
        margin: 0 auto;
        display: block;
        padding-bottom: 60px;
    }

    .hero__features {
        flex-direction: row;
        justify-content: center;
        left: 0;
        z-index: 2;
        bottom: 20px;
        top: auto;
        transform: none;
        gap: 10px;
    }

    .hero__feature {
        font-size: 14px;
        overflow: hidden;
        text-align: center;
    }

    .hero__feature::after {
        background: #ffffff;
        width: 100%;
    }

    .hero__feature:first-child {
        margin-left: 0;
    }

    .hero__feature-icon {
        display: none;
    }

    .hero__actions,
    .product__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .indications__list,
    .advantages__grid,
    .pharmacies__grid {
        grid-template-columns: 1fr;
    }

    .scheme__card {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer__top {
        flex-direction: column;
        gap: 20px;
    }
}