/* Live front preview (admin) - toolbar, iframe, expand mode. See assets/admin/js/whmc-live-preview.js */
.whmc-lp-switch { display: flex; gap: 4px; background: #fff; border-radius: 8px; padding: 4px; margin: 0 0 10px; }
.whmc-lp-tab { flex: 1; border: 0; background: transparent; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 13px; color: #3c434a; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.whmc-lp-tab:hover { background: #f0f0f1; }
.whmc-lp-tab.is-active { background: #3858e9; color: #fff; }
.whmc-lp-dot { width: 8px; height: 8px; border-radius: 50%; background: #2fb344; box-shadow: 0 0 0 0 rgba(47,179,68,.6); animation: whmcLpPulse 1.8s infinite; }
.whmc-lp-tab.is-active .whmc-lp-dot { background: #7dffa0; }
@keyframes whmcLpPulse { 70% { box-shadow: 0 0 0 7px rgba(47,179,68,0); } 100% { box-shadow: 0 0 0 0 rgba(47,179,68,0); } }

.whmc-lp-pane { background: #fff; border-radius: 8px; padding: 8px; }
.whmc-lp-pane[hidden] { display: none !important; }
.whmc-lp-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.whmc-lp-btn { border: 1px solid #c3c4c7; background: #f6f7f7; border-radius: 5px; padding: 5px 9px; font-size: 12px; cursor: pointer; color: #2c3338; line-height: 1.3; }
.whmc-lp-btn:hover { background: #fff; border-color: #3858e9; color: #3858e9; }
.whmc-lp-seg { display: inline-flex; border: 1px solid #c3c4c7; border-radius: 5px; overflow: hidden; }
.whmc-lp-seg button { border: 0; background: #f6f7f7; padding: 5px 9px; font-size: 12px; cursor: pointer; border-right: 1px solid #c3c4c7; color: #2c3338; }
.whmc-lp-seg button:last-child { border-right: 0; }
.whmc-lp-seg button.is-on { background: #3858e9; color: #fff; }
.whmc-lp-expand { margin-left: auto; font-size: 15px; padding: 2px 9px; }

.whmc-lp-stage { position: relative; background: #e9ebee; border-radius: 6px; padding: 8px 0; display: flex; justify-content: center; overflow: auto; }
.whmc-lp-framewrap { width: 390px; max-width: 100%; transition: width .25s ease; background: #fff; box-shadow: 0 2px 14px rgba(0,0,0,.18); border-radius: 4px; overflow: hidden; }
.whmc-lp-frame { display: block; width: 100%; height: min(720px, calc(100vh - 230px)); border: 0; background: #fff; }
.whmc-lp-loading { position: absolute; inset: 0; z-index: 5; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 10px; background: rgba(255,255,255,.72); font-size: 13px; color: #1d2327; }
.whmc-lp-loading.is-on { display: flex; }
.whmc-lp-spin { width: 30px; height: 30px; border: 3px solid #d0d5dd; border-top-color: #3858e9; border-radius: 50%; animation: whmcLpSpin .8s linear infinite; }
@keyframes whmcLpSpin { to { transform: rotate(360deg); } }
.whmc-lp-note { margin: 8px 2px 0; font-size: 11.5px; color: #646970; line-height: 1.45; }

/* expanded: almost full screen */
.whmc-lp-pane.is-expanded { position: fixed; inset: 3vh 3vw; z-index: 100000; box-shadow: 0 0 0 100vmax rgba(0,0,0,.6); display: flex; flex-direction: column; border-radius: 10px; }
.whmc-lp-pane.is-expanded .whmc-lp-stage { flex: 1; align-items: stretch; }
.whmc-lp-pane.is-expanded .whmc-lp-framewrap { height: 100%; }
.whmc-lp-pane.is-expanded .whmc-lp-frame { height: 100%; }
body.whmc-lp-noscroll { overflow: hidden; }

/* ---- design template gallery: real side cart thumbnails + live shop pane ---- */
.whmc-tpl-window { width: min(1380px, 96vw) !important; }
.whmc-tpl-body { display: flex; min-height: 0; flex: 1; overflow: hidden; }
.whmc-tpl-body .whmc-tpl-grid { flex: 1; min-width: 0; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.whmc-tpl-thumb { position: relative; overflow: hidden; border: 1px solid #ddd; border-radius: 8px; height: 230px; display: flex; flex-direction: column; pointer-events: none; }
.whmc-tpl-thumb .tm-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; flex: none; }
.whmc-tpl-thumb .tm-head u { width: 34px; height: 12px; border-radius: 3px; opacity: .9; }
.whmc-tpl-thumb .tm-head b { width: 60px; height: 8px; border-radius: 4px; opacity: .8; }
.whmc-tpl-thumb .tm-mid { padding: 8px 12px; flex: none; }
.whmc-tpl-thumb .tm-mid s { display: block; height: 5px; border-radius: 3px; overflow: hidden; text-decoration: none; }
.whmc-tpl-thumb .tm-mid s s { width: 45%; height: 5px; }
.whmc-tpl-thumb .tm-list { flex: 1; padding: 6px 8px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.whmc-tpl-thumb .tm-row { display: flex; gap: 8px; padding: 6px; border: 1px solid; border-radius: 6px; }
.whmc-tpl-thumb .tm-img { width: 38px; height: 38px; border-radius: 5px; background: rgba(128,128,128,.25); flex: none; }
.whmc-tpl-thumb .tm-txt { flex: 1; display: flex; flex-direction: column; gap: 5px; justify-content: center; }
.whmc-tpl-thumb .tm-txt b { display: block; height: 6px; width: 80%; border-radius: 3px; opacity: .85; }
.whmc-tpl-thumb .tm-qty { display: block; width: 36px; height: 9px; border: 1px solid; border-radius: 3px; }
.whmc-tpl-thumb .tm-foot { flex: none; padding: 8px 10px; border-top: 1px solid; }
.whmc-tpl-thumb .tm-foot span { display: block; height: 16px; border-radius: 4px; }
.whmc-tpl-livepane { width: 440px; flex: 0 0 440px; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; background: #fff; border-left: 1px solid #e5e7eb; }
.whmc-tpl-livepane .whmc-lp-toolbar { margin: 0; }
.whmc-tpl-livepane .whmc-lp-stage { flex: 1; min-height: 300px; }
.whmc-tpl-livepane .whmc-lp-framewrap { height: 100%; }
.whmc-tpl-livepane .whmc-lp-frame { height: 100%; }
.whmc-tpl-livetitle { margin-right: auto; font-size: 13px; }
.whmc-tpl-livehint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; color: #50575e; font-size: 13px; pointer-events: none; z-index: 2; }
@media (max-width: 1100px) { .whmc-tpl-livepane { display: none; } }
