/* ========================================= */
/* متغیرهای پایه و رنگی */
/* ========================================= */
:root {
    --primary-color: #043e59; /* رنگ سازمانی سیترا بیوتک */
    --primary-dark: #032b3e;
    --border-color: #e2e8f0;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --success-color: #16a34a;
    --danger-color: #dc2626;

    /* متغیرهای پیش‌فرض دسته‌بندی فعال (توسط HTML بازنویسی می‌شود) */
    --active-cat-color: #043e59;
    --active-cat-bg: #f0f7fa;
}

* {
    box-sizing: border-box;
}

/* ========================================= */
/* ساختار کلی و اصلی صفحه */
/* ========================================= */
.shop-container {
    max-width: 1400px;
    width: 100%;
    margin: 30px auto;
    padding: 0 20px;
}

.shop-layout {
    display: flex;
    flex-wrap: nowrap;
    gap: 25px;
    align-items: flex-start;
    width: 100%;
}

/* ========================================= */
/* هدر و بنر بالای صفحه */
/* ========================================= */
.shop-header {
    position: relative;
    background-color: #043e59;
    background-size: 35%; /* عکس کوچکتر می‌شود */
    background-position: left center; /* انتقال عکس به سمت چپ */
    background-repeat: no-repeat;
    padding: 65px 45px;
    border-radius: 20px;
    margin-bottom: 35px;
    overflow: hidden;
    color: white;
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; /* پوشش کل عرض بنر */
    height: 100%;
    /* گرادیانت از راست (تیره) به چپ (شفاف) برای نمایش واضح‌تر متن‌ها در حالت RTL */
    background: linear-gradient(270deg, rgba(4, 62, 89, 1) 40%, rgba(4, 62, 89, 0) 100%);
    z-index: 1;
}

.banner-content {
    position: relative;
    z-index: 2;
    max-width: 650px;
}

.banner-content h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.banner-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    opacity: 0.95;
}

/* ========================================= */
/* اسلایدر افقی دسته‌بندی‌ها */
/* ========================================= */
.categories-slider-wrapper {
    width: 100%;
    margin-bottom: 35px;
    position: relative;
}

.categories-slider {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding: 10px 5px 20px 5px;
    scroll-behavior: smooth;
    cursor: grab;
}

.categories-slider::-webkit-scrollbar {
    height: 6px;
}

.categories-slider::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.categories-slider::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.categories-slider::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.category-slide-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.9rem;
    font-weight: 700;
    transition: color 0.3s ease;
    user-select: none;
    width: 120px;
    text-align: center;
}

.category-img-container {
    width: 95px;
    height: 95px;
    border-radius: 50%;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    border: 3px solid #f1f5f9;
    padding: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.category-img-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.category-slide-item:hover .category-img-container {
    transform: translateY(-4px);
    border-color: var(--cat-color);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
}

.category-slide-item.active .category-img-container {
    border-color: var(--cat-color);
    transform: scale(1.05);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
}

.category-slide-item:hover span,
.category-slide-item.active span {
    color: var(--cat-color);
}

/* ========================================= */
/* سایدبار (فیلترها) */
/* ========================================= */
.shop-sidebar {
    width: 280px;
    flex: 0 0 280px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    position: sticky;
    top: 20px;
}

.filter-section {
    margin-bottom: 30px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-title {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 15px;
    padding-bottom: 10px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-cat-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    background: transparent;
    transition: all 0.25s ease;
    color: var(--text-dark);
    border: 1px solid transparent;
}

.sidebar-img-wrapper {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    margin-left: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-cat-item:hover {
    background-color: var(--cat-bg);
    color: var(--cat-color);
}

.sidebar-cat-item.active {
    background-color: var(--cat-bg);
    color: var(--cat-color);
    font-weight: 700;
    border-color: var(--cat-color);
}

/* ========================================= */
/* گرید و کارت محصولات */
/* ========================================= */
.products-section {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    position: relative;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    text-align: right;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--active-cat-color);
    z-index: 5;
    transition: background-color 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--active-cat-color);
    box-shadow: 0 10px 20px rgba(45, 55, 72, 0.08);
}

.product-image-container {
    height: 200px;
    background: var(--bg-light);
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-details {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-brand {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

/* طراحی جدید لیبل دسته‌بندی با آیکون تگ */
.product-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #043e59;
    background: #f1f5f9;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 8px;
    align-self: flex-start;
    font-weight: 700;
}

.product-category-badge i {
    font-size: 0.75rem;
    color: #043e59;
}

.product-title {
    font-size: 0.95rem;
    color: var(--text-dark);
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 10px;
    height: 45px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* استایل مربوط به نمایش خلوص مواد */
.product-purity-tag {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--success-color);
    background: #f0fdf4;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: bold;
    border: 1px solid #bbf7d0;
    align-self: flex-start;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px 15px;
    margin-top: auto;
}

.product-price {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-dark);
}

.add-to-cart-quick-btn {
    background-color: var(--active-cat-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s;
}

.add-to-cart-quick-btn:hover {
    filter: brightness(0.9);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--danger-color);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 10;
}

/* ========================================= */
/* واکنش‌گرایی (Responsive) */
/* ========================================= */
@media (max-width: 992px) {
    .shop-layout {
        flex-direction: column;
    }

    .shop-sidebar {
        width: 100%;
        flex: none;
        position: static;
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .shop-header {
        background-size: 50%;
        padding: 40px 25px;
    }

    .banner-content h1 {
        font-size: 1.8rem;
    }

    .banner-content p {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .shop-container {
        padding: 0 15px;
    }

    .shop-header {
        background-size: cover;
        background-position: center;
    }

    .banner-overlay {
        background: rgba(4, 62, 89, 0.85);
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .product-details, .product-footer {
        padding: 10px;
    }

    .product-title {
        font-size: 0.85rem;
        height: 38px;
    }

    .product-price {
        font-size: 1rem;
    }

    .add-to-cart-quick-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}
