/**
 * Pictaffil Carousel CSS
 * This file contains styles for the frontend carousel display.
 */

/* Core carousel layout */
.pictaffil-frontend-carousel {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px;
    position: relative;
    background-color: #ffffff;
    color: #333333;
}

/* Width variations */
.pictaffil-width-25 { width: 25%; }
.pictaffil-width-33 { width: 33%; }
.pictaffil-width-50 { width: 50%; }
.pictaffil-width-66 { width: 66%; }
.pictaffil-width-75 { width: 75%; }
.pictaffil-width-100 { width: 100%; }

.pictaffil-carousel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.pictaffil-carousel-title {
    margin: 0 0 15px 0;
    padding: 0;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.3;
}

.pictaffil-title-small {
    font-size: 16px;
}

.pictaffil-title-medium {
    font-size: 18px;
}

.pictaffil-title-large {
    font-size: 22px;
}

.pictaffil-carousel-title.bold {
    font-weight: 700;
}

.pictaffil-carousel-subtitle {
    font-size: 14px;
    font-weight: normal;
    margin: 0 0 12px 0;
    padding: 0;
    color: #666;
    line-height: 1.4;
    opacity: 0.85;
}

.pictaffil-carousel-header.no-title {
    justify-content: flex-end;
    display: flex !important;
    margin-bottom: 5px;
}

