:root {
    --font-body: 'Vazirmatn', 'Vazir', 'Segoe UI', Tahoma, sans-serif;
    --blue: #1976d2;
    --blue-light: #42a5f5;
    --orange: #f97316;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    --bg: #f8fafc;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    direction: rtl;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* shop hero */
.shop-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0c4a6e 100%);
    color: #fff;
    padding: 36px 0 40px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 16px;
}

.breadcrumb a:hover { color: #fff; }
.breadcrumb span.sep { opacity: 0.5; }

.shop-hero h1 {
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 800;
    margin-bottom: 8px;
}

.shop-hero p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    max-width: 640px;
}

/* layout */
.shop-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 28px;
    padding: 36px 0 56px;
    align-items: start;
}

/* sidebar */
.shop-sidebar {
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    overflow: hidden;
    position: sticky;
    top: 90px;
}

.sidebar-head {
    padding: 16px 18px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 15px;
    color: #0c4a6e;
}

.cat-list { padding: 8px 0; }

.cat-item > a,
.cat-item > button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 11px 18px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
    text-align: right;
    transition: background 0.2s, color 0.2s;
}

.cat-item > a:hover,
.cat-item > button:hover,
.cat-item.active > a,
.cat-item.active > button {
    background: rgba(33, 150, 243, 0.08);
    color: var(--blue);
}

.cat-item.active > a,
.cat-item.active > button { font-weight: 700; }

.cat-count {
    font-size: 12px;
    color: var(--muted);
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 999px;
}

.subcat-list {
    padding: 0 0 8px;
    display: none;
}

.cat-item.open .subcat-list { display: block; }

.subcat-list a {
    display: block;
    padding: 8px 18px 8px 32px;
    font-size: 13px;
    color: var(--muted);
    border-right: 3px solid transparent;
    transition: all 0.2s;
}

.subcat-list a:hover,
.subcat-list a.active {
    color: var(--blue);
    background: rgba(33, 150, 243, 0.05);
    border-right-color: var(--blue);
}

/* main */
.shop-main { min-width: 0; }

.shop-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    background: #fff;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
}

.shop-search {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.shop-search input {
    width: 100%;
    padding: 11px 42px 11px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
}

.shop-search input:focus {
    outline: none;
    border-color: var(--blue-light);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.12);
}

.shop-search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.shop-sort select {
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
}

.shop-count {
    font-size: 13px;
    color: var(--muted);
    width: 100%;
}

.filter-toggle {
    display: none;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
}

/* product grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.product-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card-link {
    display: flex;
    flex-direction: column;
    flex: 1;
    color: inherit;
    text-decoration: none;
}

.product-card-link:hover .product-name {
    color: var(--primary);
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(33, 150, 243, 0.12);
}

.product-thumb {
    aspect-ratio: 1;
    background: linear-gradient(145deg, #f0f9ff 0%, #e0f2fe 50%, #fef3c7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-thumb-icon {
    font-size: 48px;
    opacity: 0.85;
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--orange);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
}

.product-badge.out {
    background: #94a3b8;
}

.product-body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-brand {
    font-size: 12px;
    font-weight: 600;
    color: var(--blue);
    margin-bottom: 6px;
}

.product-name {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.5;
    margin-bottom: 12px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-name .product-name-ltr {
    direction: ltr;
    unicode-bidi: isolate;
    display: inline-block;
    white-space: nowrap;
}

.product-name .product-title-model {
    display: block;
    margin-top: 4px;
    font-size: 0.95em;
    font-weight: 700;
    color: #334155;
    direction: rtl;
    text-align: right;
    unicode-bidi: isolate;
}

.product-price {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
    line-height: 1.5;
}

.product-price span {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}

.product-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.btn-product {
    flex: 1;
    padding: 10px 12px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-view {
    background: linear-gradient(135deg, var(--blue-light), var(--blue));
    color: #fff;
}

.btn-view:hover { opacity: 0.92; }

.btn-inquiry {
    background: #fff;
    border: 1px solid var(--border);
    color: #475569;
}

.btn-inquiry:hover {
    border-color: var(--orange);
    color: var(--orange);
}

.shop-empty {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 16px;
    border: 1px dashed var(--border);
}

.shop-empty-icon { font-size: 48px; margin-bottom: 12px; }

.shop-loading {
    text-align: center;
    padding: 80px 20px;
    color: var(--muted);
}

@media (max-width: 992px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .shop-layout { grid-template-columns: 1fr; }
    .shop-sidebar { display: none; position: static; }
    .shop-sidebar.mobile-open { display: block; }
    .filter-toggle { display: block; }
}

@media (max-width: 480px) {
    .product-grid { grid-template-columns: 1fr; }
}
