/* ============================================
   Product Carousel for Elementor — Styles
   ============================================ */

/* Carousel container */
.pce-carousel {
    position: relative;
    width: 100%;
    overflow: visible;
}

/* ---- Header: Heading + View All ---- */
.pce-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 20px;
}

.pce-heading {
    font-size: 24px;
    font-weight: 400;
    color: #666;
    margin: 0;
    line-height: 1.3;
}

.pce-view-all {
    display: inline-flex;
    align-items: center;
    padding: 10px 28px;
    border: 2px solid #222;
    color: #222;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
    transition: background 0.25s, color 0.25s;
    white-space: nowrap;
    flex-shrink: 0;
}

.pce-view-all:hover {
    background: #222;
    color: #fff;
}

.pce-track-wrapper {
    overflow: hidden;
    border-radius: 4px;
}

/* ============ Grid Layout ============ */
.pce-grid-wrap {
    width: 100%;
}

.pce-grid {
    display: grid;
    grid-template-columns: repeat(var(--pce-cols, 4), 1fr);
    gap: var(--pce-gap, 20px);
}

@media (max-width: 1024px) {
    .pce-grid {
        grid-template-columns: repeat(var(--pce-cols-tablet, 3), 1fr);
    }
}

@media (max-width: 767px) {
    .pce-grid {
        grid-template-columns: repeat(var(--pce-cols-mobile, 2), 1fr);
    }
}

/* Grid cards don't need fixed width — grid handles it */
.pce-grid .pce-card {
    width: auto !important;
    margin-right: 0 !important;
}

/* End card in grid fills the cell and has min-height */
.pce-grid .pce-end-card {
    min-height: 280px;
}

.pce-track {
    display: flex;
    gap: var(--pce-gap, 20px);
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* ---- Product Card ---- */
.pce-card {
    flex: 0 0 auto;
    box-sizing: border-box;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    /* Initial sizing before JS — uses CSS gap on track */
    width: calc((100% - var(--pce-gap, 20px) * 3) / 4);
}

@media (max-width: 1024px) {
    .pce-card { width: calc((100% - var(--pce-gap, 20px) * 2) / 3); }
}
@media (max-width: 767px) {
    .pce-card { width: calc((100% - var(--pce-gap, 20px)) / 2); }
}

.pce-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* Hide WooCommerce "View Cart" button that WC injects after AJAX add-to-cart */
.pce-card .added_to_cart,
.pce-card .wc-forward,
.pce-cart-btn-wrap .added_to_cart {
    display: none !important;
}

/* ---- Image Area ---- */
.pce-image-wrap {
    position: relative;
    overflow: hidden;
    border-radius: inherit;
    aspect-ratio: 1/1;
    background: #f0f0f0;
}

/* Skeleton shimmer while images load */
.pce-image-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: pce-shimmer 1.5s infinite;
    z-index: 1;
    transition: opacity 0.3s;
}

.pce-image-wrap.pce-loaded::before {
    opacity: 0;
    pointer-events: none;
}

@keyframes pce-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.pce-image-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.pce-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    display: block;
}

.pce-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.pce-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---- Badge (top-left) ---- */
.pce-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    border-radius: 20px;
    z-index: 3;
    letter-spacing: 0.02em;
    text-transform: capitalize;
    line-height: 1.3;
}

/* ---- Image Navigation (prev/next inside image) ---- */
.pce-img-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease, background 0.2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.pce-img-nav:hover {
    background: rgba(0, 0, 0, 0.7);
}

.pce-img-prev {
    left: 10px;
}

.pce-img-next {
    right: 10px;
}

.pce-image-wrap:hover .pce-img-nav {
    opacity: 1;
}

/* ---- Image Dots — only visible on hover ---- */
.pce-image-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.pce-image-wrap:hover .pce-image-dots {
    opacity: 1;
    pointer-events: auto;
}

.pce-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.pce-dot.active {
    background: #fff;
    transform: scale(1.3);
}

