/* Side Panel Styles (Right to Left Slide) */
.pps-info-panel {
    position: absolute;
    top: 0;
    right: -100%; /* Hidden by default */
    width: 80%; /* Width inside media slider edges */
    height: 100%;
    background: rgba(0, 0, 0, 0.9); /* Dark semi-transparent background */
    z-index: 1000; /* Above everything else inside the slider */
    transition: right 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    color: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 15px rgba(0,0,0,0.5);
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(5px);
}

.pps-info-panel.active {
    right: 0;
}

.pps-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 10px;
}

.pps-info-title {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
}

.pps-info-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.pps-info-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: rgba(255,255,255,0.5) rgba(255,255,255,0.1);
    padding-right: 5px; /* Prevent content jumping when scrollbar appears */
}

/* Custom Scrollbar for Webkit (Chrome, Safari) */
.pps-info-content::-webkit-scrollbar {
    width: 6px;
}
.pps-info-content::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}
.pps-info-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.5);
    border-radius: 3px;
}
.pps-info-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.8);
}

.pps-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pps-info-list li {
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.4;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 5px;
}

.pps-info-list strong {
    display: block;
    color: #00e676; /* Accent color */
    margin-bottom: 2px;
}

/* Fix Visibility - Force overrides */
.pps-overlay-ui, 
.pps-playback-ui,
.pps-icon-btn {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    display: flex !important; /* Ensure they aren't hidden by display:none */
}
/* Ensure the parent overlay container allows clicks to pass through, but children (buttons) catch them */
.pps-overlay-ui {
    pointer-events: none !important;
}
.pps-overlay-ui > * {
    pointer-events: auto !important;
}

.pcp-sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 999998;
    display: none; opacity: 0; transition: opacity 0.3s ease;
}
.pcp-sidebar-overlay.active { display: block; opacity: 1; }

.pcp-sidebar {
    position: fixed; top: 0; right: -400px; height: 100%;
    width: 350px; /* Default width */
    background: #fff; z-index: 999999;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: right 0.3s ease-in-out;
    padding: 20px; overflow-y: auto;
    display: flex; flex-direction: column;
    overscroll-behavior: contain; /* Prevent scroll chaining to main page */
}
.pcp-sidebar.active { right: 0; }

/* Comment List Scroll Fix */
#pps_comment_list {
    overscroll-behavior: contain;
}

