:root { 
    --primary: #00B4D8; 
    --primary-dark: #0077B6; 
    --accent: #FFB703; 
    --brand-gradient: linear-gradient(135deg, var(--primary), var(--accent));
    --exclusive-glow: #ff1a1a;
    --bg: #F8FDFF; 
    --text: #2B2D42; 
    --radius: 16px; 
    --max-w: 600px;
    --safe-top: env(safe-area-inset-top, 20px);
    --safe-bottom: env(safe-area-inset-bottom, 20px);
}

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

body { 
    font-family: 'Tajawal', sans-serif; 
    background: var(--bg); 
    color: var(--text); 
    direction: rtl; 
    overflow-x: hidden;
    overscroll-behavior-y: none; 
    padding-bottom: calc(20px + var(--safe-bottom));
}

@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes btnBounce { 0% { transform: scale(1); } 40% { transform: scale(0.9); } 70% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes cartShake { 0% { transform: rotate(0deg); } 25% { transform: rotate(-10deg); } 50% { transform: rotate(10deg); } 75% { transform: rotate(-5deg); } 100% { transform: rotate(0deg); } }
@keyframes gradientBG { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

.reveal { opacity: 0; transform: translateY(30px); transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.reveal.active { opacity: 1; transform: translateY(0); }

/* LOADER & SPINNER */
.loader-overlay { position: fixed; inset: 0; background: #fff; z-index: 9999; display: flex; align-items: center; justify-content: center; }
.loader-content { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.brand-box { font-family: 'Marhey', sans-serif; font-size: 3.5rem; font-weight: 700; opacity: 0; transform: scale(0.8); animation: logoFocus 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards; }
.brand-box .brand-main { color: var(--primary); }
.brand-box .brand-sub { color: var(--accent); }
.spinner { width: 40px; height: 40px; border: 4px solid #f3f3f3; border-top: 4px solid var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.slogan-mask { overflow: hidden; padding: 5px; }
.loader-slogan { font-family: 'Marhey', sans-serif; font-size: 1.1rem; color: var(--text); margin: 0; transform: translateY(100%); opacity: 0; animation: textSlideUp 1s cubic-bezier(0.25, 1, 0.5, 1) 0.5s forwards; }

@keyframes logoFocus { 0% { opacity: 0; transform: scale(0.8) translateY(20px); filter: blur(10px); } 100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0px); } }
@keyframes textSlideUp { 0% { opacity: 0; transform: translateY(120%); } 100% { opacity: 1; transform: translateY(0); } }

/* UI */
.top-bar { background: linear-gradient(90deg, var(--primary-dark), var(--primary), var(--primary-dark)); background-size: 200% 200%; animation: gradientBG 5s ease infinite; color: #fff; text-align: center; padding: 10px; font-size: 0.85rem; font-weight: bold; position: relative; z-index: 1001; box-shadow: 0 2px 10px rgba(0, 180, 216, 0.2); letter-spacing: 0.5px; }
.navbar { background: #fff; position: sticky; top: 0; z-index: 1000; padding: 10px 0; box-shadow: 0 4px 15px rgba(0,0,0,0.04); width: 100%; transition: top 0.3s; }
.nav-content { display: flex; justify-content: space-between; align-items: center; width: 94%; max-width: var(--max-w); margin: 0 auto; }
.menu-btn { display: flex; flex-direction: column; gap: 5px; cursor: pointer; padding: 5px; }
.bar { width: 26px; height: 3px; background-color: var(--text); border-radius: 5px; }
.brand { font-family: 'Marhey', sans-serif; font-size: 1.5rem; }
.brand-main { color: var(--primary); font-weight: 700; }
.brand-sub { color: var(--accent); }
.cart-btn { position: relative; cursor: pointer; color: var(--text); display: flex; align-items: center; transition: transform 0.2s; }
.cart-btn.shake { animation: cartShake 0.5s ease-in-out; color: var(--accent); }
.badge { position: absolute; top: -6px; right: -6px; background: #FF3D00; color: #fff; width: 18px; height: 18px; border-radius: 50%; font-size: 0.7rem; display: none; align-items: center; justify-content: center; font-weight: bold; transition: transform 0.2s; }

.search-container { margin-top: 15px; margin-bottom: 10px; width: 94%; max-width: var(--max-w); margin-left: auto; margin-right: auto; }
.search-wrapper { position: relative; width: 100%; }
#search-input { width: 100%; padding: 12px 20px; border-radius: 50px; border: 1px solid #ddd; outline: none; transition: 0.3s; font-size: 16px; }
#search-input:focus { border-color: var(--primary); box-shadow: 0 4px 12px rgba(0,180,216,0.1); transform: scale(1.01); }
.suggestions-box { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid #ddd; border-radius: 0 0 15px 15px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); max-height: 300px; overflow-y: auto; z-index: 2000; display: none; }
.suggestion-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-bottom: 1px solid #f5f5f5; cursor: pointer; transition: 0.2s; }
.suggestion-item:hover { background: #f9f9f9; }
.s-img { width: 40px; height: 40px; border-radius: 5px; object-fit: cover; }
.s-info { display: flex; flex-direction: column; }
.s-name { font-size: 0.9rem; font-weight: bold; color: #333; }
.s-match { font-size: 0.75rem; color: var(--primary); }

.container { width: 94%; max-width: var(--max-w); margin: 0 auto; }
.hero-slider { height: 170px; margin-bottom: 25px; border-radius: var(--radius); overflow: hidden; position: relative; box-shadow: 0 5px 15px rgba(0,0,0,0.1); animation: fadeInUp 0.8s ease-out; }
.hero-slide { width: 100%; height: 100%; position: absolute; top: 0; left: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 0.8s ease; }
.hero-slide.active { opacity: 1; }
.categories-wrapper { display: flex; gap: 10px; overflow-x: auto; padding: 5px 5px 15px; scrollbar-width: none; animation: fadeInUp 1s ease-out; }
.cat-btn { background: #fff; border: 1px solid #eee; padding: 8px 20px; border-radius: 25px; white-space: nowrap; font-weight: bold; color: #666; transition: 0.3s; transform: scale(1); }
.cat-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); transform: scale(1.05); }
.horizontal-scroll { display: flex; gap: 12px; overflow-x: auto; padding: 10px 5px; scrollbar-width: none; width: 94%; max-width: var(--max-w); margin: 0 auto; scroll-snap-type: x mandatory; }
.horizontal-scroll .card { scroll-snap-align: start; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 94%; max-width: var(--max-w); margin: 0 auto; padding-bottom: 40px; }

.card { background: #fff; border-radius: 15px; overflow: hidden; position: relative; box-shadow: 0 2px 10px rgba(0,0,0,0.03); border: 1px solid #f9f9f9; display: flex; flex-direction: column; cursor: pointer; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.card:active { transform: scale(0.98); }
.card-img { width: 100%; height: 160px; object-fit: contain; padding: 10px; background: #fff; transition: transform 0.3s ease; }
.real-badge { position: absolute; top: 8px; right: 8px; background: var(--brand-gradient); color: #fff; font-family: 'Marhey', sans-serif; font-size: 0.7rem; font-weight: bold; padding: 5px 10px; border-radius: 12px; display: flex; align-items: center; gap: 4px; z-index: 5; box-shadow: 0 2px 8px rgba(0, 180, 216, 0.3); }
.card.shimmer-effect { position: relative; overflow: hidden; border: 2px solid var(--exclusive-glow); box-shadow: 0 0 15px rgba(255, 26, 26, 0.5); transition: all 0.3s ease; }
.card.shimmer-effect:hover { box-shadow: 0 0 25px rgba(255, 26, 26, 0.8); }
.card.shimmer-effect::after { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to right, transparent 0%, rgba(255, 255, 255, 0.6) 50%, transparent 100%); background-size: 200% 100%; animation: shimmer 3s infinite linear; pointer-events: none; }
.card-body { padding: 10px; text-align: center; flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; }
.card-title { font-size: 0.85rem; font-weight: bold; color: #333; margin-bottom: 5px; height: 36px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.price-container { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.old-price { font-size: 0.8rem; text-decoration: line-through; color: #999; }
.price-red { color: #D32F2F; font-weight: 800; font-size: 1rem; }
.price-normal { color: #2B2D42; font-weight: 800; font-size: 1rem; }

.reality-toggle-wrapper { display: flex; background: #f0f0f0; border-radius: 50px; padding: 4px; margin: 10px auto; width: fit-content; box-shadow: inset 0 2px 5px rgba(0,0,0,0.05); }
.rt-btn { padding: 8px 20px; border: none; border-radius: 50px; font-family: 'Tajawal'; font-weight: bold; font-size: 0.9rem; cursor: pointer; transition: all 0.3s ease; background: transparent; color: #666; display: flex; align-items: center; gap: 6px; }
.rt-btn.active { background: #fff; color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.rt-btn.active.real { background: var(--brand-gradient); color: #fff; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 5000; display: none; align-items: flex-end; backdrop-filter: blur(3px); transition: opacity 0.3s; opacity: 0; pointer-events: none; }
.modal-overlay.active { opacity: 1; pointer-events: auto; display: flex; }
.modal-sheet { background: #fff; width: 100%; height: 100%; border-radius: 0; max-height: 100%; display: flex; flex-direction: column; position: relative; overflow: hidden; transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.modal-overlay.active .modal-sheet { transform: translateY(0); }
.modal-header-sticky { position: sticky; top: 0; z-index: 10; background: #fff; padding: 15px 20px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.close-sheet-btn { background: #f5f5f5; border: none; width: 36px; height: 36px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; color: #333; z-index: 20; }
.close-sheet-btn:active { transform: scale(0.9); background: #e0e0e0; }
.modal-scroll-content { padding: 20px; overflow-y: auto; flex-grow: 1; padding-bottom: 20px; -webkit-overflow-scrolling: touch; scroll-behavior: smooth; }
.modal-footer-sticky { position: sticky; bottom: 0; z-index: 20; background: #fff; padding: 15px 20px; border-top: 1px solid #eee; padding-bottom: calc(15px + var(--safe-bottom)); box-shadow: 0 -4px 15px rgba(0,0,0,0.05); flex-shrink: 0; }

.gallery-wrapper { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.main-img-container { width: 100%; height: 350px; background: #fff; border-radius: 12px; border: 1px solid #f0f0f0; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; transition: opacity 0.3s; }
.main-img-view { width: 100%; height: 100%; object-fit: contain; transition: opacity 0.3s; }
.preview-btn { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,0.9); border: none; padding: 8px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.thumbnails-strip { display: flex; gap: 8px; overflow-x: auto; padding: 5px 2px; scrollbar-width: none; width: 100%; min-height: 80px; flex-wrap: nowrap; align-items: center; scroll-snap-type: x mandatory; }
.thumb-box { width: 65px; height: 65px; flex-shrink: 0; border: 2px solid #eee; border-radius: 10px; overflow: hidden; cursor: pointer; transition: all 0.2s ease; background: #fff; scroll-snap-align: center; }
.thumb-box img { width: 100%; height: 100%; object-fit: cover; }
.thumb-box.active { border-color: var(--primary); transform: scale(1.1); box-shadow: 0 4px 10px rgba(0, 180, 216, 0.25); }

.variants-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 25px; }
.variant-row { display: flex; align-items: center; justify-content: space-between; background: #fff; border: 1px solid #eee; border-radius: 12px; padding: 8px 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.03); transition: 0.2s; }
.variant-row:hover { border-color: var(--primary); }
.variant-info { display: flex; align-items: center; gap: 10px; flex-grow: 1; overflow: hidden; cursor: pointer; }
.variant-img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; border: 1px solid #eee; flex-shrink: 0; }
.variant-name { font-weight: bold; font-size: 1rem; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.variant-controls { display: flex; align-items: center; gap: 12px; background: #f8f9fa; border-radius: 8px; padding: 4px 8px; }

.v-btn, .mq-btn, .cart-mini-btn { width: 44px; height: 44px; border: none; background: #fff; border-radius: 10px; font-weight: bold; color: var(--primary); cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.1); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; transition: transform 0.1s; }
.v-btn:active, .mq-btn:active, .cart-mini-btn:active { transform: scale(0.9); background: #eee; }
.v-qty, .mq-display, .cart-mini-qty { font-weight: bold; width: 24px; text-align: center; font-size: 1.1rem; }

.main-qty-wrapper { display: flex; justify-content: center; margin-top: 20px; }
.main-qty-ctrl { display: flex; align-items: center; gap: 20px; background: #f5f5f5; padding: 10px 20px; border-radius: 15px; }

.order-submit { width: 100%; padding: 15px; background: var(--accent); color: #fff; border: none; border-radius: 12px; font-weight: bold; font-size: 1rem; cursor: pointer; box-shadow: 0 4px 15px rgba(255, 183, 3, 0.3); transition: transform 0.2s; }
.order-submit:active { transform: scale(0.96); }
.go-cart-btn { width: 100%; padding: 15px; background: #fff; color: var(--primary); border: 2px solid var(--primary); border-radius: 12px; font-weight: bold; font-size: 1rem; cursor: pointer; margin-top: 10px; transition: 0.2s; }
.go-cart-btn:active { background: #f0fbff; transform: scale(0.98); }

.cart-item { display: flex; justify-content: space-between; padding: 15px 10px; border-bottom: 1px solid #f0f0f0; align-items: center; }
.cart-info { display: flex; flex-direction: column; gap: 5px; }
.cart-qty-ctrl { display: flex; align-items: center; gap: 10px; margin-top: 5px; background: #f9f9f9; border-radius: 8px; padding: 2px; width: fit-content; }
.cart-mini-btn { width: 32px; height: 32px; font-size: 1.1rem; }
.delivery-note { background: #E3F2FD; color: #1565C0; padding: 12px; border-radius: 10px; text-align: center; font-weight: bold; font-size: 0.9rem; margin-bottom: 15px; border: 1px solid #BBDEFB; }
.form-input { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 10px; margin-bottom: 10px; font-family: 'Tajawal'; font-size: 16px; }
.toast-msg { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: #333; color: #fff; padding: 12px 25px; border-radius: 50px; z-index: 6000; font-weight: bold; text-align: center; animation: slideUp 0.4s; }
.empty-cart-view { text-align: center; padding: 40px 20px; }
.empty-icon { font-size: 4rem; color: #ddd; margin-bottom: 15px; display: block; }
.shop-now-btn { background: var(--primary); color: #fff; border: none; padding: 12px 30px; border-radius: 50px; font-weight: bold; font-size: 1rem; cursor: pointer; }
.sidebar { position: fixed; top: 0; right: -280px; width: 280px; height: 100%; background: #fff; z-index: 2100; transition: 0.4s; padding: 20px; box-shadow: -5px 0 20px rgba(0,0,0,0.05); display: flex; flex-direction: column; }
.sidebar.active { right: 0; }
.sidebar-nav a { display: block; padding: 15px 0; font-weight: bold; color: var(--text); border-bottom: 1px solid #f5f5f5; text-decoration: none; }

.hidden-stock-section { background: linear-gradient(135deg, #2B2D42, #1a1b2e); color: #fff; padding: 25px; margin-top: 40px; border-radius: var(--radius); text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.2); margin-bottom: 40px; }
.hidden-btn { background: var(--accent); color: #fff; border: none; padding: 10px 25px; border-radius: 50px; font-weight: bold; margin-top: 15px; transition: transform 0.2s; }
.hidden-btn:active { transform: scale(0.95); }

.main-footer { background: #fff; padding: 30px 20px; text-align: center; margin-top: 40px; border-top: 1px solid #eee; }
.footer-links { margin-bottom: 15px; }
.footer-links span { cursor: pointer; color: #666; font-size: 0.9rem; margin: 0 5px; transition: 0.3s; }
.footer-links span:hover { color: var(--primary); text-decoration: underline; }
.copy { font-weight: bold; color: var(--text); margin-bottom: 5px; }
.disclaimer { font-size: 0.7rem; color: #999; font-family: sans-serif; }

.floating-contact { position: fixed; bottom: 20px; left: 20px; display: flex; flex-direction: column; gap: 12px; z-index: 4000; }
.float-btn { width: 52px; height: 52px; border-radius: 14px; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,0.25); transition: transform 0.2s; border: 2px solid rgba(255,255,255,0.2); }
.float-btn:hover { transform: scale(1.1); }
.float-btn.whatsapp { background: linear-gradient(135deg, #25D366, #128C7E); }
.float-btn.facebook { background: linear-gradient(135deg, #1877F2, #0C5DC7); }
.float-btn.instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }

.social-links-container { display: flex; justify-content: center; gap: 15px; margin-bottom: 25px; }
.social-icon { padding: 10px 20px; border-radius: 50px; color: #fff; font-weight: bold; text-decoration: none; font-size: 0.9rem; transition: transform 0.2s; }
.social-icon:active { transform: scale(0.95); }
.social-icon.fb { background: #1877F2; }
.social-icon.insta { background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#bc1888 100%); }

.zoom-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 5000; display: none; align-items: center; justify-content: center; }
.zoom-overlay.active { display: flex; }
.zoom-content-wrapper { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; position: relative; }
#zoom-img { max-width: 95%; max-height: 85vh; object-fit: contain; transition: 0.3s; }
.zoom-counter { color: #fff; margin-top: 15px; font-size: 1.1rem; font-weight: bold; background: rgba(255,255,255,0.2); padding: 5px 15px; border-radius: 20px; }
.close-zoom { position: absolute; top: 20px; right: 20px; background: none; border: none; color: #fff; font-size: 2.5rem; cursor: pointer; z-index: 5002; }
.zoom-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.15); color: #fff; border: none; font-size: 2rem; width: 50px; height: 50px; border-radius: 50%; cursor: pointer; z-index: 5001; display: flex; align-items: center; justify-content: center; transition: 0.3s; }
.zoom-nav-btn:hover { background: rgba(255,255,255,0.3); }
.zoom-nav-btn.prev { left: 20px; }
.zoom-nav-btn.next { right: 20px; }

/* 🔥 زر متابعة التسوق الجديد 🔥 */
.continue-btn { width: 100%; padding: 12px; background: transparent; color: #555; border: 2px solid #eee; border-radius: 12px; font-weight: bold; margin-top: 10px; cursor: pointer; transition: 0.2s; }
.continue-btn:active { background: #f9f9f9; transform: scale(0.98); }
