/* إضافات المتجر فوق تصميم الموقع (style.css) */
.page-head.slim { padding-top: calc(var(--header-h) + clamp(40px, 6vw, 80px)); padding-bottom: clamp(20px, 3vw, 40px); }
.flash-wrap { padding-top: calc(var(--header-h) + 20px); margin-bottom: -60px; z-index: 3; }
.text-link { display: inline-block; margin-top: 18px; color: var(--muted); font-size: 14px; border-bottom: 1px solid var(--line-strong); transition: color .3s, border-color .3s; }
.text-link:hover { color: var(--gold); border-color: var(--gold); }
.fine { font-size: 12.5px; color: var(--muted); margin-top: 16px; }
.fine a { color: var(--gold); border-bottom: 1px solid; }

.cart-link { position: relative; width: 40px; height: 40px; display: grid; place-items: center; transition: color .3s, transform .4s var(--ease); }
.cart-link:hover { color: var(--gold); transform: translateY(-2px); }
.cart-link b { position: absolute; top: 0; inset-inline-end: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gold); color: var(--gold-ink); font: 700 11px/18px var(--font-en); text-align: center; }

/* شبكة المنتجات */
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(26px, 3.4vw, 52px) clamp(16px, 2.4vw, 34px); }
.product-card { display: block; transition: opacity .35s, transform .5s var(--ease); }
.product-card.is-out { opacity: 0 !important; transform: scale(.97) !important; }
.product-media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--bg-2); }
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease); }
.product-card:hover .product-media img { transform: scale(1.07); }
.product-media::after { content: ""; position: absolute; inset: auto 0 0 0; height: 3px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease-io); }
[dir="rtl"] .product-media::after { transform-origin: right; }
.product-card:hover .product-media::after { transform: scaleX(1); }
.product-tags { position: absolute; top: 14px; inset-inline-start: 14px; display: flex; gap: 6px; }
.tag { background: var(--gold); color: var(--gold-ink); font-size: 11px; font-weight: 700; padding: 3px 12px; }
.tag.muted { background: #555; color: #fff; }
.tag.line { background: rgba(0, 0, 0, .55); color: #fff; backdrop-filter: blur(4px); }
.product-meta { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; padding-top: 16px; }
.product-cat { display: block; font-size: 12px; color: var(--gold); font-weight: 700; }
.product-meta h3 { font-size: 17px; line-height: 1.6; }
.price { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; font-family: var(--font-en); }
.price b { font-size: 16px; }
.price del { font-size: 12.5px; color: var(--muted); }
[dir="rtl"] .price { font-family: var(--font-ar); }
.price.big { flex-direction: row; align-items: baseline; gap: 14px; margin: 18px 0 24px; }
.price.big b { font-size: clamp(26px, 3vw, 38px); }
.price.big del { font-size: 16px; }
.price.big small { color: var(--muted); font-size: 12.5px; }

/* صفحة المنتج */
.product-page { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(30px, 6vw, 100px); padding-top: calc(var(--header-h) + clamp(40px, 6vw, 80px)); padding-bottom: clamp(70px, 9vw, 130px); align-items: start; }
.product-main { aspect-ratio: 4 / 5; overflow: hidden; background: var(--bg-2); }
.product-main img { width: 100%; height: 100%; object-fit: cover; transition: opacity .35s; }
.product-main img.is-swapping { opacity: 0; }
.product-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.product-thumbs button { width: 78px; aspect-ratio: 1; overflow: hidden; opacity: .5; outline: 1px solid transparent; outline-offset: 2px; transition: opacity .3s, outline-color .3s; }
.product-thumbs button.is-active, .product-thumbs button:hover { opacity: 1; }
.product-thumbs button.is-active { outline-color: var(--gold); }
.product-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product-info { position: sticky; top: 100px; }
.product-info h1 { font-size: clamp(28px, 3.6vw, 50px); line-height: 1.35; font-weight: 800; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 26px; transition: color .3s; }
.back-link:hover { color: var(--gold); }
.back-link .ico { width: 16px; height: 16px; transform: scaleX(-1); }
[dir="rtl"] .back-link .ico { transform: none; }
.product-desc { color: var(--muted); max-width: 520px; }
.product-facts { display: grid; gap: 10px; margin: 26px 0 34px; font-size: 14px; }
.product-facts li { display: flex; gap: 10px; align-items: flex-start; }
.product-facts .ico { color: var(--gold); width: 18px; height: 18px; margin-top: 5px; }
.add-form { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); height: 52px; }
.qty button { width: 44px; height: 100%; font-size: 20px; transition: background-color .3s, color .3s; }
.qty button:hover { background: var(--gold); color: var(--gold-ink); }
.qty input { width: 48px; height: 100%; text-align: center; background: none; border: 0; font: 600 16px var(--font-en); -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-one { width: 138px; text-align: center; color: var(--muted); }

/* السلة وإتمام الطلب */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: clamp(30px, 5vw, 80px); align-items: start; }
.cart-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto auto 40px; gap: 20px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); }
.cart-row:first-of-type { border-top: 1px solid var(--line); }
.cart-thumb { aspect-ratio: 1; overflow: hidden; background: var(--bg-2); display: block; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-name a { display: block; font-weight: 700; font-size: 17px; transition: color .3s; }
.cart-name a:hover { color: var(--gold); }
.cart-name span { color: var(--muted); font-size: 13px; }
.cart-sum { min-width: 90px; text-align: end; white-space: nowrap; }
.cart-row .qty { height: 44px; }
.cart-remove { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); transition: background-color .3s, color .3s; }
.cart-remove:hover { background: rgba(229, 138, 138, .15); color: #e58a8a; }
.cart-remove .ico { width: 16px; height: 16px; }

.summary { background: var(--bg-2); padding: clamp(24px, 3vw, 38px); position: sticky; top: 100px; border: 1px solid var(--line); }
.summary h2, .checkout-fields h2, .callout h2 { font-size: 18px; margin-bottom: 18px; }
.summary .btn { width: 100%; margin-top: 26px; }
.summary .btn[disabled] { opacity: .4; pointer-events: none; }
.totals { display: grid; gap: 10px; }
.totals div { display: flex; justify-content: space-between; gap: 16px; }
.totals dt { color: var(--muted); }
.totals .grand { border-top: 1px solid var(--line-strong); padding-top: 14px; margin-top: 6px; font-size: 20px; font-weight: 800; }
.totals .grand dt { color: var(--text); }
.totals .small { font-size: 12.5px; }
.mini-lines { display: grid; gap: 10px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.mini-lines li { display: flex; justify-content: space-between; gap: 14px; }
.mini-lines b { white-space: nowrap; }

.checkout-fields { display: grid; gap: 22px; }
.checkout-fields h2 { margin: 16px 0 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.checkout-fields h2:first-of-type { margin-top: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.fld em { display: block; color: #e58a8a; font-size: 12.5px; font-style: normal; margin-top: 6px; }
.methods { display: grid; gap: 12px; }
.method { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border: 1px solid var(--line-strong); cursor: pointer; transition: border-color .3s, background-color .3s; }
.method:hover { border-color: var(--gold); }
.method:has(input:checked) { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.method input { accent-color: var(--gold); width: 18px; height: 18px; margin-top: 6px; flex: none; }
.method b { display: block; }
.method small { color: var(--muted); }
.methods.is-invalid .method { border-color: #e07b7b; }

/* صفحة الطلب */
.status-row { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); margin-bottom: 26px; }
.status-row div { padding: 18px 20px; border-inline-end: 1px solid var(--line); display: grid; gap: 6px; align-content: start; }
.status-row div:last-child { border-inline-end: 0; }
.status-row span { font-size: 12px; color: var(--muted); }
.pill { display: inline-block; justify-self: start; padding: 1px 14px; font-size: 13px; background: var(--bg-2); border: 1px solid var(--line-strong); }
.pill.p-paid, .pill.s-completed { border-color: #7fc891; color: #7fc891; }
.pill.p-unpaid, .pill.s-new { border-color: var(--gold); color: var(--gold); }
.pill.s-cancelled, .pill.p-refunded { border-color: #e58a8a; color: #e58a8a; }
.callout { border: 1px solid var(--gold); padding: 24px 26px; margin-bottom: 26px; background: color-mix(in srgb, var(--gold) 7%, transparent); }
.callout p { margin-bottom: 12px; }
.callout .btn { margin-top: 8px; }
.order-items li { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.order-items li > div { display: grid; flex: 1; min-width: 180px; }
.order-items span, .order-items small { color: var(--muted); font-size: 13px; }
.ship-to { display: grid; gap: 2px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; }
.ship-to span { color: var(--muted); }
[dir="rtl"] .ship-to span[dir="ltr"] { text-align: right; }

.track-form { display: grid; gap: 26px; max-width: 460px; }
.track-form .btn { justify-self: start; }
.policy-text { max-width: 760px; }
.pay-wrap { max-width: 520px; margin-inline: auto; }
.pay-box { background: #fff; color: #1b1c1a; padding: 26px; min-height: 120px; }
.store-footer { border-top: 0; padding-block: 34px; }

@media (max-width: 1000px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cart-layout { grid-template-columns: 1fr; }
  .summary, .product-info { position: static; }
  .status-row { grid-template-columns: 1fr 1fr; }
  .status-row div:nth-child(2) { border-inline-end: 0; }
  .status-row div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 720px) {
  .product-page { grid-template-columns: 1fr; }
  .product-grid { gap: 26px 12px; }
  .product-meta { flex-direction: column; align-items: flex-start; gap: 4px; }
  .price { align-items: flex-start; }
  .product-meta h3 { font-size: 15px; }
  .two { grid-template-columns: 1fr; }
  .cart-row { grid-template-columns: 70px minmax(0, 1fr) 36px; gap: 12px 14px; }
  .cart-row .qty, .cart-row .qty-one { grid-column: 2; grid-row: 2; justify-self: start; }
  .cart-sum { grid-column: 2 / 4; grid-row: 2; justify-self: end; }
  .cart-row > form:last-child { grid-column: 3; grid-row: 1; }
  .cart-link { width: 34px; }
}

.js .product-main.img-reveal > img { transition: clip-path 1.3s var(--ease-io), transform 1.8s var(--ease), opacity .35s; }