.pcp-sidebar-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; border-bottom: 1px solid #eee; padding-bottom: 10px;
}
.pcp-sidebar-title { margin: 0; font-size: 18px; font-weight: bold; color: #333; }
.pcp-close-btn {
    background: none; border: none; font-size: 24px; cursor: pointer; color: #333;
}
.pcp-sidebar-content { color: #333; }

.pps-parent-container {
    display: flex;
    flex-direction: column;
    /* Vertical Stack as per screenshot */
    position: relative;
    box-sizing: border-box;
    /* overflow: hidden; */ /* Removed to fix border clipping */
    margin: 0 auto;
    background-color: #0a0a0a;
    /* Dark background */
    /* Visual Indicator for Version Update (Green Border) */
    /* border: 2px solid #00ff00; */ /* Removed debug border */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    position: relative;
    /* For labeling */

    /* PERFORMANCE OPTIMIZATION */
    /* Skip rendering when off-screen. Browser calculates height as needed. */
    content-visibility: auto;
    /* Estimate height to prevent scrollbar jumping.
       Assuming ~600px height for typical product slider card (9:16 ratio + headers/footers) */
    contain-intrinsic-size: 600px;
}

/* Slider ID Label Style */
.pps-slider-id-label {
    text-align: right;
    font-weight: bold;
    font-family: sans-serif;
    font-size: 14px;
    padding: 5px 10px;
    background: #ffffff;
    color: #000000;
    margin-top: 0;
    border-top: 1px solid #eee;
}

/* App Mode: Hide Theme Header & Title for clear full-screen view */
.site-header,
#masthead,
header.wp-block-template-part,
.entry-header,
.page-header,
.page-title,
.entry-title,
.site-branding {
    display: none !important;
}

.pps-container {
    width: 100%;
    border: 1px solid #eee;
    background: #fff;
    margin-bottom: 5px;
    padding: 10px;
    box-sizing: border-box;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* Specific Container Styles mimicking screenshot */
.slider_container {
    background: #000;
    padding: 0;
    border: none;
    overflow: hidden;
    position: relative;
    border-radius: 0; /* Full width often looks better without radius if it's the main media */
}

/* Fix aspect ratio container */
.pps-aspect-wrapper {
    width: 100%;
    /* Default to something reasonable if ratio not set */
    /* aspect-ratio: 9/16; handled inline */
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pps-slides-wrapper {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    width: 100%;
    height: 100%;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE */
    scroll-behavior: smooth;
    position: absolute; top: 0; left: 0;
}
.pps-slides-wrapper::-webkit-scrollbar { display: none; }

.pps-slide-item {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    scroll-snap-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.pps-slide-item img, .pps-slide-item video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Fill the container */
    display: block;
}

/* Overlay UI */
.pps-overlay-ui {
    display: flex;
    flex-direction: column;
    /* Default, overridden by inline styles */
}

.pps-icon-btn {
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.1s;
}
.pps-icon-btn:active { transform: scale(0.9); }

.pps-btn-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: red;
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 50%;
    font-weight: bold;
}

.pps-price-badge {
    background: #ffffff;
    color: #000;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Playback UI */
.pps-playback-ui {
    /* flex row handled inline */
}

/* Dots */
.pps-dots-container {
    display: flex;
    gap: 5px;
}
.pps-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.3s;
}
.pps-dot.active {
    background: #fff;
    transform: scale(1.2);
}

/* Range Slider */
.pps-range-slider {
    -webkit-appearance: none;
    width: 200px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    outline: none;
    margin: 0;
    padding: 0;
    cursor: pointer;
}
.pps-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}
.pps-range-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

/* Tooltip for Range Slider */
.pps-range-tooltip {
    position: absolute;
    bottom: 20px; /* Above slider */
    left: 0;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
    white-space: nowrap;
    transform: translateX(-50%);
}
.pps-range-tooltip.pps-tooltip-visible {
    opacity: 1;
    visibility: visible;
}

/* Hotspots */
.pps-hotspot {
    position: absolute;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    cursor: pointer;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
    animation: pps-pulse 2s infinite;
    z-index: 10;
}
@keyframes pps-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.pps-hotspot-tooltip {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: #000;
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.pps-hotspot-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
}
.pps-hotspot:hover .pps-hotspot-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Variations */
.pps-variations-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 5px;
}
.pps-var-item {
    cursor: pointer;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px;
    transition: all 0.2s;
    background: #fff;
}
.pps-var-item:hover {
    border-color: #aaa;
    transform: translateY(-2px);
}
.pps-var-text { font-size: 14px; padding: 0 5px; }
.pps-var-bubble {
    display: block; width: 20px; height: 20px; border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
}
.pps-mode-color { border: none; padding: 2px; }

/* Force Visibility for Action Buttons and Playback Controls */
.pps-overlay-ui,
.pps-playback-ui,
.pps-action-container-ui {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important; /* Ensure they are not hidden by display:none */
}

/* Ensure icons themselves are visible */
.pps-icon-btn,
.pps-play-btn {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.pps-loader-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: #000; /* Solid background initially */
    display: flex; align-items: center; justify-content: center;
    z-index: 100;
    transition: opacity 0.5s ease; /* Smooth fade out */
}
.pps-circular-loader { position: relative; width: 60px; height: 60px; }
.pps-progress-ring__circle {
    transition: stroke-dashoffset 0.35s;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    stroke-dasharray: 163; /* 2 * PI * 26 */
    stroke-dashoffset: 163;
}
.pps-loader-text {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: #fff; font-size: 12px; font-weight: bold; font-family: sans-serif;
}
