/* تنظیمات پایه */
*,
*::before,
*::after {
box-sizing: border-box;
}

/* استایل‌های سواایپر */
.modern-swiper {
width: 100%;
height: auto;
padding: 20px 5px 40px 5px !important;
overflow: visible !important;
margin: 0 -5px;
}

.modern-swiper .swiper-wrapper {
padding: 5px 0;
}

.modern-swiper .swiper-slide {
height: auto;
transition: all 0.3s ease;
}

/* کارت مدرن */
.modern-card {
background: white;
border-radius: 30px;
overflow: hidden;
transition: all 0.3s ease;
box-shadow: 0 5px 20px rgba(0,0,0,0.05);
border: 1px solid #e2e8f0;
height: 100%;
width: 100%;
}

.modern-card:hover {
transform: translateY(-5px);
box-shadow: 0 15px 30px rgba(0,136,204,0.15);
border-color: #0088cc;
}

[data-theme="dark"] .modern-card {
background: #1e293b;
border-color: #334155;
}

.card-link {
text-decoration: none;
color: inherit;
display: block;
height: 100%;
}

/* تصویر کارت */
.card-image {
position: relative;
height: 200px;
overflow: hidden;
}

.card-image img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.5s ease;
}

.modern-card:hover .card-image img {
transform: scale(1.05);
}

/* برچسب‌ها */
.card-badge {
position: absolute;
top: 15px;
right: 15px;
background: rgba(0,0,0,0.7);
color: white;
padding: 5px 15px;
border-radius: 30px;
font-size: 0.85rem;
font-weight: 500;
z-index: 2;
backdrop-filter: blur(5px);
}

.card-badges {
position: absolute;
top: 15px;
right: 15px;
display: flex;
gap: 8px;
z-index: 2;
flex-wrap: wrap;
max-width: calc(100% - 30px);
}

.badge {
padding: 5px 15px;
border-radius: 30px;
font-size: 0.85rem;
font-weight: 600;
box-shadow: 0 3px 10px rgba(0,0,0,0.2);
white-space: nowrap;
}

