:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 16px;
}

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

body {
    font-family: 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    direction: rtl;
    line-height: 1.5;
}

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

/* Header */
.site-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    padding: 32px 0;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    font-size: 2.8rem;
    background: rgba(255, 255, 255, 0.1);
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.site-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.subtitle {
    color: #94a3b8;
    font-size: 0.95rem;
    margin-top: 4px;
}

.header-stats {
    display: flex;
    gap: 16px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 12px;
    text-align: center;
    min-width: 110px;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: #38bdf8;
}

.stat-label {
    font-size: 0.75rem;
    color: #cbd5e1;
}

/* Controls & Filters */
.controls-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
}

.search-bar-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: var(--text-muted);
}

#searchInput {
    width: 100%;
    padding: 14px 48px 14px 44px;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    transition: all 0.2s ease;
    background: #f8fafc;
    font-family: inherit;
}

#searchInput:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.clear-btn {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    font-size: 1.4rem;
    color: var(--text-muted);
    cursor: pointer;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: #f1f5f9;
    color: var(--text-main);
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pill:hover {
    background: #e2e8f0;
}

.pill.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.options-group {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: flex-end;
}

.select-wrapper {
    flex: 1;
}

.custom-select {
    width: 100%;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #ffffff;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    cursor: pointer;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 6px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.88rem;
    font-weight: 500;
}

/* Products Grid */
.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.products-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
}

.results-badge {
    background: #e0e7ff;
    color: #3730a3;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* Product Card */
.product-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
}

.card-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
}

.card-badges {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
}

.badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-store-mi-il { background: #ff6900; color: #fff; }
.badge-store-xistore { background: #000000; color: #fff; }
.badge-store-ronlight { background: #2b59c0; color: #fff; }

.badge-type {
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    position: absolute;
    bottom: 12px;
    right: 12px;
    backdrop-filter: blur(4px);
}

.badge-stock {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
}

.badge-stock.in-stock { background: #d1fae5; color: #065f46; }
.badge-stock.out-of-stock { background: #fee2e2; color: #991b1b; }

.card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
}

.card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.price-container {
    display: flex;
    flex-direction: column;
}

.price-label {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.price-val {
    font-size: 1.35rem;
    font-weight: 800;
    color: #047857;
}

.price-na {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
}

.btn-buy {
    background: var(--primary);
    color: #ffffff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    transition: background 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-buy:hover {
    background: var(--primary-hover);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
    margin-top: 20px;
}

.empty-icon {
    font-size: 3.5rem;
    margin-bottom: 12px;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 6px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.btn-reset {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.btn-reset:hover {
    background: var(--primary);
    color: #ffffff;
}

/* Footer */
.site-footer {
    margin-top: 60px;
    padding: 30px 0;
    background: #0f172a;
    color: #94a3b8;
    text-align: center;
    font-size: 0.85rem;
}

.footer-content p {
    margin-bottom: 6px;
}

@media (max-width: 640px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    .options-group {
        flex-direction: column;
        align-items: flex-start;
    }
    .products-grid {
        grid-template-columns: 1fr;
    }
}