/* Hide subtitle when not needed */
.pictaffil-frontend-carousel[data-show-subtitle="no"] .pictaffil-carousel-subtitle,
.pictaffil-hide-subtitle .pictaffil-carousel-subtitle {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Products container */
.pictaffil-saved-products-container {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 15px;
    padding: 10px 5px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    height: auto;
    min-height: 150px;
}

.pictaffil-saved-products-container::-webkit-scrollbar {
    display: none;
}

/* Product card styling */
.pictaffil-saved-product {
    flex: 0 0 auto;
    width: 220px;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 320px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pictaffil-saved-product:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Product image */
.pictaffil-product-image {
    position: relative;
    width: 100%;
    padding-bottom: 75%;
    height: 0;
    overflow: hidden;
    background-color: #f9f9f9;
}

.pictaffil-product-image a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pictaffil-product-image img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.pictaffil-product-image a:hover img {
    transform: scale(1.05);
}

/* Product details */
.pictaffil-product-details {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.pictaffil-product-info {
    margin-bottom: 10px;
}

.pictaffil-product-title {
    font-size: 14px; 
    line-height: 1.4;
    font-weight: 500;
    margin-bottom: 4px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2; /* Standard property fallback */
    -webkit-box-orient: vertical;
    box-orient: vertical; /* Standard property fallback */
    color: #333;
    height: auto;
}

.pictaffil-product-title a {
    color: inherit;
    text-decoration: none;
}

.pictaffil-product-title a:hover {
    color: #0066cc;
    text-decoration: underline;
}

.pictaffil-product-price {
    font-weight: 700;
    font-size: 15px;
    color: #d63031;
    margin-bottom: 6px;
}

.pictaffil-product-rating {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
}

.pictaffil-stars {
    color: #f39c12;
    letter-spacing: -1px;
    margin-right: 4px;
}

/* Product button */
.pictaffil-button-container {
    margin-top: auto;
    text-align: center;
}

.pictaffil-product-button {
    display: inline-block;
    width: 90% !important;
    max-width: 160px;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 4px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    margin: 0 auto !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    background-color: #4f46e5;
    color: white;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.2;
    width: auto;
    border: none;
}

.pictaffil-product-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    opacity: 0.95;
    text-decoration: none;
}

/* Carousel collapse button */
.pictaffil-frontend-carousel-collapse {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 0 5px;
    color: inherit;
    transition: transform 0.3s ease;
    background: transparent;
    padding: 2px 5px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.pictaffil-frontend-carousel-collapse:hover {
    opacity: 1;
}

.pictaffil-frontend-carousel.collapsed .pictaffil-saved-products-carousel {
    display: none;
}

.pictaffil-frontend-carousel.collapsed .pictaffil-frontend-carousel-collapse {
    transform: rotate(180deg);
}

/* Navigation buttons */
.pictaffil-carousel-nav {
    position: absolute;
    width: 30px;
    height: 30px;
    background: rgba(255,255,255,0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.pictaffil-carousel-prev {
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
}

.pictaffil-carousel-next {
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
}

/* Side carousel navigation */
.pictaffil-position-side .pictaffil-carousel-nav,
.pictaffil-position-side-left .pictaffil-carousel-nav {
    left: 50% !important;
    transform: translateX(-50%) !important;
    right: auto !important;
}

.pictaffil-position-side .pictaffil-carousel-prev,
.pictaffil-position-side-left .pictaffil-carousel-prev {
    top: 10px !important;
    bottom: auto !important;
}

.pictaffil-position-side .pictaffil-carousel-next,
.pictaffil-position-side-left .pictaffil-carousel-next {
    bottom: 10px !important;
    top: auto !important;
}

/* Position styles */
.pictaffil-position-top {
    margin-bottom: 20px !important;
    width: 100% !important;
}

.pictaffil-position-bottom {
    margin-top: 20px !important;
    width: 100% !important;
}

.pictaffil-position-side {
    float: right;
    margin-left: 20px;
    margin-bottom: 20px;
    max-width: 300px;
}

.pictaffil-position-side-left {
    float: left;
    margin-right: 20px;
    margin-bottom: 20px;
    max-width: 300px;
}

/* Clearfix for floated carousels */
.pictaffil-clearfix::after {
    content: "";
    clear: both;
    display: table;
}

/* Card style variations */
.pictaffil-style-minimal .pictaffil-saved-product {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    min-height: 230px !important;
    max-height: none !important;
    border-radius: 4px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
    border: 1px solid #eee !important;
    padding: 6px !important;
}

.pictaffil-style-minimal .pictaffil-product-image {
    min-height: 100px !important;
    max-height: 120px !important;
    padding-bottom: 60% !important;
}

.pictaffil-style-minimal .pictaffil-product-details {
    padding: 5px !important;
    gap: 3px !important;
}

.pictaffil-style-minimal .pictaffil-product-title {
    font-size: 12px !important;
    line-height: 1.2 !important;
    margin: 0 0 3px 0 !important;
    -webkit-line-clamp: 1 !important;
    line-clamp: 1 !important; /* Standard property fallback */
    max-height: 15px !important;
}

.pictaffil-style-minimal .pictaffil-product-price {
    font-size: 12px !important;
    margin-bottom: 3px !important;
}

.pictaffil-style-minimal .pictaffil-product-rating {
    margin-bottom: 5px !important;
    font-size: 10px !important;
}

.pictaffil-style-minimal .pictaffil-product-button {
    padding: 4px 8px !important;
    font-size: 11px !important;
    max-width: 120px !important;
}

/* Medium style */
.pictaffil-style-medium .pictaffil-saved-product {
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
    min-height: 250px !important;
    max-height: none !important;
}

.pictaffil-style-medium .pictaffil-product-image {
    min-height: 110px !important;
    max-height: 150px !important;
    padding-bottom: 70% !important;
}

.pictaffil-style-medium .pictaffil-product-details {
    padding: 8px !important;
    gap: 5px !important;
}

.pictaffil-style-medium .pictaffil-product-title {
    font-size: 13px !important;
    margin: 0 0 4px 0 !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important; /* Standard property fallback */
    max-height: 30px !important;
}

/* Normal style */
.pictaffil-style-normal .pictaffil-saved-product {
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
    min-height: 320px !important;
    max-height: none !important;
}

.pictaffil-style-normal .pictaffil-product-image {
    min-height: 140px !important;
    max-height: 180px !important;
    padding-bottom: 75% !important;
}

.pictaffil-style-normal .pictaffil-product-details {
    padding: 12px !important;
    gap: 6px !important;
}

/* Element visibility control */
.pictaffil-hide-buttons .pictaffil-button-container,
.pictaffil-frontend-carousel[data-show-buttons="no"] .pictaffil-button-container {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    clip: rect(0, 0, 0, 0) !important;
}

.pictaffil-hide-ratings .pictaffil-product-rating,
.pictaffil-frontend-carousel[data-show-ratings="no"] .pictaffil-product-rating {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.pictaffil-hide-prices .pictaffil-product-price,
.pictaffil-frontend-carousel[data-show-prices="no"] .pictaffil-product-price {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.pictaffil-hide-product-names .pictaffil-product-title,
.pictaffil-frontend-carousel[data-show-product-name="no"] .pictaffil-product-title {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.pictaffil-frontend-carousel[data-visible="no"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .pictaffil-mobile-hidden {
        display: none !important;
    }
    
    /* Reset side positions on mobile */
    .pictaffil-position-side, .pictaffil-position-side-left {
        float: none;
        margin: 20px 0;
        width: 100% !important;
        max-width: none;
    }
    
    /* Smaller carousel items on mobile */
    .pictaffil-saved-product {
        width: 160px !important;
        min-height: 260px !important;
    }
    
    /* Touch-friendly navigation */
    .pictaffil-carousel-nav {
        width: 40px !important;
        height: 40px !important;
        opacity: 0.9 !important;
        background: rgba(255,255,255,0.9) !important;
    }
    
    /* Better touch scrolling */
    .pictaffil-saved-products-container {
        -webkit-overflow-scrolling: touch !important;
        scroll-snap-type: x mandatory !important;
    }
    
    .pictaffil-saved-product {
        scroll-snap-align: start !important;
    }
    
    /* More mobile optimizations */
    .pictaffil-carousel-nav {
        width: 26px !important;
        height: 26px !important;
        background: rgba(255,255,255,0.7) !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.15) !important;
        opacity: 0.9 !important;
        top: 40% !important;
    }
    
    .pictaffil-carousel-prev {
        left: 2px !important;
    }
    
    .pictaffil-carousel-next {
        right: 2px !important;
    }
}

/* Small mobile phones */
@media (max-width: 480px) {
    .pictaffil-saved-product {
        width: 140px !important;
        min-height: 240px !important;
    }
    
    .pictaffil-product-title {
        font-size: 12px !important;
        -webkit-line-clamp: 2 !important;
    }
    
    .pictaffil-product-button {
        padding: 8px 6px !important;
        font-size: 12px !important;
    }
    
    .pictaffil-style-minimal .pictaffil-saved-product {
        width: 130px !important;
        min-height: 150px !important;
    }
    
    .pictaffil-style-medium .pictaffil-saved-product {
        width: 140px !important;
        min-height: 220px !important;
    }
}

/* Sticky carousel */
.pictaffil-sticky-active {
    position: fixed;
    top: 20px;
    z-index: 999;
}

/* Padding variations */
.pictaffil-padding-small { padding: 8px; }
.pictaffil-padding-medium { padding: 15px; }
.pictaffil-padding-large { padding: 20px; }

.pictaffil-saved-product .pictaffil-product-description {
    font-size: 12px;
    line-height: 1.5;
    color: #666;
    margin-bottom: 10px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3; /* Standard property fallback */
    -webkit-box-orient: vertical;
    box-orient: vertical; /* Standard property fallback */
}

.pictaffil-product-detail-card .pictaffil-product-description {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2; /* Standard property fallback */
    -webkit-box-orient: vertical;
    box-orient: vertical; /* Standard property fallback */
}

.pictaffil-card-description {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2; /* Standard property fallback */
    -webkit-box-orient: vertical;
    box-orient: vertical; /* Standard property fallback */
}