/* ==========================================================================
   Ramadan Store — Core Stylesheet (Zero-Bloat, Mobile-First, RTL/LTR Ready)
   ========================================================================== */
:root {
    --rs-primary: #0f172a;
    --rs-accent: #10b981;
    --rs-accent-hover: #059669;
    --rs-danger: #ef4444;
    --rs-surface: #f8fafc;
    --rs-border: #e2e8f0;
    --rs-text: #1e293b;
    --rs-text-muted: #64748b;
    --rs-radius: 12px;
    --rs-font: 'Tajawal', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--rs-font);
    color: var(--rs-text);
    background: #fff;
    line-height: 1.65;
    padding-bottom: 64px;
}
@media (min-width: 768px) { body { padding-bottom: 0; } }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.rs-container { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.rs-section { padding: 36px 0; }
.rs-section--alt { background: var(--rs-surface); }

/* شريط الإعلان */
.rs-announcement-bar { background: var(--rs-primary); color: #fff; font-size: 0.86rem; padding: 8px 0; text-align: center; }
.rs-announcement-bar__inner { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.rs-copy-coupon-btn { background: var(--rs-accent); color: #fff; border: none; border-radius: 6px; padding: 2px 10px; font-family: var(--rs-font); font-weight: 800; cursor: pointer; }

/* الهيدر */
.rs-header { position: sticky; top: 0; z-index: 900; background: #fff; border-bottom: 1px solid var(--rs-border); }
.rs-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; height: 70px; }
.rs-site-title { font-size: 1.35rem; font-weight: 800; color: var(--rs-primary); }
.rs-nav { display: none; }
@media (min-width: 992px) { .rs-nav { display: block; } }
.rs-nav__list { display: flex; list-style: none; margin: 0; padding: 0; gap: 20px; font-weight: 700; }
.rs-nav__list a:hover { color: var(--rs-accent-hover); }

.rs-header__search { position: relative; flex: 1; max-width: 340px; display: none; }
@media (min-width: 640px) { .rs-header__search { display: block; } }
.rs-search-form { display: flex; border: 1px solid var(--rs-border); border-radius: 8px; overflow: hidden; background: var(--rs-surface); }
.rs-search-form input { flex: 1; border: none; background: transparent; padding: 8px 12px; font-family: var(--rs-font); outline: none; }
.rs-search-form button { border: none; background: transparent; padding: 0 12px; cursor: pointer; }
.rs-search-dropdown { position: absolute; top: 100%; right: 0; left: 0; background: #fff; border: 1px solid var(--rs-border); border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); z-index: 950; display: none; margin-top: 4px; }
.rs-search-dropdown.is-open { display: block; }
.rs-search-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--rs-border); }
.rs-search-item img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }

.rs-header__actions { display: flex; align-items: center; gap: 10px; }
.rs-icon-btn { position: relative; background: var(--rs-surface); border: 1px solid var(--rs-border); border-radius: 8px; height: 38px; padding: 0 12px; display: inline-flex; align-items: center; gap: 5px; font-weight: 800; cursor: pointer; }
.rs-badge { background: var(--rs-accent); color: #fff; border-radius: 99px; font-size: 0.75rem; padding: 1px 6px; }

/* الأزرار */
.rs-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 24px; border-radius: 10px; font-family: var(--rs-font); font-weight: 800; font-size: 0.96rem; border: none; cursor: pointer; transition: 0.2s ease; }
.rs-btn--primary { background: var(--rs-accent); color: #fff; }
.rs-btn--primary:hover { background: var(--rs-accent-hover); }
.rs-btn--ghost { background: var(--rs-surface); color: var(--rs-primary); border: 1px solid var(--rs-border); }

/* البانر الرئيسي والمميزات */
.rs-hero { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); color: #fff; padding: 54px 0; text-align: center; }
.rs-hero__badge { display: inline-block; background: rgba(16,185,129,0.2); color: #6ee7b7; padding: 4px 14px; border-radius: 99px; font-size: 0.85rem; font-weight: 800; margin-bottom: 14px; }
.rs-hero__title { font-size: clamp(1.6rem, 4vw, 2.5rem); font-weight: 800; margin: 0 auto 14px; max-width: 720px; line-height: 1.3; }
.rs-hero__desc { color: #cbd5e1; max-width: 580px; margin: 0 auto 24px; font-size: 1.05rem; }

.rs-features-bar { background: var(--rs-surface); border-bottom: 1px solid var(--rs-border); padding: 14px 0; }
.rs-features-bar__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; font-size: 0.88rem; font-weight: 700; }
@media (min-width: 768px) { .rs-features-bar__grid { grid-template-columns: repeat(4, 1fr); } }
.rs-feat-item { display: flex; align-items: center; gap: 8px; }

/* الأقسام وشبكة المنتجات */
.rs-section__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.rs-section__head h2 { margin: 0; font-size: 1.35rem; font-weight: 800; color: var(--rs-primary); }
.rs-section__link { font-weight: 800; color: var(--rs-accent-hover); font-size: 0.92rem; }

.rs-cats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 768px) { .rs-cats-grid { grid-template-columns: repeat(6, 1fr); } }
.rs-cat-card { background: #fff; border: 1px solid var(--rs-border); border-radius: var(--rs-radius); padding: 12px; text-align: center; transition: 0.2s ease; }
.rs-cat-card:hover { border-color: var(--rs-accent); transform: translateY(-2px); }
.rs-cat-card img { width: 80px; height: 80px; object-fit: cover; border-radius: 50%; margin: 0 auto 10px; }
.rs-cat-card h3 { margin: 0; font-size: 0.92rem; font-weight: 800; }

.woocommerce ul.products { display: grid !important; grid-template-columns: repeat(2, 1fr); gap: 14px; list-style: none; margin: 0 !important; padding: 0 !important; }
@media (min-width: 768px) { .woocommerce ul.products { grid-template-columns: repeat(4, 1fr); gap: 18px; } }
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none !important; }
.woocommerce ul.products li.product { width: 100% !important; margin: 0 !important; float: none !important; position: relative; background: #fff; border: 1px solid var(--rs-border); border-radius: var(--rs-radius); padding: 12px; display: flex; flex-direction: column; justify-content: space-between; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 0.98rem !important; font-weight: 800; color: var(--rs-primary); margin: 10px 0 6px; }
.woocommerce ul.products li.product .price { font-weight: 800; color: var(--rs-accent-hover); font-size: 1rem; margin-bottom: 10px; display: block; }
.woocommerce ul.products li.product .button { width: 100%; text-align: center; background: var(--rs-primary); color: #fff; border-radius: 8px; padding: 9px 12px; font-weight: 800; font-size: 0.88rem; }
.woocommerce ul.products li.product .button:hover { background: var(--rs-accent); }

/* شارة الخصم المئوية */
.woocommerce span.onsale.rs-sale-badge { position: absolute; top: 10px; right: 10px; left: auto; min-height: auto; min-width: auto; margin: 0; padding: 4px 10px; border-radius: 6px; background: var(--rs-danger); color: #fff; font-family: var(--rs-font); font-size: 0.78rem; font-weight: 800; line-height: 1.3; z-index: 5; }

/* قسم عروض اليوم والعدّاد */
.rs-flash-sale { background: linear-gradient(180deg, #fef2f2 0%, #fff 100%); border-bottom: 1px solid var(--rs-border); }
.rs-flash-sale__header { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
@media (min-width: 768px) { .rs-flash-sale__header { flex-direction: row; align-items: center; justify-content: space-between; } }
.rs-flash-sale__title-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.rs-flash-sale__title { margin: 0; font-size: 1.3rem; font-weight: 800; }
.rs-countdown { display: inline-flex; align-items: center; gap: 6px; direction: ltr; }
.rs-cd-box { background: var(--rs-danger); color: #fff; min-width: 44px; padding: 4px 8px; border-radius: 8px; text-align: center; }
.rs-cd-box span { display: block; font-size: 1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.rs-cd-box small { display: block; font-size: 0.65rem; }
.rs-cd-sep { font-weight: 800; color: var(--rs-danger); }

/* السلة الجانبية */
.rs-drawer-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.5); z-index: 980; opacity: 0; visibility: hidden; transition: 0.25s; }
.rs-drawer-overlay.is-open { opacity: 1; visibility: visible; }
.rs-cart-drawer { position: fixed; top: 0; bottom: 0; left: 0; width: 100%; max-width: 380px; background: #fff; z-index: 990; transform: translateX(-100%); transition: 0.3s ease; display: flex; flex-direction: column; }
.rs-cart-drawer.is-open { transform: translateX(0); }
.rs-cart-drawer__header { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--rs-border); }
.rs-cart-drawer__header h3 { margin: 0; font-size: 1.1rem; }
.rs-drawer-close { background: none; border: none; font-size: 24px; cursor: pointer; }
.rs-cart-drawer__body { padding: 16px; overflow-y: auto; flex: 1; }
.rs-drawer-shipping { background: var(--rs-surface); padding: 10px; border-radius: 8px; margin-bottom: 14px; font-size: 0.85rem; }
.rs-progress-track { height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin-top: 6px; }
.rs-progress-fill { height: 100%; background: var(--rs-accent); transition: width 0.3s; }
.rs-drawer-items { list-style: none; padding: 0; margin: 0 0 16px; }
.rs-drawer-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rs-border); }
.rs-drawer-item img { width: 50px; height: 50px; border-radius: 6px; object-fit: cover; }
.rs-drawer-total { display: flex; justify-content: space-between; font-size: 1.05rem; margin-bottom: 12px; }

/* أزرار التحكم بالكمية (+) و (−) */
.rs-qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--rs-border); border-radius: 8px; background: #fff; overflow: hidden; height: 46px; }
.rs-qty-btn { width: 38px; height: 100%; border: none; background: var(--rs-surface); color: var(--rs-primary); font-family: var(--rs-font); font-size: 1.25rem; font-weight: 800; cursor: pointer; padding: 0; }
.rs-qty-stepper input.qty { width: 46px !important; height: 100% !important; border: none !important; border-right: 1px solid var(--rs-border) !important; border-left: 1px solid var(--rs-border) !important; text-align: center; font-weight: 800; padding: 0; -moz-appearance: textfield; }
.rs-qty-stepper input.qty::-webkit-outer-spin-button, .rs-qty-stepper input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* شريط وسائل الدفع */
.rs-trust-badges { margin-top: 16px; padding: 12px 14px; background: var(--rs-surface); border: 1px solid var(--rs-border); border-radius: 10px; text-align: center; }
.rs-trust-badges__head { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 700; color: var(--rs-text-muted); margin-bottom: 10px; }
.rs-trust-badges__grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px; }
.rs-pay-pill { display: inline-flex; align-items: center; justify-content: center; height: 30px; padding: 0 8px; background: #fff; border: 1px solid var(--rs-border); border-radius: 6px; }
.rs-pay-pill--tabby { background: #ecfdf5; border-color: #a7f3d0; }
.rs-pay-pill--tamara { background: #fffbeb; border-color: #fde68a; }

/* إشعارات المبيعات الحية */
.rs-sales-popup { position: fixed; bottom: 76px; right: 16px; width: calc(100% - 32px); max-width: 330px; background: #fff; border: 1px solid var(--rs-border); border-right: 4px solid var(--rs-accent); border-radius: 10px; box-shadow: 0 12px 30px rgba(15,23,42,0.14); padding: 10px 12px; z-index: 930; opacity: 0; visibility: hidden; transform: translateY(16px); transition: 0.35s ease; }
@media (min-width: 768px) { .rs-sales-popup { bottom: 22px; right: 22px; } }
.rs-sales-popup.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.rs-sales-popup__close { position: absolute; top: 6px; left: 8px; background: none; border: none; font-size: 18px; cursor: pointer; }
.rs-sales-popup__inner { display: flex; align-items: center; gap: 10px; padding-left: 16px; }
.rs-sales-popup__inner img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; }
.rs-sales-popup__buyer { display: block; font-size: 0.78rem; color: var(--rs-text-muted); }
.rs-sales-popup__prod { display: block; font-size: 0.86rem; font-weight: 800; color: var(--rs-primary); }
.rs-sales-popup__time { display: block; font-size: 0.75rem; font-weight: 700; color: var(--rs-accent-hover); }

/* مسار التنقل المرئي ومبدل اللغة */
.rs-breadcrumbs { margin: 0 0 16px; padding: 8px 12px; background: var(--rs-surface); border: 1px solid var(--rs-border); border-radius: 8px; overflow-x: auto; white-space: nowrap; }
.rs-breadcrumbs__list { display: inline-flex; align-items: center; gap: 8px; list-style: none; margin: 0; padding: 0; font-size: 0.84rem; }
.rs-breadcrumbs__item { display: inline-flex; align-items: center; gap: 8px; color: var(--rs-text-muted); }
.rs-breadcrumbs__item.is-current { color: var(--rs-primary); font-weight: 800; }

.rs-lang-switcher { display: inline-flex; align-items: center; background: var(--rs-surface); border: 1px solid var(--rs-border); border-radius: 8px; padding: 3px; gap: 3px; }
.rs-lang-pill { padding: 4px 10px; border-radius: 6px; font-size: 0.8rem; font-weight: 800; color: var(--rs-text-muted); }
.rs-lang-pill.is-active { background: var(--rs-primary); color: #fff; }
.rs-single-lang-bar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-bottom: 14px; font-size: 0.85rem; font-weight: 700; }

html[dir="ltr"] body { font-family: 'Inter', -apple-system, sans-serif; text-align: left; }
html[dir="ltr"] .woocommerce span.onsale.rs-sale-badge { right: auto; left: 10px; }
html[dir="ltr"] .rs-sales-popup { right: auto; left: 22px; border-right: 1px solid var(--rs-border); border-left: 4px solid var(--rs-accent); }
html[dir="ltr"] .rs-cart-drawer { left: auto; right: 0; transform: translateX(100%); }
html[dir="ltr"] .rs-cart-drawer.is-open { transform: translateX(0); }

/* الفوتر وشريط الجوال */
.rs-footer { background: var(--rs-primary); color: #cbd5e1; padding: 40px 0 0; margin-top: 40px; }
.rs-footer__grid { display: grid; grid-template-columns: 1fr; gap: 24px; padding-bottom: 30px; }
@media (min-width: 768px) { .rs-footer__grid { grid-template-columns: repeat(3, 1fr); } }
.rs-footer__title, .rs-footer__subtitle { color: #fff; margin-top: 0; }
.rs-footer__links { list-style: none; padding: 0; margin: 0; line-height: 2; }
.rs-wa-footer-btn { display: inline-block; background: #25d366; color: #fff; padding: 10px 18px; border-radius: 8px; font-weight: 800; }
.rs-footer__bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 14px 0; text-align: center; font-size: 0.85rem; }

.rs-mobile-bar { position: fixed; bottom: 0; right: 0; left: 0; height: 60px; background: #fff; border-top: 1px solid var(--rs-border); display: grid; grid-template-columns: repeat(4, 1fr); z-index: 920; }
@media (min-width: 768px) { .rs-mobile-bar { display: none; } }
.rs-mobile-bar a, .rs-mobile-bar button { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; background: none; border: none; font-family: var(--rs-font); color: var(--rs-primary); }

/* الطباعة والفاتورة المبسطة */
.rs-invoice-actions { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.rs-print-invoice-btn { padding: 10px 18px; background: #fff; color: var(--rs-primary); border: 1px solid var(--rs-border); border-radius: 8px; font-family: var(--rs-font); font-weight: 800; cursor: pointer; }
.print-only { display: none; }
@media print {
    .rs-announcement-bar, .rs-header, .rs-footer, .rs-mobile-bar, .rs-checkout-steps, .rs-thankyou-hero, .woocommerce-MyAccount-navigation, .no-print { display: none !important; }
    .print-only { display: block !important; border: 1px solid #cbd5e1; border-radius: 8px; padding: 18px; margin-bottom: 20px; }
    .rs-inv-top { display: flex; justify-content: space-between; border-bottom: 1px solid #e2e8f0; padding-bottom: 12px; margin-bottom: 12px; }
}
