/* Vegas Product Widget — widget.css v2.0 (carousel + new UI) */

/* ── Carousel Wrapper ─────────────────────────────────────────────────── */
.vpw-carousel-outer {
    position: relative;
    direction: rtl;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}
.vpw-carousel-outer:active {
    cursor: grabbing;
}
/* while dragging, images shouldn't get selected/highlighted */
.vpw-carousel-track img {
    pointer-events: none;
    -webkit-user-drag: none;
    user-drag: none;
    draggable: false;
}

.vpw-carousel-track-wrap {
    overflow: hidden;
    width: 100%;
}

.vpw-carousel-track {
    display: flex;
    gap: 16px;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    align-items: stretch;
}

/* ── Grid fallback (when carousel is off) ─────────────────────────────── */
.vpw-grid {
    display: grid;
    grid-template-columns: repeat(var(--vpw-cols, 4), 1fr);
    gap: 16px;
    direction: rtl;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
}

/* prevent cards from ever escaping their column */
.vpw-grid .vpw-card,
.vpw-carousel-track .vpw-card {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
@media (max-width: 1024px) {
    .vpw-grid { grid-template-columns: repeat(var(--vpw-cols-t, 3), 1fr); }
}
@media (max-width: 767px) {
    .vpw-grid { grid-template-columns: repeat(var(--vpw-cols-m, 2), 1fr); }
}

/* ── Cards in carousel are fixed width ────────────────────────────────── */
.vpw-carousel-track .vpw-card {
    flex: 0 0 var(--vpw-slide-width, 280px);
    width: var(--vpw-slide-width, 280px);
}

/* ── Card ─────────────────────────────────────────────────────────────── */
.vpw-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow .25s ease, transform .25s ease;
    border: 1px solid #f0f0f0;
    font-family: 'IRANSans', Tahoma, sans-serif;
}
/* WooCommerce's own price markup (amount/currency spans + the <bdi> wrapper)
   ships its own font-family from the theme, which is why the price looked
   like a different font from the rest of the card. Force it to inherit
   the card's font instead. (Doesn't touch .vpw-title so the Typography
   control in Elementor still works normally.) */
.vpw-card .woocommerce-Price-amount,
.vpw-card .woocommerce-Price-currencySymbol,
.vpw-card .vpw-price-wrap bdi {
    font-family: inherit !important;
}
.vpw-card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,.1);
    transform: translateY(-3px);
}

/* on-sale border is now opt-in from Elementor (سوییچ "نمایش حاشیه روی محصولات تخفیف‌دار")
   — no border is applied here by default */

/* ── Image wrap ───────────────────────────────────────────────────────── */
.vpw-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4/5;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f5f5;
    border-radius: 16px 16px 0 0;
}
.vpw-img-link {
    position: absolute;
    inset: 0;
    display: block;
}
.vpw-main-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: opacity .3s ease, transform .5s ease;
}
.vpw-hover-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
}
.vpw-card:hover .vpw-main-img  { opacity: 0; }
.vpw-card:hover .vpw-hover-img { opacity: 1; }
.vpw-card:not(:has(.vpw-hover-img)):hover .vpw-main-img { opacity: 1; transform: scale(1.04); }

/* ── Dark overlay ─────────────────────────────────────────────────────── */
.vpw-overlay-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
        rgba(0,0,0,.55) 0%,
        rgba(0,0,0,.12) 40%,
        transparent     65%);
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
    z-index: 2;
}
.vpw-card:hover .vpw-overlay-gradient { opacity: 1; }

