/* ============================================================
   product-modern.css - استایل مدرن برای ماژول‌های محصولات
   نسخه بهینه شده با طراحی زیباتر - هماهنگ با الگوی رز-آلبالویی
   ============================================================ */

/* ===== متغیرها - هماهنگ با الگو ===== */
:root {
    --pm-primary: #C62840;
    --pm-primary-dark: #8B1E2B;
    --pm-primary-light: #E8436E;
    --pm-secondary: #8B1E2B;
    --pm-success: #38a169;
    --pm-danger: #e53e3e;
    --pm-shadow-hover: 0 20px 60px rgba(198, 40, 64, 0.08);
    --pm-gradient: linear-gradient(135deg, #E8436E, #C62840);
    --pm-gradient-dark: linear-gradient(135deg, #C62840, #8B1E2B);
    --pm-bg: #ffffff;
    --pm-border: #f0d6d9;
    --pm-bg-soft: #fdf6f7;
    --pm-text: #2d3748;
    --pm-muted: #718096;
    --pm-shadow: 0 2px 12px rgba(198, 40, 64, 0.08);
}

/* ===== ماژول ===== */
.product-modern-module {
    margin: 40px 0 50px;
    padding: 20px 20px 30px;
    background: var(--pm-bg);
    border-radius: 16px;
    box-shadow: var(--pm-shadow);
    border: 1px solid var(--pm-border);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.product-modern-module:hover {
    box-shadow: 0 4px 20px rgba(198, 40, 64, 0.10);
}

.product-modern-module::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: var(--pm-gradient);
    opacity: 0.8;
}

/* ===== هدر ===== */
.product-modern-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--pm-border);
    flex-wrap: wrap;
    gap: 12px;
}

.product-modern-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--pm-text);
    margin: 0;
    letter-spacing: -0.3px;
    position: relative;
}

.product-modern-title::after {
    content: '';
    position: absolute;
    bottom: -14px;
    right: 0;
    width: 55px;
    height: 3px;
    background: var(--pm-gradient);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.product-modern-title:hover::after {
    width: 70px;
}

.product-modern-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.product-modern-viewall {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--pm-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 6px 14px;
    border-radius: 30px;
    background: rgba(198, 40, 64, 0.08);
}

.product-modern-viewall:hover {
    background: var(--pm-gradient);
    color: #fff;
    transform: translateX(-4px);
    box-shadow: 0 4px 15px rgba(198, 40, 64, 0.3);
}

.product-modern-viewall i {
    font-size: 13px;
    transition: transform 0.3s ease;
}

.product-modern-viewall:hover i {
    transform: translateX(-4px);
}

.product-modern-nav {
    display: flex;
    gap: 6px;
}

.product-modern-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: var(--pm-bg-soft);
    color: var(--pm-muted);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.product-modern-btn:hover {
    background: var(--pm-gradient);
    color: #fff;
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(198, 40, 64, 0.3);
}

.product-modern-btn:active {
    transform: scale(0.95);
}

/* ===== کاروسل ===== */
.product-modern-wrapper {
    overflow: hidden;
    position: relative;
}

.product-modern-track {
    display: flex;
    gap: 18px;
    padding: 4px 0;
    will-change: transform;
}

.product-modern-item {
    box-sizing: border-box;
    flex-shrink: 0;
}

/* ===== کارت محصول ===== */
.product-modern-card {
    background: var(--pm-bg);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--pm-border);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.02);
}

.product-modern-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--pm-shadow-hover);
    border-color: var(--pm-primary);
}

/* ===== تصویر ===== */
.product-modern-image {
    position: relative;
    padding-top: 85%;
    background: var(--pm-bg-soft);
    overflow: hidden;
}

.product-modern-image a {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-modern-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-modern-card:hover .product-modern-image img {
    transform: scale(1.07);
}

/* ===== برچسب‌ها - هماهنگ با الگو ===== */
.product-modern-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #FF6B8A, #E8436E);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 14px;
    border-radius: 20px;
    z-index: 2;
    box-shadow: 0 2px 12px rgba(232, 67, 110, 0.3);
    letter-spacing: 0.3px;
    animation: fadeIn 0.5s ease;
}

.product-modern-badge-new {
    background: linear-gradient(135deg, #48bb78, #38a169);
    box-shadow: 0 2px 12px rgba(56, 161, 105, 0.3);
    right: auto;
    left: 12px;
}

/* ===== اطلاعات ===== */
.product-modern-info {
    padding: 16px 16px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-modern-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--pm-text);
    margin: 0;
    line-height: 1.4;
    height: 38px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-modern-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-modern-name a:hover {
    color: var(--pm-primary);
}

/* ===== امتیاز - هماهنگ با الگو ===== */
.product-modern-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    color: #f6ad55;
}

.product-modern-rating .fa-star-o {
    color: #dce0e6;
}

.product-modern-rating-count {
    color: var(--pm-muted);
    font-size: 11px;
    margin-right: 4px;
}

/* ===== قیمت - هماهنگ با الگو ===== */
.product-modern-price {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 2px 0 10px;
}

