/* ============================================
   Gallery Section
   ============================================ */
.gallery-section { 
    background: #fff; 
    padding: 60px 0 80px; 
}

/* Gallery Tabs */
#galleryTabs { 
    margin-bottom: 40px; 
    justify-content: center; 
}
#galleryTabs .nav-link { 
    color: #666; 
    font-size: 16px; 
    font-weight: 500; 
    padding: 15px 30px; 
    margin: 0 5px; 
    border: none; 
    background: transparent; 
    position: relative; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    transition: all 0.3s ease; 
}
#galleryTabs .nav-link:hover, 
#galleryTabs .nav-link.active { 
    color: #A44A1F; 
    background: transparent; 
    border: none; 
}
#galleryTabs .nav-link::after { 
    content: ''; 
    position: absolute; 
    bottom: -1px; 
    left: 0; 
    width: 100%; 
    height: 2px; 
    background: #A44A1F; 
    transform: scaleX(0); 
    transition: transform 0.3s ease; 
}
#galleryTabs .nav-link:hover::after, 
#galleryTabs .nav-link.active::after { 
    transform: scaleX(1); 
}
#galleryTabs .nav-link.active { 
    color: #A44A1F; 
    font-weight: 600; 
}




.grid-item .gallery-item {
    height: 100%;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Gallery Items */
.gallery-item { 
    position: relative; 
    overflow: hidden; 
    border-radius: 4px; 
    transition: all 0.3s ease; 
    background: #fff; 
    height: 100%; 
    border: none; 
    margin: 0;
    padding: 0;
    box-shadow: none;
}

/* Footer row under each item */
.gallery-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 2px 0; /* minimal spacing, no box */
    background: transparent;
}

.gallery-item-title-listing {
    color: #0f172a; /* slate-900 */
    text-decoration: none;
    flex: 1 1 auto;
    min-width: 0; /* required for text-overflow inside flex */
}
.gallery-item-title-listing h4 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
    color: inherit;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.gallery-item-title-listing:hover h4 { text-decoration: underline; }
.gallery-img, 
.video-preview { 
    width: 100%; 
    height: 100%;
    min-height: 200px;
    object-fit: cover; 
    transition: all 0.5s ease; 
    display: block; 
}
.gallery-item .hover-img {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s ease;
}
/*.gallery-item:hover .gallery-img {
    opacity: 0;
}
.gallery-listing .gallery-item:hover .hover-img {
    opacity: 1;
}*/

.gallery-listing .gallery-item:hover .gallery-img {
    opacity: 0;
}
.gallery-listing .gallery-item:hover .hover-img {
    opacity: 1;
}


/* .gallery-item:hover { 
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); 
} */
 .downlaod-btn-listing {
    position: relative;
    flex: 0 0 auto;
    padding: 0;
    border: none !important;
    background: transparent;
 }

