/* ============================================================
   مشتری‌یاب — Upsell / Cross-sell Widget
   All rules scoped inside .my-uw-widget to prevent bleed.
   ============================================================ */

/* ── Wrapper ───────────────────────────────────────────────── */
.my-uw-widget {
    direction: rtl;
    font-family: inherit;
    box-sizing: border-box;
}

.my-uw-widget *,
.my-uw-widget *::before,
.my-uw-widget *::after {
    box-sizing: inherit;
}

/* ── Header ────────────────────────────────────────────────── */
.my-uw-widget .my-uw__header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.my-uw-widget .my-uw__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    padding: 0;
    padding-right: 14px;
    position: relative;
    line-height: 1.4;
    border: none;
    background: none;
}

.my-uw-widget .my-uw__title::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 1.2em;
    background: linear-gradient(180deg, #6366f1, #a855f7);
    border-radius: 4px;
}

/* ── Minimal Swiper core (scoped — no global CDN CSS needed) ── */
.my-uw-widget .my-uw-swiper {
    overflow: hidden;
    position: relative;
    list-style: none;
    padding: 0;
    z-index: 1;
}

.my-uw-widget .my-uw-swiper .swiper-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    align-items: stretch;
    transition-property: transform;
    box-sizing: border-box;
}

.my-uw-widget .my-uw-swiper .swiper-slide {
    flex-shrink: 0;
    width: 100%;
    height: auto;
    position: relative;
    transition-property: transform;
}

/* Swiper button icons (uses font from Swiper JS bundle) */
.my-uw-widget .my-uw-carousel .swiper-button-next::after,
.my-uw-widget .my-uw-carousel .swiper-button-prev::after {
    font-family: swiper-icons;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: none;
    font-variant: initial;
    line-height: 1;
}

.my-uw-widget .my-uw-carousel .swiper-button-next::after { content: 'next'; }
.my-uw-widget .my-uw-carousel .swiper-button-prev::after { content: 'prev'; }

.my-uw-widget .my-uw-carousel .swiper-button-disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* ── Carousel wrapper ──────────────────────────────────────── */
.my-uw-widget .my-uw-carousel {
    position: relative;
    padding-bottom: 40px;
}

/* ── Card ──────────────────────────────────────────────────── */
.my-uw-widget .my-uw-card {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #f0f0f0;
    margin: 0;
    padding: 0;
}

.my-uw-widget .my-uw-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* ── Badge ─────────────────────────────────────────────────── */
.my-uw-widget .my-uw-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    padding: 5px 9px;
    border-radius: 6px;
    letter-spacing: 0;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: inline-block;
}

.my-uw-widget .my-uw-badge--upsell {
    background-color: #f59e0b;
    color: #ffffff;
}

.my-uw-widget .my-uw-badge--crosssell {
    background-color: #10b981;
    color: #ffffff;
}

/* ── Sale tag ──────────────────────────────────────────────── */
.my-uw-widget .my-uw-sale-tag {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 4px;
    z-index: 5;
}

/* ── Image ─────────────────────────────────────────────────── */
.my-uw-widget .my-uw-card__img-wrap {
    position: relative;
    width: 100%;
    padding-top: var(--img-ratio, 100%);
    overflow: hidden;
    background: #f3f4f6;
    flex-shrink: 0;
    display: block;
}

.my-uw-widget .my-uw-card__img-wrap a {
    display: block;
    position: absolute;
    inset: 0;
    border: none;
    outline: none;
}

.my-uw-widget .my-uw-card__img-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, opacity 0.4s ease;
    display: block;
    max-width: none;
    border: none;
}

/* Hover effects */
.my-uw-widget.img-hover-zoom .my-uw-card:hover .my-uw-card__img-wrap img,
.my-uw-widget .img-hover-zoom .my-uw-card:hover .my-uw-card__img-wrap img {
    transform: scale(1.07);
}

.my-uw-widget.img-hover-fade .my-uw-card:hover .my-uw-card__img-wrap img,
.my-uw-widget .img-hover-fade .my-uw-card:hover .my-uw-card__img-wrap img {
    opacity: 0.75;
}

