/* Modal Styles */
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000 !important; /* Đảm bảo luôn có màu đen */
    opacity: 1 !important; /* Đảm bảo luôn hiển thị rõ */
}

/* Đảm bảo icon bên trong cũng có màu đen */
.modal-close i {
    color: #000 !important;
}

.modal-close:hover {
    color: #000 !important; /* Giữ màu đen khi hover */
    opacity: 0.8 !important; /* Chỉ giảm độ trong suốt khi hover */
}

/* Ẩn menu chính khi modal mở */
body.modal-open .header {
    display: none;
}

/* Đảm bảo modal hiển thị đúng */
.modal {
    z-index: 1000;
}

/* Điều chỉnh cho mobile */
@media (max-width: 768px) {
    .modal-close {
        top: 0.5rem;
        right: 0.5rem;
        font-size: 1.25rem;
    }

    /* Ngăn chặn sự kiện touch trên các nút chuyển ảnh */
    .image-nav {
        pointer-events: auto !important;
        z-index: 1002;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0, 0, 0, 0.5);
        color: white;
        border: none;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .image-nav.prev {
        left: 10px;
    }

    .image-nav.next {
        right: 10px;
    }

    /* Đảm bảo các nút không bị ảnh hưởng bởi sự kiện touch của parent */
    .image-nav * {
        pointer-events: none;
    }

    /* Ngăn chặn sự kiện touch trên vùng ảnh chính */
    .main-image {
        position: relative;
    }

    .main-image::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1001;
        pointer-events: none;
    }

    /* Cho phép tương tác với các nút điều hướng */
    .image-nav {
        pointer-events: auto !important;
    }
}
