/**
 * 2007-2025 PrestaShop
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to http://www.prestashop.com for more information.
 *
 * @author   Forwix <contact@forwix.com>
 * @copyright 2025 DSIELAB
 * @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 * International Registered Trademark & Property of PrestaShop SA
*/


/* RecSync - Recomendaciones Inteligentes */

.recsync-widget {
    margin: 2rem 0;
    padding: 1.5rem 0;
}

.recsync-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
}

.recsync-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 2px;
}

/* Ensure compatibility with PrestaShop product styles */
.recsync-products .products {
    margin: 0;
}

/* Add more spacing between products */
.recsync-widget .product {
    margin-bottom: 2rem;
}

.recsync-widget .product:last-child {
    margin-bottom: 0;
}

/* Override any conflicting styles for products in RecSync widget */
.recsync-widget .product-miniature {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #fff;
    overflow: hidden;
}

.recsync-widget .product-miniature:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.recsync-widget .thumbnail-container {
    position: relative;
}

.recsync-widget .thumbnail-top {
    position: relative;
    overflow: hidden;
}

.recsync-widget .product-thumbnail img {
    transition: transform 0.3s ease;
}

.recsync-widget .product-miniature:hover .product-thumbnail img {
    transform: scale(1.05);
}

/* Additional RecSync-specific enhancements */
.recsync-widget .highlighted-informations {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.recsync-widget .product-miniature:hover .highlighted-informations {
    opacity: 1;
}

.recsync-widget .quick-view {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border: 1px solid white;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.recsync-widget .quick-view:hover {
    background: white;
    color: #333;
    text-decoration: none;
}

.recsync-widget .quick-view i {
    margin-right: 0.5rem;
}

/* Carousel Layout */
.recsync-carousel {
    position: relative;
    overflow: hidden;
    margin: 2rem 0;
    padding: 1.5rem 50px 0 50px;
    /* Space for navigation buttons, no bottom padding */
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.recsync-carousel-container {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    gap: 0.75rem;
}

.recsync-carousel .recsync-product {
    flex: 0 0 calc(25% - 0.5625rem);
    min-width: 250px;
    padding: 1rem 0.25rem;
}

/* Navigation Buttons - Configurable */
.recsync-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: none;
    outline: none;
}

.recsync-carousel-nav:hover {
    transform: translateY(-50%) scale(1.1);
    outline: none;
}

.recsync-carousel-nav:focus {
    outline: none;
    box-shadow: none;
}

.recsync-carousel-nav:active {
    transform: translateY(-50%) scale(0.95);
    outline: none;
    box-shadow: none;
}

.recsync-carousel-nav.prev {
    left: 15px;
}

.recsync-carousel-nav.next {
    right: 15px;
}

.recsync-carousel-nav::before {
    content: '';
    width: 12px;
    height: 12px;
    border: 3px solid #333;
    border-top: none;
    border-right: none;
    transition: border-color 0.3s ease;
}

.recsync-carousel-nav:hover::before {
    border-color: #007bff;
}

.recsync-carousel-nav.prev::before {
    transform: rotate(45deg);
    margin-left: 4px;
}

.recsync-carousel-nav.next::before {
    transform: rotate(225deg);
    margin-right: 4px;
}

/* Show arrows when enabled */
.recsync-carousel.show-arrows .recsync-carousel-nav {
    display: flex;
}

/* Show indicators when enabled */
.recsync-carousel.show-indicators .recsync-carousel-indicators {
    display: flex;
}

/* Carousel Indicators - Hidden by default */
.recsync-carousel-indicators {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 0 0 0.5rem 0;
}

.recsync-carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(0, 123, 255, 0.3);
    border: none;
    outline: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.recsync-carousel-indicator:hover {
    background: rgba(0, 123, 255, 0.6);
    outline: none;
}

.recsync-carousel-indicator:focus {
    outline: none;
    box-shadow: none;
}

.recsync-carousel-indicator:active {
    outline: none;
    box-shadow: none;
}

.recsync-carousel-indicator.active {
    background: #0056b3;
    outline: none;
    box-shadow: none;
}

/* Carousel Product Enhancements */
.recsync-carousel .recsync-product .product-miniature {
    margin-bottom: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.recsync-carousel .recsync-product .product-miniature:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Responsive Carousel */
@media (max-width: 1200px) {
    .recsync-carousel .recsync-product {
        flex: 0 0 calc(33.333% - 1rem);
        min-width: 220px;
    }
}

@media (max-width: 768px) {
    .recsync-carousel {
        padding: 0 40px;
    }

    .recsync-carousel .recsync-product {
        flex: 0 0 calc(50% - 0.75rem);
        min-width: 200px;
    }

    .recsync-carousel-nav {
        display: none;
    }
}

@media (max-width: 576px) {
    .recsync-carousel {
        padding: 0 35px;
        margin-top: 0.5rem;
    }

    .recsync-carousel-container {
        gap: 1rem;
        padding: 1rem 0;
    }

    .recsync-carousel .recsync-product {
        flex: 0 0 calc(100% - 0.5rem);
        min-width: 180px;
    }

    .recsync-carousel-nav {
        display: none;
    }
}

/* Loading State */
.recsync-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    color: #666;
}

.recsync-loading::after {
    content: '';
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Empty State */
.recsync-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.recsync-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Responsive Design - Enhanced for PrestaShop compatibility */
@media (max-width: 768px) {
    .recsync-widget {
        margin: 1rem 0;
        padding: 1rem 0;
    }

    .recsync-title {
        font-size: 1.25rem;
    }

    /* Ensure proper spacing on mobile */
    .recsync-widget .products {
        margin: 0 -0.5rem;
    }

    .recsync-widget .product {
        padding: 0 0.5rem;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 576px) {
    .recsync-widget {
        padding: 0.5rem 0;
    }

    .recsync-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    /* Enhanced mobile product spacing */
    .recsync-widget .products {
        margin: 0 -0.25rem;
    }

    .recsync-widget .product {
        padding: 0 0.25rem;
        margin-bottom: 1.25rem;
    }
}

/* Telemetry Tracking */
.recsync-telemetry-track {
    position: relative;
}

.recsync-telemetry-track::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
}

/* Animation for new products */
.recsync-product.new {
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Score indicator */
.recsync-score-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #666;
}

.recsync-score-stars {
    display: flex;
    gap: 1px;
}

.recsync-score-star {
    width: 8px;
    height: 8px;
    background: #ddd;
    border-radius: 50%;
}

.recsync-score-star.filled {
    background: #ffc107;
}

/* Fallback indicator */
.recsync-fallback-indicator {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(255, 193, 7, 0.9);
    color: #333;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    z-index: 2;
}