.product-modern-current {
    font-size: 17px;
    font-weight: 800;
    color: var(--pm-text);
}

.product-modern-special {
    font-size: 17px;
    font-weight: 800;
    color: #E8436E;
}

.product-modern-old {
    font-size: 13px;
    color: var(--pm-muted);
    text-decoration: line-through;
    font-weight: 400;
}

/* ===== بخش پایین کارت ===== */
.product-modern-bottom {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.product-modern-icons {
    display: flex;
    gap: 6px;
    width: 100%;
}

.product-modern-icons button {
    flex: 1;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: var(--pm-bg-soft);
    color: var(--pm-muted);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border: 1px solid var(--pm-border);
    position: relative;
    overflow: hidden;
}

.product-modern-icons button::after {
    content: '';
    position: absolute;
    inset: 0;
    background: currentColor;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-modern-icons button:hover {
    transform: translateY(-3px);
}

/* دکمه سبد خرید - هماهنگ با الگو (آلبالویی تیره) */
.product-modern-icons .product-modern-cart {
    background: linear-gradient(135deg, #C62840, #8B1E2B);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 12px rgba(139, 30, 43, 0.25);
}

.product-modern-icons .product-modern-cart:hover {
    background: linear-gradient(135deg, #D6335A, #8B1E2B);
    box-shadow: 0 6px 20px rgba(139, 30, 43, 0.35);
    transform: translateY(-3px) scale(1.02);
}

/* دکمه علاقه‌مندی - هماهنگ با الگو */
.product-modern-icons .product-modern-wishlist:hover {
    background: #fff5f5;
    color: #e53e3e;
    border-color: #fff5f5;
}

/* دکمه مقایسه - هماهنگ با الگو */
.product-modern-icons .product-modern-compare:hover {
    background: #fdf0f1;
    color: var(--pm-primary);
    border-color: #fdf0f1;
}

.product-modern-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--pm-muted);
    background: var(--pm-bg-soft);
    border-radius: 16px;
}

.product-modern-empty i {
    font-size: 48px;
    color: var(--pm-border);
    display: block;
    margin-bottom: 12px;
}

.product-modern-empty p {
    font-size: 15px;
    margin: 0;
}

/* ===== انیمیشن‌ها ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== RTL ===== */
[dir="rtl"] .product-modern-next i {
    transform: rotate(180deg);
}

[dir="rtl"] .product-modern-prev i {
    transform: rotate(180deg);
}

[dir="rtl"] .product-modern-viewall:hover i {
    transform: translateX(4px);
}

[dir="rtl"] .product-modern-viewall:hover {
    transform: translateX(4px);
}

/* ============================================================
   ریسپانسیو
   ============================================================ */

@media (min-width: 1201px) {
    .product-modern-item {
        flex: 0 0 calc(20% - 15px);
        max-width: calc(20% - 15px);
    }
}

@media (max-width: 1200px) and (min-width: 993px) {
    .product-modern-item {
        flex: 0 0 calc(25% - 15px);
        max-width: calc(25% - 15px);
    }
}

@media (max-width: 992px) and (min-width: 769px) {
    .product-modern-item {
        flex: 0 0 calc(33.333% - 15px);
        max-width: calc(33.333% - 15px);
    }
    .product-modern-title {
        font-size: 20px;
    }
    .product-modern-btn {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }
    .product-modern-icons button {
        height: 36px;
        font-size: 14px;
    }
}

@media (max-width: 768px) and (min-width: 481px) {
    .product-modern-item {
        flex: 0 0 calc(50% - 15px);
        max-width: calc(50% - 15px);
    }
    .product-modern-module {
        margin: 25px 0 35px;
        padding: 16px 16px 24px;
    }
    .product-modern-header {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        margin-bottom: 18px;
        padding-bottom: 10px;
        flex-wrap: nowrap;
    }
    .product-modern-title {
        font-size: 18px;
    }
    .product-modern-title::after {
        display: none;
    }
    .product-modern-actions {
        gap: 8px;
        flex-wrap: nowrap;
    }
    .product-modern-viewall span {
        display: none;
    }
    .product-modern-viewall i {
        font-size: 16px;
    }
    .product-modern-info {
        padding: 12px 12px 14px;
    }
    .product-modern-name {
        font-size: 13px;
        height: 34px;
    }
    .product-modern-current,
    .product-modern-special {
        font-size: 15px;
    }
    .product-modern-icons {
        gap: 4px;
    }
    .product-modern-icons button {
        height: 34px;
        font-size: 13px;
    }
}

/* ============================================================
   موبایل (نمایش تک محصول کامل)
   ============================================================ */

@media (max-width: 480px) {
    .product-modern-module {
        margin: 15px 0 25px;
        padding: 14px 12px 20px;
        border-radius: 12px;
    }

    .product-modern-header {
        flex-direction: row;
        align-items: center;
        gap: 6px;
        margin-bottom: 14px;
        padding-bottom: 8px;
        flex-wrap: nowrap;
    }

    .product-modern-title {
        font-size: 15px;
        font-weight: 700;
        white-space: nowrap;
    }

    .product-modern-title::after {
        display: none;
    }

    .product-modern-actions {
        gap: 4px;
        flex-wrap: nowrap;
    }

    .product-modern-viewall {
        font-size: 10px;
        padding: 2px 8px;
        border-radius: 20px;
    }

    .product-modern-viewall span {
        display: none;
    }

    .product-modern-viewall i {
        font-size: 12px;
    }

    .product-modern-nav {
        gap: 3px;
    }

    .product-modern-btn {
        width: 26px;
        height: 26px;
        font-size: 10px;
    }

    /* ===== تک محصول کامل در موبایل ===== */
    .product-modern-item {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .product-modern-track {
        gap: 0;
        padding: 0;
    }

    .product-modern-wrapper {
        overflow: hidden;
        border-radius: 0;
    }

    .product-modern-card {
        border-radius: 12px;
        margin: 0 4px;
    }

    .product-modern-info {
        padding: 10px 12px 14px;
    }

    .product-modern-name {
        font-size: 13px;
        height: 34px;
    }

    .product-modern-current,
    .product-modern-special {
        font-size: 15px;
    }

    .product-modern-old {
        font-size: 11px;
    }

    .product-modern-icons {
        gap: 4px;
    }

    .product-modern-icons button {
        height: 34px;
        font-size: 13px;
        border-radius: 8px;
    }
}

/* ============================================================
   تنظیمات ویژه برای ستون‌های باریک (چپ و راست)
   ============================================================ */

#column-left .product-modern-module,
#column-right .product-modern-module {
    margin: 20px 0 30px;
    padding: 12px 12px 20px;
    border-radius: 12px;
}

#column-left .product-modern-module::before,
#column-right .product-modern-module::before {
    height: 2px;
}

#column-left .product-modern-header,
#column-right .product-modern-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 4px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--pm-border);
}

