/* EVENT360 — "תצוגה מקדימה של ההזמנה ב-WhatsApp".
   Scoped entirely under .e360wap-* . It styles nothing that existed before this file.
   One large centred popup: the note, the message, two actions. */

.e360wap-overlay{
  position:fixed;inset:0;z-index:2000050;display:none;
  align-items:center;justify-content:center;overflow-y:auto;
  background:rgba(15,23,42,.6);padding:24px 16px;direction:rtl;
  font-family:'Rubik',Arial,sans-serif;
}
.e360wap-overlay.is-open{display:flex}
body.e360wap-locked{overflow:hidden}

.e360wap-sheet{
  background:#fff;border:1px solid #e9ebef;border-radius:22px;
  box-shadow:0 28px 70px rgba(15,23,42,.32);
  width:100%;max-width:600px;margin:auto;padding:24px;
  display:flex;flex-direction:column;gap:20px;color:#14171f;
}

/* ── the clarification note — the only thing above the preview, centred ── */
.e360wap-disc{display:block;border:1px solid #e6e8ec;background:#f7f8fa;border-radius:13px;padding:12px 16px;text-align:center}
.e360wap-disc svg{display:none}
.e360wap-disc > div{display:flex;flex-direction:column;gap:4px;align-items:center;min-width:0}
.e360wap-disc p{margin:0;font-size:13px;line-height:1.55;color:#5a6270;text-align:center}
.e360wap-disc p.is-strong{color:#14171f;font-weight:600}

/* ── reminder picker — one small row above the message, display only ── */
.e360wap-pick{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;margin:-6px auto 0;max-width:468px;font-size:13.5px;color:#14171f}
.e360wap-pick[hidden]{display:none}
.e360wap-pick label{margin:0;font-weight:600;font-size:inherit;color:inherit}
.e360wap-pick select{
  font:inherit;font-size:14px;color:#14171f;background:#fff;border:1px solid #d8dbe1;border-radius:10px;
  padding:7px 12px;min-width:200px;max-width:100%;cursor:pointer;direction:rtl;
}
.e360wap-pick select:disabled{opacity:.6;cursor:progress}
.e360wap-pick select:focus-visible{outline:2px solid #4f7cf5;outline-offset:2px}
.e360wap-media.is-off{display:none!important}

/* ── WhatsApp replica — centred, large enough to actually inspect the design ── */
.e360wap-wa{
  border-radius:16px;overflow:hidden;border:1px solid #dfe3e8;background-color:#efe7de;
  background-image:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23d9cdc0' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='20' cy='22' r='7'/%3E%3Cpath d='M52 16h16v12H52z'/%3E%3Cpath d='M92 14l6 10-6 10-6-10z'/%3E%3Cpath d='M14 58c6-8 14-8 20 0'/%3E%3Ccircle cx='62' cy='62' r='6'/%3E%3Cpath d='M96 54v16M88 62h16'/%3E%3Cpath d='M18 96h14v10H18z'/%3E%3Cpath d='M54 100c4-6 10-6 14 0'/%3E%3Ccircle cx='98' cy='100' r='7'/%3E%3C/g%3E%3C/svg%3E");
  padding:22px 18px;display:flex;justify-content:center;
  width:100%;max-width:468px;margin:0 auto;
}
.e360wap-bubble{
  width:100%;max-width:420px;background:#fff;border-radius:10px;
  box-shadow:0 1px .5px rgba(11,20,26,.13);overflow:hidden;
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif;
}

/* The image is shown exactly as the file is: the width follows the bubble, the height
   follows the file's own aspect ratio. No crop, no object-fit, no fixed or minimum
   height once the image is in, no ratio change — a portrait file stays portrait, a
   landscape file stays landscape. The placeholders below size ONLY the loading and
   the failure states. */
.e360wap-media{margin:4px 4px 0;border-radius:7px;overflow:hidden;background:#e6e0d8}
.e360wap-media img{display:block;width:100%;height:auto;max-height:none;object-fit:initial}
.e360wap-media.is-loading{display:grid;place-items:center;min-height:360px}
.e360wap-spin{width:28px;height:28px;border-radius:50%;border:3px solid #cfc7bd;border-top-color:#7d8b97;animation:e360wap-spin .8s linear infinite}
@keyframes e360wap-spin{to{transform:rotate(360deg)}}
.e360wap-media.is-empty{
  display:grid;place-items:center;min-height:180px;padding:18px;text-align:center;
  font-family:'Rubik',Arial,sans-serif;font-size:13px;color:#6b6257;line-height:1.55;
}

.e360wap-msg{padding:10px 12px 4px;font-size:15px;line-height:1.48;color:#111b21;white-space:pre-line;word-break:break-word}
.e360wap-meta{display:flex;justify-content:flex-start;padding:0 12px 8px;font-size:11.5px;color:#667781}
.e360wap-btns{border-top:1px solid #e9edef}
.e360wap-btn{
  width:100%;display:flex;align-items:center;justify-content:center;gap:7px;
  background:none;border:0;border-bottom:1px solid #e9edef;padding:12px 8px;
  font:inherit;font-size:15px;font-weight:500;color:#00a884;cursor:default;
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif;
}
.e360wap-btn:last-child{border-bottom:0}
.e360wap-btn svg{width:16px;height:16px;flex:none}

.e360wap-err{
  margin:0 auto;max-width:468px;font-size:12.5px;line-height:1.55;color:#8a5a12;
  background:#fff8e6;border:1px solid #f1d58a;border-radius:12px;padding:10px 12px;
}

/* ── actions — centred under the preview ── */
.e360wap-actions{display:flex;gap:10px;justify-content:center;border-top:1px solid #e9ebef;padding-top:18px}
.e360wap-act{
  font:inherit;font-size:15px;font-weight:600;border-radius:12px;padding:12px 26px;
  cursor:pointer;border:1px solid #dcdcdc;background:#fff;color:#14171f;text-align:center;
}
.e360wap-act.is-primary{background:#111;border-color:#111;color:#fff;font-weight:700}
.e360wap-act:hover{filter:brightness(.97)}
.e360wap-act:focus-visible{outline:2px solid #4f7cf5;outline-offset:2px}

/* ── mobile: full-screen sheet. The note and the picker are one compact line each,
   the actions stay at the bottom, and ONLY the message area scrolls — so the
   invitation gets almost the whole screen and a long message is scrolled by finger
   inside its own area. Desktop is untouched. ── */
@media (max-width:820px){
  .e360wap-overlay{padding:0;align-items:stretch;overflow:hidden}
  .e360wap-sheet{
    max-width:none;height:100%;min-height:0;box-sizing:border-box;margin:0;border:0;border-radius:0;box-shadow:none;
    padding:8px 12px 0;gap:8px;overflow:hidden;
  }
  /* the note: the first sentence only, one compact line */
  .e360wap-disc{padding:7px 10px;border-radius:10px;flex:none}
  .e360wap-disc > div{gap:0}
  .e360wap-disc p{font-size:12px;line-height:1.35}
  .e360wap-disc p:not(.is-strong){display:none}
  /* the picker: one compact row */
  .e360wap-pick{margin:0;gap:8px;font-size:13px;flex:none}
  .e360wap-pick select{padding:4px 10px;min-width:0;flex:1 1 auto;max-width:230px;border-radius:8px}
  /* the message area takes all the remaining height and scrolls on its own */
  .e360wap-wa{
    flex:1 1 auto;min-height:0;max-width:none;padding:12px 10px;
    align-items:flex-start;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;
  }
  .e360wap-bubble{max-width:328px;flex:none}
  .e360wap-msg{font-size:14px}
  .e360wap-btn{font-size:14px;padding:11px 8px}
  .e360wap-err{flex:none}
  .e360wap-actions{
    flex:none;background:#fff;margin:0 -12px;border-top:1px solid #e9ebef;
    padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px));
    flex-direction:column-reverse;gap:8px;
  }
  .e360wap-act{width:100%;padding:11px 20px}
}

@media (prefers-reduced-motion:reduce){.e360wap-spin{animation:none}}
