/* WooCommerce Product Carousel Widget Styles */

.woocommerce-product-carousel {
    position: relative;
    width: 100%;
    direction: rtl;
    text-align: right;
}

/* Header Section */
.product-carousel-header {
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}

.header-text {
    flex: 1;
    min-width: 200px;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: #333333;
    margin: 0 0 5px 0;
    line-height: 1.2;
}

.section-subtitle {
    font-size: 1rem;
    font-weight: 400;
    color: #666666;
    margin: 0;
    line-height: 1.4;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

/* Navigation Buttons */
.carousel-navigation {
    display: flex;
    gap: 8px;
}

.nav-button {
    width: 40px;
    height: 40px;
    background-color: #f5f5f5;
    border: none;
    border-radius: 4px;
    color: #333333;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-button:hover {
    background-color: #333333;
    color: #ffffff;
    transform: translateY(-1px);
}

.nav-button:active {
    transform: translateY(0);
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* View All Link */
.view-all-link {
    color: #333333;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.view-all-link:hover {
    color: #ff6b35;
    text-decoration: none;
}

/* Carousel Container */
.product-carousel-container {
    position: relative;
    overflow: hidden;
}

.product-carousel-container .swiper {
    width: 100%;
    height: auto;
    padding: 0;
}

.product-carousel-container .swiper-wrapper {
    align-items: stretch;
}

.product-carousel-container .swiper-slide {
    height: auto;
    display: flex;
}

/* Product Card */
.product-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 20px 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Product Image */
.product-image-container {
    position: relative;
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 8px;
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
    border-radius: 8px;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

/* Product Content */
.product-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Product Title */
.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333333;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.8em;
}

.product-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-title a:hover {
    color: #ff6b35;
    text-decoration: none;
}

/* Product Categories */
.product-categories {
    font-size: 0.85rem;
    color: #666666;
    margin: 0 0 12px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Product Price */
.product-price {
    margin: 0 0 15px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.current-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ff6b35;
    line-height: 1.2;
}

.regular-price {
	font-size: 0.9rem;
	color: #999999;
	text-decoration: line-through;
	line-height: 1.2;
	text-align: left;
}

/* Product Actions */
.product-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: auto;
}

.add-to-cart-button {
	width: 40px;
	height: 40px;
	background-color: #ff6b35;
	border: none;
	border-radius: 4px;
	color: #ffffff;
	font-size: 16px;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	overflow: hidden;
	box-shadow: 0px 4px 15px 0px #CC5732 !important;
	border: 2px solid;
	border-image-source: linear-gradient(233.15deg, #FFFFFF 4.87%, rgba(255, 255, 255, 0) 39.12%);
}

.add-to-cart-button:hover {
    background-color: #e55a2b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.3);
}

.add-to-cart-button:active {
    transform: translateY(0);
}

.add-to-cart-button.loading {
    pointer-events: none;
}

.add-to-cart-button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.add-to-cart-button.added {
    background-color: #28a745;
}

.add-to-cart-button.added::before {
    content: '✓';
    position: absolute;
    font-size: 18px;
    font-weight: bold;
}

/* Swiper Pagination */
.product-carousel-container .swiper-pagination {
    position: relative;
    margin-top: 20px;
    text-align: center;
}

.product-carousel-container .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #cccccc;
    opacity: 1;
    margin: 0 4px;
    transition: all 0.3s ease;
}

.product-carousel-container .swiper-pagination-bullet-active {
    background: #ff6b35;
    transform: scale(1.2);
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .section-title {
        font-size: 1.8rem;
    }
    
    .header-content {
        gap: 15px;
    }
    
    .product-image {
        height: 180px;
    }
}

@media (max-width: 992px) {
.header-content {
	align-items: center;
	gap: 20px;
}
    
    .header-controls {
        justify-content: space-between;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .product-card {
        padding: 18px 12px;
    }
    
    .product-image {
        height: 160px;
    }
    
    .product-title {
        font-size: 0.95rem;
    }
    
    .current-price {
        font-size: 1rem;
    }
.header-text {
	flex: 1;
	min-width: 100px;
}
.header-controls .view-all-link {
	display: none;
}
}

@media (max-width: 768px) {
    .product-carousel-header {
        margin-bottom: 25px;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .section-subtitle {
        font-size: 0.9rem;
    }
    
    .nav-button {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .carousel-navigation {
        gap: 6px;
    }
    
    .view-all-link {
        font-size: 0.85rem;
    }
    
    .product-card {
        padding: 15px 10px;
    }
    
    .product-image {
        height: 140px;
    }
    
    .product-title {
        font-size: 0.9rem;
        min-height: 2.6em;
    }
    
    .product-categories {
        font-size: 0.8rem;
    }
    
    .current-price {
        font-size: 0.95rem;
    }
    
    .regular-price {
        font-size: 0.85rem;
    }
    
    .add-to-cart-button {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.2rem;
    }
    
    .header-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .carousel-navigation {
        order: 2;
    }
    
    .view-all-link {
        order: 1;
    }
    
    .product-card {
        padding: 12px 8px;
    }
    
    .product-image {
        height: 120px;
    }
    
    .product-title {
        font-size: 0.85rem;
        min-height: 2.4em;
    }
    
    .product-categories {
        font-size: 0.75rem;
    }
    
    .current-price {
        font-size: 0.9rem;
    }
    
    .regular-price {
        font-size: 0.8rem;
    }
    
    .add-to-cart-button {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

/* RTL Support */
[dir="rtl"] .woocommerce-product-carousel {
    direction: rtl;
    text-align: right;
}
.card-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-direction: row-reverse;
	margin-top: 15px;
}

[dir="rtl"] .header-controls {
    flex-direction: row-reverse;
}

[dir="rtl"] .carousel-navigation {
    flex-direction: row-reverse;
}

[dir="rtl"] .product-actions {
    justify-content: flex-start;
}

/* LTR Support */
[dir="ltr"] .woocommerce-product-carousel {
    direction: ltr;
    text-align: left;
}

[dir="ltr"] .header-content {
    flex-direction: row;
}

[dir="ltr"] .header-controls {
    flex-direction: row;
}

[dir="ltr"] .carousel-navigation {
    flex-direction: row;
}

[dir="ltr"] .product-actions {
    justify-content: flex-end;
}

/* Animation Effects */
.product-card {
    animation: fadeInUp 0.6s ease-out;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus styles for accessibility */
.nav-button:focus,
.add-to-cart-button:focus,
.view-all-link:focus {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .product-card {
        border: 2px solid #000000;
    }
    
    .product-title,
    .product-categories,
    .current-price,
    .regular-price {
        color: #000000;
    }
    
    .nav-button,
    .add-to-cart-button {
        border: 2px solid #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .product-card,
    .product-image,
    .nav-button,
    .add-to-cart-button {
        animation: none;
        transition: none;
    }
    
    .product-card:hover {
        transform: none;
    }
    
    .product-card:hover .product-image {
        transform: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .product-card {
        background: #2a2a2a;
        color: #ffffff;
    }
    
    .section-title {
        color: #ffffff;
    }
    
    .section-subtitle {
        color: #cccccc;
    }
    
    .product-title {
        color: #ffffff;
    }
    
    .product-categories {
        color: #cccccc;
    }
    
    .nav-button {
        background-color: #444444;
        color: #ffffff;
    }
    
    .nav-button:hover {
        background-color: #666666;
    }
    
    .view-all-link {
        color: #ffffff;
    }
    
    .view-all-link:hover {
        color: #ff6b35;
    }
}

/* Print styles */
@media print {
    .product-carousel-header {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .nav-button,
    .add-to-cart-button,
    .swiper-pagination {
        display: none;
    }
    
    .product-card {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000000;
    }
    
    .product-card:hover {
        transform: none;
    }
}

/* WooCommerce Integration */
.woocommerce-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 20px 0;
}

.no-products {
    background: #d1ecf1;
    color: #0c5460;
    padding: 15px;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    margin: 20px 0;
    text-align: center;
}

/* Loading state */
.woocommerce-product-carousel.loading {
    opacity: 0.7;
    pointer-events: none;
}

.woocommerce-product-carousel.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}


