/* Shop With Me - storefront styles.
   Everything is scoped under .swm so nothing bleeds into the host theme (framework 5.2).
   Petal palette (5.1.1), logical properties for RTL (5.3.4), 44px tap targets (5.3.5). */

.swm {
  --swm-orange: #F26A1F;
  --swm-orange-2: #F4A024;
  --swm-blue: #1FA2F2;
  --swm-purple: #9A2BB0;
  --swm-green: #2FBA5B;
  --swm-danger: #E53935;
  --swm-ink: #0F0F12;
  --swm-ink-2: #1A1A20;
  --swm-text: #1a1a1a;
  --swm-muted: #6b7280;
  --swm-bg: #FFFFFF;
  --swm-card: #F7F8FA;
  --swm-border: rgba(0,0,0,.08);
  --swm-radius: 16px;
  --swm-shadow: 0 8px 24px rgba(0,0,0,.08);
  --swm-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --swm-z: 2147483000;
  font-family: var(--swm-font);
  color: var(--swm-text);
  box-sizing: border-box;
  line-height: 1.5;
}
.swm *, .swm *::before, .swm *::after { box-sizing: border-box; }
.swm.swm-rtl, .swm-rtl.swm { font-family: Tahoma, system-ui, sans-serif; }
.swm [hidden] { display: none !important; }
.swm-sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.swm button, .swm a { font-family: inherit; }
.swm :focus-visible { outline: 3px solid var(--swm-blue); outline-offset: 2px; }

