/**
 * User Products Section
 * بخش اخیراً مشاهده شده و علاقه‌مندی‌ها
 */

/* Section */
.user-products-section {
    background: var(--bg-body);
    overflow: hidden;
}

/* Grid Layout */
.user-products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    max-width: 100%;
}

/* Column Box */
.user-products-col {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    min-height: 280px;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

/* Header - ارتفاع ثابت */
.user-products-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
    min-height: 40px;
}

.user-products-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.user-products-title i {
    color: var(--primary);
}

.user-products-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.user-products-clear:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.user-products-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    height: 32px;
    flex-shrink: 0;
}

.user-products-link:hover {
    color: var(--accent);
}

/* Slider Container */
.user-products-slider {
    position: relative;
    overflow: hidden;
}

.user-products-slider .swiper {
    overflow: hidden;
}

/* Navigation */
.user-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.user-slider-nav:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.user-slider-prev {
    right: 0;
}

.user-slider-next {
    left: 0;
}

.user-slider-nav i {
    width: 18px;
    height: 18px;
}

/* ========================================
   Product Card
   ======================================== */

.user-products-section .user-product-card {
    display: flex !important;
    flex-direction: column !important;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    transition: border-color 0.3s ease;
    height: 100%;
    padding: 0 !important;
    gap: 0 !important;
}

.user-products-section .user-product-card:hover {
    border-color: var(--accent);
}

/* Image */
.user-products-section .user-product-card__image {
    position: relative !important;
    background: var(--bg-body) !important;
    padding: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: auto !important;
    flex-shrink: 0 !important;
}

.user-products-section .user-product-card__image img {
    width: 100% !important;
    height: 160px !important;
    object-fit: contain !important;
    transition: transform 0.3s ease;
}

.user-products-section .user-product-card:hover .user-product-card__image img {
    transform: scale(1.05);
}

/* Remove Button */
.user-products-section .user-product-card__remove {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 2;
}

.user-products-section .user-product-card:hover .user-product-card__remove {
    opacity: 1;
    visibility: visible;
}

.user-products-section .user-product-card__remove:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.user-products-section .user-product-card__remove i {
    width: 14px;
    height: 14px;
}

/* Discount Badge */
.user-products-section .user-product-card__badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--danger);
    color: #fff;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
}

/* Content */
.user-products-section .user-product-card__info {
    padding: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    flex: 1;
    min-width: 0;
}

/* Title */
.user-products-section .user-product-card__title {
    font-size: 13px;
    font-weight: 500;
    margin: 0;
    line-height: 1.5;
}

.user-products-section .user-product-card__title a {
    color: var(--text-primary);
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-products-section .user-product-card__title a:hover {
    color: var(--accent);
}

/* Price */
.user-products-section .user-product-card__price {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin-top: auto;
}

.user-products-section .user-product-card__price del {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 400;
    margin-left: 6px;
}

.user-products-section .user-product-card__price ins {
    text-decoration: none;
    color: var(--danger);
}


/* ========================================
   Skeleton Loading
   ======================================== */

.user-products-skeleton {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.user-skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
}

.user-skeleton-card .skeleton-box {
    background: linear-gradient(90deg, var(--bg-body) 25%, var(--bg-hover) 50%, var(--bg-body) 75%);
    background-size: 200% 100%;
    animation: userSkeletonShimmer 1.5s infinite;
}

.user-skeleton-image {
    height: 160px;
    background: var(--bg-body);
}

.user-skeleton-content {
    padding: 12px;
}

.user-skeleton-title {
    height: 16px;
    width: 80%;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
}

.user-skeleton-price {
    height: 14px;
    width: 50%;
    border-radius: var(--radius-sm);
}

@keyframes userSkeletonShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ========================================
   Empty State
   ======================================== */

.user-products-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.user-products-empty i {
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.user-products-empty p {
    font-size: 13px;
    margin: 0;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 1023px) {
    .user-products-grid {
        gap: 24px;
    }
}

@media (max-width: 767px) {
    .user-products-grid {
        grid-template-columns: 1fr;
    }

    .user-slider-nav {
        display: none;
    }

    .user-products-col {
        min-height: auto;
    }
}