.wpgdg-gallery-wrapper {
    font-family: inherit;
    margin: 20px 0;
}

.wpgdg-breadcrumb {
    margin-bottom: 20px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.wpgdg-back-btn {
    background: #cc1f1a;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

/* Kiểu dáng Thư mục & Lưới Ảnh dùng chung CSS Variable */
.wpgdg-folders-container,
.wpgdg-images-container {
    display: grid;
    /* Dùng biến --wpgdg-cols được truyền từ HTML, nếu không có thì mặc định là 4 */
    grid-template-columns: repeat(var(--wpgdg-cols, 4), 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

/* Kiểu dáng item Thư mục */
.wpgdg-folder-item {
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.wpgdg-folder-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: #cc1f1a;
}

/* Kiểu dáng item Ảnh */
.wpgdg-image-item {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1 / 1; 
}

.wpgdg-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.wpgdg-image-item:hover img {
    transform: scale(1.05);
}

/* Xử lý Responsive (Tự động thích ứng trên thiết bị di động) */
@media screen and (max-width: 1024px) {
    .wpgdg-folders-container,
    .wpgdg-images-container {
        /* Màn hình Tablet hiển thị 3 cột */
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media screen and (max-width: 768px) {
    .wpgdg-folders-container,
    .wpgdg-images-container {
        /* Điện thoại ngang hiển thị 2 cột */
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media screen and (max-width: 480px) {
    .wpgdg-folders-container,
    .wpgdg-images-container {
        /* Điện thoại dọc hiển thị 1 cột hoặc 2 cột tùy ý (ở đây để 2 cột cho gọn) */
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
/* --- Hiệu ứng Hover Overlay cho Ảnh --- */

.wpgdg-image-item {
    position: relative; /* Bắt buộc để chứa lớp overlay absolute */
    display: block;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1 / 1; 
    /* Thêm shadow nhẹ cho ảnh thêm nổi bật */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Lớp phủ mờ đen */
.wpgdg-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* Màu đen trong suốt 40% */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0; /* Ẩn mặc định */
    transition: opacity 0.3s ease; /* Hiệu ứng mờ dần */
    z-index: 1;
}

/* Định dạng Icon kính lúp */
.wpgdg-icon-zoom {
    color: #ffffff; /* Màu icon trắng */
    transform: scale(0.5); /* Bắt đầu nhỏ hơn bình thường */
    transition: transform 0.3s ease; /* Hiệu ứng phóng to icon */
}

/* Khi di chuột vào ảnh */
.wpgdg-image-item:hover .wpgdg-image-overlay {
    opacity: 1; /* Hiện lớp phủ */
}

.wpgdg-image-item:hover .wpgdg-icon-zoom {
    transform: scale(1); /* Phóng to icon về kích thước thật */
}

.wpgdg-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease; /* Đổi thành 0.4s cho mượt hơn với overlay */
}

.wpgdg-image-item:hover img {
    transform: scale(1.08); /* Phóng to ảnh nhẹ khi hover */
}
.wpgdg-loader {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #666;
}

.wpgdg-pagination-wrap {
    text-align: center;
    margin-top: 30px;
}

#wpgdg-load-more {
    padding: 10px 25px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
}