/**
 * CTA Layout Styles for Product Display
 * 
 * This file contains styles specific to the CTA layout.
 * The main wcps-styles.scss is loaded as default for all layouts.
 * 
 * @package Product_Display
 */

// CTA 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;

/* --------------CTA Style Start -------------- */
/* -------------- Shared Base Styles for CTA Layouts -------------- */
.wcps-container {
    background: var(--wcps-container-background, #ffffff3b);
    padding: var(--wcps-container-padding, 25px);
    margin: var(--wcps-container-margin, 0px);

    // Common styles for traditional CTA layouts (1 & 2)
    &.wcps-layout-cta-layout,
    &.wcps-layout-cta-layout-2 {
        margin: 30px 0;
        position: relative;

        // CTA Container - Grid Layout
        .wcps-cta-container {
            display: grid;
            // grid-template-columns: repeat(2, minmax(0, 1fr));
            grid-template-columns: repeat(var(--wcps-columns, 2), minmax(0, 1fr));
            gap: var(--wcps-grid-gap, 20px);
            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));
            }

            @media (max-width: 900px) {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

            @media (max-width: 600px) {
                grid-template-columns: 1fr;
            }

            // 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
        .wcps-cta-item {
            border: var(--wcps-border-width, 1px) var(--wcps-border-style, solid) var(--wcps-border-color, #eee);
            border-radius: var(--wcps-border-radius, 12px);
            overflow: hidden;
            transition: all var(--wcps-hover-transition, 0.3s) cubic-bezier(0.4, 0, 0.2, 1);
            background: var(--wcps-cta-background, #fff);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);

            &:hover {
                transform: translateY(-3px);
                box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);

                .wcps-cta-actions-on-image {
                    opacity: 1;
                    visibility: visible;
                }
            }
        }

        // CTA Inner Container
        .wcps-cta-inner {
            display: flex;
            align-items: stretch;
            min-height: var(--wcps-cta-min-height, 200px);

            @media (max-width: 768px) {
                flex-direction: column;
            }
        }

        // Image Section (Base styles)
        .wcps-cta-left {
            position: relative;
            flex: 0 0 var(--wcps-cta-image-width, 40%);
            overflow: hidden;
            background: var(--wcps-cta-image-background, #f8f9fa);

            @media (max-width: 768px) {
                flex: none;
                height: 250px;
            }

            .wcps-cta-image-link {
                display: block;
                width: 100%;
                height: 100%;
                position: relative;
            }

            .wcps-cta-image {
                width: 100%;
                height: 100%;
                object-fit: var(--wcps-image-object-fit, cover);
                display: block;
                transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            }

            &:hover .wcps-cta-image {
                transform: scale(1.05);
            }

            // Shared action button styles (positioning is layout-specific)
            .wcps-cta-actions-on-image {
                position: absolute;
                opacity: 0;
                visibility: hidden;
                transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

                .wcps-product-actions {
                    display: flex;
                    gap: 8px;

                    a {
                        display: inline-flex;
                        align-items: center;
                        justify-content: center;
                        width: 40px;
                        height: 40px;
                        border-radius: 50%;
                        background: rgba(255, 255, 255, 0.95);
                        backdrop-filter: blur(15px);
                        border: 1px solid rgba(255, 255, 255, 0.3);
                        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
                        color: #333;
                        text-decoration: none;
                        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                        position: relative;

                        .wcps-btn-icon {
                            display: flex;
                            align-items: center;
                            justify-content: center;
                            z-index: 2;

                            i {
                                font-size: 16px;
                                color: #333;
                                transition: all 0.3s ease;
                            }
                        }

                        // Base tooltip styles (positioning is layout-specific)
                        .wcps-btn-cta {
                            position: absolute;
                            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
                            color: #fff;
                            padding: 6px 10px;
                            border-radius: 6px;
                            font-size: 11px;
                            font-weight: 500;
                            white-space: nowrap;
                            opacity: 0;
                            visibility: hidden;
                            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
                            z-index: 100;
                        }

                        &:hover {
                            transform: scale(1.1);
                            background: #fff;
                            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);

                            .wcps-btn-cta {
                                opacity: 1;
                                visibility: visible;
                            }

                            .wcps-btn-icon i {
                                color: #667eea;
                            }
                        }
                    }
                }
            }
        }


        // Sale Badge
        .wcps-product-badge {
            position: absolute;
            top: 15px;
            right: 15px;
            background: linear-gradient(135deg, #ff6b6b 0%, #ff8787 100%);
            color: #fff;
            padding: var(--wcps-badge-padding, 6px 12px);
            border-radius: var(--wcps-badge-radius, 20px);
            font-size: var(--wcps-badge-font-size, 12px);
            font-weight: var(--wcps-badge-font-weight, 600);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            box-shadow: 0 2px 10px rgba(255, 107, 107, 0.3);
            z-index: 10;
        }

        // Responsive adjustments
        @media (max-width: 480px) {
            .wcps-cta-container {
                gap: 15px;
            }

            .wcps-cta-right {
                padding: 15px;
                gap: 10px;
            }

            .wcps-cta-title {
                font-size: 16px;
            }

            .wcps-cta-price {
                font-size: 18px;
            }
        }
    }

    /* -------------- Layout 1: Image Left, Actions Bottom to Top -------------- */
    &.wcps-layout-cta-layout {
        .wcps-cta-actions-on-image {
            bottom: 15px;
            left: 15px;
            right: 15px;
            display: flex;
            justify-content: center;
            transform: translateY(20px);

            a .wcps-btn-cta {
                bottom: calc(100% + 10px);
                left: 50%;
                transform: translateX(-50%) translateY(5px);

                &::before {
                    content: '';
                    position: absolute;
                    top: 100%;
                    left: 50%;
                    transform: translateX(-50%);
                    width: 0;
                    height: 0;
                    border: 5px solid transparent;
                    border-top: 5px solid #667eea;
                }
            }

            a:hover .wcps-btn-cta {
                transform: translateX(-50%) translateY(0);
            }
        }

        .wcps-cta-item:hover .wcps-cta-actions-on-image {
            transform: translateY(0);
        }
    }

}