/* Remove video dark mask so only the bar is visible */
body.single.single-gallery .video-thumbnail::before {
    background: transparent !important;
}
 .downlaod-btn-listing > a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #A44A1F; /* brand brown */
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
 }
 .downlaod-btn-listing > a:focus-visible {
    outline: 2px solid rgba(164,74,31,0.35);
    outline-offset: 2px;
    border-radius: 6px;
 }
 .downlaod-btn-listing > a:hover { color: #7e3817; }
 .downlaod-btn-listing > a:hover span,
 .downlaod-btn-listing > a:hover::after { text-decoration: underline; }
 /* use the existing svg icon and tint it to brand */
 .downlaod-btn-listing img {
    width: 18px;
    height: 18px;
    /* approximate #A44A1F with filter */
    filter: invert(36%) sepia(21%) saturate(1882%) hue-rotate(354deg) brightness(89%) contrast(86%);
    transition: filter .2s ease, transform .2s ease;
 }
 .downlaod-btn-listing > a:hover img { transform: translateY(-1px); }
 /* Append text label using pseudo if no text node is present */
 .downlaod-btn-listing > a::after {
    content: 'Download';
    display: inline-block;
 }
.gallery-item:hover .gallery-img, 
.gallery-item:hover .video-preview { 
    transform: scale(1.03); 
}

/* Gallery Overlay */
.gallery-overlay { 
    position: absolute; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    background: rgba(0, 0, 0, 0.8); 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    opacity: 0; 
    transition: all 0.3s ease; 
    padding: 20px; 
    text-align: center; 
}

.gallery-item:hover .gallery-overlay { 
    opacity: 1; 
}

/* Play Button */
.play-btn { 
    width: 50px !important; 
    height: 50px !important; 
    opacity: 1; 
    transition: all 0.3s ease; 
    position: relative; 
    z-index: 2; 
}

/* Gallery Item Title */
.gallery-item-title { 
    color: #fff; 
    font-size: 18px; 
    font-weight: 600; 
    margin: 15px 0 5px; 
    position: relative; 
    padding-bottom: 10px; 
    width: 100%; 
}

.gallery-item-title:after { 
    content: ''; 
    position: absolute; 
    bottom: 0; 
    left: 50%; 
    transform: translateX(-50%); 
    width: 40px; 
    height: 2px; 
    background: #fff; 
    transition: all 0.3s ease; 
}

/* Gallery Item Category */
.gallery-item-category { 
    color: #fff; 
    font-size: 13px; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    margin-top: 10px; 
    opacity: 0.8; 
}

/* Video Thumbnail */
.video-thumbnail { 
    position: relative; 
    width: 100%; 
    height: 100%; 
    min-height: 200px;
    border-radius: 8px; 
    overflow: hidden; 
    transition: all 0.3s ease; 
}

.video-thumbnail::before { 
    content: ''; 
    position: absolute; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    background-color: rgba(0, 0, 0, 0.5); 
    transition: all 0.3s ease; 
}

.video-preview { 
    background: #000; 
}

/* Organized masonry layout */
.grid {
    margin: 0;
    padding: 0;
    width: 100%;
}

.grid-item {
    margin: 0 !important;
    overflow: hidden;
    border: none !important;
}

.grid-item .gallery-item {
    border: none;
    margin: 0;
}


/* Ensure images fill their containers */
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.downlaod-btn {  position: absolute; top: 10px; right: 10px; z-index: 99; border:1px solid #666; } 
.downlaod-btn img { filter: invert(1); }
/* Override for listing footer button (must come after generic rule) */
.downlaod-btn.downlaod-btn-listing { position: static; top: auto; right: auto; }
.downlaod-btn.downlaod-btn-listing img { filter: none; }
/* Badge styles for product status */
/* Base badge style */
.featured-category { 
    position: absolute; 
    top: 35px;
    left: -44px;
    width: 183px;
    padding:2px 0; 
    gap: 5px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    z-index: 5;
    transform-origin: center center;
    transform: rotate(-45deg) ;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}
.featured-category img { width: 13px; height: 13px; }
.featured-category span {font-size: 12px; color: #fff; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

/* Best Selling badge */
.best-selling { 
    background-color: #ff7f00; 
}

/* Out of Stock badge */
.out-of-stock { 
    background-color: #c9280c; 
}

/* Now Trending badge */
.now-trending { 
    background-color: #28a745; 
}


/* =============================
   Single Gallery: bottom title bar overlay
   Only affect single gallery pages via body class
   ============================= */
body.single.single-gallery .gallery-item .gallery-overlay,
body.single.single-gallery .video-thumbnail .gallery-overlay {
    top: auto;            /* no full cover */
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 14px;
    background: linear-gradient(to top, rgba(0,0,0,0.6), rgba(0,0,0,0.35));
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none; /* let clicks pass through */
}

/* Hover/Focus reveal */
body.single.single-gallery .gallery-item:hover .gallery-overlay,
body.single.single-gallery .video-thumbnail:hover .gallery-overlay,
body.single.single-gallery a:focus .gallery-overlay {
    opacity: 1;
    transform: translateY(0);
}

/* Title styling inside the bar */
body.single.single-gallery .gallery-overlay .gallery-item-title {
    margin: 0;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
}

/* Remove centered underline from default style */
body.single.single-gallery .gallery-overlay .gallery-item-title:after { display: none; }
