/* Кнопка-тригер */
#maw-trigger {
    position: fixed;
    bottom: 20px;
    left: 30px;
    
    /* (1) ВИПРАВЛЕНО: Задаємо бажаний загальний розмір віджета.
       Я поставив 70px. Можете легко змінити це значення (наприклад, на 80px). */
    width: 100px; 
    height: 100px;

    /* (2) ВИПРАВЛЕНО: Прибираємо відступ, який створював "білу обводку" */
    padding: 0; 
    
    /* (3) Залишаємо білий фон (на випадок, якщо іконка має прозорість) 
       і робимо контейнер круглим */
    background: #fff; 
    border-radius: 50%; 
    
    /* (4) ВАЖЛИВО: Ховаємо кути зображення, якщо воно квадратне */
    overflow: hidden; 

    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 9998;
    transition: transform 0.2s ease;

    animation: maw-slide-in 0.5s ease-out 0.5s backwards, 
               maw-pulse 2s ease-in-out 3s infinite;
}
#maw-trigger:hover {
    transform: scale(1.1);
}
#maw-trigger img {
    display: block;
    
    /* (5) ВИПРАВЛЕНО: Змушуємо зображення заповнити контейнер */
    width: 100%;
    height: 100%;
    
    /* (6) Додано: Гарантує, що зображення заповнить простір,
       зберігаючи пропорції і обрізаючи зайве (якщо потрібно). */
    object-fit: cover; 
}

/* Оверлей модального вікна */
.maw-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Зробив фон трішки світлішим */
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Вміст модального вікна */
.maw-modal-content {
    position: relative;
    background: #fff;
    padding: 20px;
    max-width: 90%;
    max-height: 90%;
    
    /* (1) --- ПРОПОЗИЦІЯ --- */
    border-radius: 12px; /* Додаємо округлення кутів */
    box-shadow: 0 10px 30px rgba(0,0,0,0.4); /* Робимо тінь глибшою */
    /* --- Кінець пропозиції --- */
    
    /* Це ми додали для анімації, нехай лишається */
    animation: maw-zoom-in 0.3s ease-out;
}

.maw-modal-close {
    position: absolute;
    /* Виносимо кнопку за межі білого блоку */
    top: -15px; 
    right: -15px; 
    
    /* Створюємо круглу кнопку */
    width: 36px;
    height: 36px;
    background: #fff;
    color: #555; /* Робимо колір 'х' м'якшим */
    border-radius: 50%;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    
    /* Центруємо 'х' всередині */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px; /* Трішки зменшимо 'х' */
    line-height: 1; /* Для точного центрування */
    font-weight: bold;
    text-decoration: none; /* Прибираємо підкреслення, якщо це 'a' */
    
    cursor: pointer;
    transition: all 0.2s ease;
}

.maw-modal-close:hover {
    background: #555;
    color: #fff;
    transform: scale(1.1); /* Ефект легкого збільшення */
}

/* Галерея */
.maw-gallery .maw-slide {
    display: none; /* Ховаємо всі слайди */
}
.maw-gallery .maw-slide.active {
    display: block; /* Показуємо активний */
}
.maw-gallery img {
    max-width: 100%;
    max-height: 80vh; /* Обмеження висоти зображення */
    display: block;
}

/* Кнопки "Вперед/Назад" */
.maw-prev, .maw-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    margin-top: -22px;
    padding: 16px;
    color: white;
    background-color: rgba(0,0,0,0.3);
    font-weight: bold;
    font-size: 18px;
    transition: 0.3s ease;
    user-select: none;
}
.maw-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}
.maw-prev {
    left: 0;
    border-radius: 0 3px 3px 0;
}
.maw-prev:hover, .maw-next:hover {
    background-color: rgba(0,0,0,0.8);
}


/* Анімація появи (виїзд знизу) */
@keyframes maw-slide-in {
    from {
        transform: translateY(100px); /* Початкова позиція (за екраном) */
        opacity: 0;
    }
    to {
        transform: translateY(0); /* Кінцева позиція */
        opacity: 1;
    }
}



/* Анімація пульсації */
@keyframes maw-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    }
    50% {
        transform: scale(1.05); /* Збільшуємо */
        box-shadow: 0 6px 15px rgba(0,0,0,0.3); /* Тінь теж */
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    }
}