/**
 * WC Product Images Carousel Styles
 */

/* ==========================================================================
   Variables
   ========================================================================== */
:root {
    --wcpic-arrow-size: 36px;
    --wcpic-arrow-color: #333333;
    --wcpic-arrow-bg: #ffffff;
    --wcpic-arrow-hover-bg: #f5f5f5;
    --wcpic-dot-color: #cccccc;
    --wcpic-dot-active-color: #333333;
    --wcpic-spacing: 10px;
    --wcpic-transition: 0.2s ease;
}

/* ==========================================================================
   Hide Original Thumbnails
   ========================================================================== */
.wcpic-enabled .flex-control-thumbs.wcpic-original-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ==========================================================================
   Carousel Container
   ========================================================================== */
.wcpic-carousel {
    position: relative;
    width: 100%;
    margin-top: 10px;
}

.wcpic-swiper {
    width: 100%;
    overflow: hidden;
}

.wcpic-swiper .swiper-wrapper {
    display: flex;
    align-items: center;
}

.wcpic-swiper .swiper-slide {
    flex-shrink: 0;
    cursor: pointer;
    box-sizing: border-box;
}

.wcpic-swiper .swiper-slide img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: inherit;
    transition: opacity var(--wcpic-transition), transform var(--wcpic-transition);
}

.wcpic-swiper .swiper-slide:hover img {
    opacity: 0.8;
}

/* ==========================================================================
   Active Slide State
   ========================================================================== */
.wcpic-swiper .swiper-slide.wcpic-active img {
    opacity: 1;
    outline: 2px solid var(--wcpic-dot-active-color);
    outline-offset: 2px;
}

/* ==========================================================================
   Navigation Arrows - Base Styles
   ========================================================================== */
.wcpic-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    background-color: #ffffff;
    color: #333333;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease,
                transform 0.2s ease,
                box-shadow 0.2s ease;
}

.wcpic-nav-btn:hover {
    background-color: #f5f5f5;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.wcpic-nav-btn:focus {
    outline: 2px solid #333333;
    outline-offset: 2px;
}

.wcpic-nav-btn:disabled,
.wcpic-nav-btn.swiper-button-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

.wcpic-nav-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    flex-shrink: 0;
}