/* ── Badge — pill style like the photo ───────────────────────────────── */
.vpw-badge {
    position: absolute;
    top: 12px; right: 12px;
    z-index: 6;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 800;
    border-radius: 50px;
    line-height: 1.3;
    white-space: nowrap;
    letter-spacing: .3px;
}
.vpw-badge-sale { background: #e8173a; color: #fff; }
.vpw-badge-new  { background: #1a7c3e; color: #fff; }
.vpw-badge-oos  { background: #6b6b6b; color: #fff; }

/* ── Out of stock state ──────────────────────────────────────────────── */
.vpw-card.vpw-out-of-stock .vpw-main-img,
.vpw-card.vpw-out-of-stock .vpw-hover-img {
    opacity: .55;
    filter: grayscale(35%);
}

/* ── Wishlist ─────────────────────────────────────────────────────────── */
.vpw-wishlist {
    position: absolute;
    top: 12px; left: 12px;
    z-index: 6;
    background: rgba(255,255,255,.92);
    border: none; border-radius: 50%;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: #aaa;
    opacity: 0; transform: scale(.8);
    transition: opacity .25s, transform .25s, color .2s;
    backdrop-filter: blur(4px);
}
.vpw-card:hover .vpw-wishlist { opacity: 1; transform: scale(1); }
.vpw-wishlist:hover,
.vpw-wishlist.active           { color: #e8173a; }
.vpw-wishlist.active svg       { fill: #e8173a; stroke: #e8173a; }

/* ── Gallery thumbs ───────────────────────────────────────────────────── */
.vpw-gallery-thumbs {
    position: absolute;
    bottom: 58px; left: 0; right: 0;
    display: flex; gap: 5px;
    justify-content: center;
    padding: 0 10px;
    opacity: 0; transform: translateY(5px);
    transition: opacity .28s ease, transform .28s ease;
    z-index: 5;
}
.vpw-card:hover .vpw-gallery-thumbs { opacity: 1; transform: translateY(0); }

.vpw-thumb {
    width: 38px; height: 38px;
    border-radius: 6px; overflow: hidden;
    border: 2px solid rgba(255,255,255,.5);
    cursor: pointer; padding: 0;
    background: #ccc; flex-shrink: 0;
    transition: border-color .2s, transform .2s;
}
.vpw-thumb img {
    width: 100%; height: 100%;
    object-fit: cover; object-position: center top;
    display: block;
}
.vpw-thumb.active,
.vpw-thumb:hover { border-color: #fff; transform: scale(1.1); }

/* ── Color swatches ───────────────────────────────────────────────────── */
.vpw-swatches {
    position: absolute;
    bottom: 14px; left: 0; right: 0;
    display: flex; gap: 6px;
    justify-content: center; flex-wrap: wrap;
    padding: 0 12px;
    opacity: 0; transform: translateY(6px);
    transition: opacity .28s ease .05s, transform .28s ease .05s;
    z-index: 5;
}
.vpw-card:hover .vpw-swatches { opacity: 1; transform: translateY(0); }
.vpw-card:has(.vpw-gallery-thumbs) .vpw-swatches { bottom: 58px; }

.vpw-swatch {
    width: 24px; height: 24px;
    border-radius: 50%;
    overflow: hidden;
    border: 2.5px solid rgba(255,255,255,.8);
    box-shadow: 0 0 0 1px rgba(0,0,0,.2);
    cursor: pointer; padding: 0; outline: none;
    flex-shrink: 0; position: relative;
    transition: transform .2s, box-shadow .2s;
}
.vpw-swatch:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(26,124,62,.6);
}
.vpw-swatch.active {
    transform: scale(1.18);
    box-shadow: 0 0 0 2.5px #fff, 0 0 0 4.5px #1a7c3e;
}
.vpw-swatch.active::after {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='%23fff' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
        center/65% no-repeat;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.5));
}

/* ── Colour label ─────────────────────────────────────────────────────── */
.vpw-color-label {
    position: absolute;
    bottom: 42px; left: 0; right: 0;
    display: flex; align-items: center;
    justify-content: center; gap: 5px;
    opacity: 0;
    transition: opacity .25s ease .08s;
    z-index: 5; pointer-events: none;
}
.vpw-card:hover .vpw-color-label { opacity: 1; }
.vpw-card:has(.vpw-gallery-thumbs) .vpw-color-label { bottom: 106px; }

.vpw-color-label-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,.8);
    flex-shrink: 0;
}
.vpw-color-label-text {
    font-size: 11px; font-weight: 700;
    color: #fff;
    background: rgba(0,0,0,.45);
    padding: 2px 8px; border-radius: 20px;
    white-space: nowrap;
}

/* ── Add to cart — new button style matching photo ────────────────────── */
.vpw-atc-wrap {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 8px 10px 10px;
    opacity: 0; transform: translateY(6px);
    transition: opacity .28s ease, transform .28s ease;
    z-index: 5;
}
.vpw-card:hover .vpw-atc-wrap { opacity: 1; transform: translateY(0); }

.vpw-atc-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 10px;
    background: #1c1c1c;
    color: #fff;
    font-family: inherit; font-size: 13px;
    font-weight: 700; text-align: center;
    border: none; border-radius: 10px;
    cursor: pointer; text-decoration: none;
    transition: background .2s;
    line-height: 1; letter-spacing: .3px;
    direction: rtl;
}
.vpw-atc-btn:hover  { background: #333; }
.vpw-atc-btn.adding { background: #888; pointer-events: none; }
.vpw-atc-btn.added  { background: #1a7c3e; }
.vpw-atc-btn.error  { background: #c0392b; }
.vpw-atc-btn.vpw-variable-link {
    background: #1c1c1c;
}
.vpw-atc-btn.vpw-variable-link:hover { background: #333; }
.vpw-atc-btn.vpw-atc-disabled,
.vpw-atc-btn.vpw-atc-disabled:hover {
    background: #9b9b9b;
    cursor: not-allowed;
}
/* cart icon in button */
.vpw-atc-btn svg { flex-shrink: 0; }

/* ── Product info — new style ─────────────────────────────────────────── */
.vpw-info {
    padding: 12px 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    direction: rtl;
    align-items: flex-end; /* default: right (RTL end) */
}

/* category label above title */
.vpw-category-label {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 2px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.vpw-title-link { text-decoration: none; color: inherit; }
.vpw-title {
    font-size: 15px; font-weight: 800;
    margin: 0; color: #111; line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Price — new style ────────────────────────────────────────────────── */
.vpw-price-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    direction: rtl;
    margin-top: 6px;
    min-height: 38px;
    width: 100%;
}

/* original / struck-through — color now fully controlled from Elementor (price_original_color) */
.vpw-price-original {
    font-size: 12px; font-weight: 400;
    text-decoration: line-through;
}
/* force the strike-through onto the inner WooCommerce spans too, since
   some themes reset text-decoration on .woocommerce-Price-amount */
.vpw-price-original .woocommerce-Price-amount,
.vpw-price-original .woocommerce-Price-currencySymbol {
    text-decoration: line-through !important;
}

/* current / sale price — color now fully controlled from Elementor (price_color) */
.vpw-price-current {
    font-size: 15px; font-weight: 800;
}

/* when no sale — color controlled from Elementor (price_no_sale_color) */


/* discount badge */
.vpw-disc-badge {
    display: inline-block;
    background: #e8173a; color: #fff;
    font-size: 10px; font-weight: 700;
    padding: 2px 6px; border-radius: 10px;
    line-height: 1.4; white-space: nowrap;
}

/* ── No products ──────────────────────────────────────────────────────── */
.vpw-no-products {
    padding: 2rem; color: #888;
    text-align: center; grid-column: 1 / -1;
}

/* ── Carousel Nav Arrows ──────────────────────────────────────────────── */
.vpw-carousel-outer {
    position: relative;
}

.vpw-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e5e5e5;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #222;
    transition: background .2s, box-shadow .2s, transform .2s;
}
.vpw-nav-btn:hover {
    background: #1c1c1c;
    color: #fff;
    box-shadow: 0 6px 20px rgba(0,0,0,.2);
}
.vpw-nav-btn:active { transform: translateY(-50%) scale(.94); }
.vpw-nav-btn.vpw-prev { right: -20px; }
.vpw-nav-btn.vpw-next { left: -20px; }
.vpw-nav-btn:disabled { opacity: .35; pointer-events: none; }

/* ── Carousel Dots ────────────────────────────────────────────────────── */
.vpw-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.vpw-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #ddd;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background .2s, transform .2s, width .3s;
}
.vpw-dot.active {
    background: #1c1c1c;
    width: 24px;
    border-radius: 4px;
}
