/* 
 * Olla Video Banner Styles - Advanced Integration
 */

.olla-video-banner-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #000;
}

/* Shimmer Animations */
.shimmer {
    background-size: 200% 100%;
    animation: sk-shimmer 1.5s infinite linear;
}

.shimmer.sk-dark {
    background: linear-gradient(90deg, #111 25%, #222 50%, #111 75%);
    background-size: 200% 100%;
}

.shimmer.sk-light { 
    background: linear-gradient(90deg, #eee 25%, #f9f9f9 50%, #eee 75%); 
    background-size: 200% 100%; 
}

@keyframes sk-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Fail-safe Fallback: Auto-fade out if JS fails after 7 seconds */
@keyframes auto-fade-out {
    0% { opacity: 1; visibility: visible; pointer-events: all; }
    90% { opacity: 1; visibility: visible; pointer-events: all; }
    100% { opacity: 0; visibility: hidden; pointer-events: none; }
}

/* Header Skeleton - Using CLASS to handle duplicates safely */
.olla-header-skeleton {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    z-index: 9991; /* lowered from 999999 to allow search popups to show above */
    display: block;
    background-color: #000;
    animation: auto-fade-out 7s forwards; /* CSS Fail-safe */
}

.sk-top-bar {
    height: 40px; 
    background-color: #fdf6e3; 
    display: flex; 
    justify-content: center; 
    align-items: center;
}

.sk-main-header {
    height: 80px; 
    background-color: #000; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 0 40px;
}

.sk-column {
    display: flex;
    gap: 20px;
    align-items: center;
    flex: 1;
}

.sk-column.sk-center {
    justify-content: center;
    flex: 0 0 200px;
}

.sk-column.sk-right, 
.sk-column.sk-menu-right {
    justify-content: flex-end;
}

.sk-text { width: 200px; height: 10px; border-radius: 5px; }
.sk-logo { width: 140px; height: 40px; border-radius: 4px; }
.sk-icon { width: 22px; height: 22px; border-radius: 50%; }
.sk-link { width: 70px; height: 8px; border-radius: 4px; }

/* Video Skeletons */
.olla-video-skeleton-overlay {
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    z-index: 10;
    transition: opacity 0.8s ease-in-out, visibility 0.8s;
    animation: auto-fade-out 7s forwards; /* CSS Fail-safe */
}

/* Main Video Player (YouTube or HTML5) */
.olla-video-banner-container iframe,
.olla-video-banner-container video {
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%);
    width: 100vw; 
    height: 56.25vw; /* 16:9 ratio */
    min-height: 100%; 
    min-width: 177.77vh; /* ensures no black bars on ultra-wide or tall screens */
    opacity: 0; 
    transition: opacity 1s ease-in-out; 
    pointer-events: none;
    background-color: #000;
}

.olla-video-banner-container.video-active iframe,
.olla-video-banner-container.video-active video {
    opacity: 1;
}

/* Helper Class for Video Active State */
.olla-video-banner-container.video-active .olla-video-skeleton-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.olla-video-banner-container .banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

/* 
 * Global Search Popup Restore Styles 
 * Ensures the search works regardless of Elementor widget presence
 */
#tbs-global-search .popup-search {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: flex-start; /* Moved from center to top for better scrolling */
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#tbs-global-search .popup-search.active {
    opacity: 1;
    visibility: visible;
}

#tbs-global-search .search-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    cursor: zoom-out;
}

#tbs-global-search .popup-search-wrapper {
    position: relative;
    z-index: 100001;
    width: 90%;
    max-width: 900px;
    padding: 60px 40px;
    margin-top: 10vh; /* Added margin to push it slightly from the very top edge */
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

#tbs-global-search .popup-search.active .popup-search-wrapper {
    transform: scale(1);
}

#tbs-global-search .search-title {
    color: #fff;
    font-size: 32px;
    font-family: 'Playfair Display', serif;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

#tbs-global-search .search-wrapper {
    position: relative;
    display: flex;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 15px;
    transition: border-color 0.3s;
}

#tbs-global-search .search-wrapper:focus-within {
    border-color: #fdf6e3;
}

#tbs-global-search .autosearch-input {
    width: 100%;
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    font-size: 24px !important;
    padding: 10px 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

#tbs-global-search .button-search-pro {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0 15px;
}

#tbs-global-search .search-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 30px;
    text-decoration: none;
    line-height: 1;
}

#tbs-global-search .search-close:hover {
    color: #fdf6e3;
}

/* AJAX Results Styling for Layout 1 */
#tbs-global-search .content-search {
    background: transparent;
    box-shadow: none;
    position: relative;
    top: 0;
}

#tbs-global-search .content-search:before {
    display: none;
}

#tbs-global-search .search-append {
    background: #111;
    max-height: 65vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 10px;
    border-radius: 4px;
    text-align: left;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    padding: 0;
    display: none; /* Hide initially so no empty bar appears */
}

/* Ensure flexbox styling when shown */
#tbs-global-search .search-append[style*="display: block"] {
    display: flex !important;
    flex-direction: column;
}

/* Custom Dark Scrollbar */
#tbs-global-search .search-append::-webkit-scrollbar {
    width: 6px;
}
#tbs-global-search .search-append::-webkit-scrollbar-track {
    background: #111;
    border-radius: 4px;
}
#tbs-global-search .search-append::-webkit-scrollbar-thumb {
    background: #444; 
    border-radius: 4px;
}
#tbs-global-search .search-append::-webkit-scrollbar-thumb:hover {
    background: #666; 
}

#tbs-global-search .search-append a.media-left {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #222;
    color: #ccc;
    text-decoration: none;
    transition: all 0.3s ease;
}

#tbs-global-search .search-append a.media-left:last-child {
    border-bottom: none;
}

#tbs-global-search .search-append a.media-left:hover {
    background: #222;
    color: #fff;
}

#tbs-global-search .search-append a.media-left img {
    width: 60px !important;
    height: 60px !important;
    object-fit: cover;
    margin-right: 15px;
    border-radius: 4px;
}

#tbs-global-search .search-append .media-body {
    display: flex;
    flex-direction: column;
}

#tbs-global-search .search-append .media-body > span {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 5px;
}

#tbs-global-search .search-append .media-body .price {
    font-size: 14px;
    color: #fdf6e3;
    margin: 0;
}

/* Prevent scrolling when modal is open */
html.olla-modal-open,
body.olla-modal-open {
    overflow: hidden !important;
    height: 100vh;
}
