@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700&family=Tajawal:wght@400;500;700&display=swap');

:root {
    /* Premium Color Palette */
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.15);
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --border: #e2e8f0;
    --radius-lg: 20px;
    --radius-md: 12px;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-main: #0f172a;
        --card-bg: #1e293b;
        --text-main: #f8fafc;
        --text-muted: #94a3b8;
        --border: #334155;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Tajawal', 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    direction: rtl;
    line-height: 1.5;
    overflow-x: hidden;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

/* Luxury Header */
header {
    margin-bottom: 24px;
    padding: 12px 4px;
}

header h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 10px;
}

header h1 i {
    color: var(--primary);
    font-size: 20px;
}

/* 2-Column Luxury Grid */
.product-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

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

.product-card:active {
    transform: scale(0.98);
}

.product-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* Square Aspect Ratio */
    background: #f1f5f9;
}

.product-image {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.type-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    color: var(--primary);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.product-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-info h3 {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-info p.desc {
    font-size: 12px;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 36px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.price {
    color: var(--accent);
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-buy {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    width: 100%;
    margin-top: 8px;
    transition: opacity 0.2s;
}

.btn-buy:active {
    opacity: 0.8;
}

/* Modals Modern Refinement */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end; /* Mobile Bottom Sheet Style */
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-bg);
    width: 100%;
    max-width: 600px;
    padding: 24px;
    border-radius: 32px 32px 0 0;
    box-shadow: 0 -10px 25px rgba(0,0,0,0.1);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.input-modern {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg-main);
    color: var(--text-main);
    font-family: inherit;
    font-size: 15px;
    margin-top: 8px;
}

.input-modern:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Admin Specific */
.admin-tabs {
    display: flex;
    background: var(--border);
    padding: 4px;
    border-radius: 14px;
    margin-bottom: 20px;
}

.admin-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-family: inherit;
    border-radius: 10px;
}

.admin-tab.active {
    background: var(--card-bg);
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