/* ── Card body ─────────────────────────────────────────────── */
.my-uw-widget .my-uw-card__body {
    padding: 12px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

/* ── Product name ──────────────────────────────────────────── */
.my-uw-widget .my-uw-card__name {
    margin: 0;
    padding: 0;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    border: none;
    background: none;
}

.my-uw-widget .my-uw-card__name a {
    color: #1a1a2e;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: inherit;
}

.my-uw-widget .my-uw-card__name a:hover {
    color: #6366f1;
    text-decoration: none;
}

/* ── Price ─────────────────────────────────────────────────── */
.my-uw-widget .my-uw-card__price {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    margin-top: auto;
    direction: rtl;
}

.my-uw-widget .my-uw-card__price del {
    color: #9ca3af;
    font-size: 0.8em;
    text-decoration: line-through;
    margin-left: 4px;
    margin-right: 0;
}

.my-uw-widget .my-uw-card__price ins {
    color: #ef4444;
    text-decoration: none;
    font-weight: 700;
}

.my-uw-widget .my-uw-card__price .amount {
    color: #374151;
}

.my-uw-widget .my-uw-card__price ins .amount {
    color: #ef4444;
}

/* ── Button ────────────────────────────────────────────────── */
.my-uw-widget .my-uw-card__btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 16px;
    background-color: #6366f1;
    color: #ffffff !important;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    transition: background-color 0.2s ease, transform 0.15s ease;
    line-height: 1.4;
    margin-top: auto;
    box-shadow: none;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.my-uw-widget .my-uw-card__btn:hover {
    background-color: #4f46e5;
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-1px);
    box-shadow: none;
}

.my-uw-widget .my-uw-card__btn:active {
    transform: translateY(0);
}

.my-uw-widget .my-uw-card__btn:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* --view inherits the same style as the default button */

.my-uw-widget .my-uw-btn--loading {
    opacity: 0.7;
    cursor: wait;
}

.my-uw-widget .my-uw-btn--added {
    background-color: #10b981 !important;
}

/* ── Swiper Navigation (scoped) ────────────────────────────── */
.my-uw-widget .my-uw-carousel .swiper-button-next,
.my-uw-widget .my-uw-carousel .swiper-button-prev {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.14);
    transition: box-shadow 0.2s;
    top: calc(50% - 20px - 20px);
    margin-top: 0;
}

.my-uw-widget .my-uw-carousel .swiper-button-next:hover,
.my-uw-widget .my-uw-carousel .swiper-button-prev:hover {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
}

.my-uw-widget .my-uw-carousel .swiper-button-next::after,
.my-uw-widget .my-uw-carousel .swiper-button-prev::after {
    font-size: 14px;
    font-weight: 900;
    color: #6366f1;
    font-family: swiper-icons;
}

/* RTL arrow positions */
.my-uw-widget .my-uw-carousel .swiper-button-next {
    left: -4px;
    right: auto;
}

.my-uw-widget .my-uw-carousel .swiper-button-prev {
    right: -4px;
    left: auto;
}

/* ── Swiper Pagination (scoped) ────────────────────────────── */
.my-uw-widget .my-uw-carousel .swiper-pagination {
    bottom: 0;
    left: 0;
    right: 0;
    position: absolute;
    text-align: center;
}

.my-uw-widget .my-uw-carousel .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background-color: #d1d5db;
    opacity: 1;
    transition: background-color 0.2s, transform 0.2s;
    display: inline-block;
    border-radius: 50%;
    margin: 0 3px;
    cursor: pointer;
}

.my-uw-widget .my-uw-carousel .swiper-pagination-bullet-active {
    background-color: #6366f1;
    transform: scale(1.3);
}

/* ── Empty state ───────────────────────────────────────────── */
.my-uw-widget .my-uw-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 0.9rem;
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    direction: rtl;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 767px) {
    .my-uw-widget .my-uw-carousel .swiper-button-next,
    .my-uw-widget .my-uw-carousel .swiper-button-prev {
        display: none;
    }

    .my-uw-widget .my-uw__title {
        font-size: 1.05rem;
    }

    .my-uw-widget .my-uw-card__body {
        padding: 10px 10px 12px;
    }
}
