/**
 * Public CSS for You May Also Like plugin
 */

.ymal-section {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
    text-align: center;
}

.ymal-title {
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 50px;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Desktop Grid - Default 3 columns */
.ymal-desktop-grid {
    display: grid;
    gap: 40px;
    justify-items: center;
}

.ymal-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.ymal-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.ymal-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.ymal-columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

.ymal-columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* Product Card */
.ymal-product-card {
    max-width: 400px;
    width: 100%;
    background: #fff;
    text-align: center;
    transition: transform 0.3s ease;
}

.ymal-product-card:hover {
    transform: translateY(-5px);
}

.ymal-image-container {
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8f8f8;
    position: relative;
    border-radius: 0;
}

.ymal-product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease;
    padding: 20px;
}

.ymal-product-link {
    display: block;
    text-decoration: none;
}

.ymal-product-card:hover .ymal-product-image {
    transform: scale(1.02);
}

.ymal-product-info {
    padding: 25px 0 15px;
}

.ymal-product-name {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    line-height: 1.4;
    color: #333;
}

.ymal-product-name a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.ymal-product-name a:hover {
    color: #666;
}

.ymal-product-price {
    color: #333;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 1px;
}

/* Mobile Carousel - Hidden by default on desktop */
.ymal-mobile-carousel {
    display: none;
    position: relative;
    overflow: hidden;
}

.ymal-carousel-track {
    display: flex;
    transition: transform 0.3s ease;
    will-change: transform;
}

.ymal-carousel-slide {
    flex: 0 0 100%;
    min-width: 0;
    padding: 0 10px;
}

.ymal-carousel-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.ymal-carousel-prev,
.ymal-carousel-next {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ymal-carousel-prev:hover,
.ymal-carousel-next:hover {
    background: #f5f5f5;
    border-color: #999;
    transform: scale(1.05);
}

.ymal-carousel-prev:disabled,
.ymal-carousel-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.ymal-carousel-prev:disabled:hover,
.ymal-carousel-next:disabled:hover {
    background: #fff;
    border-color: #ddd;
    transform: none;
}

/* Error and No Products Messages */
.ymal-error,
.ymal-no-products {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .ymal-columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    .ymal-columns-5,
    .ymal-columns-6 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Mobile breakpoint - Hide desktop grid and show mobile carousel */
@media (max-width: 768px) {
    .ymal-section {
        margin: 40px auto;
        padding: 0 15px;
    }
    
    .ymal-title {
        font-size: 16px;
        margin-bottom: 30px;
        letter-spacing: 2px;
    }
    
    /* Hide desktop grid on mobile */
    .ymal-desktop-grid {
        display: none !important;
    }
    
    /* Show mobile carousel on mobile */
    .ymal-mobile-carousel {
        display: block;
    }
    
    .ymal-image-container {
        height: 280px;
    }
    
    .ymal-product-card {
        max-width: 280px;
        margin: 0 auto;
    }
    
    .ymal-product-info {
        padding: 15px 0;
    }
}

@media (max-width: 480px) {
    .ymal-section {
        padding: 0 10px;
    }
    
    .ymal-image-container {
        height: 250px;
    }
    
    .ymal-product-card {
        max-width: 250px;
    }
    
    .ymal-carousel-slide {
        padding: 0 5px;
    }
}