/* ===== تنظیمات عمومی ===== */
:root {
    --mavi-gold: #B89A5A;
    --mavi-dark: #222;
    --mavi-light: #f8f8f8;
    --mavi-border: #eee;
}

.mavi-sets-archive,
.mavi-set-detail,
.mavi-sets-tabs {
    direction: rtl;
    text-align: center;
}

/* ===== صفحه Archive ===== */
.mavi-sets-archive .archive-header {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--mavi-gold) 0%, #a08950 100%);
    color: white;
    border-radius: 8px;
    margin-bottom: 40px;
}

.mavi-sets-archive .archive-header h1 {
    font-size: 32px;
    margin-bottom: 10px;
    font-weight: 700;
}

.mavi-sets-archive .archive-header p {
    font-size: 16px;
    opacity: 0.9;
}

/* ===== شبکه ست‌ها ===== */
.sets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

.set-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.set-card:hover {
    box-shadow: 0 6px 20px rgba(184, 154, 90, 0.2);
    transform: translateY(-5px);
    border-color: var(--mavi-gold);
}

.set-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, #f0e6d2 0%, #e8dcc7 100%);
}

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

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

.set-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-icon {
    font-size: 60px;
    opacity: 0.5;
}

.placeholder-icon.large {
    font-size: 120px;
}

.set-card-content {
    padding: 20px;
}

.set-card h3 {
    font-size: 18px;
    color: var(--mavi-dark);
    margin-bottom: 8px;
    font-weight: 600;
}

.set-card p {
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
    min-height: 30px;
}

.set-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.product-count {
    background: #f0e6d2;
    color: var(--mavi-gold);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ===== دکمه‌ها ===== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: inherit;
    text-align: center;
}

.btn-primary {
    background-color: var(--mavi-gold);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: #a08950;
    transform: scale(1.02);
}

.btn-secondary {
    background-color: #f0f0f0;
    color: var(--mavi-dark);
    flex: 1;
    margin-left: 8px;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

/* ===== صفحه جزئیات Set ===== */
.mavi-set-detail {
    padding: 20px;
}

.breadcrumb {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--mavi-border);
}

