/****************************************
 * Category Detail Page Styles
 * هماهنگ با product_detail.css
 ****************************************/

/* اگر متغیرها در جای دیگری تعریف نشده‌اند، می‌توانید این بخش را هم اضافه کنید
:root {
    --primary-color: #2c4b4d;
    --primary-light: rgba(44, 75, 77, 0.1);
    --primary-dark: #1e3536;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --white-color: #ffffff;
    --border-color: #e9ecef;
    --text-color: #333333;
    --text-muted: #6c757d;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 5px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    --font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    --transition: all 0.3s ease;
}
*/

/* کلیات صفحه دسته‌بندی */
body {
    font-family: var(--font-family);
    background-color: var(--light-color);
    color: var(--text-color);
}

/* ========== Breadcrumb ========== */

nav[aria-label="breadcrumb"] {
    background: linear-gradient(to right, var(--white-color), var(--light-color));
    padding: 12px 18px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.breadcrumb {
    background: transparent;
    margin-bottom: 0;
    padding: 0;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb-item a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--text-muted);
}

/* ========== Category Header ========== */

.category-header {
    background: var(--primary-light);
    padding: 40px 0;
    border-radius: var(--border-radius-lg);
    margin-top: 20px;
    margin-bottom: 30px;
}

.category-header .img-fluid.rounded.shadow {
    border-radius: var(--border-radius-lg) !important;
    box-shadow: var(--shadow-md) !important;
}

.category-icon-placeholder {
    width: 100%;
    height: 220px;
    border-radius: var(--border-radius-lg);
    background: var(--white-color);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon-placeholder i {
    color: var(--primary-color);
}

.category-header h1 {
    color: var(--dark-color);
    margin-bottom: 15px;
}

.category-description {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.category-meta {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-meta .badge {
    border-radius: 50px;
    padding: 8px 14px;
    box-shadow: var(--shadow-sm);
}

/* ========== Subcategories Section ========== */

.subcategories-section {
    padding-top: 0;
    padding-bottom: 40px;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--dark-color);
}

/* کارت زیردسته‌ها */
.subcategory-card {
    display: block;
    background: var(--white-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
}

.subcategory-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.subcategory-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.subcategory-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    background: var(--primary-light);
    color: var(--primary-color);
}

.subcategory-info {
    padding: 12px 16px 16px;
}

.subcategory-info h5 {
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 1rem;
}

.subcategory-info .text-muted {
    font-size: 0.85rem;
}

/* ========== Products Section ========== */

.products-section {
    padding-top: 0;
    padding-bottom: 60px;
}

/* عنوان و مرتب‌سازی */
.products-section .section-title {
    margin-bottom: 0;
}

.sort-options .form-select {
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    border-color: var(--border-color);
    font-size: 0.9rem;
}

/* کارت محصول در گرید دسته‌بندی */
.product-card {
    background: var(--white-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* تصویر محصول */
.product-image {
    position: relative;
    overflow: hidden;
    background: var(--light-color);
}

.product-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.no-image {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary-color);
    font-size: 2rem;
}

/* برچسب‌ها (جدید، ویژه، تخفیف) */
.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--white-color);
    box-shadow: var(--shadow-md);
}

.product-badge.new {
    background: var(--success-color);
}

.product-badge.featured {
    background: var(--info-color);
}

.product-badge.discount {
    background: var(--danger-color);
}

/* آیکون‌های اکشن روی تصویر */
.product-actions {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.product-card:hover .product-actions {
    opacity: 1;
    visibility: visible;
    bottom: 20px;
}

.btn-action {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--white-color);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    color: var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
}

.btn-action:hover {
    background: var(--primary-color);
    color: var(--white-color);
    transform: translateY(-2px);
}

/* اطلاعات محصول */
.product-info {
    padding: 14px 16px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category a {
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--text-muted);
    transition: var(--transition);
}

.product-category a:hover {
    color: var(--primary-color);
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 6px 0 4px;
}

.product-title a {
    color: var(--dark-color);
    text-decoration: none;
}

.product-title a:hover {
    color: var(--primary-color);
}

.product-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    min-height: 44px; /* دو خط تقریبی */
}

/* قیمت‌ها */
.product-price {
    margin-top: 8px;
}

.price-original {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-left: 6px;
}

.price-final {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-color);
}

.price-call .call-text,
.price-out .out-text {
    font-weight: 600;
    color: var(--secondary-color);
}

/* متای محصول (موجودی / امتیاز) */
.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 0.85rem;
}

.stock-status .badge {
    border-radius: 50px;
}

/* امتیاز و ستاره‌ها */
.product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-rating .stars {
    display: inline-flex;
    gap: 2px;
}

.product-rating .stars i.bi-star-fill,
.product-rating .stars i.bi-star-half {
    color: var(--warning-color);
}

/* دکمه اصلی پایین کارت */
.product-actions-main {
    display:flex;
    gap:10px;
    margin-top: 12px;
}

.product-actions-main .btn {
    font-size: 0.9rem;
    border-radius: var(--border-radius-md);
    flex:1;
    text-align:center;
    padding:10px;
}

/* ========== ریسپانسیو ========== */

@media (max-width: 767.98px) {
    .category-header {
        padding: 24px 0;
    }

    .category-header h1 {
        font-size: 1.6rem;
    }

    .subcategory-image img,
    .subcategory-icon {
        height: 160px;
    }

    .product-image img,
    .no-image {
        height: 200px;
    }
}

@media (max-width: 576px){

    .product-actions-main{
        flex-direction:column;
    }

    .product-actions-main .btn{
        width:100%;
    }

}
