/* custom.css — поверх main: фон секции [data-section-bg] */

/* Одна высота вьюпорта, без прокрутки страницы (в т.ч. из-за canvas / transform фона) */
html {
    width: 100%;
    height: 100%;
    max-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-text-size-adjust: 100%;
}

body.body {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    box-sizing: border-box;
    -webkit-tap-highlight-color: rgba(255, 236, 170, 0.22);
}

/* Лёгкое «дыхание» без scale — масштаб размывал фон-картинку */
@keyframes sectionBgDrift {
    0%,
    100% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(0, -3px, 0);
    }
}

[data-section-bg] {
    pointer-events: none;
    overflow: hidden;
    transform-origin: center top;
    background-color: #0f0e0d;
    /* Градиент виден сразу; поверх подтянется bg.jpg, если положить файл в images/hero/ */
    background-image: linear-gradient(
            180deg,
            rgba(15, 14, 13, 0.2) 0%,
            rgba(15, 14, 13, 0) 100%
        ),
        radial-gradient(
            ellipse 100% 65% at 50% -15%,
            rgba(232, 209, 166, 0.18) 0%,
            transparent 55%
        ),
        url("../images/1ecd34542230aea4f4d37125d369bcda.jpeg");
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    min-height: 100vh;
    min-height: 100dvh;
    height: auto !important;
    animation: sectionBgDrift 8s infinite ease-in-out;
}

/* Летающие частицы: не расширяем layout (без 100vw, растр = client размеры в JS) */
canvas#nano-particles {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    display: block;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 4;
    overflow: hidden;
    contain: strict;
}

/* Логотип в шапке: шире контейнер (было max-width 8.75rem в main.css) */
.navigation__logobox {
    max-width: clamp(15.5rem, 38vw, 23rem);
}

/* Счётчик кофе — крупнее, чтобы читались подпись и цифры */
.coffee-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin-left: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    cursor: default;
    user-select: none;
    font-weight: 600;
    font-size: clamp(0.9375rem, 0.85rem + 0.45vw, 1.1875rem);
    color: rgba(255, 255, 255, 0.95);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    white-space: nowrap;
    line-height: 1.2;
}

.coffee-pill .coffee-icon {
    font-size: clamp(1.35rem, 1.15rem + 0.75vw, 1.65rem);
    line-height: 1;
}

.coffee-pill .coffee-count {
    font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #fef3c7;
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.6);
    transition: transform 0.3s ease;
}

/* У секции футера в main.css pointer-events: none — без auto соцссылки не кликаются */
[data-section="footer"] .footer__left,
[data-section="footer"] .footer__social,
[data-section="footer"] .footer__social-link {
    pointer-events: auto;
}

/* Футер: соцсети слева, горизонтальная линия тянется до копирайта, текст справа */
.footer .footer__content {
    flex-direction: row !important;
    justify-content: flex-start !important;
    align-items: center !important;
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
    gap: 0.75rem 0;
}

.footer__left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Горизонтальная линия на всю дистанцию между иконками и блоком копирайта */
.footer__stretch-rule {
    flex: 1 1 auto;
    align-self: center;
    min-width: 1.25rem;
    height: 0.125rem;
    margin: 0 1rem;
    pointer-events: none;
    border-radius: 0.0625rem;
    background: linear-gradient(
        90deg,
        rgba(107, 81, 43, 0.2) 0%,
        #6b512b 8%,
        #c9a227 45%,
        #ffecaa 50%,
        #c9a227 55%,
        #6b512b 92%,
        rgba(107, 81, 43, 0.2) 100%
    );
}

.footer .footer__info {
    margin-left: 0;
    flex-shrink: 0;
    text-align: right;
    align-items: flex-end !important;
    max-width: none;
    width: auto;
}

@media (max-width: 30rem) {
    .footer .footer__content {
        gap: 0.5rem 0;
    }

    .footer__stretch-rule {
        flex: 1 1 100%;
        order: 2;
        width: 100%;
        min-width: 0;
        margin: 0.25rem 0 0.15rem;
    }

    .footer__left {
        order: 1;
    }

    .footer .footer__info {
        order: 3;
        flex: 1 1 100%;
        text-align: left;
        align-items: flex-start !important;
    }
}

