/* --- Футер всегда внизу для шаблона акций --- */
body.page-template-page-promotions #page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.page-template-page-promotions #content {
    flex: 1 0 auto;
}

body.page-template-page-promotions footer.site-footer {
    flex-shrink: 0;
}

#promo-modal-description ul {
    list-style: disc;
    padding: 8px 0 8px 20px;
}

/* Не задаём внешние отступы, как на других страницах */
/* Заголовок оставляем по умолчанию темы */
.promotions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.promotion-card {
    background: #f8f9fa;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    width: calc(33.333% - 32px); /* три в ряд, учёт gap */
    cursor: pointer;
    gap: 20px;
}

.promotion-card img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    object-fit: cover;
}

.promo-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.promo-content h3 {
    font-size: 20px;
    font-weight: 500;
    margin: 0;
    color: #2c3e50;
}

.promo-content p {
    font-size: 16px;
    color: #7f8c8d;
    margin: 0;
    line-height: 1.5;
}

#promo-code-description {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 300;
    line-height: 1.2;
}

#promotion-modal .modal-content {
    max-height: 80vh;
    overflow-y: auto;
}

#promotion-modal .modal-body {
    flex-direction: column;
    gap: 20px;
    padding: 40px;
}

#promotion-modal .modal-image {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    height: max-content;
}

#promotion-modal .modal-info {
    width: 100%;
    overflow-y: auto;
}   

#promotion-modal .modal-scrollable-content,
#promo-code-modal .modal-scrollable-content {
    padding: 0;
    overflow-y: hidden;
}

#promo-modal-description {
    font-weight: 300;
    line-height: 1.3;
}

#promo-modal-description hr {
    opacity: 0.2;
    margin-top: 40px;
}

#promo-modal-description strong {
    font-weight: 300;
    font-size: 12px;
    opacity: 0.5;
}

/* === PROMO CODE MODAL (зеркало стиля акций) === */
#promo-code-modal .modal-content {
    max-height: 80vh;
    overflow-y: auto;
}

#promo-code-modal .modal-body {
    flex-direction: column;
    gap: 20px;
    padding: 40px;
}

#promo-code-modal .modal-image {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    height: max-content;
}

#promo-code-modal .modal-image img{
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#promo-code-modal .modal-info {
    display: flex;
    gap: 20px;
    flex-wrap:wrap;
    width:100%;
    flex-direction: row;
}

/* Внутренние колонки */
#promo-code-modal .promo-code-content {
    flex: 1 1 0%; /* занимает всё доступное пространство */
    min-width: 0; /* предотвращает переполнение */
}
#promo-code-modal .promo-code-sidebar {
    flex: 0 0 34%; /* фиксированная доля ширины */
    max-width: 380px; /* ограничиваем абсолютную ширину */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 20px 20px;
    box-sizing: border-box;
    overflow: hidden;
}

.promo-code-sidebar .promo-code-badge {
    box-shadow: 0 0px 0px rgba(0, 0, 0, 0.00);
    background:  none;
}

.promo-label {
    color: #000000;
    font-size: 14px;
    font-weight: 300;
    opacity: 0.8;
}

.promo-code-text {
    color: #ff6b35;
}

/* Бейдж и кнопка */
.promo-code-badge {
    background: linear-gradient(135deg, #ff6b35 0%, #ffa066 100%);
    color: #fff;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    display:flex;
    flex-direction:column;
    gap:8px;
    width:100%;
}
.promo-label{font-size:14px;opacity:0.9;}
.promo-code-text{font-size:32px;font-weight:700;word-break:break-all;letter-spacing:1px;}

.copy-btn {
    background: #ff6b35;
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 24px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background .3s, transform .2s;
    width: 100%;
}
.copy-btn:hover { background: #d95b2f; transform: translateY(-2px); }
.copy-feedback {
    font-size: 14px;
    color: #2e7d32;
    display: none;
    font-weight: 500;
}

.promo-code-validity{
    font-size:14px;
    color:#555;
    text-align:center;
}

.promo-code-badge {
    background:#ff6b35;
    color:#fff;
    font-size:24px;
    font-weight:700;
    border-radius:16px;
}

.copy-btn {
    background:#ff6b35;
    color:#fff;
    border:none;
    padding:10px 24px;
    border-radius:24px;
    cursor:pointer;
    font-size:15px;
    transition:background .3s;
}

.copy-btn:hover {
    background:#d95b2f;
}

.copy-feedback {
    font-size:14px;
    color:#2e7d32;
    display:none;
}

/* Адаптивность */
@media (max-width: 1367px) {
    #promotion-modal .modal-body {
        padding: 20px;
    }

    #promo-code-modal .close, #promotion-modal .close {
        color: #000000;
        background: #fff;
    }

    #promotion-modal .modal-info {
        overflow-y: auto;
        height: 100%;
    }

    #promotion-modal .modal-scrollable-content, #promo-code-modal .modal-scrollable-content {
        padding: 0;
        overflow-y: visible;
    }
}

@media (max-width: 992px) {
    .promotion-card {
        width: calc(50% - 20px);
    }
}

@media (max-width: 768px) {
    .promotion-card {
        width: 100%;
    }

    .modal-image img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }
}

@media (max-width: 600px) {
    #promo-code-modal .modal-info {
        display: flex;
        flex-direction: column;
    }
    #promo-code-modal .promo-code-sidebar {
        width: 100%;
    }
} 

@media (max-width: 480px) {
    .promotion-card {
        gap: 8px;
    }

    .promo-content h3 {
        font-size: 18px;
    }

    .promo-content p {
        font-size: 14px;
    }

    .promo-content {
        gap: 2px;
        padding: 0px 4px;
    }

    .promotions-grid {
        gap: 24px;
    }

    #promo-code-modal .modal-content,
    #promotion-modal .modal-content {
        max-height: 90%;
        max-width: 94%;
        border-radius: 20px;
        height: max-content;
        padding: 0px;
        width: 94%;
        margin: 0 4%;
    }

    #promo-code-modal .modal-body,
    #promotion-modal .modal-body {
        padding: 0px;
    }

    #promo-code-modal .close,
    #promotion-modal .close {
        top: 4px;
        right: 4px;
    }

    #promo-code-modal .modal-image,
    #promotion-modal .modal-image {
        border-radius: 0px;
        padding-top: 0px;
        height: max-content;
        max-height: max-content;
    }

    #promo-code-modal .modal-info,
    #promotion-modal .modal-info {
        padding: 0px 20px 20px 20px;
        box-sizing: border-box;
        gap: 8px;
        display: flex;
        flex-direction: column;
    }

    #promo-code-modal .promo-code-content {
        width: 100%;
        gap: 8px;
        display: flex;
        flex-direction: column;
    }

    #promo-code-modal .promo-code-sidebar {
        width: 100%;
    }

    .modal-header h2 {
        font-size: 20px;
    }

    .copy-btn {
        width: max-content;
    }

    .promo-code-text {
        font-size: 24px;
    }

    #promo-code-modal .close,
    #promotion-modal .close {
        color: #000000;
        background: #fff;
    }
}