.breadcrumb a {
    color: var(--mavi-gold);
    text-decoration: none;
    font-weight: 600;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* ===== Set Header ===== */
.set-header {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

.set-header-image {
    width: 100%;
    min-height: 400px;
    background: linear-gradient(135deg, #f0e6d2 0%, #e8dcc7 100%);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.set-header-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.set-header-content h1 {
    font-size: 32px;
    color: var(--mavi-dark);
    margin-bottom: 15px;
    font-weight: 700;
    text-align: center;
}

.set-header-content h2 {
    text-align: center;
}

.featured-badge {
    display: inline-block;
    background: #fff3cd;
    color: #856404;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
}

.set-header-content .description {
    color: #666;
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 25px;
    text-align: center;
}

.set-info p {
    margin-bottom: 10px;
    font-size: 14px;
}

.set-info strong {
    color: var(--mavi-dark);
}

/* ===== بخش محصولات ===== */
.products-section {
    margin: 40px 0;
}

.products-section h2 {
    font-size: 24px;
    color: var(--mavi-dark);
    margin-bottom: 20px;
    border-bottom: 3px solid var(--mavi-gold);
    padding-bottom: 10px;
    text-align: center;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.product-card:hover {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}

.product-image {
    width: 100%;
    height: 200px;
    background: #ffffff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    box-sizing: border-box;
}

.product-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.product-info {
    padding: 15px;
    text-align: center;
}

.product-info h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--mavi-dark);
    margin-bottom: 8px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.product-info h3 a {
    text-decoration: none;
    color: inherit;
}

.product-info h3 a:hover {
    color: var(--mavi-gold);
}

.product-price {
    color: var(--mavi-gold);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.product-rating {
    margin-bottom: 12px;
    font-size: 12px;
    text-align: center;
}

.product-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.product-actions .btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
}

.product-actions form {
    flex: 1;
}

.product-actions button {
    width: 100%;
    background: var(--mavi-gold);
    color: white;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.3s;
}

.product-actions button:hover {
    background: #a08950;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .set-header {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .set-header-image {
        min-height: 300px;
    }
    
    /* ست‌ها و محصولات هر دو دو ستونه */
    .sets-grid,
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .archive-header {
        padding: 40px 20px;
    }
    
    .archive-header h1 {
        font-size: 24px;
    }
    
    .set-header-content h1 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    /* در موبایل کوچک هم دو ستونه می‌ماند، فقط جمع‌وجورتر */
    .sets-grid,
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    /* عکس‌ها کوتاه‌تر تا کارت‌ها کوچک‌تر شوند */
    .set-image {
        height: 150px;
    }
    
    .product-image {
        height: 140px;
    }
    
    /* متن‌ها کوچک‌تر */
    .set-card-content h3 {
        font-size: 15px;
    }
    
    .set-card-content p {
        font-size: 12px;
    }
    
    .product-info h3 {
        font-size: 13px;
    }
    
    .set-card-content,
    .product-info {
        padding: 12px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .archive-header h1 {
        font-size: 20px;
    }
    
    .archive-header p {
        font-size: 13px;
    }
}

/* ===== حالت تب فوری (mavi_sets_tabs) ===== */
.mavi-set-trigger {
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    border: 2px solid transparent;
}
.mavi-set-trigger:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.mavi-set-trigger.is-active {
    border-color: var(--mavi-gold, #B89A5A);
    box-shadow: 0 8px 28px rgba(184,154,90,.28);
}
.mavi-set-view-btn {
    cursor: pointer;
}
.mavi-sets-panels {
    margin-top: 36px;
}
.mavi-set-panel {
    animation: maviFadeIn .35s ease;
}
@keyframes maviFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== تضمین وسط‌چینی (override قالب سایت) ===== */
.mavi-sets-archive,
.mavi-sets-archive *,
.mavi-set-detail,
.mavi-set-detail *,
.mavi-sets-tabs,
.mavi-sets-tabs *,
.mavi-sets-panels,
.mavi-sets-panels *,
.mavi-sets-page,
.mavi-sets-page *,
.mavi-inline-panel,
.mavi-inline-panel * {
    text-align: center;
}

/* استثناها: توضیحات بلند ست */
.mavi-set-detail .description,
.mavi-sets-tabs .description {
    text-align: center;
}

/* دکمه‌ها و کارت‌ها وسط */
.mavi-sets-archive .set-card-content,
.mavi-sets-tabs .set-card-content,
.mavi-set-detail .product-info,
.mavi-sets-tabs .product-info {
    text-align: center;
}

.mavi-sets-archive .btn,
.mavi-set-detail .btn,
.mavi-sets-tabs .btn {
    margin-left: auto;
    margin-right: auto;
}

/* ===== پنل محصولات زیر همان ست (mavi_sets_page) ===== */
.mavi-page-grid {
    align-items: start;
}
/* پنل تمام عرض گرید را می‌گیرد تا زیر ردیف ست بیاید */
.mavi-inline-panel {
    grid-column: 1 / -1;
    background: #faf7f0;
    border-radius: 12px;
    padding: 24px;
    margin: 4px 0 16px;
    animation: maviFadeIn .3s ease;
    border: 1px solid #efe6d4;
}
.mavi-inline-panel .set-header {
    box-shadow: none;
    background: transparent;
    display: block;
    padding: 0 0 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e8dcc4;
}
.mavi-inline-panel .mavi-set-detail {
    padding: 0;
}
/* کارت ست فعال مشخص شود */
.mavi-page-grid .set-card.is-active {
    border: 2px solid var(--mavi-gold, #B89A5A);
    box-shadow: 0 8px 28px rgba(184,154,90,.28);
}

/* ===== تضمین وسط‌چینی توضیحات (غلبه بر قالب و محتوای ادیتور) ===== */
.mavi-inline-panel .description,
.mavi-inline-panel .description *,
.mavi-set-detail .description,
.mavi-set-detail .description *,
.set-header-content,
.set-header-content * {
    text-align: center !important;
}

/* ===== وسط‌چینی نهایی با اولویت بالا (غلبه بر قالب سایت) ===== */
.mavi-sets-page h1,
.mavi-sets-page h2,
.mavi-sets-page h3,
.mavi-sets-page p,
.mavi-sets-page .set-card-content,
.mavi-sets-page .product-info,
.mavi-sets-page .archive-header,
.mavi-inline-panel h2,
.mavi-inline-panel h3,
.mavi-inline-panel p,
.mavi-inline-panel .description,
.mavi-inline-panel .set-header-content {
    text-align: center !important;
}
