:root {
    --bg-color: #F0F0F5;
    --card-bg: #FFFFFF;
    --card-border: #E0E0E0;
    --text-primary: #2C3E50;
    --text-secondary: #666666;
    --primary-color: #C2185B;
    --primary-light: #FCE4EC;
    --primary-border: #E91E63;
    --success-color: #28A745;
    --warning-color: #FF9800;
    --danger-color: #DC3545;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

[data-theme="dark"] {
    --bg-color: #121212;
    --card-bg: #1E1E1E;
    --card-border: #333333;
    --text-primary: #FFFFFF;
    --text-secondary: #AAAAAA;
    --primary-light: #3D1F2F;
    --primary-border: #F48FB1;
    --shadow: 0 2px 12px rgba(0,0,0,0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, sans-serif; -webkit-tap-highlight-color: transparent; }
body { background-color: var(--bg-color); color: var(--text-primary); transition: background 0.3s, color 0.3s; padding-bottom: 70px; }

.install-banner { position: fixed; top: 0; left: 0; right: 0; background: var(--primary-color); color: white; padding: 12px 15px; display: flex; align-items: center; justify-content: space-between; z-index: 9999; box-shadow: 0 4px 12px rgba(0,0,0,0.2); font-size: 13px; font-weight: bold; }
.banner-btn { background: white; color: var(--primary-color); border: none; padding: 6px 12px; border-radius: 6px; font-weight: bold; cursor: pointer; margin-right: 10px; }
.banner-close { background: none; border: none; color: white; font-size: 24px; cursor: pointer; padding: 0 5px; }

.app-header { position: sticky; top: 0; background: var(--card-bg); padding: 12px 12px 10px; z-index: 1000; border-bottom: 1px solid var(--card-border); box-shadow: var(--shadow); }
.header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.header-title { font-size: 22px; font-weight: bold; color: var(--primary-color); }
.header-icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--card-border); background: var(--bg-color); color: var(--text-primary); font-size: 18px; cursor: pointer; display: flex !important; align-items: center; justify-content: center; transition: transform 0.1s; }
.header-icon-btn:active { transform: scale(0.9); }
.search-container { background-color: var(--bg-color); border: 1px solid var(--card-border); border-radius: 25px; padding: 8px 16px; }
.search-bar { width: 100%; border: none; background: transparent; color: var(--text-primary); font-size: 14px; outline: none; }

