/**
 * IF Cookie Consent — glassmorphism notice.
 *
 * Rendered in wp_footer:5 (includes/cookie-consent.php); .is-visible is added by the
 * inline script after the markup (first paint) and by assets/js/cookie-consent.js
 * when the visitor has not answered yet («Принять» / «Отклонить»).
 * Base look works out of the box; the Customizer emits ADDITIVE overrides.
 */

.if-cookie {
    position: fixed;
    z-index: 99998;
    box-sizing: border-box;
    width: calc(100% - 32px);
    max-width: 1320px; /* Elementor content width; overridable in the Customizer */
    padding: 26px 30px;
    border-radius: 24px;
    color: #fff;
    text-align: center;
    overflow: hidden; /* clip the specular sheen to the rounded card */
    isolation: isolate;
    /* Hidden by default; JS adds .is-visible when consent is not yet given. */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s ease;
}

/* Liquid glass: translucent tint + heavy backdrop blur/saturation, layered
   specular highlights (inset) and depth shadow. SKIPPED when custom glass classes
   (e.g. ElementsKit) are applied — `.if-cookie--glass-off` makes this rule not
   match, so those classes fully control the surface with no override war. */
.if-cookie:not(.if-cookie--glass-off) {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.02) 42%, rgba(255, 255, 255, 0.06)),
        rgba(18, 18, 22, 0.82); /* 0.45 was unreadable over busy product photos */
    -webkit-backdrop-filter: blur(22px) saturate(180%) brightness(1.06);
    backdrop-filter: blur(22px) saturate(180%) brightness(1.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.40),
        inset 0 1px 0 rgba(255, 255, 255, 0.30),
        inset 0 -1px 1px rgba(0, 0, 0, 0.25);
}

/* Specular sheen — soft light arcs that sell the "liquid glass" refraction. */
.if-cookie:not(.if-cookie--glass-off)::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(120% 80% at 15% -10%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 55%),
        radial-gradient(90% 60% at 100% 0%, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0) 50%);
    pointer-events: none;
    z-index: 0;
}

.if-cookie.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Positions (a small enter-offset is removed on .is-visible) */
.if-cookie--bottom-center {
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(14px);
}
.if-cookie--bottom-center.is-visible { transform: translateX(-50%) translateY(0); }

.if-cookie--bottom-left {
    left: 24px;
    bottom: 24px;
    transform: translateY(14px);
}
.if-cookie--bottom-left.is-visible { transform: translateY(0); }

.if-cookie--bottom-right {
    right: 24px;
    bottom: 24px;
    transform: translateY(14px);
}
.if-cookie--bottom-right.is-visible { transform: translateY(0); }

.if-cookie--center {
    left: 50%;
    top: 50%;
    transform: translate(-50%, calc(-50% + 14px));
}
.if-cookie--center.is-visible { transform: translate(-50%, -50%); }

.if-cookie__inner {
    position: relative; /* above the ::before sheen */
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0; /* spacing handled by per-element margins so each is Customizer-controllable */
}

.if-cookie__text {
    width: 100%;
}

.if-cookie__title {
    margin: 0;
    font-family: var(--if-font-heading, sans-serif);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 15px;
    line-height: 1.5;
    color: #fff;
}

.if-cookie__desc {
    margin: 8px auto 0; /* default title→desc gap; centre the max-width block */
    font-family: var(--if-font-heading, sans-serif);
    font-size: 11px;
    line-height: 1.7; /* ONDER renders tall — extra room so 2 lines don't crowd */
    color: rgba(255, 255, 255, 0.78);
    max-width: 46ch;
}

.if-cookie__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;        /* button → "Подробнее" */
    margin-top: 16px; /* description → button */
}

.if-cookie__accept {
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    font-family: var(--if-font-heading, sans-serif);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 13px;
    line-height: 1;
    color: #fff;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    border-radius: 9999px;
    padding: 13px 40px;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.if-cookie__accept:hover,
.if-cookie__accept:focus {
    background: #ffffff;
    color: #111111;
    border-color: #ffffff;
}

.if-cookie__more {
    font-family: var(--if-font-heading, sans-serif);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}
.if-cookie__more:hover,
.if-cookie__more:focus {
    color: #ffffff;
}

/* «Отклонить» и «Подробнее» — одна строка под кнопкой «Принять» (152-ФЗ, T6.4).
   «Отклонить» выглядит как ссылка «Подробнее»; её размер задаёт тот же ползунок
   Кастомайзера («Размер шрифта «Подробнее»»). Проверено на бою: 375 и 1440 px,
   строка 195×7 px, высота плашки не меняется. `.if-cookie` в селекторе — чтобы
   общие стили кнопок ([type=button]:hover — розовый фон) сюда не доставали. */
.if-cookie__secondary {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 8px 28px;
}

.if-cookie .if-cookie__decline {
    -webkit-appearance: none;
    appearance: none;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    cursor: pointer;
    font-family: var(--if-font-heading, sans-serif);
    font-size: 12px;
    font-weight: 400;
    line-height: inherit;
    text-transform: none;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}
.if-cookie .if-cookie__decline:hover,
.if-cookie .if-cookie__decline:focus {
    background: none;
    color: #ffffff;
    text-decoration: underline;
}

@media (max-width: 767px) {
    .if-cookie {
        width: calc(100% - 20px);
        padding: 22px 20px;
        border-radius: 20px;
    }
    .if-cookie--bottom-left,
    .if-cookie--bottom-right {
        left: 10px;
        right: 10px;
    }
    .if-cookie__accept {
        width: 100%;
    }

    /* Phones: a compact card at the bottom edge. The Customizer sizes (title 17px ONDER —
       it draws twice its size — gaps 35/60/30px, 210px offset) are for desktop; on a
       375px screen they covered half the page. Two classes beat the Customizer's
       one-class rules printed after this file. */
    .if-cookie.if-cookie--bottom-center,
    .if-cookie.if-cookie--bottom-left,
    .if-cookie.if-cookie--bottom-right {
        bottom: 10px;
    }
    .if-cookie.if-cookie {
        padding: 16px 16px 24px;
    }
    .if-cookie .if-cookie__title {
        font-size: 9px;
    }
    .if-cookie .if-cookie__desc {
        margin-top: 10px;
        font-size: 6px;
        line-height: 12px;
    }
    .if-cookie .if-cookie__actions {
        margin-top: 14px;
        gap: 10px;
    }
    .if-cookie .if-cookie__accept {
        padding: 12px 24px;
    }

    /* «Отклонить» и «Подробнее» — текст 7px по высоте, пальцем трудно попасть. Поле вокруг
       текста (сверху до кнопки «Принять», снизу до края плашки, по бокам — половина
       промежутка 28px) даёт зону ~40×110 px; отрицательный отступ того же размера оставляет
       строку на месте. Нижнее поле плашки 14 → 24px: зону ниже края срезал бы overflow. */
    .if-cookie .if-cookie__decline,
    .if-cookie .if-cookie__more {
        display: inline-block;
        padding: 10px 14px 23px;
        margin: -10px -14px -23px;
    }
}
