/* =============================================
   Webify Products Carousel – Frontend Styles
   ============================================= */

/* Carousel wrapper */
.webify-pc-carousel {
    position: relative;
    width: 100%;
}

/* Viewport – hides overflow */
.webify-pc-viewport {
    overflow: hidden;
    width: 100%;
}

/* Track – flex row holding the cards */
.webify-pc-track {
    display: flex;
    gap: 20px;
    transition: transform 0.4s ease;
    will-change: transform;
}

/* Individual product card */
.webify-pc-product {
    flex: 0 0 auto;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ── Equal height alignment ────────────────── */
.webify-pc-product-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* The add-to-cart is pushed to the bottom so all cards align */
.webify-pc-add-to-cart {
    margin-top: auto;
}

/* ── Product image ─────────────────────────── */
.webify-pc-product-image {
    position: relative;
    overflow: hidden;
    line-height: 0;
}

.webify-pc-product-image a {
    display: block;
}

.webify-pc-product-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* ── Sale badge ────────────────────────────── */
.webify-pc-sale-badge {
    position: absolute;
    z-index: 2;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
    background-color: #e44d26;
    border-radius: 3px;
    pointer-events: none;
}

/* Badge positions */
.webify-pc-badge-top-left {
    top: 8px;
    left: 8px;
}
.webify-pc-badge-top-right {
    top: 8px;
    right: 8px;
}
.webify-pc-badge-bottom-left {
    bottom: 8px;
    left: 8px;
}
.webify-pc-badge-bottom-right {
    bottom: 8px;
    right: 8px;
}

/* RTL badge overrides */
[dir="rtl"] .webify-pc-badge-top-left {
    left: auto;
    right: 8px;
}
[dir="rtl"] .webify-pc-badge-top-right {
    right: auto;
    left: 8px;
}
[dir="rtl"] .webify-pc-badge-bottom-left {
    left: auto;
    right: 8px;
}
[dir="rtl"] .webify-pc-badge-bottom-right {
    right: auto;
    left: 8px;
}

/* ── Product content ───────────────────────── */
.webify-pc-product-content {
    padding: 12px 0 0;
}

/* Title – flex-grow pushes price/swatches/button to a consistent position */
.webify-pc-product-title {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    flex-grow: 1;
}

.webify-pc-product-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

/* Rating */
.webify-pc-rating {
    margin-bottom: 6px;
    line-height: 1;
}

.webify-pc-rating .star-rating {
    display: inline-block;
    overflow: hidden;
    position: relative;
    height: 1em;
    width: 5.4em;
    font-family: star;
    font-size: 1em;
    line-height: 1;
}

/* Price */
.webify-pc-product-price {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
}

.webify-pc-product-price del {
    opacity: 0.5;
    margin-right: 4px;
}

[dir="rtl"] .webify-pc-product-price del {
    margin-right: 0;
    margin-left: 4px;
}

.webify-pc-product-price ins {
    text-decoration: none;
    font-weight: 600;
}

/* Color swatches */
.webify-pc-swatches {
    margin-bottom: 8px;
    line-height: 1;
}

.webify-pc-swatches .wvci-archive-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}

.webify-pc-swatches .wvci-swatch--color {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.webify-pc-swatches .wvci-swatch--color:hover,
.webify-pc-swatches .wvci-swatch--color.wvci-selected {
    border-color: #333;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.webify-pc-swatches .wvci-swatch--image {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #ddd;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.webify-pc-swatches .wvci-swatch--image:hover,
.webify-pc-swatches .wvci-swatch--image.wvci-selected {
    border-color: #333;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.webify-pc-swatches .wvci-swatch--image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Smooth image transition on swatch change */
.webify-pc-product-image img {
    transition: opacity 0.25s ease;
}

/* Add-to-cart */
.webify-pc-add-to-cart a,
.webify-pc-add-to-cart button {
    display: inline-block;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    border: none;
    border-radius: 4px;
    background-color: #333;
    color: #fff;
}

.webify-pc-add-to-cart a:hover,
.webify-pc-add-to-cart button:hover {
    opacity: 0.85;
}

/* ── Navigation arrows ─────────────────────── */
.webify-pc-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: #fff;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: background-color 0.2s, box-shadow 0.2s;
}

.webify-pc-arrow:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.webify-pc-arrow svg {
    width: 16px;
    height: 16px;
    fill: #333;
    pointer-events: none;
}

.webify-pc-arrow-prev {
    left: -20px;
}

.webify-pc-arrow-next {
    right: -20px;
}

/* RTL arrow positioning */
[dir="rtl"] .webify-pc-arrow-prev {
    left: auto;
    right: -20px;
}

[dir="rtl"] .webify-pc-arrow-next {
    right: auto;
    left: -20px;
}

/* RTL arrow icon rotation */
[dir="rtl"] .webify-pc-arrow svg {
    transform: scaleX(-1);
}

.webify-pc-arrow[disabled] {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

/* ── Touch / mobile: hide arrows ───────────── */
@media (max-width: 767px) {
    .webify-pc-arrow {
        display: none !important;
    }

    .webify-pc-viewport {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;        /* Firefox */
        -ms-overflow-style: none;     /* IE / Edge */
    }

    .webify-pc-viewport::-webkit-scrollbar {
        display: none;                /* Chrome / Safari */
    }

    .webify-pc-product {
        scroll-snap-align: start;
    }
}

/* ── Elementor editor placeholder ──────────── */
.elementor-editor-active .webify-pc-carousel {
    min-height: 200px;
}