.badge.special {
background: linear-gradient(135deg, #f59e0b, #d97706);
color: white;
}

.badge.fast {
background: linear-gradient(135deg, #ef4444, #dc2626);
color: white;
}

/* تعداد عکس‌ها */
.image-count {
position: absolute;
bottom: 15px;
left: 15px;
background: rgba(0,0,0,0.6);
color: white;
padding: 4px 12px;
border-radius: 30px;
font-size: 0.8rem;
display: flex;
align-items: center;
gap: 5px;
z-index: 2;
backdrop-filter: blur(5px);
}

/* محتوای کارت */
.card-content {
padding: 20px;
}

.card-title {
font-size: 1.1rem;
font-weight: 600;
color: #1e293b;
margin: 0 0 10px 0;
line-height: 1.4;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
min-height: 3em;
}

[data-theme="dark"] .card-title {
color: #f1f5f9;
}

.card-location {
display: flex;
align-items: center;
gap: 8px;
color: #64748b;
font-size: 0.9rem;
margin-bottom: 15px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.card-location i {
color: #0088cc;
font-size: 0.9rem;
flex-shrink: 0;
}

[data-theme="dark"] .card-location {
color: #94a3b8;
}

/* قیمت‌ها */
.card-prices {
background: #f8fafc;
border-radius: 20px;
padding: 12px;
margin-bottom: 15px;
}

[data-theme="dark"] .card-prices {
background: #0f172a;
}

.price-item {
display: flex;
align-items: center;
gap: 5px;
font-size: 0.9rem;
margin-bottom: 5px;
flex-wrap: wrap;
}

.price-item:last-child {
margin-bottom: 0;
}

.price-item.main-price {
font-size: 1.1rem;
font-weight: 600;
color: #0088cc;
}

.price-label {
color: #64748b;
font-weight: 500;
min-width: 45px;
}

.price-value {
color: #1e293b;
font-weight: 600;
direction: ltr;
}

.price-unit {
color: #94a3b8;
font-size: 0.8rem;
}

[data-theme="dark"] .price-label {
color: #94a3b8;
}

[data-theme="dark"] .price-value {
color: #f1f5f9;
}

.price-per-meter {
font-size: 0.85rem;
opacity: 0.9;
}

/* متا اطلاعات */
.card-meta {
margin-bottom: 15px;
}

.meta-item {
display: inline-flex;
align-items: center;
gap: 5px;
padding: 5px 15px;
background: #f1f5f9;
border-radius: 30px;
font-size: 0.9rem;
color: #475569;
}

.meta-item i {
color: #0088cc;
font-size: 0.9rem;
}

[data-theme="dark"] .meta-item {
background: #334155;
color: #e2e8f0;
}

/* فوتر کارت */
.card-footer {
display: flex;
align-items: center;
justify-content: space-between;
padding-top: 15px;
border-top: 1px solid #e2e8f0;
font-size: 0.8rem;
gap: 10px;
}

[data-theme="dark"] .card-footer {
border-top-color: #334155;
}

.card-time {
display: flex;
align-items: center;
gap: 5px;
color: #94a3b8;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
flex: 1;
}

.card-time i {
color: #64748b;
flex-shrink: 0;
}

.expert-badge {
display: flex;
align-items: center;
gap: 5px;
color: #10b981;
background: #d1fae5;
padding: 4px 12px;
border-radius: 30px;
font-weight: 500;
white-space: nowrap;
flex-shrink: 0;
}

[data-theme="dark"] .expert-badge {
background: #064e3b;
color: #a7f3d0;
}

/* دکمه‌های ناوبری سواایپر */
.modern-swiper .swiper-button-next,
.modern-swiper .swiper-button-prev {
width: 40px;
height: 40px;
background: white;
border-radius: 50%;
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
color: #0088cc;
transition: all 0.3s ease;
}

.modern-swiper .swiper-button-next:hover,
.modern-swiper .swiper-button-prev:hover {
background: #0088cc;
color: white;
transform: scale(1.1);
}

.modern-swiper .swiper-button-next:after,
.modern-swiper .swiper-button-prev:after {
font-size: 18px;
font-weight: bold;
}

[data-theme="dark"] .modern-swiper .swiper-button-next,
[data-theme="dark"] .modern-swiper .swiper-button-prev {
background: #1e293b;
color: #60a5fa;
}

[data-theme="dark"] .modern-swiper .swiper-button-next:hover,
[data-theme="dark"] .modern-swiper .swiper-button-prev:hover {
background: #0088cc;
color: white;
}

/* صفحه‌شمار */
.modern-swiper .swiper-pagination {
position: relative;
margin-top: 20px;
}

.modern-swiper .swiper-pagination-bullet {
width: 8px;
height: 8px;
background: #cbd5e1;
opacity: 1;
transition: all 0.3s ease;
}

.modern-swiper .swiper-pagination-bullet-active {
width: 24px;
border-radius: 4px;
background: #0088cc;
}

[data-theme="dark"] .modern-swiper .swiper-pagination-bullet {
background: #475569;
}

[data-theme="dark"] .modern-swiper .swiper-pagination-bullet-active {
background: #60a5fa;
}

/* حالت بدون نتیجه */
.no-results {
text-align: center;
padding: 60px;
background: white;
border-radius: 40px;
color: #94a3b8;
width: 100%;
}

.no-results i {
font-size: 3rem;
margin-bottom: 15px;
display: block;
}

.no-results p {
font-size: 1.1rem;
}

[data-theme="dark"] .no-results {
background: #1e293b;
}

/* دکمه نمایش بیشتر */
.more-posts-btn {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 70px;
width: 100%;
}

.more-posts-btn a {
display: inline-flex;
align-items: center;
gap: 10px;
padding: 10px 30px;
background: #f1f5f9;
border: 1px solid #e2e8f0;
border-radius: 40px;
color: #0088cc;
text-decoration: none;
font-weight: 600;
transition: all 0.3s ease;
}

.more-posts-btn a:hover {
background: #0088cc;
color: white;
transform: translateY(-2px);
box-shadow: 0 5px 20px rgba(0,136,204,0.2);
}

.more-posts-btn i {
transition: transform 0.3s ease;
}

.more-posts-btn a:hover i {
transform: translateX(-5px);
}

[data-theme="dark"] .more-posts-btn a {
background: #1e293b;
border-color: #334155;
color: #60a5fa;
}

[data-theme="dark"] .more-posts-btn a:hover {
background: #0088cc;
color: white;
}

/* رسپانسیو */
@media (max-width: 768px) {
.modern-swiper .swiper-button-next,
.modern-swiper .swiper-button-prev {
display: none;
}

.modern-swiper {
padding: 15px 5px 35px 5px !important;
}

.card-content {
padding: 15px;
}

.card-title {
font-size: 1rem;
}

.card-footer {
flex-direction: column;
align-items: flex-start;
gap: 10px;
}

.card-time {
max-width: 100%;
}
}

@media (max-width: 576px) {
.modern-card {
max-width: 260px;
margin: 0 auto;
}
}


/* تنظیمات گرید اصلی - با قابلیت تنظیم ستون‌ها */
.amlak-grid-container {
display: grid !important;
grid-template-columns: repeat(<?php echo $columns_desktop; ?>, 1fr) !important;
gap: <?php echo $gap_size; ?>px !important;
margin: 40px 0 60px 0 !important;
padding: 0 !important;
width: 100%!important;
}

.amlak-grid-item {
margin: 0 !important;
padding: 0 !important;
height: 100%;
display: flex;
width: 100%;
}

.amlak-card-link {
text-decoration: none;
display: block;
color: inherit;
width: 100%;
height: 100%;
}

/* کانتینر تمام عرض */
.amlak-container-full {
width: 100%;
max-width: 100%;
padding-right: 15px;
padding-left: 15px;
margin: 0 auto;
overflow: visible;
position: relative;
box-sizing: border-box;
}

/* فاصله عمودی بین ردیف‌ها */
.amlak-card-classic,
.amlak-card-compact,
.amlak-card-instagram,
.amlak-card-royal,
.amlak-card-diamond,
.amlak-card-mirror {
margin: 0 !important;
width: 100%;
height: 100%;
background: #ffffff;
border-radius: <?php echo $border_radius; ?>px;
overflow: hidden;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* ریسپانسیو - بر اساس تنظیمات */
@media (max-width: 1100px) {
.amlak-grid-container {
grid-template-columns: repeat(<?php echo min($columns_tablet, 4); ?>, 1fr) !important;
gap: <?php echo max(20, $gap_size - 5); ?>px !important;
}
}

@media (max-width: 800px) {
.amlak-grid-container {
grid-template-columns: repeat(<?php echo min($columns_tablet, 3); ?>, 1fr) !important;
gap: <?php echo max(18, $gap_size - 7); ?>px !important;
}
}

@media (max-width: 600px) {
.amlak-grid-container {
grid-template-columns: repeat(<?php echo $columns_mobile; ?>, 1fr) !important;
gap: <?php echo max(15, $gap_size - 10); ?>px !important;
}
}

/* عنوان بخش */
.amlak-section-title {
text-align: right;
margin-bottom: 40px;
position: relative;
padding-bottom: 15px;
}

.amlak-section-title h2 {
font-size: 28px;
font-weight: 700;
color: <?php echo $title_color; ?>;
margin: 0;
display: flex;
align-items: center;
gap: 15px;
}

.amlak-section-title h2 i {
width: 50px;
height: 50px;
background: linear-gradient(135deg, <?php echo $price_color; ?>, #4a90e2);
color: white;
border-radius: 16px;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
box-shadow: 0 10px 20px rgba(0,136,204,0.15);
}

.amlak-section-title::after {
content: '';
position: absolute;
bottom: 0;
right: 0;
width: 100px;
height: 4px;
background: linear-gradient(90deg, <?php echo $price_color; ?>, #4a90e2);
border-radius: 4px;
}

/* رنگ‌های داینامیک */
.amlak-title,
.compact-title,
.royal-title,
.diamond-title,
.mirror-title,
.instagram-title {
color: <?php echo $title_color; ?> !important;
}

.amlak-price,
.compact-price,
.royal-price-number,
.diamond-price,
.mirror-price,
.instagram-price {
color: <?php echo $price_color; ?> !important;
}

.badge-special,
.mini-badge.special,
.insta-badge.special,
.special-feature,
.diamond-badge.special-badge,
.mirror-badge.special-badge {
background: <?php echo $badge_special_color; ?> !important;
}

.badge-fast,
.mini-badge.fast,
.insta-badge.fast,
.fast-feature,
.diamond-badge.fast-badge,
.mirror-badge.fast-badge {
background: <?php echo $badge_fast_color; ?> !important;
}

.badge-expert,
.mini-badge.expert,
.insta-badge.expert,
.expert-feature,
.mirror-badge.expert-badge {
background: <?php echo $badge_expert_color; ?> !important;
}

/* سایه */
.shadow-none .amlak-card-classic,
.shadow-none .amlak-card-compact,
.shadow-none .amlak-card-instagram,
.shadow-none .amlak-card-royal,
.shadow-none .amlak-card-diamond,
.shadow-none .amlak-card-mirror {
box-shadow: none !important;
}

.shadow-light .amlak-card-classic,
.shadow-light .amlak-card-compact,
.shadow-light .amlak-card-instagram,
.shadow-light .amlak-card-royal,
.shadow-light .amlak-card-diamond,
.shadow-light .amlak-card-mirror {
box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
}

.shadow-medium .amlak-card-classic,
.shadow-medium .amlak-card-compact,
.shadow-medium .amlak-card-instagram,
.shadow-medium .amlak-card-royal,
.shadow-medium .amlak-card-diamond,
.shadow-medium .amlak-card-mirror {
box-shadow: 0 5px 20px rgba(0,0,0,0.08) !important;
}

.shadow-heavy .amlak-card-classic,
.shadow-heavy .amlak-card-compact,
.shadow-heavy .amlak-card-instagram,
.shadow-heavy .amlak-card-royal,
.shadow-heavy .amlak-card-diamond,
.shadow-heavy .amlak-card-mirror {
box-shadow: 0 10px 30px rgba(0,0,0,0.12) !important;
}

/* افکت هاور */
.hover-lift .amlak-card-classic:hover,
.hover-lift .amlak-card-compact:hover,
.hover-lift .amlak-card-instagram:hover,
.hover-lift .amlak-card-royal:hover,
.hover-lift .amlak-card-diamond:hover,
.hover-lift .amlak-card-mirror:hover {
transform: translateY(-8px) !important;
}

.hover-scale .amlak-card-classic:hover,
.hover-scale .amlak-card-compact:hover,
.hover-scale .amlak-card-instagram:hover,
.hover-scale .amlak-card-royal:hover,
.hover-scale .amlak-card-diamond:hover,
.hover-scale .amlak-card-mirror:hover {
transform: scale(1.03) !important;
}

.hover-shadow .amlak-card-classic:hover,
.hover-shadow .amlak-card-compact:hover,
.hover-shadow .amlak-card-instagram:hover,
.hover-shadow .amlak-card-royal:hover,
.hover-shadow .amlak-card-diamond:hover,
.hover-shadow .amlak-card-mirror:hover {
box-shadow: 0 25px 50px rgba(0,0,0,0.15) !important;
}


.amlak-view-all {
text-align: center;
margin-top: 40px;
}

.view-all-btn {
display: inline-flex;
align-items: center;
gap: 10px;
color: white;
padding: 14px 35px;
border-radius: 50px;
text-decoration: none;
font-weight: 600;
font-size: 16px;
transition: all 0.3s ease;
box-shadow: 0 8px 20px rgba(0,136,204,0.3);
border: none;
cursor: pointer;
}

.view-all-btn:hover {
transform: translateY(-3px);
box-shadow: 0 15px 30px rgba(0,136,204,0.4);
}

.view-all-btn i {
transition: transform 0.3s ease;
}

.view-all-btn:hover i {
transform: translateX(-5px);
}

.amlak-load-more {
text-align: center;
margin-top: 40px;
}

.load-more-btn {
display: inline-flex;
align-items: center;
gap: 10px;
color: white;
padding: 14px 35px;
border: none;
border-radius: 50px;
font-weight: 600;
font-size: 16px;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 8px 20px rgba(0,136,204,0.3);
}

.load-more-btn:hover {
transform: translateY(-3px);
box-shadow: 0 15px 30px rgba(0,136,204,0.4);
}

.load-more-btn i {
transition: transform 0.3s ease;
}

.load-more-btn:hover i {
transform: translateY(3px);
}

.load-more-btn:disabled {
opacity: 0.6;
cursor: not-allowed;
}

#load-more-spinner,
#infinite-scroll-spinner {
text-align: center;
padding: 20px;
}

[data-theme="dark"] .view-all-btn,
[data-theme="dark"] .load-more-btn {
background: linear-gradient(135deg, #006699, #004466);
}