/* === Base Section === */
section[data-module="az-gallery"] {
}

/* === Gallery Grid === */
section[data-module="az-gallery"] .grid {
    margin: auto;
}

section[data-module="az-gallery"] .grid-item {
	display: inline-block;
	height: 240px;
	overflow: hidden;
	text-align: center;
	width: 32%;
	margin: 5px;
	border-radius: 20px;
}

section[data-module="az-gallery"] .grid-item img {
    width: 100%;
    height: auto;
    filter: gray;
    -webkit-filter: grayscale(1);
    transition: 0.9s;
}

section[data-module="az-gallery"] .grid-item img:hover {
    filter: none;
}

section[data-module="az-gallery"] .overlay {
    position: absolute;
    bottom: 0;
    background: rgba(0, 0, 0, 0.72);
    width: 100%;
    transition: .5s ease;
    opacity: 0;
    color: white;
    font-size: 20px;
    padding: 20px;
    text-align: center;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

section[data-module="az-gallery"] .grid-item:hover .overlay {
    opacity: 1;
}

section[data-module="az-gallery"] .bg-image {
    background-color: #cccccc;
    height: 300px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* === Pagination === */
section[data-module="az-gallery"] .isotope-pager {
    text-align: center;
    margin-top: 20px;
}

section[data-module="az-gallery"] .isotope-pager a {
    margin: 5px;
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 32px;
    color: #fff;
    font-weight: 600;
    transition: 0.3s;
    border-radius: 50%;
    background-color: #232323;
    text-decoration: none;
    font-size: 16px;
    text-align: center;
}

section[data-module="az-gallery"] .isotope-pager a:hover {
    background-color: brown;
}

section[data-module="az-gallery"] .isotope-pager .active {
    color: #e3ca66 !important;
    background-color: brown;
}

/* === Filter Buttons - Desktop === */
section[data-module="az-gallery"] .filters {
    width: 100%;
    text-align: center;
    padding: 10px;
    margin: 0;
}

section[data-module="az-gallery"] .filters ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

section[data-module="az-gallery"] .filters li {
    display: inline-block;
    padding: 5px 15px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    background-color: #ccc;
    transition: 0.3s;
}

section[data-module="az-gallery"] .filters li.active,
section[data-module="az-gallery"] .filters li:hover {
    background-color: #000;
    color: #fff;
}

/* === Mobile Optimized Category Filter with Arrows === */
section[data-module="az-gallery"] .az-category-scroll-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    padding: 0 20px;
}

section[data-module="az-gallery"] .az-scroll-left,
section[data-module="az-gallery"] .az-scroll-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: none; /* shown only on mobile */
    cursor: pointer;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 50%;
    font-size: 18px;
    padding: 6px;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

section[data-module="az-gallery"] .az-scroll-left {
    left: -10px;
}

section[data-module="az-gallery"] .az-scroll-right {
    right: -10px;
}

section[data-module="az-gallery"] .az-category-filter {
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    display: flex;
    gap: 8px;
    padding: 8px 40px; /* add padding so buttons don't get hidden under arrows */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
}

section[data-module="az-gallery"] .az-category-filter::-webkit-scrollbar {
    display: none;
}

section[data-module="az-gallery"] .az-filter-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background-color: #f0f0f0;
    cursor: pointer;
    border-radius: 20px;
    white-space: nowrap;
    flex: 0 0 auto;
    transition: background 0.3s;
}

section[data-module="az-gallery"] .az-filter-btn.active {
    background-color: #3a1d17;
    color: #fff;
}

/* === Responsive Media Queries === */
@media (max-width: 768px) {
    /* Show arrows only on mobile */
    section[data-module="az-gallery"] .az-scroll-left,
    section[data-module="az-gallery"] .az-scroll-right {
        display: inline-block;
    }

    /* Grid adjustments */
    section[data-module="az-gallery"] .grid-item {
        height: 130px;
        width: 45%;
        margin: 5px;
    }

    section[data-module="az-gallery"] .bg-image {
        height: 130px;
    }

    /* Optional: Style isotope filter buttons in .filters on mobile if used */
    section[data-module="az-gallery"] .filters {
        display: flex;
        flex-wrap: nowrap;
        gap: 10px;
        padding: 0;
        margin: 0;
        list-style: none;
        overflow-x: auto;
        white-space: nowrap;
    }

    section[data-module="az-gallery"] .filters li {
        white-space: nowrap;
        padding: 8px 16px;
        background: #f0f0f0;
        border-radius: 20px;
        cursor: pointer;
        flex: 0 0 auto;
        transition: background 0.3s;
    }

    section[data-module="az-gallery"] .filters li.active {
        background: #0073aa;
        color: #fff;
    }
}
