/**
 * 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 */
}



/* New Css */ 
.pictaffil-frontend-carousel[data-show-ratings="no"] .pictaffil-product-rating,
.pictaffil-hide-ratings .pictaffil-product-rating {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.pictaffil-frontend-carousel[data-show-prices="no"] .pictaffil-product-price,
.pictaffil-hide-prices .pictaffil-product-price {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide product name when disabled - MUST OVERRIDE OTHER STYLES */
.pictaffil-frontend-carousel[data-show-product-name="no"] .pictaffil-product-title,
.pictaffil-hide-product-names .pictaffil-product-title {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure product cards display properly in carousel */
.pictaffil-saved-products-container {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 15px;
    padding: 10px 5px;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
    /* Allow height to adjust dynamically */
    height: auto;
    min-height: 150px;
}

/* Add specific styling for product container when height is set */
.pictaffil-frontend-carousel[style*="min-height"] .pictaffil-saved-products-container {
    height: auto;
    min-height: calc(100% - 60px); /* Adjust for header and padding */
}

.pictaffil-saved-products-container::-webkit-scrollbar {
    display: none;  /* Chrome, Safari, Opera */
}

.pictaffil-saved-product {
    flex: 0 0 auto;
    width: 220px; /* Standardized width for better proportions */
    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; /* Set minimum height to prevent layout shifts */
    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);
}

/* Improved image container with proper aspect ratio */
.pictaffil-product-image {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 aspect ratio */
    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);
}

/* Improved product details section */
.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;
    font-weight: 500;
    line-height: 1.3;
    margin: 0 0 8px 0;
    max-height: 36px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: #333;
}

.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;
}

/* Enhanced button styling */
.pictaffil-button-container {
    margin-top: auto;
    text-align: center;
}

.pictaffil-product-button {
    display: inline-block;
    width: 90% !important; /* Better proportion than exactly 50% */
    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;
}

.pictaffil-product-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    opacity: 0.95;
}

/* Collapse button styling */
.pictaffil-frontend-carousel-collapse {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 0 5px;
    color: inherit;
    transition: transform 0.3s ease;
}

.pictaffil-frontend-carousel.collapsed .pictaffil-saved-products-carousel {
    display: none;
}

.pictaffil-frontend-carousel.collapsed .pictaffil-frontend-carousel-collapse {
    transform: rotate(180deg);
}

/* Navigation buttons - general styling */
.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);
}

/* Horizontal carousel navigation positioning (default) */
.pictaffil-carousel-prev {
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
}

.pictaffil-carousel-next {
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
}

/* Side carousel navigation positioning - override the default positioning completely */
.pictaffil-position-side .pictaffil-carousel-nav,
.pictaffil-position-side-left .pictaffil-carousel-nav {
    left: 50% !important; /* Center horizontally */
    transform: translateX(-50%) !important; /* Center adjustment */
    right: auto !important; /* Override any right positioning */
}

.pictaffil-position-side .pictaffil-carousel-prev,
.pictaffil-position-side-left .pictaffil-carousel-prev {
    top: 10px !important; /* Position at the top with some padding */
    bottom: auto !important; /* Ensure it's not at the bottom */
}

.pictaffil-position-side .pictaffil-carousel-next,
.pictaffil-position-side-left .pictaffil-carousel-next {
    bottom: 10px !important; /* Position at the bottom with some padding */
    top: auto !important; /* Override the default top positioning */
}

/* Icons for vertical navigation */
.pictaffil-position-side .pictaffil-carousel-prev .dashicons,
.pictaffil-position-side-left .pictaffil-carousel-prev .dashicons {
    transform: rotate(0deg);
}

.pictaffil-position-side .pictaffil-carousel-next .dashicons,
.pictaffil-position-side-left .pictaffil-carousel-next .dashicons {
    transform: rotate(0deg);
}

.pictaffil-saved-products-carousel {
    position: relative;
    /* Remove fixed height to allow dynamic adjustment */
    height: auto;
}

