/* Coupon codes per unit (js/unit-coupon.js). Site palette only. Mobile first:
   a bottom sheet on phones, a centred card from 900px. */

/* cart rows */
.unit-coupon-code { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #C2EAEA; color: #243D44; font-family: 'Almoni Bold'; font-size: 13px; letter-spacing: .5px; direction: ltr; unicode-bidi: isolate; }
.unit-coupon-remove { background: none; border: none; cursor: pointer; padding: 0; margin-left: 0; color: #243D44; }
/* Figma 39_Coupon: the amount sits next to the ✕ at the left edge, "קופון" on the right */
.popup#cart_pop .discount-row.unit-coupon-row { justify-content: flex-start; gap: 12px !important; }
.popup#cart_pop .discount-row.unit-coupon-row .discount-label { margin-left: auto; }
.popup#cart_pop .discount-row.unit-coupon-row .unit-coupon-remove { margin-right: 0; }
.wrap_item .item.discount .price.unit-coupon-price { display: inline-flex; align-items: center; gap: 10px; }
.wrap_item .item.discount .price.unit-coupon-price .unit-coupon-remove { font-size: 14px; line-height: 1; }

/* the picker */
.uc-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 10050; opacity: 0; transition: opacity .28s ease; }
.uc-bg.on { opacity: 1; }
.uc-sheet { position: fixed; z-index: 10060; left: 0; right: 0; bottom: 0; direction: rtl; background: #F7F7F7;
  border-radius: 14px 14px 0 0; max-height: 90vh; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .38s cubic-bezier(.32,.72,0,1); box-shadow: 0 -2px 20px rgba(0,0,0,.12);
  font-family: 'Almoni Medium'; color: #243D44; text-align: right; }
.uc-sheet.on { transform: translateY(0); }
.uc-grab { width: 36px; height: 5px; border-radius: 3px; background: #D3D8DA; margin: 8px auto 0; flex: none; }
.uc-head { position: relative; padding: 14px 20px 10px; text-align: center; flex: none; touch-action: none; }
.uc-x { position: absolute; top: 10px; left: 14px; width: 30px; height: 30px; border-radius: 15px; border: 0; background: #ECECEC; color: #545F64; font-size: 15px; line-height: 30px; padding: 0; cursor: pointer; }
.uc-icon img { width: 44px; height: 44px; }
.uc-title { font-family: 'Almoni Bold'; font-size: 22px; line-height: 1.15; margin: 6px 0 4px; }
.uc-title .unit-coupon-code { font-size: 17px; padding: 2px 10px; vertical-align: 2px; }
.uc-sub { font-size: 15px; color: #545F64; line-height: 1.3; }
.uc-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 16px 12px; flex: 1 1 auto; }
.uc-sec { font-size: 13px; color: #545F64; margin: 14px 16px 6px; }
.uc-group { background: #fff; border-radius: 12px; overflow: hidden; }
.uc-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 64px; position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.uc-row + .uc-row::before { content: ''; position: absolute; top: 0; right: 62px; left: 0; height: 1px; background: #ECECEC; }
.uc-row:active:not(.off) { background: #F7F7F7; }
.uc-row.off { cursor: default; }
.uc-sheet:focus { outline: none; }
.uc-row:focus { outline: none; }
.uc-row:focus-visible, .uc-go:focus-visible, .uc-x:focus-visible { outline: 2px solid #243D44; outline-offset: -2px; }
.uc-row.off .uc-main, .uc-row.off .uc-thumb { opacity: .5; }
.uc-thumb { width: 40px; height: 40px; border-radius: 8px; flex: none; object-fit: cover; background: #ECECEC; }
.uc-main { flex: 1 1 auto; min-width: 0; }
.uc-name { font-family: 'Almoni Bold'; font-size: 16px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.uc-meta { font-size: 14px; color: #545F64; margin-top: 2px; }
.uc-why { font-size: 13px; color: #545F64; margin-top: 3px; }
.uc-side { flex: none; display: flex; align-items: center; gap: 10px; }
.uc-disc { font-family: 'Almoni Bold'; font-size: 17px; color: #38715E; direction: ltr; }
.uc-disc s { color: #545F64; font-family: 'Almoni Medium'; font-size: 13px; display: block; text-align: left; }
.uc-chk { width: 24px; height: 24px; border-radius: 12px; border: 1.5px solid #D3D8DA; background: #fff; display: inline-flex; align-items: center; justify-content: center; transition: background .15s, border-color .15s; }
.uc-chk svg { opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s; }
.uc-row.sel .uc-chk { background: #243D44; border-color: #243D44; }
.uc-row.sel .uc-chk svg { opacity: 1; transform: scale(1); }
.uc-lock { width: 24px; text-align: center; }
.uc-lock svg { display: block; margin: 0 auto; }
.uc-foot { flex: none; padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid #ECECEC; }
.uc-sum { display: flex; justify-content: space-between; font-size: 15px; color: #545F64; margin: 0 4px 8px; }
.uc-sum span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: 12px; }
.uc-sum b { flex: none; font-family: 'Almoni Bold'; font-weight: normal; color: #38715E; font-size: 17px; }
.uc-go { display: block; width: 100%; height: 52px; border-radius: 30px; border: 0; background: #243D44; color: #fff; font-family: 'Almoni Bold'; font-size: 19px; cursor: pointer; transition: transform .1s; }
.uc-go:active:not([disabled]) { transform: scale(.98); }
.uc-go[disabled] { background: #D3D8DA; color: #545F64; cursor: default; }
.uc-err { color: #B04444; font-size: 14px; text-align: center; margin: 0 0 8px; }

.uc-toast { position: fixed; z-index: 10100; left: 50%; top: calc(16px + env(safe-area-inset-top)); transform: translate(-50%, -160%);
  background: #243D44; color: #fff; border-radius: 26px; padding: 12px 20px; font-family: 'Almoni Bold'; font-size: 16px; direction: rtl;
  box-shadow: 0 6px 24px rgba(0,0,0,.18); transition: transform .4s cubic-bezier(.32,.72,0,1); width: max-content; max-width: calc(100vw - 32px); text-align: center; line-height: 1.3; }
.uc-toast.on { transform: translate(-50%, 0); }

@media (min-width: 900px) {
  .uc-sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 520px; max-height: 86vh; border-radius: 20px;
    transform: translate(-50%, -46%) scale(.96); opacity: 0; transition: transform .3s cubic-bezier(.32,.72,0,1), opacity .2s; }
  .uc-sheet.on { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  .uc-grab { display: none; }
  .uc-head { padding-top: 26px; }
  .uc-x { top: 16px; left: 16px; }
  .uc-body { padding: 4px 24px 12px; }
  .uc-foot { padding: 12px 24px 20px; }
  .uc-row:hover:not(.off) { background: #F7F7F7; }
}

/* ---- a cart line drawn as one row, its discounts listed under it (views/pages/_line_discounts.php) ----
   Mobile first. Every ✕ is a 44×44 tap target (Apple HIG) that overhangs the row with
   negative margins, so the rows stay compact and the amounts stay in one column. */
.line-qty { color: #545F64; white-space: nowrap; }
.line-discounts { width: 100%; direction: rtl; color: #243D44; }
.line-discount { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.line-discount + .line-discount { border-top: 1px solid #ECECEC; }
.line-discount__text { flex: 1 1 auto; min-width: 0; }
.line-discount__name { font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.line-discount__unit { color: #545F64; }
.line-discount__code { font-size: 13px; line-height: 1.3; color: #545F64; margin-top: 2px; overflow-wrap: anywhere; }
.line-discount__amount { flex: none; display: inline-flex; align-items: center; font-weight: 500; font-size: 15px; white-space: nowrap; }
.line-discount__remove { flex: none; width: 44px; height: 44px; margin: -10px 0 -10px -14px; padding: 0; border: 0; border-radius: 22px; background: none; color: #243D44; font-size: 15px; line-height: 44px; text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.line-discount__remove:active { background: #ECECEC; }
.line-discount__remove:focus-visible { outline: 2px solid #243D44; outline-offset: -6px; }
.line-discount__remove--none { visibility: hidden; }
.line-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 4px; padding-top: 10px; border-top: 1px solid #D3D8DA; font-size: 15px; }
.line-total__price { font-weight: 500; white-space: nowrap; }
.line-total__price s { margin-right: 6px; color: #545F64; font-weight: 400; font-size: 13px; }

/* cart popup: app.css styles `.popup#cart_pop .digitel-remove-main` (loaded later) -- keep the tap target */
.popup#cart_pop .line-discount .line-discount__remove { margin: -10px 0 -10px -14px; padding: 0; width: 44px; height: 44px; }

/* order summaries (beforeCheckoutProcess / payment): the production "↳" line */
.line-discounts--summary { padding-top: 5px; }
.line-discounts--summary .line-discount { padding: 3px 0; }
.line-discounts--summary .line-discount + .line-discount { border-top: 0; }
.line-discounts--summary .line-discount__name { font-size: 16px; position: relative; padding-right: 12px; }
.line-discounts--summary .line-discount__name::before { content: ''; position: absolute; top: 7px; right: 0; width: 8px; height: 8px; background: url(/images/r_off.svg) no-repeat; }
.line-discounts--summary .line-discount__code { padding-right: 12px; }
.line-discounts--summary .line-discount__amount { font-size: 18px; }

@media (min-width: 900px) {
  .line-discount__remove:hover { background: #F7F7F7; }
}

/* payment page: a code taken off right before payment (UnitCoupon::lockForPayment) */
.unit-coupon-removed { margin: 12px 0 0; padding: 12px 16px; border-radius: 10px; background: #F6ABAA; color: #243D44; font-size: 16px; line-height: 1.4; direction: rtl; }