/* ---------- pages ---------- */
.swm-page { max-width: 980px; margin: 0 auto; padding: 24px 16px 48px; }
.swm-page-narrow { max-width: 560px; }
.swm-hero { text-align: center; padding: 20px 0 24px; }
.swm-logo { position: relative; width: 72px; height: 72px; margin: 0 auto 14px; background: var(--swm-ink); border-radius: 18px; }
.swm-petal { position: absolute; width: 42%; height: 42%; border-radius: 50% 50% 50% 8px; }
.swm-p1 { top: 10%; left: 10%; background: var(--swm-orange); transform: rotate(-45deg); }
.swm-p2 { top: 10%; right: 10%; background: var(--swm-blue); transform: rotate(45deg); }
.swm-p3 { bottom: 10%; left: 10%; background: var(--swm-purple); transform: rotate(-135deg); }
.swm-p4 { bottom: 10%; right: 10%; background: var(--swm-green); transform: rotate(135deg); }
.swm-title { font-size: 32px; font-weight: 800; letter-spacing: .5px; margin: 0 0 6px;
  background: linear-gradient(90deg, var(--swm-orange), var(--swm-purple), var(--swm-blue), var(--swm-green));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.swm-subtitle { margin: 0; color: var(--swm-muted); font-size: 16px; }
.swm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 767px) { .swm-grid { grid-template-columns: 1fr; } .swm-title { font-size: 26px; } }
.swm-card { background: var(--swm-bg); border: 1px solid var(--swm-border); border-radius: var(--swm-radius); padding: 22px; box-shadow: 0 8px 20px rgba(0,0,0,.04); }
.swm-card-center { text-align: center; max-width: 560px; margin: 0 auto; }
.swm-card-title { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--swm-muted); margin: 0 0 14px; }
.swm-lead { font-size: 17px; margin: 0 0 16px; }
.swm-muted { color: var(--swm-muted); }
.swm-small { font-size: 12.5px; }
.swm-error { color: var(--swm-danger); font-weight: 600; font-size: 17px; margin: 0 0 18px; }
.swm-steps { list-style: none; padding: 0; margin: 0 0 22px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.swm-steps li { background: var(--swm-card); border-radius: 12px; padding: 12px 8px; font-size: 13px; font-weight: 600; }
.swm-step-num { display: block; width: 28px; height: 28px; margin: 0 auto 6px; border-radius: 50%; background: linear-gradient(135deg, var(--swm-orange), var(--swm-orange-2)); color: #fff; line-height: 28px; font-weight: 800; }
@media (max-width: 480px) { .swm-steps { grid-template-columns: repeat(2, 1fr); } }
.swm-facts { display: grid; gap: 8px; margin: 0 0 18px; text-align: start; }
.swm-facts div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; background: var(--swm-card); border-radius: 10px; }
.swm-facts dt { color: var(--swm-muted); font-weight: 600; margin: 0; }
.swm-facts dd { margin: 0; font-weight: 600; display: flex; align-items: center; gap: 8px; }

/* ---------- buttons ---------- */
.swm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 1px solid transparent; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s ease; }
.swm-btn:hover { transform: translateY(-1px); text-decoration: none; }
.swm-btn-lg { padding: 14px 28px; font-size: 16px; }
.swm-btn-sm { min-height: 36px; padding: 6px 14px; font-size: 13px; }
.swm-btn-primary { background: linear-gradient(90deg, var(--swm-orange), var(--swm-orange-2)); color: #fff; box-shadow: 0 6px 16px rgba(242,106,31,.3); }
.swm-btn-secondary { background: transparent; border-color: var(--swm-blue); color: var(--swm-blue); }
.swm-btn-ghost { background: transparent; color: var(--swm-muted); }
.swm-btn-ghost:hover { background: rgba(0,0,0,.05); }
.swm-btn-danger { background: var(--swm-danger); color: #fff; }
.swm-btn-success { background: var(--swm-green); color: #fff; }
.swm-btn[disabled], .swm-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.swm-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; margin-top: 18px; }
.swm-actions-stack { flex-direction: column; }
.swm-actions-stack .swm-btn { width: 100%; max-width: 360px; }
.swm-inline-form { display: inline-flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

/* ---------- share ---------- */
.swm-share-row { display: flex; gap: 8px; margin-bottom: 12px; }
.swm-share-input { flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid var(--swm-border); border-radius: 12px; font-family: Consolas, Menlo, monospace; font-size: 13px; background: var(--swm-card); color: var(--swm-text); }
.swm-share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.swm-share { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: 13.5px; text-decoration: none; border: 1px solid var(--swm-border); background: var(--swm-bg); color: var(--swm-text); cursor: pointer; }
.swm-share:hover { text-decoration: none; box-shadow: var(--swm-shadow); }
.swm-share-whatsapp { border-color: #25D366; color: #128C7E; }
.swm-share-messenger { border-color: #0084FF; color: #0084FF; }
.swm-share-sms { border-color: var(--swm-purple); color: var(--swm-purple); }
.swm-share-email { border-color: var(--swm-orange); color: var(--swm-orange); }
.swm-share-qr { border-color: var(--swm-ink); color: var(--swm-ink); }
.swm-qr { text-align: center; margin: 14px 0; }
.swm-qr img { border: 1px solid var(--swm-border); border-radius: 12px; padding: 8px; background: #fff; max-width: 100%; height: auto; }
@media (max-width: 480px) { .swm-share-row { flex-direction: column; } }

/* ---------- participants ---------- */
.swm-participants { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.swm-participant { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--swm-card); }
.swm-participant-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swm-avatar { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--swm-blue), var(--swm-purple)); color: #fff; font-weight: 800; font-size: 14px; flex: none; }
.swm-avatar-inline { width: 26px; height: 26px; font-size: 12px; }
.swm-presence { font-size: 12px; color: var(--swm-muted); display: inline-flex; align-items: center; gap: 5px; }
.swm-presence::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #c4c4c4; }
.swm-online .swm-presence::before, .swm-presence.swm-online::before { background: var(--swm-green); }
.swm-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .4px; }
.swm-badge-controller { background: rgba(244,160,36,.18); color: #9a5b00; }
.swm-badge-host { background: rgba(31,162,242,.14); color: #0f6fa8; }
.swm-badge-observer { background: rgba(89,89,89,.12); color: #595959; }
.swm-waiting { display: flex; align-items: center; gap: 8px; color: var(--swm-muted); font-style: italic; }
.swm-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--swm-orange); animation: swm-pulse 1.4s ease-in-out infinite; }
@keyframes swm-pulse { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.1); } }

/* ---------- inline / floating start button ---------- */
.swm-inline-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: linear-gradient(90deg, #F26A1F, #F4A024); color: #fff !important; font-weight: 700; font-size: 13px; text-decoration: none !important; line-height: 1.2; min-height: 34px; vertical-align: middle; font-family: var(--swm-font); }
.swm-inline-btn:hover { box-shadow: 0 6px 16px rgba(242,106,31,.3); }
.swm-zone-header-links-after { margin-inline-start: 8px; }
.swm-zone-productdetails-inside-overview-buttons-after { margin: 8px 0; }
.swm-fab { position: fixed; z-index: var(--swm-z); bottom: 20px; inset-inline-end: 20px; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 999px; background: linear-gradient(90deg, #F26A1F, #F4A024); color: #fff !important; font-weight: 700; font-size: 14px; text-decoration: none !important; box-shadow: 0 10px 24px rgba(242,106,31,.35); }
.swm-fab:hover { transform: translateY(-2px); }
@media (max-width: 480px) { .swm-fab-text { display: none; } .swm-fab { padding: 12px; width: 52px; height: 52px; justify-content: center; } }

/* ---------- floating session panel ---------- */
.swm-panel { position: fixed; z-index: var(--swm-z); bottom: 20px; inset-inline-end: 20px; width: 340px; max-width: calc(100vw - 24px); background: var(--swm-bg); color: var(--swm-text); border-radius: 18px; box-shadow: 0 16px 40px rgba(0,0,0,.18); border: 1px solid var(--swm-border); overflow: hidden; display: flex; flex-direction: column; max-height: min(80vh, 640px); }
.swm-panel-collapsed { width: auto; max-height: none; border-radius: 999px; }
.swm-panel-collapsed .swm-panel-body, .swm-panel-collapsed .swm-panel-footer { display: none; }
.swm-panel-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: linear-gradient(135deg, var(--swm-ink), var(--swm-ink-2)); color: #fff; cursor: pointer; min-height: 52px; }
.swm-panel-head:focus-visible { outline-offset: -3px; }
.swm-panel-icon { width: 28px; height: 28px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.swm-panel-title { font-weight: 800; letter-spacing: .3px; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swm-panel-count { font-size: 12px; color: rgba(255,255,255,.72); display: flex; align-items: center; gap: 6px; }
.swm-status-dot { width: 9px; height: 9px; border-radius: 50%; background: #c4c4c4; flex: none; }
.swm-status-dot.swm-connected { background: var(--swm-green); box-shadow: 0 0 0 3px rgba(47,186,91,.25); }
.swm-status-dot.swm-connecting { background: var(--swm-orange-2); animation: swm-pulse 1.2s ease-in-out infinite; }
.swm-status-dot.swm-disconnected { background: var(--swm-danger); }
.swm-panel-toggle { background: transparent; border: 0; color: #fff; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.swm-panel-toggle:hover { background: rgba(255,255,255,.12); }
.swm-panel-body { padding: 12px 14px; overflow: auto; display: grid; gap: 12px; }
.swm-role-banner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; font-weight: 700; font-size: 13.5px; }
.swm-role-controller { background: rgba(244,160,36,.16); color: #8a4b00; }
.swm-role-observer { background: rgba(31,162,242,.12); color: #0f6fa8; }
.swm-role-private { background: rgba(154,43,176,.12); color: #6e1a80; }
.swm-panel .swm-participants { margin: 0; }
.swm-panel .swm-participant { padding: 6px 8px; }
.swm-panel .swm-avatar { width: 30px; height: 30px; font-size: 12px; }
.swm-mic { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--swm-muted); flex: none; }
.swm-mic.swm-speaking { color: var(--swm-green); box-shadow: 0 0 0 3px rgba(47,186,91,.25); background: rgba(47,186,91,.12); }
.swm-mic.swm-muted-icon { color: var(--swm-danger); }
.swm-mic.swm-off { opacity: .35; }
.swm-give-btn { min-height: 32px; padding: 4px 10px; font-size: 12px; }
.swm-panel-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.swm-panel-row .swm-btn { flex: 1; min-width: 0; }
.swm-panel .swm-btn { min-height: 42px; padding: 8px 14px; font-size: 13.5px; }
.swm-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--swm-card); font-size: 13.5px; font-weight: 600; }
.swm-switch { position: relative; width: 44px; height: 26px; border-radius: 999px; background: #cfd4da; border: 0; cursor: pointer; flex: none; transition: background .2s ease; }
.swm-switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s ease; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.swm-switch[aria-checked="true"] { background: var(--swm-green); }
.swm-switch[aria-checked="true"]::after { transform: translateX(18px); }
.swm-rtl .swm-switch[aria-checked="true"]::after { transform: translateX(-18px); }
.swm-voice-status { font-size: 12.5px; color: var(--swm-muted); }
.swm-panel-footer { padding: 10px 14px 14px; border-top: 1px solid var(--swm-border); display: grid; gap: 8px; }
.swm-cart { display: grid; gap: 6px; }
.swm-cart-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--swm-muted); }
.swm-cart-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 180px; overflow: auto; }
.swm-cart-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.swm-cart-item img { width: 36px; height: 36px; object-fit: cover; border-radius: 8px; flex: none; background: var(--swm-card); }
.swm-cart-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.swm-cart-name a { color: inherit; text-decoration: none; }
.swm-cart-qty { color: var(--swm-muted); flex: none; }
.swm-cart-remove { background: transparent; border: 0; color: var(--swm-danger); cursor: pointer; width: 32px; height: 32px; border-radius: 50%; flex: none; font-size: 16px; }
.swm-cart-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 13px; }
.swm-empty { color: var(--swm-muted); font-size: 13px; }

/* ---------- toasts / prompts / overlays ---------- */
.swm-toasts { position: fixed; z-index: var(--swm-z); top: 16px; inset-inline-end: 16px; display: grid; gap: 8px; max-width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.swm-toast { pointer-events: auto; background: var(--swm-ink); color: #fff; padding: 10px 14px; border-radius: 12px; box-shadow: var(--swm-shadow); font-size: 13.5px; display: flex; gap: 10px; align-items: center; animation: swm-slide .25s ease; }
.swm-toast-success { background: #1F7A3F; }
.swm-toast-danger { background: var(--swm-danger); }
.swm-toast-info { background: #0f6fa8; }
@keyframes swm-slide { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.swm-prompt { position: fixed; z-index: calc(var(--swm-z) + 1); bottom: 24px; inset-inline-start: 50%; transform: translateX(-50%); background: var(--swm-bg); color: var(--swm-text); border-radius: 16px; box-shadow: 0 16px 40px rgba(0,0,0,.25); padding: 16px 18px; width: min(420px, calc(100vw - 24px)); border: 1px solid var(--swm-border); }
.swm-rtl .swm-prompt { transform: translateX(50%); }
.swm-prompt-text { font-weight: 600; margin: 0 0 12px; }
.swm-prompt-actions { display: flex; gap: 8px; justify-content: flex-end; }
.swm-modal-backdrop { position: fixed; inset: 0; z-index: calc(var(--swm-z) + 2); background: rgba(15,15,18,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.swm-modal { background: var(--swm-bg); color: var(--swm-text); border-radius: 18px; padding: 24px; width: min(440px, 100%); text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.swm-modal h2 { margin: 0 0 8px; font-size: 20px; }
.swm-modal p { margin: 0 0 18px; color: var(--swm-muted); }
.swm-lock-bar { position: fixed; z-index: calc(var(--swm-z) - 1); top: 0; inset-inline: 0; height: 4px; background: linear-gradient(90deg, var(--swm-blue), var(--swm-purple)); pointer-events: none; }
body.swm-observing .swm-lockable { cursor: not-allowed; }

/* ---------- mobile: bottom sheet ---------- */
@media (max-width: 640px) {
  .swm-panel { inset-inline: 8px; bottom: 8px; width: auto; max-width: none; max-height: 70vh; border-radius: 16px; }
  .swm-panel-collapsed { inset-inline-start: auto; inset-inline-end: 12px; bottom: 12px; width: auto; }
  .swm-toasts { top: 8px; inset-inline: 8px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .swm *, .swm *::before, .swm *::after { animation: none !important; transition: none !important; } }
