/* ===== تم تیره فروشگاه ===== */
:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --primary: #f97316;
    --primary-hover: #ea580c;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --success: #10b981;
    --danger: #ef4444;
}

body.shop-theme {
    background: var(--bg-dark);
    color: var(--text-light);
    font-family: 'Vazirmatn', sans-serif;
    overflow-x: hidden;
}

body.shop-theme *,
body.shop-theme *::before,
body.shop-theme *::after {
    box-sizing: border-box;
}

/* هدر فروشگاه */
.shop-header {
    background: var(--bg-card);
    border-bottom: 2px solid var(--primary);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.shop-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
}

.shop-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 900;
    text-decoration: none;
}

.shop-search {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.shop-search input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-light);
    font-family: inherit;
}

.shop-search button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    border: none;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.shop-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    min-width: 0;
}

.shop-header-actions a {
    color: var(--text-light);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 6px;
    transition: 0.3s;
    white-space: nowrap;
}

.shop-header-actions .cart-badge {
    padding: 2px 6px;
}

.shop-header-actions a[aria-label="سبد خرید"] {
    background: var(--primary);
    color: #fff;
}

.shop-header-actions a[aria-label="سبد خرید"]:hover {
    background: var(--primary-hover);
    color: #fff;
}

.shop-header-actions a:hover {
    background: var(--bg-card-hover);
    color: var(--primary);
}

.cart-badge {
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: bold;
}

/* منوی دسته‌بندی */
.category-menu {
    background: var(--bg-card);
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.category-menu ul {
    display: flex;
    gap: 10px;
    list-style: none;
    flex-wrap: wrap;
    justify-content: center;
}

.category-menu a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    transition: 0.3s;
    font-size: 0.9rem;
}

.category-menu a:hover,
.category-menu a.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* بنر اصلی */
.shop-hero {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 60px 0;
    border-radius: 15px;
    margin: 30px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.shop-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(249,115,22,0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.shop-hero h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 15px;
    position: relative;
}

.shop-hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    position: relative;
}

/* کارت محصول */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.product-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    transition: 0.3s;
    border: 1px solid var(--border);
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(249,115,22,0.2);
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger);
    color: #fff;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 2;
}

.product-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: var(--bg-dark);
}

.product-info {
    padding: 15px;
}

.product-title {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 8px;
    min-height: 45px;
}

.product-rating {
    color: #fbbf24;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.price-current {
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 900;
}

.price-old {
    color: var(--text-muted);
    text-decoration: line-through;
    font-size: 0.9rem;
}

.btn-add-cart {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add-cart:hover {
    background: var(--primary-hover);
}

/* فیلترها */
.shop-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 25px;
    margin: 30px 0;
}

.shop-sidebar {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    height: fit-content;
}

.shop-sidebar h4 {
    color: var(--primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    color: var(--text-muted);
    cursor: pointer;
}

.filter-group input[type="checkbox"] {
    accent-color: var(--primary);
}

/* صفحه محصول */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 30px 0;
}

.product-gallery img {
    width: 100%;
    border-radius: 12px;
    background: var(--bg-card);
}

.product-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.product-thumbs img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
}

.product-thumbs img.active {
    border-color: var(--primary);
}

.product-meta {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 12px;
}

.product-meta h1 {
    color: var(--text-light);
    margin-bottom: 15px;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}

.meta-row strong {
    color: var(--text-light);
}

/* سبد خرید */
.cart-table {
    width: 100%;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
}

.cart-table th,
.cart-table td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

.cart-table th {
    background: var(--bg-dark);
    color: var(--primary);
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-control button {
    background: var(--primary);
    color: #fff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
}

.qty-control input {
    width: 50px;
    text-align: center;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-light);
    padding: 5px;
    border-radius: 6px;
}

.cart-summary {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 12px;
    margin-top: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    color: var(--text-muted);
}

.summary-total {
    border-top: 2px solid var(--primary);
    margin-top: 10px;
    padding-top: 15px;
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--primary);
}

/* فرم‌ها */
.form-input {
    width: 100%;
    padding: 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-light);
    font-family: inherit;
    margin-bottom: 15px;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-primary-shop {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    font-size: 1rem;
    transition: 0.3s;
}

.btn-primary-shop:hover {
    background: var(--primary-hover);
}

/* تب‌ها */
.product-tabs {
    margin-top: 30px;
}

.tab-buttons {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 12px 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
    background: var(--bg-card);
    padding: 25px;
    border-radius: 12px;
    line-height: 2;
}

.tab-content.active {
    display: block;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .container {
        width: 100%;
        max-width: 100%;
        padding-right: 14px;
        padding-left: 14px;
    }
    .shop-layout {
        grid-template-columns: 1fr;
    }
    .product-detail {
        grid-template-columns: 1fr;
    }
    .shop-header .container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    .shop-logo {
        justify-content: center;
        font-size: 1.15rem;
    }
    .shop-logo img {
        width: 38px;
        height: 38px;
        object-fit: contain;
    }
    .shop-header-actions {
        width: 100%;
        justify-content: center;
        gap: 4px;
        flex-wrap: wrap;
    }
    .shop-header-actions a {
        padding: 7px 6px;
        font-size: 0.82rem;
    }
    .cart-table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .toast {
        left: 12px;
        right: 12px;
        bottom: 12px;
        justify-content: center;
        max-width: calc(100% - 24px);
    }
    .search-form {
        flex-wrap: wrap;
    }
    .search-form input {
        min-width: 0;
    }
}