/* ---- Add to Cart Button (bottom-right of image) — hidden until hover ---- */
.pce-cart-btn-wrap {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 4;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.pce-image-wrap:hover .pce-cart-btn-wrap {
    opacity: 1;
    transform: translateY(0);
}

.pce-add-cart {
    display: flex;
    align-items: center;
    gap: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    cursor: pointer;
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-radius 0.3s, background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    padding: 0 10px;
    white-space: nowrap;
    color: #111;
}

.pce-add-cart svg {
    flex-shrink: 0;
}

.pce-cart-text {
    font-size: 13px;
    font-weight: 600;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s, margin 0.3s;
    margin-left: 0;
}

.pce-add-cart:hover {
    width: auto;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.pce-add-cart:hover .pce-cart-text {
    max-width: 120px;
    opacity: 1;
    margin-left: 8px;
}

.pce-add-cart.adding {
    pointer-events: none;
    opacity: 0.7;
}

.pce-add-cart.added {
    background: #10b981;
    color: #fff;
}

.pce-add-cart.added svg {
    stroke: #fff;
}

/* ---- Product Info ---- */
.pce-info {
    padding: 14px 4px 8px;
}

.pce-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #111;
    text-decoration: none;
    line-height: 1.4;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pce-title:hover {
    text-decoration: underline;
}

/* Rating */
.pce-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.pce-stars {
    display: flex;
    align-items: center;
    gap: 1px;
    line-height: 1;
}

.pce-stars svg {
    fill: #111;
}

.pce-review-count {
    font-size: 13px;
    color: #666;
}

/* Price */
.pce-price {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pce-price del {
    color: #999;
    font-weight: 400;
    font-size: 14px;
    text-decoration: line-through;
}

.pce-price ins {
    text-decoration: none;
    color: #16a34a;
}

/* ---- Carousel Navigation (bottom-right / bottom-center / sides) ---- */
.pce-nav {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.pce-nav--bottom-right {
    justify-content: flex-end;
}

.pce-nav--bottom-center {
    justify-content: center;
}

.pce-nav--sides {
    position: absolute;
    top: 35%;
    left: 0;
    right: 0;
    justify-content: space-between;
    margin-top: 0;
    padding: 0 4px;
    pointer-events: none;
}

.pce-nav--sides .pce-nav-btn {
    pointer-events: auto;
}

.pce-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.pce-nav-btn:hover {
    background: #d1d5db;
    transform: scale(1.05);
}

.pce-nav-btn:active {
    transform: scale(0.95);
}

.pce-nav-btn svg {
    fill: #111;
}

/* ---- End Card (View All) ---- */
.pce-end-card {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
    border-radius: 16px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.pce-end-card:hover {
    opacity: 0.85;
    transform: scale(0.98);
    box-shadow: none;
}

.pce-end-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.pce-end-card-text {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.pce-end-card-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.pce-end-card:hover .pce-end-card-arrow {
    transform: translateX(6px);
}

/* ---- Color Swatches ---- */
.pce-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.pce-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    padding: 0;
    outline: none;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
    position: relative;
}

.pce-swatch:hover {
    transform: scale(1.15);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1), 0 2px 6px rgba(0,0,0,0.15);
}

.pce-swatch.active {
    border-color: #111;
    transform: scale(1.1);
}

/* White swatch needs a visible border */
.pce-swatch[style*="background-color:#fff"],
.pce-swatch[style*="background-color: #fff"],
.pce-swatch[style*="background-color:#fffff"] {
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2);
}

/* ---- Promo/Ad Card ---- */
.pce-ad-card {
    position: relative;
    display: flex;
    text-decoration: none;
    color: inherit;
    border-radius: 16px;
    overflow: hidden;
    min-height: 280px;
    transition: transform 0.3s ease;
}

.pce-ad-card:hover {
    transform: scale(0.98);
    box-shadow: none;
}

.pce-ad-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
}

.pce-ad-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    padding: 24px;
    width: 100%;
    gap: 8px;
}

.pce-ad-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.pce-ad-text {
    font-size: 14px;
    margin: 0;
    opacity: 0.9;
    line-height: 1.5;
}

.pce-ad-btn {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
    transition: opacity 0.2s;
    align-self: flex-start;
}

.pce-ad-card:hover .pce-ad-btn {
    opacity: 0.9;
}

/* ---- Pagination ---- */
.pce-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.pce-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: inherit;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.pce-page-btn:hover {
    background: rgba(255,255,255,0.2);
}

.pce-page-btn.active {
    background: #fff;
    color: #000;
    font-weight: 700;
}

.pce-page-prev,
.pce-page-next {
    font-size: 20px;
    font-weight: 700;
}

.pce-load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 40px;
    border-radius: 10px;
    background: #fff;
    color: #000;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: opacity 0.2s, transform 0.2s;
}

.pce-load-more-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

/* ---- Responsive ---- */
@media (max-width: 767px) {
    .pce-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 16px;
    }

    .pce-heading {
        font-size: 18px;
    }

    .pce-view-all {
        padding: 8px 20px;
        font-size: 12px;
    }

    .pce-badge {
        top: 8px;
        left: 8px;
        padding: 4px 10px;
        font-size: 11px;
    }

    .pce-img-nav {
        width: 28px;
        height: 28px;
    }

    .pce-add-cart {
        width: 34px;
        height: 34px;
    }

    .pce-info {
        padding: 10px 2px 6px;
    }

    .pce-title {
        font-size: 13px;
    }

    .pce-price {
        font-size: 13px;
    }

    .pce-stars svg {
        width: 12px;
        height: 12px;
    }

    .pce-review-count {
        font-size: 11px;
    }

    .pce-nav {
        margin-top: 14px;
    }
}

/* ---- Touch/Drag ---- */
.pce-carousel.dragging .pce-track {
    transition: none;
}

.pce-carousel.dragging .pce-card {
    pointer-events: none;
}