/**
 * Carousel Styles
 * 
 * Standalone CSS for carousel block functionality
 * Completely separate from existing CSS files
 * 
 * @package BlackFriday_Promotions
 * @since 1.0.0
 */

/* Carousel Container */
.blackfriday-carousel-container {
    position: relative;
    margin: 0;
    padding: 2.5rem 0 6rem 3rem;
}

.blackfriday-carousel-scroll-cue {
    display: flex;
    justify-content: center;
    margin: 0 0 0.75rem;
    color: #B08F57;
}

.blackfriday-carousel-bg-black .blackfriday-carousel-scroll-cue {
    color: #FFCF7E;
}

.blackfriday-carousel-scroll-cue svg {
    width: 28px;
    height: 28px;
    animation: blackfriday-carousel-breathe 1.8s ease-in-out infinite;
}

@keyframes blackfriday-carousel-breathe {
    0%,
    100% {
        transform: translateY(0);
        opacity: 0.45;
    }

    50% {
        transform: translateY(8px);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .blackfriday-carousel-scroll-cue svg {
        animation: none;
    }
}

/* Carousel Background Colors */
.blackfriday-carousel-bg-white {
    background-color: #ffffff;
}

.blackfriday-carousel-bg-black {
    background-color: #000000;
    color: #ffffff;
}

.blackfriday-carousel-bg-black .blackfriday-carousel-title {
    color: #FFCF7E;
}

.blackfriday-carousel-bg-black .blackfriday-carousel-description {
    color: #ffffff;
}

/* Carousel Wrapper */
.blackfriday-carousel-wrapper {
    position: relative;
    padding-top: 0;
}

/* Carousel Top Section */
.blackfriday-carousel-top-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
}

/* Layout variations for top section */
.blackfriday-carousel-top-section.has-both {
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 0.5rem;
}

.blackfriday-carousel-top-section.title-only {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.blackfriday-carousel-top-section.description-only {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Carousel Header */
.blackfriday-carousel-header {
    flex: 1;
}

.blackfriday-carousel-top-section.has-both .blackfriday-carousel-header,
.blackfriday-carousel-top-section.description-only .blackfriday-carousel-header {
    text-align: center;
    width: 100%;
}

.blackfriday-carousel-top-section.title-only .blackfriday-carousel-header {
    text-align: left;
}

.blackfriday-carousel-title {

    color: #B08F57;
    margin-bottom: 0.5rem;


    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    line-height: 120%;
    text-transform: uppercase;
}

.blackfriday-carousel-top-section.title-only .blackfriday-carousel-title {
    margin: 0 !important;
}

.blackfriday-carousel-description {

    color: #384B54;
    max-width: 600px;
    margin: 0 auto;
    font-family: Sweet Sans, Work Sans, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif;

    font-size: 36px;
    font-style: normal;
    font-weight: 500;
    line-height: 115%;
    letter-spacing: 0.72px;
    text-transform: uppercase;
}

/* Category Filters */
.blackfriday-carousel-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.blackfriday-carousel-filter-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    color: #495057;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.blackfriday-carousel-filter-btn:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    color: #343a40;
}

.blackfriday-carousel-filter-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

/* Swiper Carousel */
.blackfriday-carousel {
    position: relative;
    overflow: hidden;
}

.blackfriday-carousel .swiper-wrapper {
    display: flex;
    align-items: stretch;
}

.blackfriday-carousel .swiper-slide {
    height: auto;
    display: flex;
    flex-direction: column;
    width: 22.2%; /* 100% / 4.5 ≈ 22.2% for 4.5 card layout */
}

/* Navigation */
.swiper-navigation {
    position: relative;
    z-index: 10;
    display: none; /* Hidden by default, shown by JavaScript on desktop */
    gap: 10px;
    flex-direction: row;
    align-items: center;
    margin-bottom: 0;
}

/* When navigation is shown, ensure it displays as flex */
.swiper-navigation.show {
    display: flex !important;
}

/* Navigation layout variations */
.blackfriday-carousel-top-section.has-both .swiper-navigation {
    margin-top: 1rem;
    justify-content: center;
}

.blackfriday-carousel-top-section.title-only .swiper-navigation {
    justify-content: flex-end;
    margin-right: 3rem;
}

.blackfriday-carousel-top-section.description-only .swiper-navigation {
    margin-top: 1rem;
    justify-content: center;
}

.swiper-button-prev,
.swiper-button-next {
    position: relative;
    top: auto;
    transform: none;
    width: 80px;
    height: 40px;
    background: transparent;
    border: 1px solid #666;
    border-radius: 20px;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    margin: 0;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    background: transparent;
    border-color: #333;
    color: #333;
    box-shadow: none;
}

.swiper-button-prev {
    left: auto;
}

.swiper-button-next {
    right: auto;
}

/* Hide original Swiper arrows */
.swiper-button-prev:after,
.swiper-button-next:after {
    display: none;
}

/* Custom SVG arrows */
.swiper-button-prev .icon,
.swiper-button-next .icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.swiper-button-prev .swiper-arrow-left {
    transform: rotate(180deg);
}

.swiper-button-next .swiper-arrow-right {
    transform: rotate(0deg);
}

/* Swiper button styles for different backgrounds */
.blackfriday-carousel-bg-white .swiper-button-prev,
.blackfriday-carousel-bg-white .swiper-button-next {
    border-color: #666;
    color: #666;
}

.blackfriday-carousel-bg-white .swiper-button-prev:hover,
.blackfriday-carousel-bg-white .swiper-button-next:hover {
    border-color: #333;
    color: #333;
}

.blackfriday-carousel-bg-black .swiper-button-prev,
.blackfriday-carousel-bg-black .swiper-button-next {
    border-color: #ffffff;
    color: #ffffff;
}

.blackfriday-carousel-bg-black .swiper-button-prev:hover,
.blackfriday-carousel-bg-black .swiper-button-next:hover {
    border-color: #ffffff;
    color: #ffffff;
    opacity: 0.8;
}

/* Product Cards */
.blackfriday-carousel-product-card {
    background: #f8f9fa;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blackfriday-carousel-product-card:hover {
    transform: translateY(-4px);
    box-shadow: none;
}

.blackfriday-carousel-image-wrapper {
    position: relative;
    overflow: hidden;
}

.blackfriday-carousel-product-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #f8f9fa;
}

