/** 
 * Modal CSS for getFit Product Videos Plugin.
 * 
 * We are using PhotoSwipe for the modal functionality.
 * Custom styles to ensure proper display of video content as needed.
 */


 /*
 * Reset PhotoSwipe styles
 */

.pswp {
    z-index: 999900 !important;
}
.pswp__ui {
    z-index: 999950 !important;
}
.pswp__zoom-wrap {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}
@media (min-width: 768px) {
    .pswp__zoom-wrap {
        padding: 80px;
    }
}

.pswp__zoom-wrap video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border: none;
    border-radius: 8px;
}
.pswp__zoom-wrap .video-wrapper {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
}
.pswp__zoom-wrap .video-wrapper iframe {
    position: absolute;
    max-width: 100%;
    max-height: 100%;
    border: none;
    border-radius: 8px;
    object-fit: contain;
}
/* Portrait: height > width → set width to 100% */
@media (max-aspect-ratio: 1/1) {
    .pswp__zoom-wrap .video-wrapper {
        width: 100%;
        height: auto;
    }
}
/* Landscape: width > height → set height to 100% */
@media (min-aspect-ratio: 1/1) {
    .pswp__zoom-wrap .video-wrapper {
        width: auto;
        height: 100%;
    }
}

.admin-bar .pswp {
    height: 100% !important;
    top: 0 !important;
}
@media screen and (max-width: 782px) {
    .admin-bar .pswp {
        height: 100% !important;
        top: 0 !important;
    }
}

.pswp__top-bar {
    background-color: rgba(0, 0, 0, 0);
}
.pswp__preloader {
    display: none;
}
.pswp__counter, 
button.pswp__button--close {
    background-color: rgba(29, 29, 29, 0.8) !important;
}
button.pswp__button--close:hover {
    background-color: rgba(29, 29, 29, 1) !important;
}
.pswp__counter {
    border-radius: 0 0 8px 0;
}
button.pswp__button--close {
    border-radius: 0 0 0 8px;
}
button.pswp__button--arrow--left,
button.pswp__button--arrow--right {
    background-color: rgba(29, 29, 29, 0.4) !important;
}
button.pswp__button--arrow--left:hover,
button.pswp__button--arrow--right:hover {
    background-color: rgba(29, 29, 29, 0.7) !important;
}
button.pswp__button--arrow--left {
    border-radius: 0 8px 8px 0;
}
button.pswp__button--arrow--right {
    border-radius: 8px 0 0 8px;
}

.pswp__button--fs,
.pswp__button--share {
  display: none !important;
}


/*
 * Video bubble
 */

 #getfit-video-bubbles-container {
    position: absolute;
    top: 10px;
    z-index: 10;
    right: 10px;
 }

.getfit-video-bubbles {
    position: relative;
    display: flex;
    flex-direction: row-reverse;
    justify-content: end;
    align-items: center;
}

.getfit-video-bubbles .thumbnail {
    position: relative;
    width: 60px !important;
    height: 60px !important;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    margin-left: -35px;
    border: 3px solid rgba(255, 255, 255, 0.8);
}

.getfit-video-bubbles .thumbnail-media {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    z-index: 1;
}

.getfit-video-bubbles .thumbnail:first-child .thumbnail-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(29, 29, 29, 0.7);
    animation: pulseBlink 1s cubic-bezier(0, 0, 0.2, 1) infinite;
    pointer-events: none;
}

.getfit-video-bubbles .thumbnail:first-child:hover .thumbnail-pulse {
    animation-play-state: paused;
}

.getfit-video-bubbles .thumbnail:first-child::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    transform: translate(-50%, -50%);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M8 5v14l11-7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
    z-index: 50;
}

.getfit-video-bubbles .thumbnail:first-child {
    width: 70px !important;
    height: 70px !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.getfit-video-bubbles .thumbnail:first-child:hover {
    border-color: rgba(255, 255, 255, 1);
}

.getfit-video-bubbles .thumbnail video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    pointer-events: none;
}

@keyframes pulseBlink {
    75%,
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}
