/* Product detail modal (PLP item click) — RTL, matches live נוי השדה feel */

body.product-modal-open {
  overflow: hidden;
}

.product-modal {
  position: fixed;
  inset: 0;
  z-index: 10200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: min(24px, 4vw);
  box-sizing: border-box;
  visibility: hidden;
  pointer-events: none;
  /* Avoid opacity transition on this root (visibility only): keeps backdrop/scrim stable. */
}

.product-modal.is-open {
  visibility: visible;
  pointer-events: auto;
}

.product-modal__backdrop {
  position: absolute;
  inset: 0;
  /* Dim only — no backdrop-filter (avoids Chrome’s delayed blur + keeps page sharp) */
  background: rgba(0, 0, 0, 0.58);
}

.product-modal__sheet {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: min(92vh, 900px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  direction: rtl;
  text-align: right;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.product-modal.is-open .product-modal__sheet {
  opacity: 1;
  transform: none;
}

.product-modal__close {
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  z-index: 5;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--green-dark, #1e3e20);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: background 0.15s, transform 0.15s;
}

.product-modal__close:hover,
.product-modal__close:focus-visible {
  background: #f2f5eb;
  transform: scale(1.04);
  outline: none;
}

.product-modal__grid {
  display: grid;
  grid-template-columns: min(42%, 380px) 1fr;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 720px) {
  .product-modal__grid {
    grid-template-columns: 1fr;
  }
}

.product-modal__media {
  background: #fafcfa;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  min-height: 220px;
}

@media (max-width: 720px) {
  .product-modal__media {
    min-height: 180px;
    max-height: 42vh;
    padding: 16px;
  }
}

.product-modal__media img {
  width: 100%;
  max-width: 340px;
  max-height: min(52vh, 420px);
  height: auto;
  object-fit: contain;
}

.product-modal__body {
  padding: 28px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

@media (max-width: 720px) {
  .product-modal__body {
    padding: 20px 18px 24px;
  }
}

.product-modal__title {
  font-family: Marom, var(--font-marom, sans-serif);
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  font-weight: 800;
  color: var(--green-dark, #1e3e20);
  margin: 0;
  line-height: 1.15;
  padding-inline-end: 40px;
}

.product-modal__price-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-modal__price-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  font-size: 1.15rem;
}

.product-modal__price {
  font-weight: 800;
  color: var(--text, #222);
}

.product-modal__price-old {
  font-size: 0.95rem;
  color: #9a9a9a;
  text-decoration: line-through;
  font-weight: 500;
}

.product-modal__unit {
  font-weight: 600;
  color: var(--muted, #5c6560);
  font-size: 1rem;
}

.product-modal__origin {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--text, #333);
}

/* Same 🇮🇱 rendering as .cat-card__flag (Twemoji regional indicator pair) */
.product-modal__origin-flag {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  width: auto;
  height: auto;
}

.product-modal__origin-flag--emoji {
  font-size: 1.35rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.18));
}

.product-modal__origin-flag--emoji::before {
  content: "\1F1EE\1F1F1";
  font-family: "Twemoji Country Flags", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
    "Noto Color Emoji", emoji, sans-serif;
}

.product-modal__per-100 {
  font-size: 0.82rem;
  color: var(--muted, #666);
}

.product-modal__desc {
  font-size: 0.95rem;
  line-height: 1.65;
  color: #444;
  margin: 0;
}

.product-modal__desc p {
  margin: 0 0 0.65em;
}

.product-modal__desc p:last-child {
  margin-bottom: 0;
}

.product-modal__cart-block {
  align-self: center;
  margin-top: 6px;
  width: 100%;
  max-width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.product-modal__add {
  min-width: min(280px, 100%);
  padding: 14px 28px;
  border: 0;
  border-radius: 999px;
  background: #a4d668;
  color: #1e3e20;
  font-family: inherit;
  font-size: 1.08rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(124, 179, 66, 0.35);
  transition: background 0.15s, transform 0.12s;
}

.product-modal__add:hover,
.product-modal__add:focus-visible {
  background: #97ca5a;
  outline: none;
  transform: translateY(-1px);
}

.product-modal__add[hidden] {
  display: none;
}

.product-modal__in-cart {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  width: 100%;
}

.product-modal__in-cart[hidden] {
  display: none;
}

.product-modal__unit-pill {
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--green-dark, #1e3e20);
  color: #fff;
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.2;
  white-space: nowrap;
}

.product-modal__qty-stepper {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 14px;
  background: #ebebe8;
}

.product-modal__qty-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: #333;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: background 0.12s;
}

.product-modal__qty-btn:hover:not(:disabled),
.product-modal__qty-btn:focus-visible:not(:disabled) {
  background: #f5f5f4;
  outline: none;
}

.product-modal__qty-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.product-modal__qty-value {
  min-width: 1.75rem;
  text-align: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text, #222);
}

.product-modal__nutrition {
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid #e8ebe4;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
}

.product-modal__nutrition.is-hidden {
  display: none;
}

.product-modal__nutrition-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--green-dark, #1e3e20);
  line-height: 1.2;
}

.product-modal__nutrition-label {
  font-size: 0.75rem;
  color: var(--muted, #666);
  margin-top: 4px;
}

.product-modal__tip {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 12px;
  background: #f0f2eb
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Ccircle cx='8' cy='12' r='1.2' fill='%23d4d9cc'/%3E%3Ccircle cx='22' cy='28' r='1' fill='%23d4d9cc'/%3E%3Ccircle cx='38' cy='14' r='0.9' fill='%23d4d9cc'/%3E%3Ccircle cx='48' cy='40' r='1.1' fill='%23d4d9cc'/%3E%3C/svg%3E");
  background-size: 60px 60px;
  border: 1px solid #e2e6dc;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 16px;
  align-items: start;
}

.product-modal__tip.is-hidden {
  display: none;
}

.product-modal__tip-ico {
  font-size: 2rem;
  line-height: 1;
}

.product-modal__tip-head {
  font-weight: 800;
  font-size: 1rem;
  color: var(--green-dark, #1e3e20);
  margin: 0 0 6px;
}

.product-modal__tip-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #3d453d;
}

/* Card affordance: whole tile opens details except cart controls */
.cat-grid .cat-card {
  cursor: pointer;
}

.cat-grid .cat-card__plus,
.cat-grid .cat-card__qty-bar,
.cat-grid .cat-card__remove {
  cursor: pointer;
}