.blackfriday-carousel-product-content {
    padding: 0.75rem 1rem 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.blackfriday-carousel-product-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.4rem 0;
    line-height: 1.4;
}

.blackfriday-carousel-product-content-text {
    font-size: 0.9rem;
    color: #666;
    line-height: 125%;
}

.blackfriday-carousel-product-content-text p {
    margin: 0;
    line-height: 125%;
}

.blackfriday-carousel-product-validity {
    margin-bottom: 0.25rem;
}

.blackfriday-carousel-product-tags {
    margin-bottom: 0.5rem;
}

.blackfriday-carousel-product-validity .validity-period {
    color: #666;
    padding: 0;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

.blackfriday-carousel-product-price {
    margin-top: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.blackfriday-carousel-price-current {
    font-size: 1.5rem;
    font-weight: 400;
    color: #dc3545;
    margin: 0;
    font-family: Sweet Sans, Work Sans, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif;

}

.blackfriday-carousel-price-original {
    font-size: 0.875rem;
    color: #6c757d;
    text-decoration: line-through;
    margin: 0;
    font-family: Sweet Sans, Work Sans, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    font-weight: 400;
    letter-spacing: 0.7px;
}

.blackfriday-carousel-discount {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #e30b20;
    color: white;
    padding: 8px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-family: Sweet Sans, Work Sans, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    
}

.blackfriday-carousel-product-actions {
    margin-top: 0;
    padding: 0;
}

.blackfriday-carousel-store-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #B08F57;
    color: white;
    padding: 0.5rem 0;
    border-radius: 0;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
    text-transform: uppercase;
}

.blackfriday-carousel-giftcard-icon {
    width: 1rem !important;
    height: 1rem !important;
    fill: currentColor;
    padding: 0 0 4px 0 !important;
}

.blackfriday-carousel-store-link:hover {
    background: #9a7a4a;
    color: white;
    text-decoration: none;
}

.blackfriday-carousel-store-link.sold-out {
    background: #6c757d;
    cursor: not-allowed;
}

.blackfriday-carousel-store-link.sold-out:hover {
    background: #6c757d;
}

/* Responsive Design */
@media (max-width: 1023px) and (min-width: 768px) {
    /* Tablet */
    .blackfriday-carousel .swiper-slide {
        width: calc(100% / 2.5); /* Show 2.5 cards on tablet */
    }
}

@media (max-width: 767px) {
    /* Mobile */
    .blackfriday-carousel .swiper-slide {
        width: calc(100% / 1.1); /* Show 1.1 cards on mobile */
    }
    
    .blackfriday-carousel-container {
        padding: 2rem 0 4rem 0.875rem;
    }
    
    .blackfriday-carousel-top-section.has-both {
        padding: 0 0.875rem 0 0;
    }

    .blackfriday-carousel-title {
        font-size: 0.9rem;
    }
    
    .blackfriday-carousel-description {
        font-size: 1.5rem;
    }
    
    .blackfriday-carousel-filters {
        gap: 0.25rem;
    }
    
    .blackfriday-carousel-filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .blackfriday-carousel-product-content {
        padding: 0.75rem 1rem 0;
    }
    
    .blackfriday-carousel-product-title {
        font-size: 1rem;
    }
    
    .blackfriday-carousel-price-current {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .blackfriday-carousel-container {
        padding: 2rem 0 4rem 0.875rem;
    }
    
    .blackfriday-carousel-top-section.has-both {
        padding: 0 0.875rem 0 0;
    }

    .blackfriday-carousel-title {
        font-size: 0.8rem;
    }
    
    .blackfriday-carousel-description {
        font-size: 1.3rem;
    }
    
    .blackfriday-carousel-product-content {
        padding: 0.75rem 0.75rem 0;
    }
}

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

.blackfriday-carousel-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

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

/* Empty State */
.blackfriday-carousel-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.blackfriday-carousel-empty h3 {
    margin-bottom: 0.5rem;
    color: #495057;
}

.blackfriday-carousel-empty p {
    margin-bottom: 0;
}
