/* --- المتغيرات والأساسيات --- */
:root {
    --bg-color: #f9f9f9;
    --text-color: #2c3e50; 
    --card-bg: #ffffff;
    --card-border: #e0e0e0;
    --primary-color: #6c5ce7; 
    --sa-color: #27ae60; 
    --price-now-color: #e74c3c; 
    --old-price-color: #7f8c8d;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #f1f2f6; 
    --card-bg: #1e1e1e;
    --card-border: #333333;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .amazon-logo {
    /* If original is black, invert to white in dark mode so it has no white background box */
    filter: brightness(0) invert(1);
}
[data-theme="dark"] .box-icon img {
    /* Invert black brand logos in dark mode so they are visible */
    filter: brightness(0) invert(1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    transition: background 0.4s, color 0.4s;
    overflow-x: hidden;
}

/* Glass & Shapes - Removed for classic look, kept empty for compatibility if left in HTML */
.bg-shape { display: none; }

.glass, .classic-card, .classic-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
}

/* --- Header --- */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 20px 20px;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    margin-bottom: 25px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto 15px;
}

.brand-center {
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s;
}
.brand-center:hover { transform: scale(1.05); }

.logo-wrapper { font-size: 26px; font-weight: 900; }
.logo-main-text { color: var(--text-color); }
.logo-sa { color: var(--sa-color); }

.live-users {
    font-size: 12px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.pulse-dot {
    width: 8px; height: 8px; background-color: #2ecc71; border-radius: 50%;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

.icon-btn {
    background: none; border: none; font-size: 22px; cursor: pointer;
    color: var(--text-color); padding: 8px; border-radius: 12px; transition: 0.3s;
}
.icon-btn:hover { background: rgba(108, 92, 231, 0.15); }

/* Smart Search */
.search-container {
    max-width: 600px;
    margin: 0 auto;
}

#searchInput {
    width: 100%;
    padding: 14px 20px;
    border-radius: 25px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-color);
    outline: none;
    font-size: 15px;
    backdrop-filter: blur(10px);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
    transition: 0.3s;
    box-sizing: border-box;
}
#searchInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(108, 92, 231, 0.3);
}

/* --- Autocomplete Search Suggestions Dropdown --- */
.search-suggestions-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 3000;
    max-height: 350px;
    overflow-y: auto;
    margin-top: 5px;
    flex-direction: column;
}
[data-theme="dark"] .search-suggestions-dropdown {
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.suggestion-box {
    padding: 10px 15px;
    border-bottom: 1px solid var(--card-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    transition: 0.2s;
    text-align: right;
    background: transparent;
}
.suggestion-box:last-child {
    border-bottom: none;
}

.suggestion-box:hover {
    background: rgba(150, 150, 150, 0.1);
    border-color: var(--primary-color);
}
.sug-img {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.sug-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow: hidden;
}
.sug-title { 
    font-size: 14px; 
    font-weight: bold; 
    color: var(--text-color); 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sug-price { 
    font-size: 13px; 
    font-weight: 900; 
    color: var(--primary-color); 
}


/* --- Main Content --- */
.content-area {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px 90px;
}

.view-section { animation: fadeIn 0.4s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- Home View (Layouts) --- */
.boxes-section { margin-bottom: 30px; }
.section-title { font-size: 20px; margin-bottom: 15px; font-weight: 800; padding: 0 10px; }

/* Horizontal Scroll for Deals */
.horizontal-scroll-container {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 5px 10px 15px; /* for shadow space */
}
.horizontal-scroll-container::-webkit-scrollbar { height: 6px; }
.horizontal-scroll-container::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 10px; }

.stores-grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    padding: 5px 10px;
}

.box-card-small {
    padding: 20px 15px;
    border-radius: 20px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
}
.horizontal-scroll-container .box-card-small {
    flex: 0 0 auto;
    width: 110px; /* fixed width for horizontal items */
}

.box-card-small:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-color: var(--cat-color, var(--primary-color));
}

.box-icon { font-size: 32px; margin-bottom: 10px; }
.box-name { font-size: 15px; margin: 0; font-weight: 700; line-height: 1.2;}

/* --- Products View --- */
.products-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
    gap: 15px;
}

.back-btn {
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    color: var(--text-color);
    transition: 0.3s;
}
.back-btn:hover { background: var(--primary-color); color: white; }
.products-title { font-size: 22px; font-weight: 900; margin: 0; }

