/* =====================================================================
   ליאתי — מודאלים של הקופה (דיל 15% + אישור אלרגיות) ותגי הנחה
   RTL, mobile-first, משתמש במשתני העיצוב של style.css
   ===================================================================== */

/* ---------------- תגי מחיר/הנחה (גם בעגלה ובסיכום הקופה) ---------------- */

.price-was {
  color: var(--ink-soft);
  text-decoration: line-through;
  opacity: .8;
  margin-inline-end: 6px;
}

.price-deal {
  color: var(--melon-dark);
  font-weight: 700;
}

.deal-badge {
  display: inline-block;
  background: var(--melon-soft);
  color: var(--melon-dark);
  border: 1px solid #f5c2ce;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  padding: 1px 8px;
  margin-inline-start: 4px;
  vertical-align: middle;
}

.free-badge {
  display: inline-block;
  background: var(--lime-soft);
  color: #3f7a1f;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  padding: 1px 8px;
  margin-inline-start: 6px;
  vertical-align: middle;
}

/* ---------------- שלד מודאל משותף ---------------- */

body.modal-open { overflow: hidden; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(44, 35, 32, .55);
  backdrop-filter: blur(2px);
}

.modal-box {
  position: relative;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 26px 22px 20px;
  text-align: right;
  animation: modalIn .25s ease-out;
}

.modal-box-wide { max-width: 620px; }

@keyframes modalIn {
  from { transform: translateY(18px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.modal-box h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  text-align: center;
}

.modal-sub {
  margin: 0 0 16px;
  font-size: .9rem;
  color: var(--ink-soft);
  text-align: center;
}

.modal-fine {
  margin: 12px 0 0;
  font-size: .76rem;
  color: var(--ink-soft);
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 10px;
  left: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
}

.modal-close:hover { background: var(--melon-soft); color: var(--melon-dark); }

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
}

.modal-actions .btn { width: 100%; justify-content: center; }

/* ---------------- מודאל אישור אלרגיות ---------------- */

.modal-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
  font-size: .9rem;
  line-height: 1.5;
  cursor: pointer;
}

.modal-check input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: var(--melon);
}

.modal-check:has(input:checked) {
  border-color: var(--lime);
  background: var(--lime-soft);
}

.allergy-icon {
  display: block;
  font-size: 34px;
  text-align: center;
  margin-bottom: 4px;
}

/* ---------------- מודאל הדיל ---------------- */

.deal-countdown {
  font-weight: 700;
  color: var(--melon-dark);
  direction: ltr;
  display: inline-block;
}

.deal-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 10px;
  scrollbar-width: thin;
}

.deal-row::-webkit-scrollbar { height: 6px; }
.deal-row::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }

.deal-card {
  flex: 0 0 158px;
  scroll-snap-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--cream);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}

.deal-card-img {
  width: 100%;
  height: 104px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--paper);
}

.deal-card-name {
  margin: 0;
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.35;
  min-height: 2.7em;
}

.deal-card-price {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  font-size: .82rem;
}

.deal-card-price .price-deal { font-size: 1.05rem; }

.deal-card-btn {
  margin-top: auto;
  padding: 8px 10px;
  font-size: .82rem;
}

.deal-card-btn[disabled] { opacity: .45; cursor: not-allowed; }

@media (min-width: 600px) {
  .modal-actions { flex-direction: row-reverse; justify-content: center; }
  .modal-actions .btn { width: auto; min-width: 150px; }
}

/* ---------------- שדות הקופה: צ'קבוקס ובלוק הנמען ---------------- */

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
}

.form-check input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--melon);
}

.recipient-block {
  border: 1px dashed #e2cfc4;
  border-radius: var(--radius-sm);
  background: var(--cream);
  padding: 14px 14px 2px;
  margin-bottom: 14px;
}

.recipient-block[hidden] { display: none; }

.recipient-block h3 {
  margin: 0 0 10px;
  font-size: .95rem;
  color: var(--melon-dark);
}

.cart-summary .row.row-discount b { color: var(--melon-dark); }

/* ---------------- שאלת אלרגיה בטופס ההזמנה ---------------- */

.allergy-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--cream);
  padding: 14px;
  margin-bottom: 14px;
}

.allergy-block > span {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.allergy-block .field { margin-top: 12px; margin-bottom: 0; }

.radio-row-inline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.radio-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 600;
  background: var(--paper);
}

.radio-pill:has(input:checked) {
  border-color: var(--melon);
  background: var(--melon-soft);
}

.radio-pill input { accent-color: var(--melon); margin: 0; }

.allergy-warning {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: var(--mango-soft);
  border: 1px solid #ffdca8;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 12px;
  font-size: .82rem;
  line-height: 1.5;
  color: #8a5a12;
}