/* 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;
}

/* Minimal style optimizations */
.pictaffil-style-minimal .pictaffil-saved-product {
    width: 150px; /* Smaller width for minimal style */
    border-radius: 4px; /* Less rounded corners */
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
    border: 1px solid #eee !important;
}

.pictaffil-style-minimal .pictaffil-product-image {
    min-height: 100px !important; /* Reduced minimum height for image */
    max-height: 120px !important; /* Reduced maximum height for image */
}

.pictaffil-style-minimal .pictaffil-product-details {
    padding: 5px !important;
    gap: 3px !important; /* Reduce spacing between elements */
}

.pictaffil-style-minimal .pictaffil-product-title {
    font-size: 12px !important;
    margin: 0 0 3px 0 !important;
    -webkit-line-clamp: 1 !important;
    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 optimizations */
.pictaffil-style-medium .pictaffil-saved-product {
    width: 180px !important; /* Medium width */
    min-height: 250px !important;
}

.pictaffil-style-medium .pictaffil-product-image {
    min-height: 110px !important; /* Medium minimum height */
    max-height: 150px !important; /* Medium maximum height */
}

.pictaffil-style-medium .pictaffil-product-details {
    padding: 8px !important;
    gap: 5px !important; /* Medium spacing */
}

.pictaffil-style-medium .pictaffil-product-title {
    font-size: 13px !important;
    margin: 0 0 4px 0 !important;
}

/* Ensure header is visible when title is shown */
.pictaffil-carousel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

/* Fix for collapse icon when title is hidden */
.pictaffil-carousel-header.no-title {
    justify-content: flex-end;
    display: flex !important; /* Always show the header for collapse button */
}

.pictaffil-carousel-title {
    margin: 0;
    padding: 0;
}

/* Clearfix for floated carousels */
.pictaffil-clearfix::after {
    content: "";
    clear: both;
    display: table;
}

/* Sticky carousel styles */
.pictaffil-sticky-active {
    position: fixed;
    top: 20px;
    z-index: 999;
}

/* Hide on mobile if setting enabled */
@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;
    }
}