#column-left .product-modern-title,
#column-right .product-modern-title {
    font-size: 13px;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    letter-spacing: 0;
}

#column-left .product-modern-title::after,
#column-right .product-modern-title::after {
    display: none;
}

#column-left .product-modern-actions,
#column-right .product-modern-actions {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-wrap: nowrap;
}

#column-left .product-modern-viewall,
#column-right .product-modern-viewall {
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 12px;
    background: rgba(198, 40, 64, 0.08);
    gap: 3px;
}

#column-left .product-modern-viewall span,
#column-right .product-modern-viewall span {
    display: none;
}

#column-left .product-modern-viewall i,
#column-right .product-modern-viewall i {
    font-size: 10px;
    margin: 0;
}

#column-left .product-modern-viewall:hover,
#column-right .product-modern-viewall:hover {
    background: var(--pm-gradient);
    color: #fff;
}

#column-left .product-modern-nav,
#column-right .product-modern-nav {
    display: flex;
    gap: 2px;
}

#column-left .product-modern-btn,
#column-right .product-modern-btn {
    width: 22px;
    height: 22px;
    font-size: 9px;
    background: var(--pm-bg-soft);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--pm-muted);
}

#column-left .product-modern-btn:hover,
#column-right .product-modern-btn:hover {
    background: var(--pm-gradient);
    color: #fff;
    transform: scale(1.1);
}

#column-left .product-modern-item,
#column-right .product-modern-item {
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

#column-left .product-modern-track,
#column-right .product-modern-track {
    gap: 12px;
}

#column-left .product-modern-wrapper,
#column-right .product-modern-wrapper {
    overflow: hidden;
}

#column-left .product-modern-card,
#column-right .product-modern-card {
    overflow: hidden;
    border-radius: 12px;
}

#column-left .product-modern-info,
#column-right .product-modern-info {
    padding: 10px 12px 14px;
    gap: 4px;
}

#column-left .product-modern-name,
#column-right .product-modern-name {
    font-size: 12px;
    height: 32px;
}

#column-left .product-modern-price,
#column-right .product-modern-price {
    margin: 0 0 6px;
    gap: 4px;
}

#column-left .product-modern-current,
#column-right .product-modern-current {
    font-size: 14px;
}

#column-left .product-modern-special,
#column-right .product-modern-special {
    font-size: 14px;
}

#column-left .product-modern-old,
#column-right .product-modern-old {
    font-size: 11px;
}

#column-left .product-modern-icons button,
#column-right .product-modern-icons button {
    height: 32px;
    font-size: 12px;
    border-radius: 6px;
}

#column-left .product-modern-icons button:hover,
#column-right .product-modern-icons button:hover {
    transform: translateY(-2px);
}

#column-left .product-modern-rating,
#column-right .product-modern-rating {
    font-size: 10px;
}

#column-left .product-modern-rating .fa,
#column-right .product-modern-rating .fa {
    font-size: 10px;
}

#column-left .product-modern-badge,
#column-right .product-modern-badge {
    font-size: 8px;
    padding: 2px 10px;
    top: 8px;
    right: 8px;
}