/* Соцсети в футере (из indexold.html) */
.footer__social {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0;
}

.footer__social-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 2.25rem;
    height: 2.25rem;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 0.25rem;
    text-decoration: none;
    color: #fff;
    transition: background-color 0.25s ease, transform 0.2s ease;
    filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.5));
}

.footer__social-link:hover {
    background: rgba(255, 255, 255, 0.28);
}

.footer__social-link:focus-visible {
    outline: 2px solid #ffecaa;
    outline-offset: 2px;
}

.footer__social-link svg {
    width: 1.125rem;
    height: 1.125rem;
    fill: currentColor;
}

/* ------------------------------------------------------------------------- */
/* Мобильная вёрстка: брейкпоинт как у бургера в main.css (max-width:1199.99px) */
/* ------------------------------------------------------------------------- */

[data-section="navigation"] {
    padding-left: max(0.25rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.25rem, env(safe-area-inset-right, 0px));
    padding-top: max(1rem, env(safe-area-inset-top, 0px));
}

[data-section="footer"] {
    padding-bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px)) !important;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

.navigation__box_side_left {
    min-width: 0;
}

/* Планшет и телефон: одна строка шапки, кофе скрыт, футер прижат к низу экрана */
@media (max-width: 1199.98px) {
    html,
    body.body {
        overflow-x: hidden;
    }

    [data-section="footer"] {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: -50px !important;
        top: auto !important;
        width: 100%;
        max-width: 100%;
        z-index: 30;
        box-sizing: border-box;
    }

    [data-container="navigation"] .container {
        padding-left: max(0.65rem, env(safe-area-inset-left, 0px)) !important;
        padding-right: max(0.65rem, env(safe-area-inset-right, 0px)) !important;
    }

    .navigation {
        flex-wrap: nowrap;
        align-items: center;
        height: 4.375rem;
        height: var(--navigation-height, 4.375rem);
        padding-bottom: 0;
    }

    .navigation__box_side_left {
        flex: 1 1 auto;
        min-width: 0;
    }

    .navigation__logobox {
        max-width: clamp(8.25rem, 52vw, 15.5rem);
    }

    .navigation__gw-burger {
        margin-left: auto;
        flex-shrink: 0;
    }

    .navigation__box_side_right {
        display: none !important;
    }

    /* Футер: колонка по центру — не жмётся в одну линию с иконками */
    .footer .footer__content {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.65rem 0;
    }

    .footer__left {
        justify-content: center;
        width: 100%;
    }

    .footer__stretch-rule {
        flex: 0 0 auto;
        width: min(20rem, 90vw);
        min-width: 0;
        margin: 0.25rem auto;
    }

    .footer .footer__info {
        align-items: center !important;
        text-align: center !important;
        width: 100%;
        max-width: 22rem;
        margin-left: auto;
        margin-right: auto;
    }

    .footer .footer__links {
        justify-content: center;
    }

    .footer__copyright {
        font-size: clamp(0.72rem, 3.2vw, 0.8125rem);
        line-height: 1.4;
        word-break: break-word;
    }

    .footer .footer__link {
        font-size: 0.6875rem;
        line-height: 1.45;
        min-height: 2.75rem;
        display: inline-flex;
        align-items: center;
        padding: 0.35rem 0.65rem;
    }

    .footer__social {
        gap: 0.75rem;
        justify-content: center;
    }

    .footer__social-link {
        width: 3rem;
        height: 3rem;
        border-radius: 0.4rem;
    }

    .footer__social-link svg {
        width: 1.35rem;
        height: 1.35rem;
    }

    [data-container="footer"] .footer {
        padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
    }
}

@media (max-width: 28rem) {
    .navigation__logobox {
        max-width: clamp(7rem, 58vw, 12.5rem);
    }
}

@media (max-width: 22.5rem) {
    html,
    body.body {
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    [data-section-bg] {
        animation: none;
    }
}
