/* ============================================
   WCPS Caption Layouts Styles
   ============================================ */

// Breakpoints (matching main wcps-styles.scss)
$breakpoint-xs: 480px;
$breakpoint-sm: 576px;
$breakpoint-md: 768px;
$breakpoint-lg: 992px;
$breakpoint-xl: 1200px;

/* ============================================
   Caption Layout Base Styles
   ============================================ */
.wcps-container {

    // Base caption layout styles
    &[class*="wcps-layout-blinds-"],
    &[class*="wcps-layout-blocks-"],
    &[class*="wcps-layout-book-"],
    &[class*="wcps-layout-border-"],
    &[class*="wcps-layout-bounce-"],
    &[class*="wcps-layout-circle-"],
    &[class*="wcps-layout-cube-"],
    &[class*="wcps-layout-swiper-"],
    &[class*="wcps-layout-liquid-"],
    &[class*="wcps-layout-neon-"],
    &[class*="wcps-layout-origami-"],
    &[class*="wcps-layout-particle-"],
    &[class*="wcps-layout-hologram"],
    &[class*="wcps-layout-glass-"],
    &[class*="wcps-layout-magnetic-"],
    &[class*="wcps-layout-quantum-"],
    &[class*="wcps-layout-fire-"],
    &[class*="wcps-layout-matrix-"] {
        background: var(--wcps-container-background, #ffffff3b);
        padding: var(--wcps-container-padding, 25px);
        margin: var(--wcps-container-margin, 0px);
        width: var(--wcps-grid-width, 100%);

        // Grid layout for caption items
        .wcps-caption-container {
            display: grid;
            grid-template-columns: repeat(var(--wcps-columns, 4), minmax(0, 1fr));
            gap: var(--wcps-grid-gap, 20px);
            width: var(--wcps-grid-width, 100%);

            background: var(--wcps-container-background, #ffffff3b);
            padding: var(--wcps-container-padding, 25px);
            margin: var(--wcps-container-margin, 0px);

            @media (max-width: $breakpoint-xl) {
                grid-template-columns: repeat(3, 1fr);
            }

            @media (max-width: $breakpoint-lg) {
                grid-template-columns: repeat(2, 1fr);
            }

            @media (max-width: $breakpoint-md) {
                grid-template-columns: repeat(2, 1fr);
                gap: calc(var(--wcps-grid-gap, 20px) * 0.75);
            }

            @media (max-width: $breakpoint-sm) {
                grid-template-columns: 1fr;
                gap: calc(var(--wcps-grid-gap, 20px) * 0.5);
            }
        }

        .wcps-caption-item {
            display: flex;
            flex-direction: column;
            height: 100%;
            border: var(--wcps-border-width, 1px) var(--wcps-border-style, solid) var(--wcps-border-color, #eee);
            border-radius: var(--wcps-border-radius, 8px);
            transition: all var(--wcps-hover-transition, 0.3s) ease;
        }

        .wcps-product {
            position: relative;
            overflow: hidden;
            border-radius: calc(var(--wcps-border-radius, 8) * 1px);
            background: var(--wcps-product-background, #fff);
            border: var(--wcps-border-width, 0px) var(--wcps-border-style, solid) var(--wcps-border-color, #eeeeee);
            height: var(--wcps-product-width, 100%);
            display: flex;
            flex-direction: column;
            transition: all var(--wcps-hover-transition, 0.3s) ease;

            // Dynamic box shadow based on variable
            &.wcps-shadow-none {
                box-shadow: none;
            }

            &.wcps-shadow-light,
            &:not([class*="wcps-shadow-"]) {
                box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            }

            &.wcps-shadow-medium {
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
            }

            &.wcps-shadow-heavy {
                box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
            }

            .wcps-product-image {
                position: relative;
                overflow: hidden;
                aspect-ratio: var(--wcps-image-aspect-ratio, 1/1);
                border-radius: calc(var(--wcps-image-border-radius, 0) * 1px);
                width: var(--wcps-product-image-width, 100%);
                height: var(--wcps-product-image-height, auto);
                flex-shrink: 0;

                img {
                    transition: transform var(--wcps-hover-transition, 0.3s) ease;
                    width: 100%;
                    height: 250px;
                    object-fit: cover;
                    border-radius: calc(var(--wcps-image-border-radius, 0) * 1px);

                    @media (max-width: $breakpoint-md) {
                        height: 200px;
                    }

                    @media (max-width: $breakpoint-sm) {
                        height: 180px;
                    }
                }

                // Product badges
                .wcps-product-badge {
                    font-size: var(--wcps-product-badge-font-size, 14px);
                    font-weight: var(--wcps-product-badge-font-weight, 600);
                    text-transform: var(--wcps-product-badge-text-transform, capitalize); // Need to create- uppercase, capitalize, lowercase
                    text-align: center;
                    word-break: break-all;
                    letter-spacing: 0.4px;
                    line-height: 1.2;
                    list-style: none;
                    -ms-flex-align: center;
                    justify-content: center;
                    border-radius: var(--wcps-product-badge-border-radius, 20px);
                    padding: var(--wcps-product-badge-padding, 5px);
                    margin-bottom: 10px;
                    z-index: var(--wcps-product-badge-z-index, 2);
                    background: var(--wcps-product-badge-background, rgb(54, 182, 217));
                    color: var(--wcps-product-badge-font-color, #fff);
                    position: absolute;
                    right: 5px;
                    top: 5px;
                }


                // Caption overlay container
                .wcps-caption-overlay {
                    position: absolute;
                    top: 0;
                    left: 0;
                    right: 0;
                    bottom: 0;
                    background: var(--wcps-caption-hover-bg, linear-gradient(135deg, rgba(0, 123, 255, 0.9), rgba(108, 117, 125, 0.9)));
                    display: flex;
                    flex-direction: column;
                    justify-content: center;
                    align-items: center;
                    padding: 20px;
                    opacity: 0;
                    visibility: hidden;
                    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
                    z-index: 2;

                    @media (max-width: $breakpoint-md) {
                        padding: 15px;
                    }

                    @media (max-width: $breakpoint-sm) {
                        padding: 10px;
                    }

                    .wcps-caption-content {
                        position: relative;
                        z-index: 3;
                        text-align: center;
                        color: #ffffff;
                        width: 100%;

                        .wcps-caption-title {
                            font-size: calc(var(--wcps-title-size, 18) * 1px);
                            font-weight: var(--wcps-title-weight, 600);
                            margin-bottom: 10px;
                            line-height: 1.3;
                            color: #ffffff;

                            @media (max-width: $breakpoint-md) {
                                font-size: calc(var(--wcps-title-size, 16) * 1px);
                            }

                            @media (max-width: $breakpoint-sm) {
                                font-size: calc(var(--wcps-title-size, 14) * 1px);
                                margin-bottom: 8px;
                            }
                        }

                        .wcps-caption-description {
                            font-size: calc(var(--wcps-desc-size, 14) * 1px);
                            line-height: 1.4;
                            opacity: 0.9;
                            margin-bottom: 15px;
                            color: #ffffff;

                            @media (max-width: $breakpoint-md) {
                                font-size: calc(var(--wcps-desc-size, 12) * 1px);
                            }

                            @media (max-width: $breakpoint-sm) {
                                font-size: calc(var(--wcps-desc-size, 11) * 1px);
                                margin-bottom: 10px;
                            }
                        }

                        .wcps-caption-price {
                            font-weight: var(--wcps-price-font-weight, 700);
                            font-size: calc(var(--wcps-price-font-size, 16) * 1px);
                            color: #ffffff;
                            margin-bottom: 15px;

                            del {
                                opacity: 0.6;
                                margin-right: 8px;
                                font-weight: 400;
                            }

                            ins {
                                text-decoration: none;
                            }

                            @media (max-width: $breakpoint-sm) {
                                font-size: calc(var(--wcps-price-font-size, 14) * 1px);
                                margin-bottom: 10px;
                            }
                        }

                        .wcps-caption-actions {
                            display: flex;
                            gap: 10px;
                            justify-content: center;
                            flex-wrap: wrap;

                            @media (max-width: $breakpoint-sm) {
                                gap: 8px;
                            }

                            .wcps-caption-btn {
                                padding: 8px 16px;
                                background: rgba(255, 255, 255, 0.2);
                                border: 1px solid rgba(255, 255, 255, 0.3);
                                border-radius: var(--wcps-button-border-radius, 4px);
                                color: #ffffff;
                                text-decoration: none;
                                font-size: calc(var(--wcps-button-font-size, 12) * 1px);
                                font-weight: 500;
                                transition: all 0.3s ease;
                                backdrop-filter: blur(10px);
                                display: inline-flex;
                                align-items: center;
                                gap: 6px;

                                @media (max-width: $breakpoint-md) {
                                    padding: 6px 12px;
                                    font-size: calc(var(--wcps-button-font-size, 11) * 1px);
                                }

                                @media (max-width: $breakpoint-sm) {
                                    padding: 5px 10px;
                                    font-size: calc(var(--wcps-button-font-size, 10) * 1px);
                                    gap: 4px;
                                }

                                &:hover {
                                    background: rgba(255, 255, 255, 0.3);
                                    border-color: rgba(255, 255, 255, 0.5);
                                    transform: translateY(-2px);
                                }

                                i {
                                    font-size: 1em;
                                }
                            }
                        }
                    }
                }
            }

            // Product content section (below image)
            .wcps-product-content {
                padding: var(--wcps-product-content-padding, 15px);
                margin: var(--wcps-product-content-margin, 0px);
                display: flex;
                flex-direction: var(--wcps-product-content-direction, column);
                text-align: var(--wcps-text-align, left);
                background: var(--wcps-product-content-background, #ffffff);
                flex-grow: 1;

                .wcps-product-title {
                    margin: 0 0 8px;
                    font-size: calc(var(--wcps-title-size, 16) * 1px);
                    font-weight: var(--wcps-title-weight, 600);
                    line-height: 1.3;
                    display: -webkit-box;
                    -webkit-line-clamp: 2;
                    -webkit-box-orient: vertical;
                    overflow: hidden;

                    a {
                        color: var(--wcps-product-title, #0170B9);
                        text-decoration: none;
                        font-size: calc(var(--wcps-title-size, 16) * 1px);
                        font-weight: var(--wcps-title-weight, 600);
                        transition: color var(--wcps-hover-transition, 0.3s) ease;

                        &:hover {
                            color: var(--wcps-product-title-hover-color, #0170B9);
                        }
                    }
                }

                .wcps-product-price {
                    font-weight: var(--wcps-price-font-weight, 700);
                    font-size: calc(var(--wcps-price-font-size, 18) * 1px);
                    color: var(--wcps-price-font-color, #0170B9);
                    margin-bottom: 8px;

                    del {
                        opacity: 0.6;
                        margin-right: 8px;
                        color: var(--wcps-price-delete-font-color, #333333);
                        font-weight: 400;
                    }

                    ins {
                        text-decoration: none;
                        color: var(--wcps-price-font-color, #0170B9);
                    }
                }

                .wcps-product-rating {
                    margin-bottom: 8px;

                    .star-rating {
                        color: var(--wcps-star-color, #ffc107);
                        font-size: calc(var(--wcps-star-size, 14) * 1px);

                        &::before {
                            color: var(--wcps-star-color, #ffc107);
                            font-size: var(--wcps-star-size, 10px);

                        }
                    }
                }
            }
        }
    }
}

/* ============================================
   Caption Layout 1: Blinds Vertical
   ============================================ */
.wcps-container.wcps-layout-blinds-vertical {
    .wcps-product {
        &:hover {
            .wcps-product-image {
                img {
                    transform: scale(1.05);
                }

                .wcps-caption-overlay {
                    opacity: 1;
                    visibility: visible;
                    transform: translateX(0);

                    .wcps-caption-content {
                        transform: translateY(0);
                        opacity: 1;
                    }
                }
            }
        }

        .wcps-product-image .wcps-caption-overlay {
            // Clean slide-in effect from left
            transform: translateX(-100%);
            transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);

            .wcps-caption-content {
                transform: translateY(20px);
                opacity: 0;
                transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
            }
        }
    }
}

/* ============================================
   Caption Layout 2: Blocks Zoom Top Left
   ============================================ */
.wcps-container.wcps-layout-blocks-zoom-top-left {
    .wcps-product {
        &:hover {
            .wcps-product-image {
                img {
                    transform: scale(1.1) rotate(2deg);
                }

                .wcps-caption-overlay {
                    opacity: 1;
                    visibility: visible;
                    transform: scale(1);

                    .wcps-caption-content {
                        transform: scale(1) rotate(0deg);
                        opacity: 1;
                    }
                }
            }
        }

        .wcps-product-image .wcps-caption-overlay {
            // Clean zoom effect from top-left
            transform: scale(0);
            transform-origin: top left;
            transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);

            .wcps-caption-content {
                transform: scale(0.8) rotate(-10deg);
                opacity: 0;
                transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
            }
        }
    }
}

/* ============================================
   Caption Layout 3: Book Open Horizontal
   ============================================ */
.wcps-container.wcps-layout-book-open-horizontal {
    .wcps-product {
        &:hover {
            .wcps-product-image {
                img {
                    transform: scale(1.05);
                }

                .wcps-caption-overlay {
                    opacity: 1;
                    visibility: visible;

                    &::before,
                    &::after {
                        transform: rotateY(0deg);
                    }

                    .wcps-caption-content {
                        transform: translateX(0) scale(1);
                        opacity: 1;
                    }
                }
            }
        }

        .wcps-product-image .wcps-caption-overlay {
            perspective: 1000px;

            // Left page of book
            &::before {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                width: 50%;
                height: 100%;
                background: var(--wcps-caption-hover-bg, linear-gradient(135deg, rgba(0, 123, 255, 0.9), rgba(108, 117, 125, 0.9)));
                transform: rotateY(-90deg);
                transform-origin: right center;
                transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
                z-index: 1;
            }

            // Right page of book
            &::after {
                content: '';
                position: absolute;
                top: 0;
                right: 0;
                width: 50%;
                height: 100%;
                background: var(--wcps-caption-hover-bg, linear-gradient(135deg, rgba(0, 123, 255, 0.9), rgba(108, 117, 125, 0.9)));
                transform: rotateY(90deg);
                transform-origin: left center;
                transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
                z-index: 1;
            }

            .wcps-caption-content {
                transform: translateX(-30px) scale(0.8);
                opacity: 0;
                transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.4s;
            }
        }
    }
}

/* ============================================
   Caption Layout 4: Border Reveal Top Left
   ============================================ */
.wcps-container.wcps-layout-border-reveal-top-left {
    .wcps-product {
        &:hover {
            .wcps-product-image {
                img {
                    transform: scale(1.08);
                }

                .wcps-caption-overlay {
                    opacity: 1;
                    visibility: visible;

                    &::before {
                        transform: scale(1);
                    }

                    .wcps-caption-content {
                        transform: translate(0, 0);
                        opacity: 1;
                    }
                }
            }
        }

        .wcps-product-image .wcps-caption-overlay {

            // Border reveal effect
            &::before {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background: var(--wcps-caption-hover-bg, linear-gradient(135deg, rgba(0, 123, 255, 0.9), rgba(108, 117, 125, 0.9)));
                border: 3px solid rgba(255, 255, 255, 0.3);
                transform: scale(0);
                transform-origin: top left;
                transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
                z-index: 1;
            }

            .wcps-caption-content {
                transform: translate(-20px, -20px);
                opacity: 0;
                transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
            }
        }
    }
}

/* ============================================
   Caption Layout 5: Bounce Out Right
   ============================================ */
.wcps-container.wcps-layout-bounce-out-right {
    .wcps-product {
        &:hover {
            .wcps-product-image {
                img {
                    transform: scale(1.05) translateX(-10px);
                }

                .wcps-caption-overlay {
                    opacity: 1;
                    visibility: visible;
                    transform: translateX(0);

                    .wcps-caption-content {
                        animation: bounceInRight 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
                        opacity: 1;
                    }
                }
            }
        }

        .wcps-product-image .wcps-caption-overlay {
            transform: translateX(100%);
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

            .wcps-caption-content {
                opacity: 0;
                transform: translateX(50px);
            }
        }
    }
}

/* ============================================
   Caption Layout 6: Circle Top Left
   ============================================ */
.wcps-container.wcps-layout-circle-top-left {
    .wcps-product {
        &:hover {
            .wcps-product-image {
                img {
                    transform: scale(1.1);
                }

                .wcps-caption-overlay {
                    opacity: 1;
                    visibility: visible;
                    clip-path: circle(150% at top left);

                    .wcps-caption-content {
                        transform: scale(1) rotate(0deg);
                        opacity: 1;
                    }
                }
            }
        }

        .wcps-product-image .wcps-caption-overlay {

            // Circular reveal effect
            clip-path: circle(0% at top left);
            transition: clip-path 0.6s cubic-bezier(0.4, 0, 0.2, 1);

            .wcps-caption-content {
                transform: scale(0.7) rotate(-15deg);
                opacity: 0;
                transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
            }
        }
    }
}

/* ============================================
   Caption Layout 7: Cube Left
   ============================================ */
.wcps-container.wcps-layout-cube-left {
    .wcps-product {
        &:hover {
            .wcps-product-image {
                img {
                    transform: scale(1.05) rotateY(-5deg);
                }

                .wcps-caption-overlay {
                    opacity: 1;
                    visibility: visible;
                    transform: rotateY(0deg);

                    .wcps-caption-content {
                        transform: translateZ(0) rotateY(0deg);
                        opacity: 1;
                    }
                }
            }
        }

        .wcps-product-image {
            perspective: 1000px;

            .wcps-caption-overlay {
                transform: rotateY(-90deg);
                transform-origin: left center;
                transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
                background: var(--wcps-caption-hover-bg, linear-gradient(135deg, rgba(0, 123, 255, 0.9), rgba(108, 117, 125, 0.9)));

                .wcps-caption-content {
                    transform: translateZ(-50px) rotateY(15deg);
                    opacity: 0;
                    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
                }
            }
        }
    }
}

/* ============================================
   Caption Layout 8: Swiper Slide
   ============================================ */
.wcps-container.wcps-layout-swiper-slide {
    .wcps-product {
        &:hover {
            .wcps-product-image {
                img {
                    transform: scale(1.05) translateX(-5px);
                }

                .wcps-caption-overlay {
                    opacity: 1;
                    visibility: visible;
                    transform: translateX(0);

                    &::before {
                        transform: translateX(0);
                    }

                    .wcps-caption-content {
                        transform: translateX(0);
                        opacity: 1;
                    }
                }
            }
        }

        .wcps-product-image .wcps-caption-overlay {
            transform: translateX(-100%);
            transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
            background: var(--wcps-caption-hover-bg, linear-gradient(135deg, rgba(0, 123, 255, 0.9), rgba(108, 117, 125, 0.9)));

            // Sliding effect overlay
            &::before {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
                transform: translateX(-100%);
                transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
                z-index: 1;
            }

            .wcps-caption-content {
                transform: translateX(-30px);
                opacity: 0;
                transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
            }
        }
    }
}


/* ============================================
   Animation Keyframes for New Creative Layouts
   ============================================ */
@keyframes glassShatter {
    0% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }

    50% {
        opacity: 1;
        transform: scale(1.2) rotate(180deg);
    }

    100% {
        opacity: 0.8;
        transform: scale(1) rotate(360deg);
    }
}

@keyframes glassReflection {
    0% {
        transform: translateX(-100%) rotate(45deg);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateX(100%) rotate(45deg);
        opacity: 0;
    }
}

@keyframes magneticField {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.6;
    }
}

@keyframes magneticFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-5px);
    }
}

@keyframes quantumTunnel {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(15);
        opacity: 0;
    }
}

@keyframes quantumParticles {
    0% {
        opacity: 0;
        transform: scale(0);
    }

    20% {
        opacity: 1;
        transform: scale(1);
    }

    80% {
        opacity: 1;
        transform: scale(1) rotate(360deg);
    }

    100% {
        opacity: 0;
        transform: scale(0) rotate(720deg);
    }
}

@keyframes fireIgnition {
    0% {
        transform: translateX(-50%) scaleY(0);
        opacity: 0;
    }

    30% {
        transform: translateX(-50%) scaleY(0.5);
        opacity: 0.7;
    }

    100% {
        transform: translateX(-50%) scaleY(1);
        opacity: 1;
    }
}

@keyframes fireFlicker {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.8;
    }

    25% {
        transform: translateX(-48%) scale(1.05);
        opacity: 1;
    }

    50% {
        transform: translateX(-52%) scale(0.95);
        opacity: 0.9;
    }

    75% {
        transform: translateX(-50%) scale(1.02);
        opacity: 0.95;
    }
}

@keyframes fireGlow {

    0%,
    100% {
        text-shadow: 0 0 10px rgba(255, 140, 0, 0.8);
    }

    50% {
        text-shadow: 0 0 20px rgba(255, 140, 0, 1), 0 0 30px rgba(255, 69, 0, 0.8);
    }
}

@keyframes matrixRain {
    0% {
        top: -100%;
    }

    100% {
        top: 100%;
    }
}

@keyframes matrixGlitch {

    0%,
    90%,
    100% {
        opacity: 0.3;
    }

    91%,
    99% {
        opacity: 0.1;
    }

    92%,
    98% {
        opacity: 0.5;
    }
}

@keyframes matrixFlicker {

    0%,
    100% {
        opacity: 1;
        text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
    }

    50% {
        opacity: 0.7;
        text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    }
}