/* Modern Product Archive - For Category Pages Demo 1 */

/* ابزارک بالای صفحه */
.site-main > .widget {
    margin: 20px 0; /* فاصله از دو طرف */
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* المان‌های بالای صفحه که چسبیده به دیواره هستن */
.site-main {
    padding: 0 50px; /* فاصله کلی از دو طرف */
}

.mlm-advanced-search.site-main {
    padding: 0 50px !important;
}

/* اگر المان‌های خاصی چسبیده باشن */
.mlm-archive-top,
.mlm-archive-bottom,
.mlm-widget {
    margin-left: 0;
    margin-right: 0;
}

.modern-product-archive {
    margin: 20px 0;
    padding: 0;
}

/* Product Grid - 3 cards per row */
.modern-product-archive .modern-product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

/* Product Item Wrapper */
.modern-product-archive .modern-product-item {
    width: 100%;
}

.modern-product-archive .modern-product-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: visible;
    box-shadow: none;
    transition: none;
    position: relative;
    display: flex;
    flex-direction: column;
}

.modern-product-archive .modern-product-card .item-info-shell {
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.modern-product-archive .modern-product-card .item-info {
    background: #ffffff;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1 1 auto;
}

.modern-product-archive .modern-product-card .item-info-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
}

.modern-product-archive .modern-product-card .item-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    color: #111827;
}

.modern-product-archive .modern-product-card .item-title a {
    color: #111827;
    text-decoration: none;
}

.modern-product-archive .modern-product-card .item-pricing {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
}

.modern-product-archive .modern-product-card .item-discount-badge {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    background: var(--mlm-discount-bg, #F97316);
    flex-shrink: 0;
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;
}

.modern-product-archive .modern-product-card .item-discount-badge.empty {
    background: transparent;
    border: 1px solid transparent;
    color: transparent;
    pointer-events: none;
}

.modern-product-archive .modern-product-card .item-price-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
    padding-right: 36px;
    box-sizing: border-box;
}

.modern-product-archive .modern-product-card .item-price-current {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.modern-product-archive .modern-product-card .item-price-current.free {
    color: #059669;
}

.modern-product-archive .modern-product-card .item-price-regular {
    font-size: 12px;
    color: #9ca3af;
    text-decoration: line-through;
}

.modern-product-archive .modern-product-card .item-pricing-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.modern-product-archive .modern-product-card .metric {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #6b7280;
}

.modern-product-archive .modern-product-card .metric-icon svg {
    width: 11px;
    height: 11px;
}

.modern-product-archive .modern-product-card .metric-icon-star .icon-star-full {
    font-size: 12px;
    color: #F5B318;
    line-height: 1;
}

.modern-product-archive .modern-product-card .metric-number {
    font-weight: 600;
    color: #4b5563;
}

.modern-product-archive .modern-product-card .hover-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    margin-top: 12px;
}

.modern-product-archive .modern-product-card .btn-add-to-cart,
.modern-product-archive .modern-product-card .btn-preview {
    flex: 1;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.modern-product-archive .modern-product-card .btn-add-to-cart {
    background: #111827;
    color: #ffffff;
    border: none;
}

.modern-product-archive .modern-product-card .btn-preview {
    background: #ffffff;
    color: #4b5563;
    border: 1px solid #e5e7eb;
}

/* Page Header Styling */
.modern-product-archive + .mlm-navigation {
    margin-top: 40px;
}

/* Archive Header Styling */
.page-header {
    background: white;
    padding: 25px 65px; /* 25px بالا/پایین + 40px چپ/راست */
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.page-header .page-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    position: relative;
    padding-bottom: 15px;
}

.page-header .page-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #FFA726 0%, #FF9800 100%);
    border-radius: 2px;
}

.page-header .taxonomy-description {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin-top: 10px;
}

/* Breadcrumbs Styling */
.page-header .breadcrumb {
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 13px;
}

.page-header .breadcrumb-item {
    color: #666;
}

.page-header .breadcrumb-item a {
    color: #FFA726;
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-header .breadcrumb-item a:hover {
    color: #FF9800;
}

/* Pagination Styling */
.mlm-navigation {
    text-align: center;
    margin: 40px 0;
    padding: 0;
}

.mlm-navigation .page-numbers {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.mlm-navigation .page-numbers a,
.mlm-navigation .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.mlm-navigation .page-numbers a {
    background: #f8f9fa;
    color: #666;
}

.mlm-navigation .page-numbers a:hover {
    background: #FFA726;
    color: white;
    transform: translateY(-2px);
}

.mlm-navigation .page-numbers .current {
    background: linear-gradient(135deg, #FFA726 0%, #FF9800 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(255, 167, 38, 0.3);
}

.mlm-navigation .page-numbers .prev,
.mlm-navigation .page-numbers .next {
    background: #e9ecef;
    color: #495057;
    font-size: 12px;
}

.mlm-navigation .page-numbers .prev:hover,
.mlm-navigation .page-numbers .next:hover {
    background: #FFA726;
    color: white;
}

/* Empty State */
.modern-product-archive:empty + .mlm-navigation {
    display: none;
}

/* ========== Responsive Design ========== */

/* Tablet Large - 3 cards */
@media (max-width: 1200px) {
    .modern-product-archive .modern-product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* Tablet - 2 cards */
@media (max-width: 768px) {
    .site-main {
        padding: 0 20px; /* کمتر در تبلت */
    }
    
    .mlm-archive-top,
    .mlm-archive-bottom,
    .mlm-widget {
        margin-left: 0;
        margin-right: 0;
    }
    
    .site-main > .widget {
        margin: 15px 0; /* کمتر در تبلت */
        padding: 15px;
    }
    
    .modern-product-archive {
        padding: 0 20px; /* کمتر در تبلت */
    }
    
    .modern-product-archive .modern-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .page-header {
        padding: 20px 45px; /* کمتر در تبلت */
    }
    
    .page-header .page-title {
        font-size: 20px;
    }
}

/* Mobile - 1 card */
@media (max-width: 480px) {
    .site-main {
        padding: 0 15px; /* کمتر در موبایل */
    }
    
    .mlm-archive-top,
    .mlm-archive-bottom,
    .mlm-widget {
        margin-left: 0;
        margin-right: 0;
    }
    
    .site-main > .widget {
        margin: 10px 0; /* کمتر در موبایل */
        padding: 15px;
    }
    
    .modern-product-archive {
        padding: 0 15px; /* کمتر در موبایل */
    }
    
    .modern-product-archive .modern-product-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        padding: 15px 30px; /* کمتر در موبایل */
    }
    
    .page-header .page-title {
        font-size: 18px;
    }
    
    .mlm-navigation {
        padding: 0 15px; /* کمتر در موبایل */
    }
    
    .mlm-navigation .page-numbers {
        padding: 10px 15px;
        gap: 5px;
    }
    
    .mlm-navigation .page-numbers a,
    .mlm-navigation .page-numbers span {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
}
