/*
 * JO-Dealz - Deal share sheet (includes/deal-share.php + assets/js/deal-share.js).
 * Bottom sheet on phones, centred modal from 640px up. Logical properties keep Arabic RTL and English LTR in one sheet.
 * Brand palette: #F52A3B / #B50045 / #FFC61A (same tokens as mobile-deal.css).
 */
.dsh { position: fixed; inset: 0; z-index: 100001; display: flex; align-items: flex-end; justify-content: center; visibility: hidden; -webkit-tap-highlight-color: transparent; }
.dsh[hidden] { display: none; }
.dsh.is-open { visibility: visible; }
.dsh__backdrop { position: absolute; inset: 0; background: rgba(14, 6, 12, .62); opacity: 0; transition: opacity .25s ease; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dsh.is-open .dsh__backdrop { opacity: 1; }
.dsh__sheet {
  position: relative; width: 100%; max-width: 480px; max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column;
  background: #fff; color: #12131A; border-radius: 26px 26px 0 0; box-shadow: 0 -18px 50px rgba(14, 6, 12, .35);
  transform: translateY(105%); transition: transform .32s cubic-bezier(.16, 1, .3, 1); outline: none;
  padding-bottom: env(safe-area-inset-bottom, 0px); font-family: inherit;
}
.dsh.is-open .dsh__sheet { transform: translateY(0); }
.dsh__grab { align-self: center; width: 40px; height: 4px; margin-block: 8px 0; border-radius: 4px; background: #d9dbe2; flex: none; }
.dsh__head { display: flex; align-items: flex-start; gap: 12px; padding: 10px 18px 8px; flex: none; }
.dsh__heads { flex: 1; min-width: 0; }
.dsh__title { margin: 0; font-size: 19px; line-height: 1.35; font-weight: 800; }
.dsh__sub { margin: 2px 0 0; font-size: 13px; color: #6B7280; line-height: 1.5; }
.dsh__x { flex: none; width: 44px; height: 44px; margin-block: -4px; margin-inline-end: -8px; border: 0; border-radius: 50%; background: #F3F4F7; color: #4b5060; font-size: 17px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.dsh__x:active { transform: scale(.92); }
.dsh__x i { margin: 0 !important; }
.dsh__body { padding: 6px 18px 18px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* Mini advertisement */
.dsh-card { border-radius: 22px; overflow: hidden; background: #fff; border: 1px solid #ECECEC; box-shadow: 0 10px 28px -14px rgba(181, 0, 69, .45); }
.dsh-card__media { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(145deg, #F52A3B, #B50045 70%, #900037); overflow: hidden; }
.dsh-card__media > img { width: 100%; height: 100%; object-fit: cover; display: block; max-width: none; }
.dsh-card__media.is-ph > img { object-fit: contain; padding: 18%; background: #f1f5f9; }
.dsh-card__shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to bottom, rgba(14, 6, 12, .45), rgba(14, 6, 12, 0) 40%, rgba(14, 6, 12, 0) 60%, rgba(14, 6, 12, .55)); }
.dsh-card__off { position: absolute; inset-block-start: 10px; inset-inline-start: 10px; height: 30px; padding-inline: 12px; border-radius: 999px; display: inline-flex; align-items: center; background: #FFC61A; color: #1E1E1E; font-size: 14px; font-weight: 900; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); max-width: 70%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsh-card__brand { position: absolute; inset-block-end: 9px; inset-inline-end: 10px; display: inline-flex; align-items: center; color: #fff; font-weight: 900; font-size: 14px; }
.dsh-card__brand img { height: 22px; width: auto; display: block; max-width: none; }
.dsh-card__body { padding: 12px 14px 10px; display: grid; gap: 8px; }
.dsh-card__title { margin: 0; font-size: 17px; line-height: 1.4; font-weight: 800; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dsh-card__merchant { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #4b5060; min-width: 0; }
.dsh-card__merchant img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; border: 1px solid #ECECEC; flex: none; background: #fff; }
.dsh-card__merchant span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsh-card__price { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; unicode-bidi: isolate; }
.dsh-card__price b { font-size: 22px; font-weight: 900; color: #F52A3B; line-height: 1.1; }
.dsh-card__price s { font-size: 14px; color: #6B7280; font-weight: 600; }
.dsh-card__cta { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; background: linear-gradient(135deg, #F52A3B, #B50045); color: #fff; font-size: 14px; font-weight: 800; }
.dsh-card__cta i { margin: 0 !important; color: #FFC61A; }

/* Primary + channels */
.dsh-primary { margin-block-start: 14px; width: 100%; min-height: 52px; border: 0; border-radius: 16px; display: flex; align-items: center; justify-content: center; gap: 10px; background: #F52A3B; color: #fff; font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; box-shadow: 0 6px 20px rgba(245, 42, 59, .28); }
.dsh-primary[hidden] { display: none; }
.dsh-primary:active { transform: scale(.98); background: #B50045; }
.dsh-primary i { margin: 0 !important; }
.dsh__label { margin: 16px 0 10px; font-size: 13px; font-weight: 700; color: #6B7280; letter-spacing: 0; text-transform: none; }
.dsh-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px 6px; }
.dsh-ch { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 44px; padding: 4px 2px; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.dsh-ch[hidden] { display: none; }
.dsh-ch__ic { width: 54px; height: 54px; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; background: var(--c, #6b7280); color: #fff; font-size: 24px; box-shadow: 0 6px 14px -6px var(--c, #000); transition: transform .15s; }
.dsh-ch:active .dsh-ch__ic { transform: scale(.9); }
.dsh-ch__ic i { margin: 0 !important; color: inherit !important; font-size: inherit !important; }
.dsh-ch__l { font-size: 12px; font-weight: 700; color: #4b5060; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsh-ch:focus-visible, .dsh-primary:focus-visible, .dsh__x:focus-visible, .dsh-copy__btn:focus-visible { outline: 3px solid #F52A3B; outline-offset: 2px; }

/* Copy link */
.dsh-copy { margin-block-start: 14px; display: flex; align-items: center; gap: 8px; padding: 6px; padding-inline-start: 14px; border-radius: 16px; background: #F7F7F9; border: 1px solid #ECECEC; }
.dsh-copy__url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: #4b5060; text-align: start; unicode-bidi: plaintext; }
.dsh-copy__btn { flex: none; min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px; display: inline-flex; align-items: center; gap: 8px; background: #12131A; color: #fff; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; transition: background .2s; }
.dsh-copy__btn i { margin: 0 !important; }
.dsh-copy__btn.is-done { background: #047857; }
.dsh-copy__btn.is-fail { background: #B50045; }
.dsh__status { margin: 8px 2px 0; min-height: 20px; font-size: 13px; font-weight: 700; color: #047857; text-align: center; }
.dsh__status.is-fail { color: #B50045; }

html.dsh-lock, html.dsh-lock body { overflow: hidden !important; }

@media (min-width: 640px) {
  .dsh { align-items: center; padding: 24px; }
  .dsh__sheet { border-radius: 26px; max-height: 90vh; transform: translateY(18px) scale(.97); opacity: 0; transition: transform .28s cubic-bezier(.16, 1, .3, 1), opacity .22s ease; padding-bottom: 0; }
  .dsh.is-open .dsh__sheet { transform: none; opacity: 1; }
  .dsh__grab { display: none; }
  .dsh__head { padding-top: 18px; }
}
@media (max-width: 359px) {
  .dsh__head, .dsh__body { padding-inline: 14px; }
  .dsh-ch__ic { width: 48px; height: 48px; font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) { .dsh__sheet, .dsh__backdrop { transition: none; } }
