/**
 * Pretpot Grid Swap - SIMPLIFIED CSS
 */

.pretpot-grid-swap {
    width: 100%;
}

.pretpot-grid-heading {
    text-align: center;
    margin-bottom: 20px;
}

.pretpot-grid-subheading {
    text-align: center;
    margin-bottom: 30px;
}

.pretpot-grid-swap-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 1024px) {
    .pretpot-grid-swap-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .pretpot-grid-swap-container {
        grid-template-columns: 1fr;
    }
}

.pretpot-grid-swap-item {
    position: relative;
    height: 400px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.6s ease;
}

.pretpot-grid-swap-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.pretpot-grid-swap-item:hover {
    transform: translateY(-5px);
}

/* Hover overlay */
.pretpot-grid-swap-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 5;
}

.pretpot-grid-price {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px 15px;
    border-radius: 4px;
    z-index: 10;
}

.pretpot-grid-button {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: #000;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    z-index: 10;
}

.pretpot-grid-button:hover {
    background: #333;
}

/* Animation States */
.pretpot-grid-swap[data-stagger="yes"] .pretpot-grid-swap-item {
    opacity: 0;
    transform: translateY(30px);
}

.pretpot-grid-swap[data-stagger="yes"] .pretpot-grid-swap-item.animated {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.pretpot-grid-swap-item.swapping {
    opacity: 0 !important;
    transition: opacity 0.4s ease;
}

/* Popup */
.pretpot-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pretpot-popup-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.pretpot-popup-inner {
    padding: 40px;
}

.pretpot-popup-inner img {
    width: 100%;
    margin-bottom: 20px;
}

.pretpot-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
}

.pretpot-popup-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Additional styles for Blog Grid and Photo/Video Grid widgets */

/* ========================================
   Glass Effect Button
======================================== */
.pretpot-grid-button.glass-effect {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ========================================
   Video Play Icon
======================================== */
.pretpot-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    z-index: 8;
    transition: all 0.3s ease;
    pointer-events: none;
}

.pretpot-play-icon svg {
    width: 50%;
    height: 50%;
    margin-left: 3px;
}

.pretpot-grid-swap-item.has-video:hover .pretpot-play-icon {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%) scale(1.1);
}

/* ========================================
   Media Popup Video Container
======================================== */
.pretpot-media-popup .pretpot-video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
}

.pretpot-media-popup .pretpot-video-container iframe,
.pretpot-media-popup .pretpot-video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.pretpot-media-popup .pretpot-video-container video {
    object-fit: contain;
    background: #000;
}

/* ========================================
   Blog Grid Specific
======================================== */
.pretpot-blog-grid .pretpot-grid-swap-item {
    /* No price badge needed for blog posts */
}

/* ========================================
   Media Grid Specific
======================================== */
.pretpot-media-grid .pretpot-grid-swap-item {
    /* No price badge needed for media items */
}

/* Ensure all media stretches to cover */
.pretpot-media-grid .pretpot-grid-swap-item img,
.pretpot-blog-grid .pretpot-grid-swap-item img {
    object-fit: cover;
    object-position: center;
}

/**
 * ADD THIS TO YOUR grid-swap.css FILE
 * CRITICAL: Forces videos to cover containers properly
 */

/* ========================================
   VIDEO COVERAGE FIX - CRITICAL
======================================== */

/* Direct video elements in grid - MUST cover */
.pretpot-media-grid .pretpot-grid-swap-item > video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    z-index: 1 !important;
}

/* Ensure videos are behind buttons and play icons */
.pretpot-media-grid .pretpot-grid-swap-item > video {
    pointer-events: none;
}

/* Make sure buttons stay on top */
.pretpot-grid-button {
    position: absolute;
    bottom: 15px;
    right: 15px;
    z-index: 10 !important;
    pointer-events: auto;
}

/* Make sure play icon stays on top */
.pretpot-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10 !important;
    pointer-events: none;
}

/* Video items should have no overflow */
.pretpot-grid-swap-item.has-video {
    overflow: hidden !important;
}