.best154-kp-overlay {
    --kp-overlay-color: #000000;
    --kp-overlay-opacity: 0.55;
    --kp-modal-bg: #ffffff;
    --kp-modal-width: 480px;
    --kp-modal-radius: 12px;
    --kp-modal-padding: 28px;
    --kp-title-color: #1a1a1a;
    --kp-title-size: 22px;
    --kp-text-color: #444444;
    --kp-text-size: 15px;
    --kp-btn-primary-bg: #2f6fed;
    --kp-btn-primary-color: #ffffff;
    --kp-btn-secondary-bg: #f0f0f0;
    --kp-btn-secondary-color: #333333;
    --kp-input-border: #cccccc;
    --kp-input-radius: 8px;
    --kp-accent: #2f6fed;

    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.best154-kp-overlay.best154-kp-visible {
    opacity: 1;
    visibility: visible;
}

.best154-kp-modal {
    position: relative;
    width: 100%;
    max-width: var(--kp-modal-width);
    padding: var(--kp-modal-padding);
    border-radius: var(--kp-modal-radius);
    background: var(--kp-modal-bg);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: var(--kp-text-color);
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.best154-kp-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--kp-btn-secondary-bg);
    color: var(--kp-btn-secondary-color);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.best154-kp-close:hover {
    filter: brightness(0.95);
}

.best154-kp-title {
    margin: 0 40px 16px 0;
    font-size: var(--kp-title-size);
    font-weight: 700;
    line-height: 1.3;
    color: var(--kp-title-color);
}

.best154-kp-content {
    margin-bottom: 16px;
}

.best154-kp-modal--top .best154-kp-content {
    display: block;
}

.best154-kp-modal--top .best154-kp-image {
    display: block;
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: calc(var(--kp-modal-radius) - 4px);
    margin-bottom: 12px;
}

.best154-kp-modal--left .best154-kp-content {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.best154-kp-modal--left .best154-kp-image {
    flex: 0 0 38%;
    max-width: 38%;
    border-radius: calc(var(--kp-modal-radius) - 4px);
    object-fit: cover;
}

.best154-kp-modal--left .best154-kp-text-wrap {
    flex: 1;
    min-width: 0;
}

.best154-kp-text {
    font-size: var(--kp-text-size);
    line-height: 1.55;
    color: var(--kp-text-color);
}

.best154-kp-text p {
    margin: 0 0 0.75em;
}

.best154-kp-text p:last-child {
    margin-bottom: 0;
}

.best154-kp-text img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.best154-kp-text a {
    color: var(--kp-accent);
}

.best154-kp-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid var(--kp-input-border);
    border-radius: var(--kp-input-radius);
    font-size: 16px;
}

.best154-kp-input:focus {
    outline: none;
    border-color: var(--kp-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--kp-accent) 20%, transparent);
}

.best154-kp-msg {
    margin: 12px 0 0;
    font-size: 14px;
}

.best154-kp-msg-error {
    color: #c62828;
}

.best154-kp-msg-success {
    color: #2e7d32;
}

.best154-kp-msg-warn {
    color: #e65100;
}

.best154-kp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.best154-kp-btn {
    flex: 1 1 auto;
    min-width: 120px;
    padding: 12px 16px;
    border: none;
    border-radius: var(--kp-input-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.best154-kp-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.best154-kp-btn-primary {
    background: var(--kp-btn-primary-bg);
    color: var(--kp-btn-primary-color);
}

.best154-kp-btn-primary:hover:not(:disabled) {
    filter: brightness(0.92);
}

.best154-kp-btn-secondary {
    background: var(--kp-btn-secondary-bg);
    color: var(--kp-btn-secondary-color);
}

.best154-kp-btn-secondary:hover {
    filter: brightness(0.95);
}

.best154-kp-overlay.best154-kp-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.best154-kp-fab {
    --kp-fab-bg: #2f6fed;
    --kp-fab-color: #ffffff;

    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.best154-kp-fab--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.best154-kp-fab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border: none;
    border-radius: 999px;
    background: var(--kp-fab-bg);
    color: var(--kp-fab-color);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

.best154-kp-fab-btn:hover {
    filter: brightness(0.94);
    transform: translateY(-1px);
}

.best154-kp-fab-icon {
    font-size: 18px;
    line-height: 1;
}

.best154-kp-fab-tip {
    max-width: 260px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #fff;
    color: #333;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

.best154-kp-fab--remind .best154-kp-fab-tip {
    opacity: 1;
    transform: translateY(0);
}

.best154-kp-fab--remind .best154-kp-fab-btn {
    animation: best154-kp-pulse 0.8s ease-in-out 3;
}

@keyframes best154-kp-pulse {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    }
    50% {
        transform: scale(1.06);
        box-shadow: 0 12px 32px rgba(47, 111, 237, 0.45);
    }
}

/* --- Общие элементы шаблонов --- */
.best154-kp-subtitle {
    margin: 0 0 14px;
    font-size: calc(var(--kp-text-size) - 1px);
    line-height: 1.45;
    color: var(--kp-text-color);
    opacity: 0.9;
}

.best154-kp-subtitle--light {
    color: #fff;
    opacity: 0.95;
}

.best154-kp-sheet {
    padding: var(--kp-modal-padding);
}

.best154-kp-field-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
    margin-top: 8px;
}

.best154-kp-field-row .best154-kp-input {
    flex: 1;
    margin: 0;
}

.best154-kp-btn-inline {
    flex: 0 0 auto;
    min-width: 110px;
    white-space: nowrap;
}

.best154-kp-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--kp-text-color);
    cursor: pointer;
}

