/**
 * Flip Layout Styles for Product Display
 * 
 * This file contains styles specific to the flip layout.
 * The main wcps-styles.scss is loaded as default for all layouts.
 * 
 * @package Product_Display
 */

// Flip layout specific styles will be added here
// Currently empty - styles will be moved from wcps-styles.scss as needed

// Breakpoints
$breakpoint-xs: 480px;
$breakpoint-sm: 576px;
$breakpoint-md: 768px;
$breakpoint-lg: 992px;
$breakpoint-xl: 1200px;

/* ----------------Flip Style 1 layout------------- */
.wcps-container {
    background: var(--wcps-container-background, #ffffff3b);
    padding: var(--wcps-container-padding, 25px);
    margin: var(--wcps-container-margin, 0px);

    // Square flip box
    &.wcps-layout-flip-layout {
        margin: 30px 0;
        position: relative;
        width: 100%;

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

        // CTA Container - Grid Layout
        .wcps-cta-container {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: var(--wcps-grid-gap, 25px);
            // width: var(--wcps-grid-width, 100%);
            background: var(--wcps-container-background, #ffffff3b);
            padding: var(--wcps-container-padding, 25px);
            margin: var(--wcps-container-margin, 0px);

            // Responsive grid columns
            @media (max-width: 1200px) {
                grid-template-columns: repeat(3, minmax(0, 1fr));
                gap: 20px;
            }

            @media (max-width: 900px) {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

            @media (max-width: 600px) {
                grid-template-columns: 1fr;
                gap: 20px;
            }

            // No products message
            .wcps-no-products {
                grid-column: 1 / -1;
                text-align: center;
                padding: 40px 20px;
                color: var(--wcps-no-products-color, #666);
                font-size: var(--wcps-no-products-font-size, 16px);
            }
        }

        // CTA Item - Square Flip Box
        .wcps-cta-item {
            perspective: 1000px;
            height: 350px;
            position: relative;

            @media (max-width: 768px) {
                height: 320px;
            }

            @media (max-width: 600px) {
                height: 300px;
            }

            @media (max-width: 480px) {
                height: 280px;
            }

            @media (max-width: 360px) {
                height: 260px;
            }
        }

        // Flip Box Inner
        .wcps-cta-inner {
            position: relative;
            width: 100%;
            height: 100%;
            transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
            transform-style: preserve-3d;
            border-radius: var(--wcps-border-radius, 20px);
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);

            &:hover {
                transform: rotateY(180deg);
            }
        }

        // Front Face (Image)
        .wcps-cta-left {
            position: absolute;
            width: 100%;
            height: 100%;
            backface-visibility: hidden;
            border-radius: var(--wcps-border-radius, 20px);
            overflow: hidden;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

            .wcps-cta-image-link {
                display: block;
                width: 100%;
                height: 100%;
                position: relative;
            }

            .wcps-cta-image {
                width: 100%;
                height: 100%;
                object-fit: cover;
                display: block;
                transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
                filter: brightness(0.95) contrast(1.1);
            }

            // Overlay for better text visibility
            &::before {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
                z-index: 1;
            }

            // Front content overlay
            .wcps-cta-front-content {
                position: absolute;
                bottom: 0;
                left: 0;
                right: 0;
                padding: 25px;
                background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
                color: #fff;
                z-index: 2;

                .wcps-cta-title {
                    margin: 0 0 8px 0;
                    font-size: 20px;
                    font-weight: 800;
                    line-height: 1.2;
                    color: #fff;
                    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);

                    @media (max-width: 768px) {
                        font-size: 18px;
                    }
                }

                .wcps-cta-price {
                    font-size: 24px;
                    font-weight: 900;
                    color: #fff;
                    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);

                    @media (max-width: 768px) {
                        font-size: 20px;
                    }
                }
            }

            // Flip indicator
            .wcps-flip-indicator {
                position: absolute;
                top: 20px;
                right: 20px;
                width: 40px;
                height: 40px;
                background: rgba(255, 255, 255, 0.2);
                backdrop-filter: blur(10px);
                border-radius: 50%;
                display: flex;
                align-items: center;
                justify-content: center;
                color: #fff;
                font-size: 18px;
                z-index: 3;
                animation: bounce 2s infinite;

                @media (max-width: 768px) {
                    width: 35px;
                    height: 35px;
                    font-size: 16px;
                }
            }

            @keyframes bounce {

                0%,
                20%,
                50%,
                80%,
                100% {
                    transform: translateY(0);
                }

                40% {
                    transform: translateY(-10px);
                }

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

        // Back Face (Content)
        .wcps-cta-right {
            position: absolute;
            width: 100%;
            height: 100%;
            backface-visibility: hidden;
            transform: rotateY(180deg);
            border-radius: var(--wcps-border-radius, 20px);
            background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
            padding: 30px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;
            gap: 20px;
            border: 1px solid #e2e8f0;
            z-index: 10;
            pointer-events: auto;

            @media (max-width: 768px) {
                padding: 25px;
                gap: 15px;
            }

            @media (max-width: 480px) {
                padding: 20px;
                gap: 12px;
            }

            .wcps-cta-title a {
                margin: 0;
                font-size: 22px;
                font-weight: 800;
                line-height: 1.3;
                color: #1e293b;
                background: linear-gradient(135deg, #1e293b 0%, #667eea 100%);
                -webkit-background-clip: text;
                -webkit-text-fill-color: transparent;
                background-clip: text;

                @media (max-width: 768px) {
                    font-size: 19px;
                }

            }

            .wcps-cta-rating {
                display: flex;
                align-items: center;
                justify-content: center;
                gap: 8px;

                .star-rating {
                    font-size: 18px;
                    color: #fbbf24;
                }

                .rating-count {
                    font-size: 14px;
                    color: #64748b;
                    font-weight: 500;
                }
            }

            .wcps-cta-price {
                font-size: 28px;
                font-weight: 900;
                color: #1e293b;
                display: flex;
                align-items: center;
                justify-content: center;
                gap: 10px;
                flex-wrap: wrap;

                del {
                    font-size: 20px;
                    font-weight: 600;
                    color: #94a3b8;
                }

                @media (max-width: 768px) {
                    font-size: 24px;
                }
            }

            // Back Actions
            .wcps-cta-actions {
                display: flex;
                gap: 12px;
                width: 100%;
                justify-content: center;
                flex-wrap: wrap;

                .wcps-product-actions {
                    display: flex;
                    gap: 8px;

                    a {
                        display: inline-flex;
                        align-items: center;
                        justify-content: center;
                        width: 50px;
                        height: 50px;
                        border-radius: 15px;
                        background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
                        border: 2px solid #e2e8f0;
                        color: #475569;
                        text-decoration: none;
                        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                        position: relative;
                        z-index: 15;
                        pointer-events: auto;

                        &:hover {
                            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
                            border-color: #667eea;
                            color: #fff;
                            transform: translateY(-3px);
                            box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
                        }

                        .wcps-btn-icon i {
                            font-size: 18px;

                            @media (max-width: 768px) {
                                font-size: 16px;
                            }

                            @media (max-width: 480px) {
                                font-size: 15px;
                            }
                        }

                        @media (max-width: 768px) {
                            width: 45px;
                            height: 45px;
                            border-radius: 12px;
                        }

                        @media (max-width: 480px) {
                            width: 40px;
                            height: 40px;
                            border-radius: 10px;
                        }
                    }
                }

                @media (max-width: 480px) {
                    gap: 8px;
                }
            }

            .wcps-cta-add-to-cart {
                width: 100%;

                a {
                    width: 100%;
                    padding: 16px 24px;
                    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
                    color: #fff;
                    border: none;
                    border-radius: 15px;
                    font-size: 16px;
                    font-weight: 700;
                    text-transform: uppercase;
                    letter-spacing: 1px;
                    cursor: pointer;
                    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
                    text-decoration: none;
                    display: inline-flex;
                    align-items: center;
                    justify-content: center;
                    gap: 10px;
                    position: relative;
                    overflow: hidden;
                    z-index: 20;
                    pointer-events: auto;

                    &::before {
                        content: '';
                        position: absolute;
                        top: 0;
                        left: -100%;
                        width: 100%;
                        height: 100%;
                        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
                        transition: left 0.6s;
                    }

                    &:hover::before {
                        left: 100%;
                    }

                    &:hover {
                        background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
                        transform: translateY(-3px);
                        box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
                    }

                    @media (max-width: 768px) {
                        padding: 14px 20px;
                        font-size: 15px;
                        letter-spacing: 0.8px;
                    }

                    @media (max-width: 600px) {
                        padding: 12px 18px;
                        font-size: 14px;
                        letter-spacing: 0.6px;
                    }

                    @media (max-width: 480px) {
                        padding: 10px 16px;
                        font-size: 13px;
                        letter-spacing: 0.5px;
                        border-radius: 12px;
                    }

                    @media (max-width: 360px) {
                        padding: 8px 14px;
                        font-size: 12px;
                        letter-spacing: 0.4px;
                        border-radius: 10px;
                    }
                }
            }
        }
    }
}