/* Dancing Chef Elementor Widgets - Frontend Styles */

/* Recipe Products Used Widget */
.recipe-products-used {
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

/* Main layout container - CRITICAL for side-by-side layout */
.products-layout-container {
    display: flex !important;
    align-items: flex-start;
    gap: 30px;
    width: 100%;
    box-sizing: border-box;
    min-height: 120px; /* Ensure minimum height */
}

/* Content Alignment */
.recipe-products-used[style*="text-align: center"] .products-layout-container {
    justify-content: center;
}

.recipe-products-used[style*="text-align: right"] .products-layout-container {
    justify-content: flex-end;
}

.recipe-products-used[style*="text-align: center"] .products-text-section {
    text-align: center;
}

.recipe-products-used[style*="text-align: right"] .products-text-section {
    text-align: right;
}

/* Left side - Text section */
.products-text-section {
    flex: 1;
    min-width: 200px;
    max-width: 50%; /* Prevent text from taking too much space */
}

.recipe-pre-text {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.product-names-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-names-list .product-name {
    font-size: 1em;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
    margin: 0;
    padding: 4px 0;
}

/* Right side - Images section */
.products-images-section {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-start;
    position: relative;
    min-width: 150px;
}

.product-image {
    display: block;
    line-height: 0;
    transition: transform 0.3s ease, z-index 0.3s ease;
}

.product-image img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-image img:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* Card Tilt Effect CSS Variables */
.recipe-products-used[data-tilt-intensity="1"] { --tilt-degrees: 1deg; }
.recipe-products-used[data-tilt-intensity="2"] { --tilt-degrees: 2deg; }
.recipe-products-used[data-tilt-intensity="3"] { --tilt-degrees: 3deg; }
.recipe-products-used[data-tilt-intensity="4"] { --tilt-degrees: 4deg; }
.recipe-products-used[data-tilt-intensity="5"] { --tilt-degrees: 5deg; }
.recipe-products-used[data-tilt-intensity="6"] { --tilt-degrees: 6deg; }
.recipe-products-used[data-tilt-intensity="7"] { --tilt-degrees: 7deg; }
.recipe-products-used[data-tilt-intensity="8"] { --tilt-degrees: 8deg; }
.recipe-products-used[data-tilt-intensity="9"] { --tilt-degrees: 9deg; }
.recipe-products-used[data-tilt-intensity="10"] { --tilt-degrees: 10deg; }
.recipe-products-used[data-tilt-intensity="11"] { --tilt-degrees: 11deg; }
.recipe-products-used[data-tilt-intensity="12"] { --tilt-degrees: 12deg; }
.recipe-products-used[data-tilt-intensity="13"] { --tilt-degrees: 13deg; }
.recipe-products-used[data-tilt-intensity="14"] { --tilt-degrees: 14deg; }
.recipe-products-used[data-tilt-intensity="15"] { --tilt-degrees: 15deg; }
.recipe-products-used[data-tilt-intensity="16"] { --tilt-degrees: 16deg; }
.recipe-products-used[data-tilt-intensity="17"] { --tilt-degrees: 17deg; }
.recipe-products-used[data-tilt-intensity="18"] { --tilt-degrees: 18deg; }
.recipe-products-used[data-tilt-intensity="19"] { --tilt-degrees: 19deg; }
.recipe-products-used[data-tilt-intensity="20"] { --tilt-degrees: 20deg; }

/* Card Tilt Effect */
.recipe-products-used.card-tilt-enabled .products-images-section {
    position: relative;
    gap: 0px;
    min-width: 300px; /* Ensure enough space for overlapping cards */
    min-height: 180px;
    margin-left: 20px;
}

.recipe-products-used.card-tilt-enabled .product-image {
    position: absolute !important;
    transform-origin: bottom center;
    transition: all 0.4s ease;
}

/* Card positions - Creating solitaire fan effect */
.recipe-products-used.card-tilt-enabled .product-image[data-image-index="0"] {
    transform: rotate(calc(-2 * var(--tilt-degrees, 8deg)));
    left: 0px;
    top: 0px;
    z-index: 1;
}

.recipe-products-used.card-tilt-enabled .product-image[data-image-index="1"] {
    transform: rotate(calc(-1 * var(--tilt-degrees, 8deg)));
    left: 30px;
    top: -10px;
    z-index: 2;
}

.recipe-products-used.card-tilt-enabled .product-image[data-image-index="2"] {
    transform: rotate(0deg);
    left: 60px;
    top: -15px;
    z-index: 3;
}

.recipe-products-used.card-tilt-enabled .product-image[data-image-index="3"] {
    transform: rotate(calc(1 * var(--tilt-degrees, 8deg)));
    left: 90px;
    top: -10px;
    z-index: 4;
}

.recipe-products-used.card-tilt-enabled .product-image[data-image-index="4"] {
    transform: rotate(calc(2 * var(--tilt-degrees, 8deg)));
    left: 120px;
    top: 0px;
    z-index: 5;
}

.recipe-products-used.card-tilt-enabled .product-image[data-image-index="5"] {
    transform: rotate(calc(2.5 * var(--tilt-degrees, 8deg)));
    left: 150px;
    top: 10px;
    z-index: 6;
}

/* Hover effect for tilted cards */
.recipe-products-used.card-tilt-enabled .product-image:hover {
    transform: rotate(0deg) translateY(-10px) scale(1.1) !important;
    z-index: 100 !important;
}

.recipe-products-used.card-tilt-enabled .product-image:hover img {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
}

/* Layout variations */
.recipe-products-horizontal .products-layout-container {
    align-items: flex-start;
}

.recipe-products-vertical .products-layout-container {
    flex-direction: column;
    align-items: stretch;
}

.recipe-products-vertical .products-images-section {
    margin-top: 20px;
    justify-content: flex-start;
}

.recipe-products-grid .products-layout-container {
    flex-direction: column;
}

.recipe-products-grid .products-images-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
    width: 100%;
}

/* Disable tilt effect for grid layout */
.recipe-products-grid.card-tilt-enabled .product-image {
    position: static !important;
    transform: none !important;
    left: auto !important;
    top: auto !important;
}

.recipe-products-grid.card-tilt-enabled .products-images-section {
    gap: 20px;
    margin-left: 0;
    min-width: auto;
    min-height: auto;
}

/* Responsive Design */

@media (max-width: 1024px) {
    .dc-images-section {
        min-width: 40% !important;
        min-height: 115px !important;
    }

    .dc-text-section {
        min-width: 60% !important;
    }

    .dc-images-section a.dc-product-image:nth-child(2) {
        left: 20px !important;
    }

    .dc-images-section a.dc-product-image:nth-child(3) {
        left: 40px !important;
    }

    .dc-images-section a.dc-product-image:nth-child(4) {
        left: 60px !important;
    }
}

@media (max-width: 768px) {
    .products-layout-container {
        flex-direction: column !important;
        gap: 20px;
        min-height: auto;
    }
    
    .products-text-section {
        max-width: 100%;
    }
    
    .products-images-section {
        justify-content: center;
        margin-left: 0 !important;
    }
    
    /* Disable tilt effect on tablets and mobile */
    .recipe-products-used.card-tilt-enabled .product-image {
        position: static !important;
        transform: none !important;
        left: auto !important;
        top: auto !important;
        margin-left: 0 !important;
    }
    
    .recipe-products-used.card-tilt-enabled .products-images-section {
        gap: 15px;
        min-width: auto;
        min-height: auto;
        display: flex;
        flex-wrap: wrap;
    }
    
    .recipe-products-grid .products-images-section {
        grid-template-columns: 1fr;
    }

    .dc-layout-container {
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .recipe-pre-text {
        font-size: 1em;
        margin-bottom: 12px;
    }
    
    .product-names-list {
        gap: 6px;
    }
    
    .product-names-list .product-name {
        font-size: 0.9em;
    }
    
    .product-image img {
        border-radius: 6px;
    }
    
    .products-layout-container {
        gap: 15px;
    }
}

/* Widget Editor Specific */
.elementor-widget-recipe-products-used .recipe-products-used {
    position: relative;
}

/* Additional utility classes */
.recipe-products-used .no-products {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.recipe-products-used .loading {
    padding: 20px;
    text-align: center;
    color: #999;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .recipe-pre-text {
        color: #f0f0f0;
    }
    
    .product-names-list .product-name {
        color: #e0e0e0;
    }
    
    .product-image img {
        box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
    }
    
    .product-image img:hover {
        box-shadow: 0 4px 15px rgba(255, 255, 255, 0.15);
    }
    
    .recipe-products-used.card-tilt-enabled .product-image:hover img {
        box-shadow: 0 10px 30px rgba(255, 255, 255, 0.3) !important;
    }
}