/* Icon font support (Font Awesome, etc.) */
.wcpic-nav-btn i {
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* SVG icon from Elementor library */
.wcpic-nav-btn .wcpic-svg-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* ==========================================================================
   Arrow Positions - Outside
   ========================================================================== */
.wcpic-arrows-outside {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.wcpic-arrows-outside .wcpic-swiper {
    flex: 1;
    min-width: 0;
    order: 2;
}

.wcpic-arrows-outside .wcpic-nav-prev {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    order: 1;
    flex-shrink: 0;
}

.wcpic-arrows-outside .wcpic-nav-next {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    order: 3;
    flex-shrink: 0;
}

/* Pagination below carousel when arrows are outside */
.wcpic-arrows-outside .wcpic-pagination {
    order: 4;
    flex-basis: 100%;
    margin-top: 2px;
}

/* ==========================================================================
   Arrow Positions - Inside
   ========================================================================== */
.wcpic-arrows-inside {
    display: block;
}

.wcpic-arrows-inside .wcpic-swiper {
    width: 100%;
}

.wcpic-arrows-inside .wcpic-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.wcpic-arrows-inside .wcpic-nav-prev {
    left: 8px;
}

.wcpic-arrows-inside .wcpic-nav-next {
    right: 8px;
}

.wcpic-arrows-inside .wcpic-nav-btn:hover {
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Arrow Styles - Default
   ========================================================================== */
.wcpic-arrow-style-default .wcpic-nav-btn,
.elementor-widget-woocommerce-product-images.wcpic-arrow-style-default .wcpic-nav-btn {
    border-radius: 4px;
}

/* ==========================================================================
   Arrow Styles - Minimal
   ========================================================================== */
.wcpic-arrow-style-minimal .wcpic-nav-btn,
.elementor-widget-woocommerce-product-images.wcpic-arrow-style-minimal .wcpic-nav-btn {
    background-color: transparent;
    border: none;
    box-shadow: none;
}

.wcpic-arrow-style-minimal .wcpic-nav-btn:hover,
.elementor-widget-woocommerce-product-images.wcpic-arrow-style-minimal .wcpic-nav-btn:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

.wcpic-arrow-style-minimal .wcpic-nav-btn svg,
.elementor-widget-woocommerce-product-images.wcpic-arrow-style-minimal .wcpic-nav-btn svg {
    width: 24px;
    height: 24px;
}

.wcpic-arrow-style-minimal .wcpic-nav-btn i,
.elementor-widget-woocommerce-product-images.wcpic-arrow-style-minimal .wcpic-nav-btn i {
    font-size: 24px;
}

/* ==========================================================================
   Arrow Styles - Rounded
   ========================================================================== */
.wcpic-arrow-style-rounded .wcpic-nav-btn,
.elementor-widget-woocommerce-product-images.wcpic-arrow-style-rounded .wcpic-nav-btn {
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.wcpic-arrow-style-rounded .wcpic-nav-btn:hover,
.elementor-widget-woocommerce-product-images.wcpic-arrow-style-rounded .wcpic-nav-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Fix transform for inside + rounded on hover */
.wcpic-arrows-inside.wcpic-arrow-style-rounded .wcpic-nav-btn:hover {
    transform: translateY(-50%) scale(1.05);
}

/* ==========================================================================
   Pagination Dots
   ========================================================================== */
.wcpic-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 0;
}

.wcpic-pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--wcpic-dot-color);
    opacity: 1;
    cursor: pointer;
    transition: background-color var(--wcpic-transition),
                transform var(--wcpic-transition);
}

.wcpic-pagination .swiper-pagination-bullet:hover {
    transform: scale(1.2);
}

.wcpic-pagination .swiper-pagination-bullet-active {
    background-color: var(--wcpic-dot-active-color);
}

/* ==========================================================================
   No Carousel Needed (few thumbnails)
   ========================================================================== */
.wcpic-no-carousel-needed .wcpic-nav-btn {
    display: none;
}

.wcpic-no-carousel-needed .wcpic-pagination {
    display: none;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
    .wcpic-carousel {
        margin-top: 8px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .wcpic-carousel {
        margin-top: 6px;
    }

    .wcpic-pagination .swiper-pagination-bullet {
        width: 6px;
        height: 6px;
    }

    .wcpic-pagination {
        gap: 6px;
        margin-top: 8px;
    }

    .wcpic-arrows-outside {
        gap: 6px;
    }
}

/* ==========================================================================
   Elementor Editor Specific
   ========================================================================== */
.elementor-editor-active .wcpic-carousel {
    pointer-events: auto;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .wcpic-swiper .swiper-slide img,
    .wcpic-nav-btn,
    .wcpic-pagination .swiper-pagination-bullet {
        transition: none;
    }
}

/* ==========================================================================
   RTL Support
   ========================================================================== */
[dir="rtl"] .wcpic-arrows-outside {
    flex-direction: row-reverse;
}

[dir="rtl"] .wcpic-arrows-inside .wcpic-nav-prev {
    right: 8px;
    left: auto;
}

[dir="rtl"] .wcpic-arrows-inside .wcpic-nav-next {
    left: 8px;
    right: auto;
}

[dir="rtl"] .wcpic-nav-prev svg {
    transform: scaleX(-1);
}

[dir="rtl"] .wcpic-nav-next svg {
    transform: scaleX(-1);
}

/* ==========================================================================
   High Contrast Mode Support
   ========================================================================== */
@media (forced-colors: active) {
    .wcpic-nav-btn {
        border: 2px solid currentColor;
    }

    .wcpic-swiper .swiper-slide.wcpic-active img {
        outline: 3px solid currentColor;
    }
}