.announcement-bar { background: #FFF3E0; color: #E65100; padding: 12px; margin: 10px; border-radius: 12px; text-align: center; font-weight: bold; border: 1px solid #FFB74D; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; }
[data-theme="dark"] .announcement-bar { background: #3D2F1F; color: #FFB74D; border-color: #F57C00; }

.main-content { padding: 10px 10px 20px; }
.categories-container { overflow-x: auto; white-space: nowrap; padding: 5px 0 15px; scrollbar-width: none; }
.categories-container::-webkit-scrollbar { display: none; }
.category-btn { display: inline-block; padding: 8px 16px; margin: 0 4px; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 20px; color: var(--text-primary); cursor: pointer; font-size: 13px; font-weight: bold; transition: 0.2s; }
.category-btn.active { background: var(--primary-color); color: white; border-color: var(--primary-color); }

.products-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.product-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 15px; padding: 10px; box-shadow: var(--shadow); cursor: pointer; transition: transform 0.15s; position: relative; }
.product-card:active { transform: scale(0.97); }
.product-card.special-offer { background: var(--primary-light); border: 2px solid var(--primary-border); }
.image-container { position: relative; height: 120px; background: var(--bg-color); border-radius: 10px; margin-bottom: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-image { max-width: 100%; max-height: 100%; object-fit: contain; margin: 5px; }

.offer-badge { position: absolute; top: 6px; right: 6px; background: linear-gradient(135deg, #E91E63 0%, #FF5722 100%); color: white; font-size: 10px; font-weight: bold; padding: 3px 7px; border-radius: 6px; z-index: 2; box-shadow: 0 2px 6px rgba(233, 30, 99, 0.4); }
.blink-badge { animation: blinkOffer 1.5s ease-in-out infinite; }
@keyframes blinkOffer { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.7; transform: scale(0.95); } }

.product-name { color: var(--text-primary); font-size: 14px; font-weight: bold; text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px; margin-bottom: 6px; line-height: 1.3; }
.product-price { color: var(--primary-border); font-size: 14px; font-weight: bold; text-align: center; margin-bottom: 10px; }
.product-actions { display: grid; grid-template-columns: 1fr auto; gap: 5px; }
.add-to-cart-btn { background: var(--primary-color); color: white; border: none; border-radius: 10px; font-size: 13px; height: 36px; cursor: pointer; font-weight: bold; }
.add-to-cart-btn:disabled { background: #ccc !important; cursor: not-allowed !important; color: #666 !important; }
.share-btn { background: var(--success-color); color: white; border: none; border-radius: 10px; width: 38px; height: 36px; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; }

/* ===== ألوان الشريط السفلي المحدثة والآمنة ===== */
.bottom-bar { position: fixed; bottom: 0; left: 0; right: 0; height: 60px; background: var(--card-bg); border-top: 1px solid var(--card-border); display: flex !important; padding: 6px 12px; gap: 10px; z-index: 1000; box-shadow: 0 -2px 10px rgba(0,0,0,0.1); }
.bottom-btn { flex: 1; border: none; border-radius: 12px; font-size: 15px; font-weight: bold; cursor: pointer; display: flex !important; align-items: center; justify-content: center; position: relative; transition: transform 0.1s; }
.bottom-btn:active { transform: scale(0.96); }

/* ✅ زر السجل: أرجواني غامق */
.history-btn { background: #6A1B9A !important; color: white !important; flex: 0 0 80px !important; }

/* ✅ زر السلة: أصفر مع نص غامق للتباين والوضوح */
.cart-btn { background: #FFC107 !important; color: #2C3E50 !important; font-weight: 800 !important; }

.cart-badge { position: absolute; top: -6px; right: -6px; background: var(--primary-border); color: white; font-size: 11px; min-width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid var(--card-bg); font-weight: bold; padding: 0 4px; }

.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 2000; align-items: center; justify-content: center; padding: 10px; }
.modal-content { background: var(--card-bg); border-radius: 16px; width: 100%; max-width: 450px; max-height: 90vh; overflow-y: auto; position: relative; display: flex; flex-direction: column; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 15px; border-bottom: 1px solid var(--card-border); position: sticky; top: 0; background: var(--card-bg); z-index: 10; }
.modal-header h2 { font-size: 18px; color: var(--text-primary); }
.close-modal { font-size: 28px; cursor: pointer; color: var(--text-secondary); line-height: 1; }

.cart-items-list, .checkout-form, .order-history-list { padding: 15px; flex: 1; overflow-y: auto; }
.cart-item-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--card-border); gap: 10px; }
.cart-item-controls { display: flex; align-items: center; gap: 8px; }
.qty-btn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--card-border); background: var(--bg-color); color: var(--text-primary); font-weight: bold; font-size: 16px; cursor: pointer; }
.cart-summary { padding: 15px; background: var(--bg-color); border-top: 1px solid var(--card-border); }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }
.summary-row.total { font-size: 17px; font-weight: bold; color: var(--primary-color); margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--card-border); }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 15px; border-top: 1px solid var(--card-border); }
.btn-primary { background: var(--success-color); color: white; border: none; padding: 13px; border-radius: 10px; font-weight: bold; font-size: 14px; cursor: pointer; text-align: center; }
.btn-secondary { background: var(--bg-color); color: var(--text-primary); border: 1px solid var(--card-border); padding: 13px; border-radius: 10px; font-weight: bold; font-size: 14px; cursor: pointer; }
.input-field { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--card-border); background: var(--bg-color); color: var(--text-primary); font-size: 14px; outline: none; margin-bottom: 10px; }

.order-history-item { background: var(--bg-color); border-radius: 10px; padding: 12px; margin-bottom: 10px; border: 1px solid var(--card-border); }
.order-header { display: flex; justify-content: space-between; font-weight: bold; margin-bottom: 5px; }
.order-status { padding: 2px 8px; border-radius: 6px; font-size: 12px; }
.status-جديد { background: var(--warning-color); color: white; }
.status-مكتمل { background: var(--success-color); color: white; }
.status-ملغي { background: var(--danger-color); color: white; }

.fullscreen-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: 9999; align-items: center; justify-content: center; cursor: zoom-out; }
.fullscreen-image { max-width: 95%; max-height: 95%; object-fit: contain; }
.toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); background: var(--text-primary); color: white; padding: 12px 24px; border-radius: 25px; font-size: 14px; font-weight: bold; opacity: 0; transition: opacity 0.3s; z-index: 3000; pointer-events: none; }
.loading-message, .error-message, .empty-message { text-align: center; padding: 50px 20px; color: var(--text-secondary); grid-column: 1 / -1; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--card-border); border-top-color: var(--primary-color); border-radius: 50%; margin: 0 auto 15px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 600px) { .products-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .products-grid { grid-template-columns: repeat(4, 1fr); } .main-content { max-width: 1100px; margin: 0 auto; } }

a[href*="somee.com"], iframe[src*="somee.com"], iframe[id*="somee"], div[id*="somee"], div[class*="somee"], center > a[href*="somee.com"] { display: none !important; visibility: hidden !important; height: 0 !important; width: 0 !important; overflow: hidden !important; pointer-events: none !important; }
body > div[style*="position: fixed"][style*="bottom"]:not(.bottom-bar), body > div[style*="position: fixed"][style*="left"]:not(.bottom-bar), body > div[style*="position: fixed"][style*="right"]:not(.bottom-bar) { display: none !important; }