/* E-commerce tab: the share sheet (public/ecom/share.js) and the Share page (public/ecom/quickshare.js).
   Copies cloneQ's .cq-share / .share-grid / .share-ch look (static/css/panel-catalogues.css) in Party Villa colours. */

/* ---------- the share sheet */
.ecs-back { position: fixed; inset: 0; z-index: 70; background: rgba(15, 25, 22, .18); }
.ecs-sheet { position: fixed; width: 420px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow-y: auto; background: #fff;
  border-radius: 10px; box-shadow: 0 16px 48px rgba(0, 0, 0, .28); display: flex; flex-direction: column; }
.ecs-sheet.ecs-center { left: 50%; top: 8vh; transform: translateX(-50%); }
.ecs-sheet.ecs-bottom { left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-width: 100%; max-height: 88vh; border-radius: 14px 14px 0 0;
  padding-bottom: env(safe-area-inset-bottom); }
.ecs-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 4px; position: sticky; top: 0; background: #fff; z-index: 1; }
.ecs-head h2 { font-size: 1.05rem; }
.ecs-x { width: 36px; height: 36px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; display: grid; place-items: center; color: var(--muted, #5d6b67); }
.ecs-x:hover { background: var(--soft, #e8f1ee); }
.ecs-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ecs-body { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.ecs-wait { color: var(--muted, #5d6b67); margin: 8px 0; }
.ecs-about { margin: 0; font-size: .92rem; overflow-wrap: anywhere; }
.ecs-about span { color: var(--muted, #5d6b67); font-size: .85rem; }

.ecs-link { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 12px; background: #fff;
  border: 1px dashed #8fcfc2; border-radius: 6px; cursor: pointer; font: inherit; color: var(--ink, #17201e); }
.ecs-link:hover { background: #f2faf8; }
.ecs-url { font-size: .82rem; text-align: center; word-break: break-all; line-height: 1.35; }
.ecs-tap { font-size: .75rem; color: #8a9692; }

.ecs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 4px; padding: 6px 0 10px; border-bottom: 1px solid var(--line, #dde2de); }
.ecs-grid > a, .ecs-grid > button { display: flex; flex-direction: column; align-items: center; gap: 5px; font: inherit; font-size: .76rem; line-height: 1.2;
  text-align: center; color: var(--ink, #17201e); padding: 6px 2px; border-radius: 8px; border: 0; background: transparent; cursor: pointer; text-decoration: none; min-height: 64px; }
.ecs-grid > a:hover, .ecs-grid > button:hover { background: #f1f3f2; }
.ecs-si { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: #f3f5f4; }
.ecs-si svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ecs-si.wa { color: #fff; background: #1fa855; }
.ecs-si.pdf { color: #d93025; }
.ecs-si.ph { color: #0e7a6b; }
.ecs-si.br { color: #3d4552; }
.ecs-si.dl { color: #14433f; }
.ecs-si.xl { color: #1e7b45; }
.ecs-si.fb { color: #1f5fd6; }
.ecs-si.ml { color: #c98a1e; }
.ecs-si.mo { color: #5d6b67; }

.ecs-live { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .9rem; }
.ecs-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.ecs-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.ecs-switch span { position: absolute; inset: 0; border-radius: 12px; background: #c9ced6; transition: background .15s; }
.ecs-switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.ecs-switch input:checked + span { background: #0e7a6b; }
.ecs-switch input:checked + span::after { transform: translateX(18px); }
.ecs-switch input:focus-visible + span { outline: 2px solid #0e7a6b; outline-offset: 2px; }
.ecs-note { margin: 0; font-size: .78rem; color: #6f7c78; }
.ecs-notes { margin: 0; padding: 8px 10px 8px 26px; background: #fdf6e7; border-radius: 6px; font-size: .8rem; color: #7a5200; }
.ecs-notes li + li { margin-top: 3px; }
.ecs-status { min-height: 1.3em; margin: 0; font-size: .86rem; color: var(--ink, #17201e); }
.ecs-status.bad { color: var(--bad, #b3261e); }
.ecs-hide { display: none !important; }
.ecs-opts[hidden], .ecs-to[hidden], .ecs-chk[hidden], .ecs-note[hidden], .ecs-sug[hidden], .qs-bar[hidden], .qs-warn[hidden], .qs-more[hidden] { display: none !important; }

.ecs-ways { display: grid; gap: 8px; }
.ecs-choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line, #dde2de); border-radius: 8px; cursor: pointer; }
.ecs-choice:has(input:checked) { border-color: #0e7a6b; background: #f2faf8; }
.ecs-choice input { margin-top: 3px; accent-color: #0e7a6b; width: 17px; height: 17px; flex: none; }
.ecs-choice span { display: flex; flex-direction: column; font-weight: 600; font-size: .92rem; }
.ecs-choice small { font-weight: 400; color: var(--muted, #5d6b67); font-size: .8rem; }
.ecs-f { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted, #5d6b67); }
.ecs-f textarea, .ecs-f input { font: inherit; font-size: .95rem; color: var(--ink, #17201e); border: 1px solid #b9c3be; border-radius: 6px; padding: 8px 10px; width: 100%; }
.ecs-f textarea { resize: vertical; min-height: 80px; }
.ecs-to { position: relative; display: flex; flex-direction: column; gap: 4px; }
.ecs-sug { border: 1px solid var(--line, #dde2de); border-radius: 6px; overflow: hidden; }
.ecs-sug button { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-bottom: 1px solid #eef0ef; background: #fff; font: inherit; font-size: .88rem; cursor: pointer; text-align: left; }
.ecs-sug button:last-child { border-bottom: 0; }
.ecs-sug button:hover { background: var(--soft, #e8f1ee); }
.ecs-sug span { color: var(--muted, #5d6b67); }
.ecs-opts { border: 1px solid var(--line, #dde2de); border-radius: 8px; margin: 0; padding: 6px 12px 10px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.ecs-opts legend { padding: 0 6px; font-size: .8rem; color: var(--muted, #5d6b67); }
.ecs-opts .ecs-note { flex: 1 1 100%; }
.ecs-chk { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; cursor: pointer; min-height: 30px; }
.ecs-chk input { width: 17px; height: 17px; accent-color: #0e7a6b; }
.ecs-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.ecs-actions .btn { min-height: 42px; }
.btn.ecs-green { background: #1fa855; border-color: #1fa855; color: #fff; }
.btn.ecs-green:hover { background: #178f47; }
.btn[disabled].ecs-green { opacity: .6; cursor: progress; }
/* Send on linked WhatsApp (the shop's own number, E-commerce > WhatsApp): shown only when it is linked */
.ecs-linked { display: flex; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid #b7e2c6; border-radius: 8px; background: #f1fbf4; }
.ecs-linked[hidden] { display: none; }
.ecs-linked .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; font-weight: 600; }
.ecs-linked .btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 767px) {
  .ecs-back { background: rgba(15, 25, 22, .45); }
  .ecs-grid { grid-template-columns: repeat(4, 1fr); }
  .ecs-actions .btn { flex: 1 1 auto; }
}
@media (max-width: 360px) {
  .ecs-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- the Share page */
.qs { display: flex; flex-direction: column; gap: 14px; padding: 12px 16px 90px; max-width: 900px; }
.qs h2 { font-size: 1.05rem; }
.qs-warn { margin: 0; padding: 10px 12px; border-radius: 8px; background: #fdf0d9; color: #7a4a00; font-size: .9rem; }
.qs-search { position: sticky; top: 0; z-index: 3; background: var(--bg, #f3f4f1); padding: 4px 0 6px; }
.qs-search input { width: 100%; font: inherit; font-size: 1.05rem; padding: 12px 14px 12px 42px; border: 1px solid #b9c3be; border-radius: 10px; background: #fff
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d6b67' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m16 16 4.5 4.5'/%3E%3C/svg%3E") 12px 50% / 20px no-repeat; }
.qs-search input:focus { outline: 2px solid #0e7a6b; outline-offset: 1px; }
.qs-hint { margin: 0; font-size: .82rem; color: var(--muted, #5d6b67); }
.qs-list { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line, #dde2de); border-radius: 10px; overflow: hidden; }
.qs-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid #eef0ef; }
.qs-row:last-child { border-bottom: 0; }
.qs-row.on { background: #f2faf8; }
.qs-tick { width: 22px; height: 22px; accent-color: #0e7a6b; flex: none; }
.qs-ph { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; background: #f3f4f1; flex: none; }
.qs-ph.none { display: grid; place-items: center; color: #9aa3a0; font-size: .65rem; text-align: center; }
.qs-info { flex: 1; min-width: 0; }
.qs-name { font-weight: 600; font-size: .92rem; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.qs-meta { font-size: .8rem; color: var(--muted, #5d6b67); }
.qs-meta b { color: #15803d; }
.qs-meta s { color: #9ca3af; }
.qs-btns { display: flex; gap: 6px; flex: none; }
.qs-ib { width: 40px; height: 40px; border-radius: 10px; border: 1px solid #c9d2ce; background: #fff; display: grid; place-items: center; cursor: pointer; color: #14433f; text-decoration: none; }
.qs-ib:hover { background: var(--soft, #e8f1ee); }
.qs-ib svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.qs-ib.wa { background: #1fa855; border-color: #1fa855; color: #fff; }
.qs-ib.wa:hover { background: #178f47; }
.qs-more { align-self: center; }
.qs-big { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qs-big .btn { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; }
.qs-big svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.qs-tag { display: inline-block; font-size: .7rem; padding: 1px 7px; border-radius: 10px; background: var(--soft, #e8f1ee); color: #14433f; margin-left: 4px; vertical-align: 1px; }
.qs-tag.link { background: #fdf0d9; color: #7a4a00; }
.qs-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #14433f; color: #fff; box-shadow: 0 -4px 16px rgba(0, 0, 0, .18); }
.qs-bar .btn { min-height: 42px; }
.qs-bar .btn.light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }
.qs-bar .btn.ecs-green { font-weight: 600; }
.qs-empty { padding: 22px 12px; text-align: center; color: var(--muted, #5d6b67); font-size: .9rem; }
@media (min-width: 768px) {
  .qs { padding: 16px 20px 90px; }
  .qs-bar { left: auto; right: 24px; bottom: 18px; border-radius: 12px; min-width: 420px; }
}
@media (max-width: 420px) {
  .qs-big { grid-template-columns: 1fr; }
  .qs-ph { width: 46px; height: 46px; }
  .qs-ib { width: 38px; height: 38px; }
  .qs-row { gap: 8px; padding: 8px; }
}
