/* إضافات على تصميم الموقع القديم: العربي (RTL)، الروابط بدل onclick، رسائل، وصفحات النجاح/الفشل/404 */

/* ---------- عام ---------- */
:focus-visible { outline: 2px solid orange; outline-offset: 2px; }
a.name, a.cat, a.icon, a.checkout-logo, .product h3 a, .product-name a, a.product-category { color: inherit; text-decoration: none; }
button.icon { font: inherit; cursor: pointer; padding: 0; }
a.icon { cursor: pointer; }
button.menu-toggle { background: none; border: none; padding: 6px 0; }
.search-bar form { margin: 0; }
.empty-text { color: #888; text-align: center; grid-column: 1 / -1; padding: 20px; }
.product p s { color: #999; font-size: 14px; font-weight: normal; margin-inline-start: 6px; }
[data-href] { cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- العربي ---------- */
html[dir="rtl"] body { font-family: Tahoma, Arial, sans-serif; }
html[dir="rtl"] .sale-banner button { margin-left: 0; margin-right: 10px; }
html[dir="rtl"] .dropdown-menu { left: auto; right: 0; }
html[dir="rtl"] .nav-links a::after { left: auto; right: 0; }
html[dir="rtl"] .cart span { right: auto; left: -6px; }
html[dir="rtl"] .cart-item-total { text-align: left; }
html[dir="rtl"] .discount-badge { left: auto; right: 14px; }
html[dir="rtl"] .stock-badge { right: auto; left: 14px; }
html[dir="rtl"] .name, html[dir="rtl"] .loader-logo, html[dir="rtl"] .checkout-logo { letter-spacing: 3px; direction: ltr; }
@media (max-width: 768px) { html[dir="rtl"] .cart-item-total { text-align: right; } }
@media (max-width: 520px) { html[dir="rtl"] .sale-banner button { margin: 8px auto 0; } }

/* ---------- المتجر ---------- */
.load-more { display: inline-block; background: orange; color: black; padding: 16px 28px; border-radius: 16px; font-weight: bold; text-decoration: none; }
.load-more:hover { background: #111; color: white; }
.filter-bar input[type="search"] { -webkit-appearance: none; appearance: none; }

/* ---------- المنتج ---------- */
.add-cart-btn:disabled { opacity: 0.5; cursor: not-allowed; background: #ddd; color: #666; }
.thumbs img:focus-visible { border-color: orange; outline: none; }
.delivery-note { margin-top: 18px; color: #666; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.delivery-note i { color: orange; }
.option-btn:disabled { cursor: not-allowed; }
.options-grid.shake { animation: shake 0.3s; }
@keyframes shake { 25% { transform: translateX(6px); } 75% { transform: translateX(-6px); } }

/* ---------- السلة ---------- */
.cart-item .warn { color: crimson; font-size: 13px; font-weight: bold; margin-top: 4px; }
.cart-item .qty button:disabled { opacity: 0.35; cursor: not-allowed; }
.cart-warn { background: #fee2e2; color: #b91c1c; padding: 12px; border-radius: 10px; margin-top: 12px; font-size: 14px; font-weight: bold; }
.checkout:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- الدفع ---------- */
.checkout-card label { display: block; font-weight: bold; margin: 4px 0 8px; color: #444; }
.input.invalid { border-color: crimson; background: #fff5f5; }
.payment-method:focus-visible { outline: 2px solid orange; }
.checkout-error { display: none; background: #fee2e2; color: #b91c1c; padding: 14px; border-radius: 14px; margin-top: 14px; font-weight: bold; line-height: 1.6; }
.checkout-error.show { display: block; }
.place-order-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.checkout-item .info p { color: #666; margin-top: 4px; }
.checkout-item .line-total { font-weight: bold; white-space: nowrap; }
.checkout-item .warn { color: crimson; font-weight: bold; }
#shipFee.muted { color: #999; font-weight: normal; }

/* ---------- النجاح / الفشل / 404 (كانت جوه الصفحات القديمة) ---------- */
body.page-success, body.page-failed { background: #f8fafc; }
.success-page, .failed-page, .notfound-page { min-height: 100vh; display: flex; justify-content: center; align-items: center; padding: 20px; background: #f8fafc; }
.success-card, .failed-card { background: white; width: 100%; max-width: 520px; padding: 50px 35px; border-radius: 30px; text-align: center; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08); }
.success-icon, .failed-icon { width: 90px; height: 90px; margin: auto auto 25px; border-radius: 50%; color: white; display: flex; justify-content: center; align-items: center; font-size: 40px; }
.success-icon { background: #22c55e; }
.failed-icon { background: crimson; }
.success-card h1, .failed-card h1 { margin-bottom: 15px; font-size: 34px; }
.success-card p, .failed-card p { color: #64748b; line-height: 1.8; margin-bottom: 24px; }
.order-no-box { background: #f8fafc; border-radius: 18px; padding: 16px; margin-bottom: 26px; display: grid; gap: 4px; }
.order-no-box small { color: #64748b; }
.order-no-box strong { font-size: 26px; letter-spacing: 1px; }
.order-no-box span { color: #111; font-weight: bold; }
.success-btns { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }
.success-btns a, .retry-btn { text-decoration: none; padding: 14px 22px; border-radius: 14px; font-weight: bold; transition: 0.3s; display: inline-block; }
.home-btn, .retry-btn { background: #111; color: white; }
.home-btn:hover, .retry-btn:hover { background: orange; color: black; }
.orders-btn { background: #f1f5f9; color: #111; }
.orders-btn:hover { background: #e2e8f0; }
.notfound-card { background: white; width: 100%; max-width: 600px; padding: 60px 40px; border-radius: 30px; text-align: center; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08); }
.notfound-card h1 { font-size: 110px; color: orange; margin-bottom: 10px; }
.notfound-card h2 { font-size: 34px; margin-bottom: 18px; }
.notfound-card p { color: #64748b; line-height: 1.8; margin-bottom: 30px; }
.notfound-card a { display: inline-block; padding: 15px 24px; background: #111; color: white; text-decoration: none; border-radius: 14px; font-weight: bold; transition: 0.3s; }
.notfound-card a:hover { background: orange; color: black; }

/* ---------- حسابي ---------- */
.account-nav form { margin: 0; }
.account-nav .translate-icon { background: #222; }
.account-notice { background: #fff7ed; color: #9a3412; padding: 14px 18px; border-radius: 14px; margin-bottom: 20px; font-weight: bold; }
.order-click-card:focus-visible { outline: 2px solid orange; }
.login-error { background: #fee2e2; color: #b91c1c; padding: 12px; border-radius: 12px; font-weight: bold; text-align: center; }
.login-back { text-align: center; color: #666; text-decoration: none; font-size: 14px; }

/* ---------- واتساب ورسائل ---------- */
.wa-fab { position: fixed; z-index: 900; bottom: 20px; inset-inline-end: 20px; width: 56px; height: 56px; border-radius: 50%; background: #25d366; color: white; display: grid; place-items: center; font-size: 28px; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2); text-decoration: none; transition: 0.3s; }
.wa-fab:hover { transform: translateY(-3px); }
.toast { position: fixed; z-index: 99999; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: #111; color: white; padding: 14px 20px; border-radius: 16px; font-weight: bold; opacity: 0; pointer-events: none; transition: 0.3s; max-width: 90vw; display: flex; gap: 14px; align-items: center; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { color: orange; text-decoration: none; white-space: nowrap; }
.toast.err { background: crimson; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ================= العروض والخصومات ================= */
.product .promo-badge {
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  z-index: 3;
  background: crimson;
  color: #fff;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}
.product .promo-badge.gift,
.discount-badge.gift {
  background: #111;
  max-width: calc(100% - 28px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product p s { color: #999; font-size: 0.85em; margin-inline-start: 6px; }

.promo-box {
  margin: 14px 0;
  display: grid;
  gap: 8px;
}
.promo-box .po,
.promo-box .pb {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}
.promo-box .po { background: #fff1f2; color: #b4002b; border: 1px dashed #f3a5b5; }
.promo-box .pb { background: #f5f5f5; color: #333; }

.cart-item-total s,
.line-total s { display: block; color: #999; font-size: 0.8em; font-weight: 400; }
.disc-row { color: #b4002b !important; font-weight: 600; }
.disc-row b { font-family: monospace; background: #fff1f2; padding: 1px 6px; border-radius: 6px; }

.coupon-box { margin: 16px 0 6px; }
.coupon-box[hidden] { display: none; }
.coupon-box label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.coupon-row { display: flex; gap: 8px; }
.coupon-row input {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #ddd;
  border-radius: 12px;
  font: inherit;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.coupon-row input:focus { outline: 2px solid #111; outline-offset: 1px; }
.coupon-row input[readonly] { background: #f6f6f6; color: #111; font-weight: 700; }
.coupon-row button {
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: #111;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.coupon-row button[data-mode="remove"] { background: #eee; color: #111; }
.coupon-row button:disabled { opacity: 0.6; cursor: wait; }
.coupon-msg { font-size: 13px; margin-top: 6px; min-height: 1em; }
.coupon-msg.ok { color: #15803d; }
.coupon-msg.warn { color: #b45309; }
.coupon-msg.err { color: #b4002b; }

.promo-hints { display: grid; gap: 6px; margin: 10px 0; }
.promo-hint { font-size: 13px; background: #f7f7f7; border-radius: 10px; padding: 8px 12px; color: #333; }

.order-no-box .saved { display: block; margin-top: 6px; color: #15803d; font-weight: 600; }

/* درجة اللون جنب اسمه في صفحة المنتج */
.option-btn .opt-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  margin-inline-end: 6px;
  vertical-align: -1px;
}

/* سطر المطوّر في الفوتر */
.footer-bottom .dev-credit{display:inline;margin:0;color:#999;text-decoration:none;white-space:nowrap}
.footer-bottom .dev-credit b{font-family:'Cormorant Garamond',Georgia,serif;letter-spacing:.14em;color:#ccc;font-weight:600}
.footer-bottom .dev-credit:hover b{color:#B08D57}
.footer-bottom .dev-sep{margin:0 10px;opacity:.5}
@media(max-width:600px){.footer-bottom .dev-sep{display:none}.footer-bottom .dev-credit{display:block;margin-top:6px}}
