/* Fancybox Custom Fixes */

/* Center thumbnail strip at the bottom */
.fancybox-thumbs {
    display: block !important;
    background: rgba(0, 0, 0, 0.95);
    padding: 0 !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    height: 90px !important;
    text-align: center;
}

.fancybox-show-thumbs .fancybox-thumbs {
    display: block !important;
}

.fancybox-thumbs > ul {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    justify-content: flex-start !important;
    align-items: center;
    padding: 5px 0 !important;
    margin: 0 auto !important;
    max-width: 100% !important;
}

.fancybox-thumbs > ul > li {
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    display: inline-block !important;
    float: none !important;
}

.fancybox-thumbs > ul > li:hover {
    transform: scale(1.1);
}

.fancybox-thumbs > ul > li.fancybox-thumbs-active {
    border: 3px solid #fff;
    opacity: 1;
}

.fancybox-thumbs > ul > li img {
    height: 80px;
    width: auto;
    object-fit: cover;
}

.fancybox-button--thumbs {
  display: block !important;
}

.fancybox-infobar {
    display: block !important;
    color: #fff;
}

.fancybox-show-thumbs .fancybox-inner {
    right: 0 !important;
    bottom: 90px !important;
}

.fancybox-stage {
    bottom: 90px !important;
}

.fancybox-show-thumbs .fancybox-stage {
    bottom: 90px !important;
}

/* Fix toolbar button alignment - make them align in one line */
.fancybox-toolbar {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 99997 !important;
    background: transparent !important;
}

.fancybox-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

/* Responsive thumbnail sizing for mobile devices */
@media (max-width: 768px) {
    .fancybox-thumbs > ul > li img {
        height: 60px;
    }
    
    .fancybox-thumbs > ul {
        padding: 4px 0 !important;
    }
  
    .fancybox-thumbs > ul > li {
        margin: 0 3px;
    }
    
    .fancybox-stage,
    .fancybox-show-thumbs .fancybox-stage,
    .fancybox-show-thumbs .fancybox-inner {
      bottom: 68px !important;
    }
}

@media (max-width: 480px) {
    .fancybox-thumbs > ul > li img {
        height: 50px;
    }
    
    .fancybox-thumbs > ul {
        padding: 3px 0 !important;
    }
    
    .fancybox-thumbs > ul > li {
      margin: 0 2px;
    }
    
    .fancybox-stage,
    .fancybox-show-thumbs .fancybox-stage,
    .fancybox-show-thumbs .fancybox-inner {
      bottom: 56px !important;
    }
}