/* Grid */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 10px;
}

/* Product Cards */
.card {
    border-radius: 12px;
    padding: 8px;
    position: relative;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }

/* Neater Image Container */
.card-image-container {
    width: 100%;
    height: 90px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    box-sizing: border-box;
    margin-bottom: 8px;
}
.card-image-container img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.card-image-container img[src^="data:"] { mix-blend-mode: normal; }

.fav-btn {
    position: absolute; top: 10px; left: 10px;
    background: var(--card-bg); border: none; border-radius: 50%;
    width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 14px; color: #ccc; transition: 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); z-index: 2;
}
.fav-btn.active { color: #e74c3c; }

.store-badge {
    position: absolute; top: 5px; right: 5px;
    z-index: 2; display: flex; align-items: center; justify-content: center;
}
.badge-logo { height: 14px; max-width: 40px; }
.noon-badge-logo {
    background: #FEE000; color: #000; font-weight: 900; font-size: 9px;
    border-radius: 4px; padding: 2px 4px; box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.amazon-badge-logo {
    background: #232F3E; color: #FF9900; font-weight: 900; font-size: 9px;
    border-radius: 4px; padding: 2px 4px; box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.product-info { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.product-title {
    font-size: 11px; font-weight: bold; margin: 0 0 5px 0;
    color: var(--text-color); display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    line-height: 1.3;
}
.price-container { display: flex; flex-direction: column; gap: 2px; }
.price-now { font-size: 14px; font-weight: 900; color: var(--price-now-color); }
.price-old { font-size: 10px; color: var(--old-price-color); text-decoration: line-through; }
.discount-badge { background: #e74c3c; color: white; padding: 2px 6px; border-radius: 6px; font-size: 11px; font-weight: bold; margin-bottom: 2px; }

.card-btn {
    display: block; width: 100%; text-align: center;
    background: var(--primary-color); color: white; padding: 10px;
    border-radius: 12px; text-decoration: none; font-weight: bold; transition: 0.3s; margin-top: auto; font-size: 14px;
}
.card-btn:hover { opacity: 0.9; }

.loader {
    border: 4px solid var(--glass-border); border-top: 4px solid var(--primary-color);
    border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 0 auto 15px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ================= PRODUCT DETAILS MODAL ================= */
.product-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1000; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.product-modal.active { opacity: 1; pointer-events: auto; }
.modal-bg-image, .modal-bg-blur { display: none; }

.modal-content-wrapper {
    position: relative; width: 92%; max-width: 400px; max-height: 70vh;
    background: var(--card-bg); border-radius: 20px;
    z-index: 1003; display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.modal-scrollable-body {
    flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
    display: flex; flex-direction: column;
}
.modal-header {
    padding: 15px 20px; display: flex; justify-content: space-between; z-index: 1004;
}
.modal-icon-circle {
    width: 36px; height: 36px; border-radius: 50%; background: var(--card-bg);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    color: var(--text-color); font-size: 16px; border: 1px solid var(--card-border);
}
.modal-image-area {
    flex: none; height: 18vh; display: flex; align-items: center; justify-content: center;
    padding: 10px; margin: 0;
}
.modal-image-area img { max-width: 100%; max-height: 100%; object-fit: contain; }
.modal-info-sheet {
    background: transparent;
    padding: 5px 20px 15px 20px;
    display: flex; flex-direction: column; 
}
.modal-sheet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-brand-chip { background: var(--bg-color); padding: 5px 12px; border-radius: 20px; font-weight: bold; font-size: 12px; border: 1px solid var(--card-border); }
.modal-rating { display: flex; align-items: center; font-size: 13px; font-weight: bold; }
.modal-name { font-size: 17px; font-weight: bold; line-height: 1.4; margin-bottom: 10px; }
.modal-desc-title { font-size: 13px; font-weight: bold; color: var(--text-gray); margin-bottom: 5px; }
.modal-desc { 
    font-size: 12px; line-height: 1.5; color: var(--text-color); 
    padding-bottom: 5px;
}

.modal-bottom-row { flex: none; display: flex; align-items: center; margin-top: 5px; padding: 10px 20px; border-top: 1px solid var(--card-border); }
.modal-price-col { flex: 1; display: flex; flex-direction: column; }
.modal-new-price { font-size: 16px; font-weight: bold; color: var(--price-now-color); }
.modal-old-price { font-size: 12px; color: var(--old-price-color); text-decoration: line-through; }
.modal-buy-btn {
    flex: 1.5; padding: 12px; border: none; border-radius: 12px;
    background: #232F3E; color: white; font-weight: bold; font-size: 14px;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.2); transition: 0.3s;
}
.modal-buy-btn:hover { transform: translateY(-3px); }
[data-theme="dark"] .modal-buy-btn { background: #FF9900; color: #000; }
[data-theme="dark"] .samsung-logo-img {
    filter: none;
}
.brand-logo-img {
    transition: filter 0.3s ease;
}
[data-theme="dark"] .brand-logo-img {
    filter: brightness(0) invert(1) !important;
}

/* ================= CATEGORIES VIEW & FILTER DRAWER ================= */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 15px;
    padding: 10px;
}
/* ================= INLINE SUB CATEGORIES (CHIPS) ================= */
.sub-category-chip {
    background: var(--card-bg);
    color: var(--text-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border: 1px solid var(--card-border);
    white-space: nowrap;
    transition: 0.2s;
    flex: 0 0 auto;
}
.sub-category-chip.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
@media (hover: hover) {
    .sub-category-chip:not(.selected):hover {
        background: rgba(150, 150, 150, 0.1);
    }
}

/* ================= BOTTOM NAVIGATION BAR ================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: var(--bg-color);
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -5px 15px rgba(0,0,0,0.05);
}
.nav-item {
    background: none; border: none; color: var(--text-gray);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 12px; gap: 5px; cursor: pointer; transition: 0.3s;
    font-weight: bold;
}
.nav-item i { font-size: 20px; }
.nav-item.active { color: var(--primary-color); }

/* ================= RESPONSIVE DESIGN (TABLETS & DESKTOPS) ================= */

/* Tablets (iPad, etc) */
@media (min-width: 600px) {
    .grid-layout {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }
    .stores-grid-layout {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    .box-card-small {
        padding: 25px 20px;
    }
    .products-header {
        flex-direction: row;
        justify-content: center;
        position: relative;
    }
    .products-header .back-btn {
        position: absolute;
        right: 0;
    }
    .horizontal-scroll-container .box-card-small {
        width: 140px;
    }
    .card-title { font-size: 13px; }
    .card-price-now { font-size: 18px; }
}

/* Desktops & Large Tablets */
@media (min-width: 1024px) {
    .grid-layout {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 25px;
    }
    .stores-grid-layout {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    .horizontal-scroll-container .box-card-small {
        width: 180px;
    }
    .card-title { font-size: 15px; }
    .card-price-now { font-size: 20px; }
    .card-price-old { font-size: 14px; }
    .card-btn { font-size: 14px; padding: 12px; }
    
    /* Make Bottom Nav a sleek floating dock on desktop */
    .bottom-nav {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 35px 35px 0 0;
        border-left: 1px solid var(--card-border);
        border-right: 1px solid var(--card-border);
    }
    
    /* Center the modal nicely */
    .modal-content-wrapper {
        max-width: 600px;
    }
}

/* ألوان شارات المتاجر */
.badge-blue   { background: #1e88e5; color: #fff; font-weight: 900; font-size: 9px; border-radius: 4px; padding: 2px 4px; }
.badge-red    { background: #e53935; color: #fff; font-weight: 900; font-size: 9px; border-radius: 4px; padding: 2px 4px; }
.badge-green  { background: #43a047; color: #fff; font-weight: 900; font-size: 9px; border-radius: 4px; padding: 2px 4px; }
.badge-purple { background: #6c5ce7; color: #fff; font-weight: 900; font-size: 9px; border-radius: 4px; padding: 2px 4px; }
.badge-dark   { background: #222; color: #fff; font-weight: 900; font-size: 9px; border-radius: 4px; padding: 2px 4px; }

/* ===== تقييم التطبيق بالنجوم ===== */
.star-picker { display: inline-flex; gap: 4px; direction: ltr; }
.star-picker button { background: none; border: none; font-size: 34px; line-height: 1; color: #555; cursor: pointer; padding: 2px 3px; transition: transform .1s, color .15s; }
.star-picker button:hover { transform: scale(1.15); }
.star-picker button.on { color: #f1c40f; }
.rating-label { min-height: 20px; margin-top: 4px; font-size: 13px; color: var(--text-muted); }

/* ===== صفحة "لك" ===== */
.fy-bar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 4px; color: var(--text-muted); font-size: 13px; }
.fy-refresh { background: var(--primary-color); color: #fff; border: none; border-radius: 18px; padding: 7px 14px; font-weight: bold; cursor: pointer; white-space: nowrap; }
.fy-title { grid-column: 1 / -1; font-size: 17px; font-weight: 800; margin: 14px 4px 2px; }
.fy-card { position: relative; min-width: 0; }
.fy-card .card { height: 100%; }
.fy-x { position: absolute; top: 6px; left: 6px; z-index: 5; width: 26px; height: 26px; border-radius: 50%; border: none; background: rgba(0,0,0,0.55); color: #fff; font-size: 17px; line-height: 1; cursor: pointer; opacity: .8; }
.fy-x:hover { opacity: 1; background: #e74c3c; }

/* ===== نافذة التواصل والتقييم (تصميم جديد) ===== */
.support-sheet {
    position: relative; z-index: 1003; width: 92%; max-width: 440px; max-height: 90vh; display: flex; flex-direction: column;
    background: var(--card-bg); border-radius: 20px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); overflow: hidden; text-align: right;
}
.support-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-color, rgba(128,128,128,.25)); flex-shrink: 0; }
.support-head h3 { margin: 0; font-size: 18px; }
.support-close { background: none; border: none; color: var(--text-color); font-size: 20px; cursor: pointer; padding: 4px 8px; }
.support-body { padding: 18px 20px 6px; overflow-y: auto; flex: 1; min-height: 0; -webkit-overflow-scrolling: touch; }
.support-foot { padding: 12px 20px 16px; border-top: 1px solid var(--border-color, rgba(128,128,128,.25)); flex-shrink: 0; }
.support-send { width: 100%; background: var(--primary-color); color: #fff; font-weight: bold; padding: 13px; border: none; border-radius: 12px; cursor: pointer; font-size: 16px; }
.support-send:disabled { opacity: .6; cursor: not-allowed; }

.support-types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.stype {
    display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px; font-size: 13px; font-weight: bold; cursor: pointer;
    border: 1.5px solid var(--border-color, rgba(128,128,128,.3)); border-radius: 12px; background: var(--bg-color); color: var(--text-color); transition: .15s;
}
.stype .se { font-size: 20px; }
.stype.active { border-color: var(--primary-color); background: rgba(108, 92, 231, 0.12); color: var(--primary-color); }

.rating-box { display: none; text-align: center; padding: 14px 10px; margin-bottom: 16px; border-radius: 14px; background: rgba(241,196,15,0.08); border: 1px solid rgba(241,196,15,0.35); }
.rating-box.show { display: block; }
.rating-ask { font-weight: bold; margin-bottom: 6px; }
.rating-box .star-picker button { font-size: 40px; }

.support-field { position: relative; margin-bottom: 16px; }
.support-field label { display: block; margin-bottom: 6px; font-weight: bold; font-size: 14px; }
.support-field label small { font-weight: normal; color: var(--text-muted); }
.support-field textarea, .support-field input[type=text] {
    width: 100%; padding: 11px 12px; border-radius: 12px; border: 1.5px solid var(--border-color, rgba(128,128,128,.3));
    background: var(--bg-color); color: var(--text-color); font-family: inherit; font-size: 15px; outline: none; box-sizing: border-box;
}
.support-field textarea { resize: none; line-height: 1.6; }
.support-field textarea:focus, .support-field input[type=text]:focus { border-color: var(--primary-color); }
.support-count { position: absolute; left: 10px; bottom: 8px; font-size: 11px; color: var(--text-muted); pointer-events: none; }
.support-hint { display: block; margin-top: 5px; color: var(--text-muted); font-size: 12px; }
.support-status { min-height: 20px; margin: 0 0 10px; font-size: 14px; text-align: center; color: var(--text-muted); }

.product-modal { z-index: 1100; }   /* النوافذ فوق الشريط السفلي */
.support-count { direction: ltr; }
.support-body { overflow-x: hidden; }   /* حقل منع البوتات المخفي كان يسبب شريط أفقي */

/* ===== الإبلاغ عن منتج ===== */
.report-link { display: block; width: 100%; margin: 16px 0 6px; padding: 11px; border: 1px dashed var(--border-color, rgba(128,128,128,.4)); border-radius: 12px; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 13px; font-family: inherit; }
.report-link:hover { color: #e74c3c; border-color: #e74c3c; }
.report-product { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; background: var(--bg-color); margin-bottom: 16px; }
.report-product img { width: 56px; height: 56px; object-fit: contain; background: #fff; border-radius: 8px; flex-shrink: 0; }
.report-product b { display: block; font-size: 14px; line-height: 1.5; max-height: 3em; overflow: hidden; }
.report-product small { color: var(--text-muted); }
.report-reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rreason { padding: 10px 8px; font-size: 13px; font-family: inherit; text-align: center; cursor: pointer; border-radius: 12px; line-height: 1.5;
    border: 1.5px solid var(--border-color, rgba(128,128,128,.3)); background: var(--bg-color); color: var(--text-color); }
.rreason.active { border-color: #e74c3c; background: rgba(231,76,60,.1); color: #e74c3c; font-weight: bold; }
.rreason:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ===== 🔔 التنبيهات ===== */
.hdr-group { display: flex; align-items: center; gap: 6px; }
.bell-btn { position: relative; }
.bell-badge { position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #e74c3c; color: #fff; font-size: 11px; font-weight: bold; align-items: center; justify-content: center; line-height: 1; border: 2px solid var(--bg-color); box-sizing: content-box; }
.notif-tools { display: flex; align-items: center; gap: 4px; }
.notif-all { background: none; border: none; color: var(--primary-color); font-size: 12px; font-weight: bold; cursor: pointer; font-family: inherit; }
.notif-item { display: flex; gap: 12px; padding: 12px; margin-bottom: 10px; border-radius: 14px; background: var(--bg-color); border: 1px solid var(--border-color, rgba(128,128,128,.25)); cursor: pointer; }
.notif-item.unread { border-color: var(--primary-color); background: rgba(108,92,231,.08); }
.notif-ic { font-size: 24px; line-height: 1; flex-shrink: 0; }
.notif-main { min-width: 0; flex: 1; }
.notif-title { font-weight: bold; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.notif-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e74c3c; }
.notif-body { margin-top: 4px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.notif-ctx { margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: rgba(128,128,128,.12); color: var(--text-muted); font-size: 12px; }
.notif-time { margin-top: 6px; color: var(--text-muted); font-size: 11px; }
.notif-empty { text-align: center; padding: 40px 10px; color: var(--text-muted); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.notif-toast { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 2000; max-width: 92%; width: 380px; padding: 12px 16px; border-radius: 14px; background: var(--primary-color); color: #fff; box-shadow: 0 8px 30px rgba(0,0,0,.35); cursor: pointer; display: flex; flex-direction: column; gap: 2px; font-size: 14px; animation: toastIn .3s ease; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ===== 👤 حسابي ===== */
.acc-card { display: block; width: 100%; background: var(--card-bg); border: 1px solid var(--border-color, rgba(128,128,128,.25)); border-radius: 18px; padding: 18px; margin-bottom: 14px; text-align: right; box-sizing: border-box; }
.acc-title { font-weight: 800; font-size: 17px; margin-bottom: 6px; }
.acc-title small { font-weight: normal; color: var(--text-muted); font-size: 12px; }
.acc-desc { color: var(--text-muted); font-size: 14px; line-height: 1.8; margin: 0 0 12px; }
.acc-desc b { color: var(--text-color); }
.acc-input { width: 100%; padding: 12px; border-radius: 12px; border: 1.5px solid var(--border-color, rgba(128,128,128,.3)); background: var(--bg-color); color: var(--text-color); font-size: 15px; font-family: inherit; box-sizing: border-box; outline: none; margin-bottom: 10px; }
.acc-input:focus { border-color: var(--primary-color); }
.acc-code { text-align: center; letter-spacing: 8px; font-size: 22px; font-weight: bold; }
.acc-btn { width: 100%; padding: 12px; border: none; border-radius: 12px; background: var(--primary-color); color: #fff; font-weight: bold; font-size: 15px; cursor: pointer; font-family: inherit; }
.acc-link { background: none; border: none; color: var(--primary-color); font-size: 13px; font-weight: bold; cursor: pointer; font-family: inherit; padding: 8px 4px; }
.acc-link.danger { color: #e74c3c; }
.acc-row { display: flex; justify-content: space-between; margin-top: 4px; }
.acc-toggle { display: flex; align-items: center; gap: 10px; padding: 10px 0; font-size: 14px; cursor: pointer; border-top: 1px solid var(--border-color, rgba(128,128,128,.2)); }
.acc-toggle input { width: 20px; height: 20px; accent-color: var(--primary-color); flex-shrink: 0; }
.acc-msg { min-height: 18px; margin-top: 8px; font-size: 13px; text-align: center; }
.acc-notif { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; font-weight: bold; font-size: 15px; font-family: inherit; color: var(--text-color); }
.acc-badge { margin-right: auto; margin-left: 6px; background: #e74c3c; color: #fff; border-radius: 10px; padding: 1px 9px; font-size: 12px; }
.acc-badge:empty { display: none; }
.acc-h { margin: 18px 4px 10px; font-size: 18px; }
.acc-h small { color: var(--text-muted); font-weight: normal; }
.acc-empty { grid-column: 1 / -1; text-align: center; color: var(--text-muted); padding: 30px 10px; }
.acc-privacy { margin: 22px 4px 90px; color: var(--text-muted); font-size: 12px; line-height: 1.8; text-align: center; }
.drop-tag { position: absolute; z-index: 4; bottom: 8px; right: 8px; left: 8px; background: #27ae60; color: #fff; font-size: 11px; font-weight: bold; text-align: center; border-radius: 8px; padding: 3px 6px; pointer-events: none; }

/* =====================================================================
   مراجعة التصميم (2026-11-28)
   - الألوان مستمدة من الشعار: سليت للنص وأخضر للتمييز (كان بنفسجي افتراضي)
   - المتغيرات الناقصة صارت معرّفة (كانت تُلغي حدود النص الخافت والحدود بصمت)
   - خط عربي واحد بأوزان واضحة، وتباين مقروء في الفاتح والداكن
   للرجوع: python restore_design_backup.py
   ===================================================================== */
:root {
    --bg-color: #f5f6f7;
    --card-bg: #ffffff;
    --card-border: #e0e4e8;
    --border-color: #dfe3e8;
    --glass-border: #dfe3e8;
    --glass-bg: #ffffff;
    --text-color: #1f2d3a;
    --text-muted: #566472;
    --text-gray: #566472;
    --primary-color: #1b7f46;
    --primary-hover: #166a3a;
    --primary-soft: rgba(27, 127, 70, 0.10);
    --on-primary: #ffffff;
    --focus-ring: #1b7f46;
    --price-now-color: #c62f2f;
    --old-price-color: #6b7782;
    --danger-bg: #c62f2f;
    --shadow: 0 1px 2px rgba(16, 24, 32, 0.06), 0 4px 12px rgba(16, 24, 32, 0.05);
    --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
}
[data-theme="dark"] {
    --bg-color: #0f1317;
    --card-bg: #181d22;
    --card-border: #2a3139;
    --border-color: #2a3139;
    --glass-border: #2a3139;
    --glass-bg: #181d22;
    --text-color: #eef1f4;
    --text-muted: #a4afba;
    --text-gray: #a4afba;
    --primary-color: #3ecf82;
    --primary-hover: #2fb96f;
    --primary-soft: rgba(62, 207, 130, 0.14);
    --on-primary: #06210f;
    --focus-ring: #3ecf82;
    --price-now-color: #ff8a8a;
    --old-price-color: #94a0ab;
    --danger-bg: #d44343;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.35);
}

body { font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif; line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font-family: inherit; }

/* تسلسل الخطوط: عنوان الصفحة > القسم > اسم المنتج > النص المساعد */
.products-title { font-size: 22px; font-weight: 800; line-height: 1.3; }
.section-title { font-size: 19px; font-weight: 800; margin: 0 var(--s3) var(--s4); padding: 0 var(--s3) 0 0; border-right: 4px solid var(--primary-color); line-height: 1.3; }
.fy-title { font-size: 17px; font-weight: 800; margin: var(--s5) var(--s1) var(--s1); padding-right: var(--s3); border-right: 4px solid var(--primary-color); line-height: 1.3; }
.acc-h { font-size: 18px; font-weight: 800; }
.box-name { font-size: 14px; font-weight: 700; line-height: 1.4; }
.product-title { font-size: 12px; font-weight: 700; line-height: 1.5; }
.price-now { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.price-old { font-size: 11px; font-variant-numeric: tabular-nums; }
.discount-badge { background: var(--danger-bg); color: #fff; }
.modal-name { font-weight: 800; }

/* مسافات موحّدة بين العناصر المتقاربة */
.boxes-section { margin-bottom: var(--s6); }
.horizontal-scroll-container { gap: var(--s4); }
.stores-grid-layout { gap: var(--s4); }
.grid-layout { gap: var(--s3); }
.products-header { margin-bottom: var(--s5); }

/* الأزرار: لون العلامة، وعند المرور يغمق بدل ما يشحب */
.card-btn, .support-send, .acc-btn, .fy-refresh { background: var(--primary-color); color: var(--on-primary); }
.card-btn:hover, .support-send:hover, .acc-btn:hover, .fy-refresh:hover { background: var(--primary-hover); opacity: 1; }
.back-btn:hover { background: var(--primary-color); color: var(--on-primary); }
.icon-btn:hover { background: var(--primary-soft); }
.notif-toast { background: var(--primary-color); color: var(--on-primary); }
.stype.active { border-color: var(--primary-color); background: var(--primary-soft); color: var(--primary-color); }
.notif-item.unread { border-color: var(--primary-color); background: var(--primary-soft); }
.acc-link, .notif-all { color: var(--primary-color); }
.bottom-nav .nav-item.active, .nav-item.active { color: var(--primary-color); }

/* البحث: خلفية مصمتة بدل الشفافة، وإطار تركيز واضح بدل التوهج */
#searchInput { background: var(--card-bg); border: 1px solid var(--border-color); backdrop-filter: none; box-shadow: none; }
#searchInput:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px var(--primary-soft); }

/* التركيز بالكيبورد: ظاهر دائماً */
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 6px; }
.card:focus-visible, .box-card-small:focus-visible { border-radius: 14px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 0; }

/* الحركة: للتغذية الراجعة فقط، وتُلغى لمن يفضّل تقليلها */
.view-section { animation: viewIn .18s ease-out; }
@keyframes viewIn { from { opacity: 0; } to { opacity: 1; } }
.brand-center:hover { transform: none; }
.box-card-small:hover { transform: none; box-shadow: var(--shadow); border-color: var(--primary-color); }
.card:hover { transform: none; box-shadow: var(--shadow); }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* أيقونات: أنواع الرسائل والتنبيهات بدل الإيموجي */
.stype .se { font-size: 18px; color: var(--text-muted); line-height: 1; }
.stype.active .se { color: var(--primary-color); }
.notif-ic { width: 38px; height: 38px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-color); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.notif-empty i { font-size: 34px; color: var(--text-muted); margin-bottom: var(--s2); }
.drop-tag i { margin-left: 4px; }

/* رابط الخصوصية أسفل الرئيسية */
.legal-foot { text-align: center; padding: 22px 12px 96px; color: var(--text-muted); font-size: 12px; line-height: 2; }
.legal-foot a { display: block; color: var(--primary-color); font-weight: 700; font-size: 13px; }

/* ===== الرئيسية: شريط المتاجر + شريط التصنيفات + ماركة الكرت ===== */
.home-strip { margin: 4px 0 0; }
.chip-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chip-strip::-webkit-scrollbar { display: none; }
.tile { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 104px; height: 104px; padding: 10px 6px; border-radius: 18px; background: var(--card-bg); color: var(--text-color); border: 2px solid var(--card-border); font-family: inherit; font-weight: 800; font-size: 13px; text-align: center; line-height: 1.25; cursor: pointer; transition: .2s; }
.tile:hover { border-color: var(--tile-color, var(--primary-color)); transform: translateY(-2px); }
.store-tile { width: 124px; height: 124px; font-size: 14px; }
.tile-logo { display: flex; align-items: center; justify-content: center; width: 68px; height: 68px; font-size: 42px; }
.tile-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-noon { display: flex; align-items: center; justify-content: center; width: 68px; height: 68px; border-radius: 16px; background: #FEE000; color: #000; font-weight: 900; font-size: 20px; }
.logo-letter { display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-color); font-weight: 900; font-size: 28px; }
#storeCatsStrip { margin-bottom: 12px; }
.card-brand { font-size: 10px; font-weight: 700; color: var(--primary-color); margin: 0 0 3px 0; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cards-sentinel { grid-column: 1 / -1; height: 1px; }
.nav-50 { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 22px; padding: 0 5px; border-radius: 7px; border: 2px solid currentColor; font-size: 12px; font-weight: 900; line-height: 1; letter-spacing: -.3px; }
