/* Gallery layout cho phần Món ngon & Không Gian Ấm Cúng */
.gallery-slider-wrapper {
    position: relative;
    margin: 20px 0;
    padding: 0 60px;
}

.gallery-slider-container {
    overflow: hidden;
    position: relative;
    width: 100%;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    transition: transform 0.5s ease;
    width: 100%;
}

/* Pages wrapper and page styles for slider (each page = 2 rows x 4 columns) */
.gallery-pages {
    display: flex;
    transition: transform 0.5s ease;
    will-change: transform;
}

.gallery-page {
    min-width: 100%; /* one page fills the container */
    box-sizing: border-box;
    padding: 0 15px; /* keep same visual padding as grid */
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.gallery-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    opacity: 1;
    visibility: visible;
}

.gallery-slider-nav:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.gallery-prev {
    left: 0;
}

.gallery-next {
    right: 0;
}

.gallery-slider-nav i {
    font-size: 20px;
    color: #333;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 1;
}

.gallery-img-box {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
}

.gallery-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, opacity 0.3s ease;
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 20px;
    box-sizing: border-box;
}

.gallery-img-box:hover .gallery-overlay {
    opacity: 1;
}

.gallery-img-box:hover img {
    transform: scale(1.1);
    opacity: 0.9;
}

.gallery-caption {
    color: white;
    text-align: left;
    width: 100%;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.gallery-img-box:hover .gallery-caption {
    transform: translateY(0);
}

.gallery-caption h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.gallery-caption p {
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Responsive */
@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, 1fr);
    }
    .gallery-page {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(4, 1fr);
        gap: 10px;
    }
    .gallery-page {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 8px;
    }
    
    .gallery-caption h3 {
        font-size: 16px;
    }
    
    .gallery-caption p {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .gallery-page {
        grid-template-columns: 1fr;
        padding: 0 8px;
    }
}

