/* =========================================
 * Luster AJAX Filter & Grid - CSS v7.0
 * Author: load ⚜️ via Gemini Pro 2.5
 * ========================================= */

:root {
    --gold: #c5a661;
    --navy: #18294a;
    --bg-light: #f9f9f9;
    --border-color: #e5e5e5;
    --text-dark: #333;
    --text-light: #666;
    --font-main: 'Shabnam', sans-serif; /* یا فونت دلخواه شما */
    --transition: all 0.35s ease-in-out;
    --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* --- ساختار کلی و چیدمان --- */
.luster-archive-container {
    direction: rtl;
    font-family: var(--font-main);
}

#luster-main-content {
    display: grid;
    grid-template-columns: 280px 1fr; /* ستون فیلتر و ستون محصولات */
    gap: 30px;
    align-items: flex-start;
}

#luster-filter-sidebar {
    position: sticky;
    top: 20px;
}

#lusterFilterForm {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: 12px;
}

.filter-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px dashed var(--border-color);
}
.filter-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.filter-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 18px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Breadcrumbs --- */
.luster-breadcrumbs {
    margin-bottom: 30px;
    font-size: 0.9em;
    color: var(--text-light);
}
#breadcrumbs a { color: var(--gold); text-decoration: none; }
#breadcrumbs a:hover { text-decoration: underline; }

/* --- باکس شمارنده و مرتب‌سازی --- */
.luster-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px 20px;
}
.luster-result-count {
    font-size: 0.95rem;
    color: var(--text-light);
}
.luster-sorting {
    display: flex;
    align-items: center;
    gap: 15px;
}
.luster-sorting select {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}
.luster-sorting select:hover,
.luster-sorting select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(197, 166, 97, 0.15);
    outline: none;
}

/* --- گرید محصولات --- */
.luster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 25px; }
.luster-card {
    background: #fff; border-radius: 12px; overflow: hidden;
    transition: var(--transition); border: 1px solid transparent;
}
.luster-card:hover {
    box-shadow: var(--shadow-medium); transform: translateY(-5px);
    border-color: var(--gold);
}
.luster-card-image-wrapper { display: block; position: relative; overflow: hidden; background: var(--bg-light); }
.luster-card img {
    width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.luster-card .hover-image { position: absolute; top: 0; left: 0; opacity: 0; }
.luster-card:hover .main-image { opacity: 0; transform: scale(1.05); }
.luster-card:hover .hover-image { opacity: 1; transform: scale(1.05); }

.luster-card-content { padding: 15px 20px; text-align: center; }
.luster-card-title {
    font-size: 1rem; font-weight: 600; margin: 0 0 10px;
    position: relative; display: inline-block;
}
.luster-card-title a { color: var(--text-dark); text-decoration: none; }
.luster-card-title::after {
    content: ""; position: absolute; bottom: -5px; right: 0;
    width: 0; height: 2px; background: var(--gold);
    transition: width 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.luster-card:hover .luster-card-title::after { width: 100%; }
.luster-card .price { color: var(--gold); font-weight: 700; font-size: 1.1rem; }
.luster-card .price ins { background: none; color: inherit; text-decoration: none; }
.luster-card .price del { font-size: 0.9em; margin-left: 5px; color: var(--text-light); }

/* --- دکمه افزودن به سبد خرید --- */
.luster-card-footer {
    padding: 15px 20px 20px; text-align: center;
}
.luster-card-footer .button {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 10px 18px; border-radius: 30px; border: none;
    background: var(--gold); color: #fff; font-weight: 600;
    cursor: pointer; transition: var(--transition);
}
.luster-card-footer .button::before {
    content: ""; width: 16px; height: 16px;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M7 6H5L3 9v2h2l3.6 7H19l3-7h2V9l-3 .01L19.8 6H9.2zM17 20a1 1 0 1 1-2.001.001A1 1 0 0 1 17 20zm-8 0a1 1 0 1 1-2.001.001A1 1 0 0 1 9 20zm5-8h-2v2h2v-2zm3-3H7v2h10V9z'/%3E%3C/svg%3E");
    mask-size: contain; mask-repeat: no-repeat; background: currentColor;
}
.luster-card-footer .button:hover {
    background: var(--navy); transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(24, 41, 74, 0.2);
}

/* --- صفحه‌بندی --- */
.luster-pagination { text-align: center; margin-top: 40px; direction: ltr; }
.luster-pagination .page-num {
    display: inline-block; margin: 0 5px; min-width: 40px; height: 40px; line-height: 40px;
    border: 1px solid var(--border-color); border-radius: 50%; cursor: pointer;
    transition: var(--transition); font-size: 0.9rem; font-weight: bold;
}
.luster-pagination .page-num.active, .luster-pagination .page-num:hover {
    background: var(--gold); color: var(--navy); border-color: var(--gold);
    transform: translateY(-2px); box-shadow: var(--shadow-light);
}

/* --- لودر و پیام‌ها --- */
.no-products-found { text-align: center; padding: 60px 20px; background: #fff; border-radius: 12px; color: var(--text-light); }
#luster-loader {
    display: none; position: fixed; inset: 0; background: rgba(255, 255, 255, 0.7);
    z-index: 10000; align-items: center; justify-content: center;
}
.loader-ring {
    width: 50px; height: 50px; border: 4px solid var(--navy);
    border-right-color: transparent; border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- باکس دیباگ --- */
.luster-debug-box {
    background: #222; color: #0f0; padding: 15px; border-radius: 5px;
    font-family: monospace; font-size: 12px; margin-bottom: 20px;
    direction: ltr; text-align: left; max-height: 300px; overflow: auto;
}

/* --- حالت موبایل و واکنش‌گرایی --- */
.mobile-filter-title, .close-filter-mobile, .mobile-apply-wrapper, #lusterFilterToggleBtn { display: none; }

@media (max-width: 1200px) {
    #luster-main-content { grid-template-columns: 1fr; }
    #luster-filter-sidebar {
        position: static;
        order: 2;
    }
    .mobile-filter-title, .close-filter-mobile, #lusterFilterToggleBtn { display: block; }
    #lusterFilterForm {
        position: fixed; top: 0; left: 0; width: min(400px, 90vw); height: 100vh;
        transform: translateX(-100%); transition: var(--transition); z-index: 1000;
        border-radius: 0; overflow-y: auto; padding: 30px 25px; box-shadow: var(--shadow-medium);
    }
    #lusterFilterForm.active { transform: translateX(0); }
    #luster-main-content { gap: 20px; }
}

@media (max-width: 768px) {
    .luster-toolbar {
        flex-direction: column; align-items: flex-start; gap: 12px;
    }
    .luster-sorting { width: 100%; justify-content: space-between; }
    .luster-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
}

@media (max-width: 576px) {
    .luster-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; }
    .luster-card-content { padding: 12px 15px; }
    .luster-card-title { font-size: 0.95rem; }
    .luster-card-footer .button { width: 100%; }
}
