.subscribe-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    /* Центрирование через flexbox */
    display: none;
    align-items: center;
    justify-content: center;
}

.subscribe-modal.active,
.subscribe-modal.show {
    display: flex !important;
}

.subscribe-modal-content {
    background: #fff;
    position: relative;
    width: 100%;
    min-width: 200px;
    max-width: 780px;
    border-radius: 0px;
    border-style: none;
    border-width: 2px;
    border-color: rgb(233, 234, 234);
    background-color: rgb(255, 255, 255);
    background-repeat: no-repeat;
    background-position-y: 50%;
    padding: 0px;
    flex: 1 1 0%;
    margin: 0;
    max-height: 90vh;
}

.subscribe-form-group-checkbox {
    margin-top: 10px;
    gap: 8px;
    display: inline-flex; 
    align-items: flex-start;
    margin-bottom: 10px;
}

.subscribe-form-group-checkbox a {
    text-decoration: underline;
}

.subscribe-form-group-checkbox input {
    width: auto;
}

.subscribe-close {
    position: absolute;
    right: 15px;
    top: 10px;
    cursor: pointer;
    font-size: 22px;
    z-index: 10001;
}

.subscribe-modal-container {
    display: flex;
    justify-content: center;
    height: 100%;
}

.subscribe-modal-image {
    flex: 0 1 50%;
    min-height: 510px;
}

.subscribe-modal-form {
    flex: 0 1 50%;
    position: relative;
}

.subscribe-form-group {
    margin-bottom: 0px;
}

.subscribe-modal-form form {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0px;
    padding: 20px;
    min-height: 510px;
    justify-content: center;
}

.subscribe-modal-image img {
    height: 100%;
    max-width: 100%;
    object-fit: cover; /* Для корректного отображения изображения */
}

span.subscribe-form-title {
    font-size: 24px;
    font-weight: bold;
    font-style: normal;
    text-align: center;
    margin-bottom: 20px;
}

span.subscribe-form-text {
    font-size: 16px;
    text-align: center;
    margin-bottom: 20px;
}

input.email-input {
    box-sizing: border-box;
    border-radius: 0px;
    padding: 0px 0px 0px 16px;
    height: 40px;
    text-align: left;
    color: rgb(89, 89, 89);
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0px;
    background-color: rgb(255, 255, 255);
    border: 1px solid rgb(89, 89, 89);
    width: 100%;
}

.subscribe-form-policy {
    font-size: 12px;
    margin-bottom: 20px;
    margin-top: 5px;
}