/* Hide buttons, ratings, and prices when disabled - FIXED */
.pictaffil-frontend-carousel[data-show-buttons="no"] .pictaffil-button-container,
.pictaffil-hide-buttons .pictaffil-button-container {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Hide buttons with proper spacing adjustment */
.pictaffil-frontend-carousel[data-show-buttons="no"] .pictaffil-button-container,
.pictaffil-hide-buttons .pictaffil-button-container {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
}

/* Adjust product details when buttons are hidden */
.pictaffil-frontend-carousel[data-show-buttons="no"] .pictaffil-product-details,
.pictaffil-hide-buttons .pictaffil-product-details {
    padding-bottom: 8px !important;
    justify-content: flex-start !important;
}

/* Ensure product info takes full height when buttons are hidden */
.pictaffil-frontend-carousel[data-show-buttons="no"] .pictaffil-product-info,
.pictaffil-hide-buttons .pictaffil-product-info {
    margin-bottom: 0 !important;
    flex-grow: 1 !important;
}

.pictaffil-frontend-carousel[data-show-ratings="no"] .pictaffil-product-rating,
.pictaffil-hide-ratings .pictaffil-product-rating {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

.pictaffil-frontend-carousel[data-show-prices="no"] .pictaffil-product-price,
.pictaffil-hide-prices .pictaffil-product-price {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Hide product name when disabled - FIXED */
.pictaffil-frontend-carousel[data-show-product-name="no"] .pictaffil-product-title,
.pictaffil-hide-product-names .pictaffil-product-title {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Hide entire carousel when visibility is set to hidden */
.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;
}

/* Adjust spacing when elements are hidden */
.pictaffil-frontend-carousel[data-show-buttons="no"] .pictaffil-product-details {
    padding-bottom: 5px;
}

.pictaffil-frontend-carousel[data-show-ratings="no"][data-show-prices="no"] .pictaffil-product-title {
    margin-bottom: 0;
}

/* Amazon button sizing - reduce to half width */
.pictaffil-product-button {
    width: 50% !important;
    margin: 0 auto !important;
}

/* Fix for button positioning in bottom carousel */
.pictaffil-frontend-carousel[data-position="bottom"] .pictaffil-button-container {
    margin-top: 5px;
    width: 100%;
    text-align: center;
    position: absolute;
    bottom: 8px;
    left: 0;
    width: 100%;
}

/* Add CSS classes to enforce visibility settings */
.pictaffil-hide-buttons .pictaffil-button-container,
.pictaffil-hide-buttons .pictaffil-product-button {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.pictaffil-hide-ratings .pictaffil-product-rating,
.pictaffil-hide-ratings .pictaffil-stars {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.pictaffil-hide-prices .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 {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* Use more specific selectors for showing elements when enabled */
.pictaffil-frontend-carousel[data-show-product-name="yes"] .pictaffil-product-title {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
}

.pictaffil-frontend-carousel[data-show-prices="yes"] .pictaffil-product-price {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
}

.pictaffil-frontend-carousel[data-show-ratings="yes"] .pictaffil-product-rating {
    display: flex !important;
    visibility: visible !important;
    height: auto !important;
}

.pictaffil-frontend-carousel[data-show-buttons="yes"] .pictaffil-button-container {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
}

/* Apply styling for different card styles with high specificity and !important */
.pictaffil-frontend-carousel[data-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-frontend-carousel[data-style="minimal"] .pictaffil-product-image {
    min-height: 100px !important;
    max-height: 120px !important;
    padding-bottom: 60% !important;
}

.pictaffil-frontend-carousel[data-style="minimal"] .pictaffil-product-details {
    padding: 5px !important;
    gap: 3px !important;
}

.pictaffil-frontend-carousel[data-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;
    max-height: 15px !important;
}

.pictaffil-frontend-carousel[data-style="minimal"] .pictaffil-product-price {
    font-size: 12px !important;
    margin-bottom: 3px !important;
}

.pictaffil-frontend-carousel[data-style="minimal"] .pictaffil-product-rating {
    margin-bottom: 5px !important;
    font-size: 10px !important;
}

.pictaffil-frontend-carousel[data-style="minimal"] .pictaffil-product-button {
    padding: 4px 8px !important;
    font-size: 11px !important;
    max-width: 120px !important;
}

/* Medium style optimizations with !important to override other styles */
.pictaffil-frontend-carousel[data-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-frontend-carousel[data-style="medium"] .pictaffil-product-image {
    min-height: 110px !important;
    max-height: 150px !important;
    padding-bottom: 70% !important;
}

.pictaffil-frontend-carousel[data-style="medium"] .pictaffil-product-details {
    padding: 8px !important;
    gap: 5px !important;
}

.pictaffil-frontend-carousel[data-style="medium"] .pictaffil-product-title {
    font-size: 13px !important;
    margin: 0 0 4px 0 !important;
    -webkit-line-clamp: 2 !important;
    max-height: 30px !important;
}

.pictaffil-frontend-carousel[data-style="medium"] .pictaffil-product-price {
    font-size: 14px !important;
    margin-bottom: 4px !important;
}

.pictaffil-frontend-carousel[data-style="medium"] .pictaffil-product-rating {
    margin-bottom: 6px !important;
    font-size: 12px !important;
}

.pictaffil-frontend-carousel[data-style="medium"] .pictaffil-product-button {
    padding: 6px 10px !important;
    font-size: 12px !important;
    max-width: 140px !important;
}

/* Normal style with strong specificity to ensure it applies */
.pictaffil-frontend-carousel[data-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-frontend-carousel[data-style="normal"] .pictaffil-product-image {
    min-height: 140px !important;
    max-height: 180px !important;
    padding-bottom: 75% !important;
}

.pictaffil-frontend-carousel[data-style="normal"] .pictaffil-product-details {
    padding: 12px !important;
    gap: 6px !important;
}

.pictaffil-frontend-carousel[data-style="normal"] .pictaffil-product-title {
    font-size: 14px !important;
    margin: 0 0 8px 0 !important;
    -webkit-line-clamp: 2 !important;
    max-height: 36px !important;
}

/* Complete button space removal for all card styles */
.pictaffil-hide-buttons .pictaffil-saved-product,
.pictaffil-frontend-carousel[data-show-buttons="no"] .pictaffil-saved-product {
    padding-bottom: 8px !important;
    min-height: auto !important; /* Reduce the min-height to avoid extra space */
}

/* Force button container to be zero height and completely removed from layout */
.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;
}

/* Eliminate any margin/padding at the bottom of product details when buttons are hidden */
.pictaffil-hide-buttons .pictaffil-product-details,
.pictaffil-frontend-carousel[data-show-buttons="no"] .pictaffil-product-details {
    padding-bottom: 8px !important;
    margin-bottom: 0 !important;
}

/* Ensure product info expands to fill space without extra padding */
.pictaffil-hide-buttons .pictaffil-product-info,
.pictaffil-frontend-carousel[data-show-buttons="no"] .pictaffil-product-info {
    margin-bottom: 0 !important;
    flex-grow: 1 !important;
}

/* Fix for minimal style to adjust height when button is hidden */
.pictaffil-style-minimal.pictaffil-hide-buttons .pictaffil-saved-product,
.pictaffil-style-minimal[data-show-buttons="no"] .pictaffil-saved-product {
    min-height: 100px !important;
}

/* Fix for medium style to adjust height when button is hidden */
.pictaffil-style-medium.pictaffil-hide-buttons .pictaffil-saved-product,
.pictaffil-style-medium[data-show-buttons="no"] .pictaffil-saved-product {
    min-height: 200px !important;
}

@media (max-width: 767px) {
    /* Improved and smaller collapse icon for mobile - this will override the styles below */
    .pictaffil-frontend-carousel .pictaffil-frontend-carousel-collapse {
        padding: 4px !important;
        margin: 0 !important;
        width: 28px !important;
        height: 28px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background-color: rgba(0,0,0,0.05) !important;
        border-radius: 4px !important;
    }
    
    /* Make the collapse icon more visible but smaller */
    .pictaffil-frontend-carousel .pictaffil-frontend-carousel-collapse .dashicons {
        font-size: 16px !important;
        width: 16px !important;
        height: 16px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Reduce spacing in header for mobile */
    .pictaffil-carousel-header {
        padding: 4px !important;
        margin-bottom: 6px !important;
    }
    
    /* Commented out - these styles are overriding our fixes
    .pictaffil-frontend-carousel .pictaffil-frontend-carousel-collapse {
        padding: 8px !important;
        margin: 0 !important;
        width: 40px !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background-color: rgba(0,0,0,0.05) !important;
        border-radius: 4px !important;
    }
    
    .pictaffil-frontend-carousel .pictaffil-frontend-carousel-collapse .dashicons {
        font-size: 20px !important;
        width: 20px !important;
        height: 20px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .pictaffil-carousel-header {
        padding: 8px !important;
    }
    */
}

/* Mobile enhancements for side carousel navigation */
@media (max-width: 767px) {
    .pictaffil-position-side .pictaffil-carousel-nav,
    .pictaffil-position-side-left .pictaffil-carousel-nav {
        width: 40px !important;
        height: 30px !important;
        background: rgba(255, 255, 255, 0.9) !important;
    }
}

/* Mobile Responsiveness Enhancements */
@media (max-width: 767px) {
    /* Adjust carousel product cards for mobile */
    .pictaffil-saved-product {
        width: 160px !important; /* Smaller width for better fit on mobile */
        min-height: 260px !important; /* Reduce height on mobile */
    }
    
    /* Make product cards more touch-friendly */
    .pictaffil-product-details {
        padding: 8px !important;
    }
    
    /* Improve touch target sizes */
    .pictaffil-product-button {
        padding: 10px !important;
        width: 90% !important; /* Wider button for better touch target */
        font-size: 14px !important;
    }
    
    /* Enhance navigation buttons for touch */
    .pictaffil-carousel-nav {
        width: 40px !important;
        height: 40px !important;
        opacity: 0.9 !important;
        background: rgba(255,255,255,0.9) !important;
    }
    
    /* Larger navigation icons */
    .pictaffil-carousel-nav .dashicons {
        font-size: 22px !important;
        width: 22px !important;
        height: 22px !important;
    }
    
    /* Adjust container padding for better space usage */
    .pictaffil-saved-products-container {
        padding: 10px 0 !important;
        gap: 10px !important; /* Reduce gap between items on mobile */
    }
    
    /* Style specific adjustments for mobile */
    .pictaffil-frontend-carousel[data-style="minimal"] .pictaffil-saved-product {
        width: 140px !important;
        min-height: 220px !important;
    }
    
    .pictaffil-frontend-carousel[data-style="medium"] .pictaffil-saved-product {
        width: 150px !important;
        min-height: 240px !important;
    }
    
    .pictaffil-frontend-carousel[data-style="normal"] .pictaffil-saved-product {
        width: 160px !important;
        min-height: 260px !important;
    }
    
    /* Ensure carousel doesn't overflow screen */
    .pictaffil-frontend-carousel {
        max-width: 100% !important;
        width: 100% !important;
        padding: 10px !important;
        box-sizing: border-box !important;
    }

    /* Make image container smaller on mobile */
    .pictaffil-product-image {
        padding-bottom: 65% !important;
    }
    
    /* Increase side navigation buttons size */
    .pictaffil-side-nav-container .pictaffil-carousel-nav {
        width: 42px !important;
        height: 28px !important;
    }
    
    /* Optimize text for smaller screens */
    .pictaffil-product-title {
        font-size: 13px !important;
        line-height: 1.2 !important;
    }
    
    .pictaffil-product-price {
        font-size: 14px !important;
    }
    
    .pictaffil-product-rating {
        font-size: 12px !important;
    }
    
    /* Add better touch scrolling support */
    .pictaffil-saved-products-container {
        -webkit-overflow-scrolling: touch !important;
        scroll-snap-type: x mandatory !important;
    }
    
    .pictaffil-saved-product {
        scroll-snap-align: start !important;
    }
    
    /* Add visual scrollbar indicator */
    .pictaffil-scroll-indicator {
        display: flex !important;
        justify-content: center !important;
        margin-top: 8px !important;
    }
    
    .pictaffil-scroll-dot {
        width: 6px !important;
        height: 6px !important;
        border-radius: 50% !important;
        background: #ccc !important;
        margin: 0 3px !important;
    }
    
    .pictaffil-scroll-dot.active {
        background: #666 !important;
    }
}

/* Small mobile phones */
@media (max-width: 480px) {
    /* Even smaller cards for very small screens */
    .pictaffil-saved-product {
        width: 140px !important;
        min-height: 240px !important;
    }
    
    /* Further reduce font sizes */
    .pictaffil-product-title {
        font-size: 12px !important;
        -webkit-line-clamp: 2 !important;
    }
    
    .pictaffil-product-price {
        font-size: 13px !important;
    }
    
    /* Optimize button size */
    .pictaffil-product-button {
        padding: 8px 6px !important;
        font-size: 12px !important;
    }
    
    /* Adjust style-specific sizes for very small screens */
    .pictaffil-frontend-carousel[data-style="minimal"] .pictaffil-saved-product {
        width: 130px !important;
        min-height: 150px !important;
    }
    
    .pictaffil-frontend-carousel[data-style="medium"] .pictaffil-saved-product {
        width: 140px !important;
        min-height: 220px !important;
    }
    
    .pictaffil-frontend-carousel[data-style="normal"] .pictaffil-saved-product {
        width: 140px !important;
        min-height: 240px !important;
    }
}

/* Mobile-specific improvements */
@media (max-width: 767px) {
    /* Optimized smaller collapse icon for mobile */
    .pictaffil-frontend-carousel .pictaffil-frontend-carousel-collapse {
        padding: 3px !important;
        margin: 0 !important;
        width: 24px !important;
        height: 24px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background-color: rgba(0,0,0,0.05) !important;
        border-radius: 4px !important;
    }
    
    /* Smaller icon in collapse button */
    .pictaffil-frontend-carousel .pictaffil-frontend-carousel-collapse .dashicons {
        font-size: 14px !important;
        width: 14px !important;
        height: 14px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* More compact header spacing */
    .pictaffil-carousel-header {
        padding: 3px !important;
        margin-bottom: 4px !important;
    }
    
    /* Improved navigation buttons for mobile */
    .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; /* Position slightly higher to avoid finger blocking */
    }
    
    /* Make navigation icons smaller */
    .pictaffil-carousel-nav .dashicons {
        font-size: 16px !important;
        width: 16px !important;
        height: 16px !important;
    }
    
    /* Adjust prev/next positions */
    .pictaffil-carousel-prev {
        left: 2px !important;
    }
    
    .pictaffil-carousel-next {
        right: 2px !important;
    }
    
    /* Much more compact product cards with reduced height */
    .pictaffil-saved-product {
        width: 130px !important;
        min-height: 210px !important; /* Significantly reduced height */
        margin-bottom: 0 !important;
    }
    
    /* Optimize product details spacing */
    .pictaffil-product-details {
        padding: 4px !important;
    }
    
    /* Smaller title text */
    .pictaffil-product-title {
        font-size: 12px !important;
        line-height: 1.2 !important;
        margin: 0 0 3px 0 !important; /* Reduced bottom margin */
        max-height: 28px !important;
    }
    
    /* Smaller price text with reduced spacing */
    .pictaffil-product-price {
        font-size: 13px !important;
        margin-bottom: 2px !important; /* Reduced spacing under price */
    }
    
    /* Compact rating display */
    .pictaffil-product-rating {
        margin-bottom: 3px !important; /* Reduced spacing */
        font-size: 11px !important;
    }
    
    /* Optimize button size and position */
    .pictaffil-product-button {
        padding: 5px 6px !important;
        font-size: 12px !important;
        width: 85% !important;
        margin-top: 2px !important;
    }
    
    /* Product info bottom margin */
    .pictaffil-product-info {
        margin-bottom: 2px !important; /* Reduced bottom margin */
    }
    
    /* Reduce container padding */
    .pictaffil-saved-products-container {
        padding: 4px 2px !important;
        gap: 6px !important; /* Reduced gap between cards */
    }
    
    /* Reduce space in header and carousel container */
    .pictaffil-saved-products-carousel {
        margin-top: 2px !important;
    }
    
    /* Adjust carousel spacing */
    .pictaffil-frontend-carousel {
        padding: 6px !important;
    }

    /* Side position carousel improvements */
    .pictaffil-position-side,
    .pictaffil-position-side-left {
        margin: 8px 0 !important;
        width: 100% !important;
        max-width: none !important;
    }
    
    /* Style-specific optimizations with reduced heights */
    .pictaffil-frontend-carousel[data-style="minimal"] .pictaffil-saved-product {
        width: 115px !important;
        min-height: 160px !important; /* Reduced height */
    }
    
    .pictaffil-frontend-carousel[data-style="medium"] .pictaffil-saved-product {
        width: 125px !important;
        min-height: 190px !important; /* Reduced height */
    }
    
    .pictaffil-frontend-carousel[data-style="normal"] .pictaffil-saved-product {
        width: 130px !important;
        min-height: 210px !important; /* Reduced height */
    }
    
    /* Optimize image container height */
    .pictaffil-product-image {
        padding-bottom: 55% !important; /* Even shorter aspect ratio */
    }
}

/* Ultra-compact mobile optimizations */
@media (max-width: 767px) {
    /* Further optimize product cards for mobile with absolute minimum spacing */
    .pictaffil-saved-product {
        width: 125px !important; /* Reduced width */
        min-height: 150px !important; /* Further reduced height */
        margin: 0 !important;
        border-width: 1px !important;
        box-shadow: 0 1px 2px rgba(0,0,0,0.03) !important; /* Lighter shadow */
    }
    
    /* Optimize product details with minimum vertical spacing */
    .pictaffil-product-details {
        padding: 3px !important; /* Minimum padding */
        gap: 0 !important; /* Remove gap between elements */
    }
    
    /* Eliminate excess space between elements */
    .pictaffil-product-info {
        margin-bottom: 1px !important; /* Absolute minimum margin */
        line-height: 1 !important;
    }
    
    /* Tighter title with less wasted space */
    .pictaffil-product-title {
        font-size: 11px !important;
        line-height: 1.1 !important;
        margin: 0 0 1px 0 !important; /* Minimum margin */
        max-height: 24px !important;
        -webkit-line-clamp: 2 !important;
    }
    
    /* Ultra-compact price display */
    .pictaffil-product-price {
        font-size: 12px !important;
        margin: 0 0 1px 0 !important; /* Minimum margin */
        line-height: 1 !important;
    }
    
    /* Tighter rating display */
    .pictaffil-product-rating {
        margin: 0 0 1px 0 !important; /* Minimum margin */
        font-size: 10px !important;
        line-height: 1 !important;
    }
    
    /* Minimize margin and padding on button */
    .pictaffil-product-button {
        padding: 4px 5px !important; /* Smaller padding */
        font-size: 11px !important; /* Smaller font */
        margin-top: 1px !important; /* Minimum margin */
        line-height: 1 !important;
    }
    
    /* Tightest possible container spacing */
    .pictaffil-saved-products-container {
        padding: 2px 1px !important; /* Minimal padding */
        gap: 3px !important; /* Smaller gap between cards */
        min-height: 100px !important; /* Reduced min-height */
    }
    
    /* Minimize image container height */
    .pictaffil-product-image {
        padding-bottom: 52% !important; /* Shorter aspect ratio */
    }
    
    /* Optimize image padding */
    .pictaffil-product-image img {
        padding: 2px !important;
        max-width: 92% !important;
        max-height: 92% !important;
    }
    
    /* Adjust spacing for all style variants */
    .pictaffil-frontend-carousel[data-style="minimal"] .pictaffil-saved-product {
        width: 110px !important;
        min-height: 120px !important;
        padding: 1px !important;
    }
    
    .pictaffil-frontend-carousel[data-style="medium"] .pictaffil-saved-product {
        width: 120px !important;
        min-height: 175px !important;
    }
    
    .pictaffil-frontend-carousel[data-style="normal"] .pictaffil-saved-product {
        width: 125px !important;
        min-height: 195px !important;
    }
    
    /* Even tighter button styling */
    .pictaffil-product-button {
        width: 90% !important;
        height: 20px !important; /* Fixed height */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Remove excess padding from carousel container */
    .pictaffil-frontend-carousel {
        padding: 4px !important;
    }
    
    /* Reduce scroll indicator size and spacing */
    .pictaffil-scroll-indicator {
        margin-top: 3px !important;
        height: 6px !important;
    }
    
    .pictaffil-scroll-dot {
        width: 4px !important;
        height: 4px !important;
        margin: 0 2px !important;
    }
    
    /* Eliminate all margin from product info */
    .pictaffil-frontend-carousel[data-style="minimal"] .pictaffil-product-title,
    .pictaffil-frontend-carousel[data-style="minimal"] .pictaffil-product-price,
    .pictaffil-frontend-carousel[data-style="minimal"] .pictaffil-product-rating {
        margin: 0 0 1px 0 !important;
    }
    
    /* Adjust card content spacing based on displayed elements */
    .pictaffil-frontend-carousel[data-show-buttons="no"] .pictaffil-product-info,
    .pictaffil-hide-buttons .pictaffil-product-info {
        margin-bottom: 0 !important;
    }
    
    /* When anything is hidden, ensure no empty space is left */
    .pictaffil-frontend-carousel[data-show-ratings="no"] .pictaffil-product-price,
    .pictaffil-hide-ratings .pictaffil-product-price {
        margin-bottom: 0 !important;
    }
    
    .pictaffil-frontend-carousel[data-show-prices="no"] .pictaffil-product-title,
    .pictaffil-hide-prices .pictaffil-product-title {
        margin-bottom: 0 !important;
    }
    
    /* Optimize small screens even further */
    @media (max-width: 480px) {
        .pictaffil-saved-product {
            width: 110px !important;
            min-height: 175px !important;
        }
        
        .pictaffil-frontend-carousel[data-style="minimal"] .pictaffil-saved-product {
            width: 100px !important;
            min-height: 135px !important;
        }
        
        .pictaffil-frontend-carousel[data-style="medium"] .pictaffil-saved-product {
            width: 105px !important;
            min-height: 160px !important;
        }
        
        .pictaffil-frontend-carousel[data-style="normal"] .pictaffil-saved-product {
            width: 110px !important;
            min-height: 175px !important;
        }
        
        /* Absolute minimum padding for very small screens */
        .pictaffil-saved-products-container {
            gap: 3px !important;
        }
    }
}

/* Enhanced mobile collapse button for better touch response */
@media (max-width: 767px) {
    /* Simple arrow-only collapse button without background */
    .pictaffil-frontend-carousel .pictaffil-frontend-carousel-collapse {
        padding: 0 !important;
        margin: 0 !important;
        width: auto !important;
        height: auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background-color: transparent !important; /* Remove background */
        border-radius: 0 !important; /* Remove border radius */
        cursor: pointer !important;
        -webkit-tap-highlight-color: rgba(0,0,0,0) !important; /* Remove tap highlight */
        user-select: none !important; /* Prevent text selection during tapping */
        touch-action: manipulation !important; /* Optimize for touch */
        position: relative !important;
        z-index: 10 !important;
    }
    
    /* Make the icon more visible without any background */
    .pictaffil-frontend-carousel .pictaffil-frontend-carousel-collapse .dashicons {
        font-size: 20px !important;
        width: 20px !important;
        height: 20px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        transition: transform 0.3s ease !important;
        color: #555 !important; /* Slightly darker to be visible without background */
    }
    
    /* No background change on active state, just minor scale effect */
    .pictaffil-frontend-carousel .pictaffil-frontend-carousel-collapse:active {
        background-color: transparent !important;
        transform: scale(0.95) !important;
    }
    
    /* Only rotate the icon when collapsed, not the button itself */
    .pictaffil-frontend-carousel.collapsed .pictaffil-frontend-carousel-collapse .dashicons {
        transform: rotate(180deg) !important;
    }
    
    /* Ensure header maintains proper flex layout with title on left and icon on right */
    .pictaffil-carousel-header {
        padding: 5px !important;
        margin-bottom: 5px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important; /* Keep icon on right */
        min-height: 20px !important;
    }
}

/* Subtitle styles */
.pictaffil-carousel-subtitle {
    font-size: 13px;
    font-weight: normal;
    margin: 0 0 8px 0;
    padding: 0;
    color: #666;
    line-height: 1.4;
}

/* 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;
}

/* Ensure header layout works with subtitle */
.pictaffil-carousel-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    padding: 8px;
    margin-bottom: 10px;
}

.pictaffil-carousel-header .pictaffil-title-container {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
}

/* Collapse button positioning */
.pictaffil-frontend-carousel-collapse {
    position: absolute;
    right: 8px;
    top: 8px;
}