.best154-kp-consent a {
    color: var(--kp-accent);
}

.best154-kp-actions--secondary {
    margin-top: 10px;
}

.best154-kp-title--light {
    color: #fff;
}

/* Newsletter */
.best154-kp-tpl-newsletter.best154-kp-modal {
    padding: 0;
    overflow: hidden;
}

.best154-kp-tpl-newsletter .best154-kp-hero {
    min-height: 210px;
    background: linear-gradient(120deg, var(--kp-header-bg), var(--kp-header-bg2));
    background-size: cover;
    background-position: center;
    position: relative;
}

.best154-kp-tpl-newsletter .best154-kp-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.15));
}

.best154-kp-tpl-newsletter .best154-kp-close {
    top: 14px;
    right: 14px;
    z-index: 3;
    background: rgba(255, 255, 255, 0.9);
}

/* Promo */
.best154-kp-tpl-promo.best154-kp-modal {
    padding: calc(var(--kp-modal-padding) + 8px);
    background: linear-gradient(145deg, var(--kp-header-bg2), var(--kp-header-bg));
    color: #fff;
    overflow: hidden;
    position: relative;
}

.best154-kp-tpl-promo .best154-kp-deco::before,
.best154-kp-tpl-promo .best154-kp-deco::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    opacity: 0.35;
}

.best154-kp-tpl-promo .best154-kp-deco::before {
    top: -20px;
    left: -10px;
    border-width: 0 70px 70px 0;
    border-color: transparent #ff6b6b transparent transparent;
}

.best154-kp-tpl-promo .best154-kp-deco::after {
    right: 20px;
    bottom: 40px;
    border-width: 55px 0 55px 90px;
    border-color: transparent transparent transparent #ffd166;
}

.best154-kp-tpl-promo .best154-kp-text {
    color: rgba(255, 255, 255, 0.95);
}

.best154-kp-tpl-promo .best154-kp-close {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    z-index: 2;
}

.best154-kp-tpl-promo .best154-kp-input {
    border: none;
}

.best154-kp-tpl-promo .best154-kp-consent {
    color: rgba(255, 255, 255, 0.9);
}

.best154-kp-tpl-promo .best154-kp-consent a {
    color: #fff;
}

/* Split */
.best154-kp-tpl-split.best154-kp-modal {
    padding: 0;
    overflow: hidden;
}

.best154-kp-tpl-split .best154-kp-split-head {
    display: flex;
    min-height: 180px;
    background: var(--kp-header-bg);
}

.best154-kp-tpl-split .best154-kp-split-photo {
    flex: 1.1;
    background: #ddd center/cover no-repeat;
    clip-path: polygon(0 0, 100% 0, 82% 100%, 0 100%);
}

.best154-kp-tpl-split .best154-kp-split-badge {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 20px 18px;
    background: #111;
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    line-height: 1.2;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.best154-kp-tpl-split .best154-kp-close {
    top: 10px;
    right: 10px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.9);
}

@media (max-width: 520px) {
    .best154-kp-field-row {
        flex-direction: column;
    }

    .best154-kp-btn-inline {
        width: 100%;
    }

    .best154-kp-tpl-split .best154-kp-split-head {
        flex-direction: column;
        min-height: auto;
    }

    .best154-kp-tpl-split .best154-kp-split-photo {
        min-height: 140px;
        clip-path: none;
    }
}