.subscribe-submit {
    width: 100%;
    padding: 15px;
    background: var(--color-black);
    color: var(--color-white);
    border: none;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.subscribe-submit:hover {
    opacity: 0.9;
}

.input-error {
    border: 1px solid red !important;
}

.email-error {
    color: red;
    font-size: 13px;
    margin-top: 5px;
}

/* Убираем дублирующий display: none */
.subscribe-modal {
    display: none;
}

/* Адаптив для модального окна подписки */
@media screen and (max-width: 820px) {
    .subscribe-modal-content {
        width: 90%;
        max-width: 600px;
        max-height: 85vh;
    }
    
    .subscribe-modal-container {
        flex-direction: column;
    }
    
    .subscribe-modal-image {
        flex: 0 1 auto;
        min-height: auto;
        max-height: 250px;
        overflow: hidden;
    }
    
    .subscribe-modal-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .subscribe-modal-form {
        flex: 0 1 auto;
    }
    
    .subscribe-modal-form form {
        min-height: auto;
        padding: 30px 25px;
    }
}

@media screen and (max-width: 600px) {
    .subscribe-modal-content {
        width: 95%;
        max-height: 80vh;
    }
    
     .subscribe-modal-image {
        max-height: 270px;
    }
    .subscribe-modal-form form {
        padding: 25px 20px;
    }
    
    span.subscribe-form-title {
        font-size: 22px;
        margin-bottom: 15px;
    }
    
    span.subscribe-form-text {
        font-size: 15px;
        margin-bottom: 20px;
    }
    
    .subscribe-submit {
        padding: 12px;
        font-size: 15px;
    }
}

@media screen and (max-width: 480px) {
    .subscribe-modal-content {
        width: 92%;
        max-height: 90vh;
        overflow-y: auto;
        max-width: 330px;
    }
    
   .subscribe-modal-image {
        max-height: 270px;
    }
    
    .subscribe-modal-form form {
        padding: 20px 18px;
    }
    
    span.subscribe-form-title {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    span.subscribe-form-text {
        font-size: 14px;
        margin-bottom: 18px;
    }
    
    input.email-input {
        height: 44px;
        font-size: 15px;
        padding: 0 0 0 14px;
    }
    
    .subscribe-form-policy {
        font-size: 11px;
        margin-bottom: 16px;
        margin-top: 5px;
        line-height: 1.4;
    }
    
    .subscribe-submit {
        padding: 12px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .subscribe-close {
        right: 12px;
        top: 8px;
        z-index: 10000;
    }
    
    .subscribe-close svg {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        padding: 2px;
    }
}

@media screen and (max-width: 360px) {
    .subscribe-modal-content {
        width: 94%;
    }
    
    .subscribe-modal-image {
        max-height: 140px;
    }
    
    .subscribe-modal-form form {
        padding: 18px 15px;
    }
    
    span.subscribe-form-title {
        font-size: 18px;
    }
    
    span.subscribe-form-text {
        font-size: 13px;
    }
    
    input.email-input {
        height: 42px;
        font-size: 14px;
    }
}

@media screen and (max-width: 320px) {
    .subscribe-modal-image {
        display: none;
    }
    
    .subscribe-modal-content {
        width: 96%;
    }
    
    .subscribe-modal-form form {
        padding: 18px 12px;
    }
}

/* Альбомная ориентация на мобильных */
@media screen and (max-width: 900px) and (orientation: landscape) {
    .subscribe-modal-content {
        width: 85%;
        max-width: 800px;
        max-height: 85vh;
    }
    
    .subscribe-modal-container {
        flex-direction: row;
    }
    
    .subscribe-modal-image {
        flex: 0 1 40%;
        max-height: 350px;
    }
    
    .subscribe-modal-form {
        flex: 0 1 60%;
    }
    
    .subscribe-modal-form form {
        min-height: 350px;
        padding: 20px;
    }
}

/* Темная тема для модалки */
@media (prefers-color-scheme: dark) {
    .subscribe-modal-content {
        background-color: rgb(255, 255, 255);
    }
}

/* Анимация появления */
.subscribe-modal {
    animation: fadeIn 0.3s ease;
}

.subscribe-modal-content {
    animation: slideUp 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Улучшение доступности для touch-устройств */
@media (hover: none) and (pointer: coarse) {
    .subscribe-submit {
        padding: 15px;
        min-height: 48px;
    }
    
    .subscribe-close {
        padding: 8px;
        right: 8px;
        top: 5px;
    }
    
    .subscribe-close svg {
        width: 32px;
        height: 32px;
    }
    
    input.email-input {
        font-size: 16px;
        padding: 0 0 0 16px;
    }
    
    .footer-button,
    .subscribe-submit {
        min-height: 48px;
    }
}

/* Для экранов с очень маленькой высотой */
@media screen and (max-height: 600px) {
    .subscribe-modal-content {
        max-height: 95vh;
    }
    
    .subscribe-modal-image {
        max-height: 150px;
    }
    
    .subscribe-modal-form form {
        min-height: auto;
        padding: 15px;
    }
    
    span.subscribe-form-title {
        margin-bottom: 10px;
        font-size: 20px;
    }
    
    span.subscribe-form-text {
        margin-bottom: 12px;
        font-size: 14px;
    }
}

/* Дополнительные улучшения */
.subscribe-close {
    transition: transform 0.2s ease;
}

.subscribe-close:hover {
    transform: scale(1.1);
}

.subscribe-close:active {
    transform: scale(0.95);
}

/* Стили для успешной подписки */
.form-success {
    padding: 30px;
    text-align: center;
    font-size: 18px;
    color: #28a745;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Стили для ошибок */
.form-error {
    padding: 15px 30px;
    color: red;
    font-size: 14px;
    text-align: center;
    /* position: absolute; */
    /* top: 20px;
    width: 100%; */
}

.subscribe-form-group-checkbox input[type="checkbox"],
.checkbox-group #consentAgreement {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: black;
}