header {
    position: relative;
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    padding: 0;
}

.banner {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Якщо немає фонового зображення, буде сірий */
.banner:not([style*='background-image']) {
    background-color: #e5e4e4;
}


.banner-preview {
    width: 100%;      /* контейнер під прев’ю на ширину батьківського блоку */
    max-width: 100%;
    text-align: center;  /* щоб текст "Банер відсутній" був по центру */
    min-height: 80px;    /* щоб блок мав висоту навіть без зображення */
}

.banner-preview img {
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: 5px;
    display: block;
    margin-top: 10px;
}

.logo {
    position: absolute;
    top: 125px;
    left: 50%;
    transform: translate(-50%, 0);
    z-index: 2;
    width: 160px;
    height: 160px;
    overflow: hidden;
    border-radius: 50%;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 480px) {
    .banner, .default-banner {
        height: 150px;
    }

    .logo {
        width: 125px;    /* Зменшуємо контейнер */
        height: 125px;   /* Розмір контейнера = розміру картинки */
        top: 85px;       /* Центруємо відносно меншого банера */
    }

    .logo img {
        width: 100%;     /* Видаляємо max-width — він ломав пропорції */
        height: 100%;
    }

    h1 {
        font-size: 18px;
    }

    p {
        font-size: 12px;
    }
}

.banner-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Загальні стилі – як були */
.banner-modal-content {
    background: white;
    padding: 25px;
    border-radius: 12px;
    max-width: 700px;
    width: 90%;
    position: relative;

    max-height: 90vh;
    overflow-y: auto;
}

/* Зменшена модалка ТІЛЬКИ на десктопі */
@media (min-width: 1024px) {
    .banner-modal-content {
        max-width: 500px;   /* було 700px — стало компактніше */
        padding: 20px;      /* легка компактність */
    }
}

.banner-modal-title {
    text-align: center;
    margin-bottom: 20px;
}

.popup-close {
    position: absolute;
    right: 15px;
    top: 15px;
    cursor: pointer;
    font-size: 22px;
    color: #666;
}

.banner-cropper-container img {
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

/* Контейнер кнопок */
.banner-modal-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Кнопки */
.banner-action-btn {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Стилі для різних кнопок */
.banner-action-btn.cancel {
    background: #007bff;;
    color: #ffffff;
}

.banner-action-btn.confirm {
    background: #007bff;;
    color: white;
}

.banner-action-btn:hover {
    background: #005fcc;
}





/* Модалка логотипу */
.logo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Контент модалки логотипу */
.logo-modal-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    max-width: 400px;  /* компактніше, ніж банер */
    width: 90%;
    position: relative;
    text-align: center;

    max-height: 90vh;
    overflow-y: auto;
}

/* Заголовок */
.logo-modal-title {
    text-align: center;
    margin-bottom: 15px;
}

/* Верхній хрестик */
.logo-popup-close {
    position: absolute;
    right: 15px;
    top: 15px;
    cursor: pointer;
    font-size: 22px;
    color: #666;
}

/* Кнопки під кропером */
.logo-modal-actions {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Кнопки логотипу */
.logo-action-btn {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-action-btn.cancel {
    background: #007bff;;
    color: #ffffff;
}

.logo-action-btn.confirm {
    background: #007bff;;
    color: #ffffff;
}

.logo-action-btn:hover {
    background: #005fcc;
}

/* Кропер-імедж лого */
.logo-cropper-container img {
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

/* Контейнер логотипного кропера — обрізає ВСЕ, що малює Cropper */
.logo-cropper-container {
    position: relative !important;
    width: 300px;     /* або 100%, якщо хочеш */
    height: 300px;    /* квадрат під круглe вирізання */
    margin: 0 auto;
    overflow: hidden !important;
    border-radius: 0 !important; /* контейнер сам не круглий */
}

/* Обмеження для фону Cropper.js */
.logo-cropper-container .cropper-bg,
.logo-cropper-container .cropper-wrap-box,
.logo-cropper-container .cropper-canvas {
    overflow: hidden !important;
}

/* Робимо зону виділення круглою */
.logo-cropper-container .cropper-view-box {
    border-radius: 50% !important;
    overflow: hidden;
}

/* Робимо затемнення тільки навколо view-box, але ВСЕРЕДИНІ контейнера */
.logo-cropper-container .cropper-modal {
    background-color: rgba(0, 0, 0, 0.89) !important;
}