/* EGO LAB — блоки согласий и cookie-баннер */

.ego-consents {
    margin: 4px 0 14px;
    padding: 0;
    border: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.ego-consent {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.45;
    color: #555;
    font-weight: 400;
}

.ego-consent__input {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 1px 0 0;
    cursor: pointer;
    accent-color: #1a1a1a;
}

.ego-consent__input:focus-visible {
    outline: 2px solid #1a1a1a;
    outline-offset: 2px;
}

.ego-consent__text a {
    color: #1a1a1a;
    text-decoration: underline;
}

.ego-consent__optional {
    color: #999;
    font-size: 12px;
}

.ego-consent--required .ego-consent__text::after {
    content: " *";
    color: #b32d2e;
}

.ego-consents.ego-consents--error .ego-consent--required {
    color: #b32d2e;
}

.ego-consents.ego-consents--error .ego-consent--required .ego-consent__input {
    outline: 1px solid #b32d2e;
    outline-offset: 2px;
}

.ego-consent-error {
    display: none;
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.4;
    color: #b32d2e;
}

.ego-consent-error.is-visible {
    display: block;
}

/* cert-modal: не даём общему правилу #cert-form input растянуть чекбоксы */
#cert-form .ego-consents input[type="checkbox"] {
    display: inline-block;
    width: 16px;
    height: 16px;
    padding: 0;
    margin: 1px 0 0;
    border: 1px solid #c9c9c9;
    border-radius: 3px;
    vertical-align: top;
}

#cert-form .ego-consents {
    margin-top: -2px;
}

#cert-form .ego-consent {
    display: flex;
}

/* WooCommerce checkout */
.woocommerce-checkout .ego-consents {
    margin: 18px 0 6px;
    max-width: 640px;
}

.woocommerce-checkout .ego-consent {
    font-size: 14px;
}

/* CF7 */
.wpcf7 .ego-consents {
    margin: 12px 0;
}

.wpcf7 .ego-consent {
    font-size: 14px;
    color: #444;
}

.wpcf7 .ego-consent .wpcf7-list-item-label {
    display: inline;
}

.wpcf7 .ego-consent input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 1px 0 0;
    accent-color: #1a1a1a;
}

/* Вставленный в Tilda-формы блок (разметка повторяет .ego-consents) */
.t-form .ego-consents {
    margin: 12px 0 16px;
}

.t-form .ego-consent {
    font-size: 13px;
    color: #000;
}

/* Гейт для формы Bitrix24 — перекрывает iframe-форму до согласия */
.ego-b24-gate {
    position: relative;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 20px;
    background: #fafafa;
}

.ego-b24-gate__title {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

.ego-b24-gate__hint {
    margin: 0 0 12px;
    font-size: 13px;
    color: #666;
}

/* Cookie-баннер */
.ego-cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 2147482000;
    max-width: 760px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.14);
    font-family: -apple-system, 'Helvetica Neue', 'Segoe UI', Arial, sans-serif;
}

.ego-cookie-banner__inner {
    padding: 12px 14px;
}

.ego-cookie-banner__text {
    margin: 0 0 10px;
    font-size: 12.5px;
    line-height: 1.4;
    color: #444;
}

.ego-cookie-banner__text a {
    color: #1a1a1a;
    text-decoration: underline;
}

/* ID-префикс: специфичность выше темы (button[type=button] задаёт
   padding 10px 52px, letter-spacing 2.4px, margin 10px 0 0). */
#ego-cookie-banner .ego-cookie-banner__actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

#ego-cookie-banner .ego-cookie-banner__btn {
    margin: 0;
    min-width: 0;
    width: auto;
    max-width: 100%;
    height: auto;
    min-height: 0;
    padding: 7px 8px;
    background: #fff;
    color: #1a1a1a;
    border: 1px solid #c9c9c9;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-family: inherit;
    white-space: normal;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.ego-cookie-banner__btn:hover {
    background: #f2f2f2;
}

.ego-cookie-banner__btn--primary {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.ego-cookie-banner__btn--primary:hover {
    background: #333;
}

.ego-cookie-banner__btn--ghost {
    border-color: transparent;
    background: transparent;
    text-decoration: underline;
}

.ego-cookie-banner__btn:focus-visible {
    outline: 2px solid #1a1a1a;
    outline-offset: 2px;
}

/* Панель настроек категорий */
.ego-cookie-banner__settings {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ego-cookie-cat {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 13px;
    line-height: 1.45;
    color: #444;
    cursor: pointer;
}

.ego-cookie-cat input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 1px 0 0;
    accent-color: #1a1a1a;
    cursor: pointer;
}

.ego-cookie-cat input[type="checkbox"]:focus-visible {
    outline: 2px solid #1a1a1a;
    outline-offset: 2px;
}

.ego-cookie-cat--locked {
    color: #777;
    cursor: default;
}

.ego-cookie-cat--locked input {
    cursor: not-allowed;
}

.ego-cookie-cat__name em {
    font-style: normal;
    color: #999;
    font-size: 12px;
}

#ego-cookie-banner .ego-cookie-banner__settings-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 4px;
}

/* Сайт задаёт display на button — атрибут hidden должен побеждать. */
.ego-cookie-banner[hidden],
.ego-cookie-banner__settings[hidden] {
    display: none !important;
}

@media (max-width: 640px) {
    .ego-cookie-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    .ego-cookie-banner__inner {
        padding: 12px;
    }

    #ego-cookie-banner .ego-cookie-banner__actions,
    #ego-cookie-banner .ego-cookie-banner__settings-actions {
        grid-template-columns: 1fr;
    }

    #ego-cookie-banner .ego-cookie-banner__btn {
        width: 100%;
        padding: 9px;
    }

    .ego-consent {
        font-size: 13px;
    }

    /* Чекбокс чуть крупнее для удобного тапа */
    .ego-consent__input {
        width: 18px;
        height: 18px;
    }
}
