/* Storefront styles — shared by the server-rendered /shop page and the SPA's #shop route.
 *
 * These lived as an inline <style> inside Views/public/store_listing.php, which meant the
 * SPA storefront could not use any of them: it had one hard-coded grid and no view modes.
 * Now that #shop renders the same grid / vending / list markup, the rules have to come from
 * one place or the two pages will drift apart the moment either is touched.
 *
 * Loaded by BOTH layouts, deliberately unconditionally:
 *   - tcg-sg-app/Views/public/_layout.php   (every server-rendered public page)
 *   - tcg-sg-app/Views/pwa_shell.php        (the SPA shell)
 * _layout.php does NOT load app.css — it carries its own inline styles — so putting these
 * in app.css would have styled #shop and left /shop unstyled. Hence a separate file rather
 * than an addition to app.css.
 *
 * The .vm-* block is the PACK DROP vending machine and is namespaced on purpose; .store-*
 * covers the header, search, grid and list views.
 */

.store-listing-header { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-bottom:20px; }
.store-listing-title { font-size:24px; font-weight:800; margin:0; }
.store-listing-controls { display:flex; align-items:center; gap:10px; }
.store-search-wrap { position:relative; }
.store-search-input { background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.1); color:inherit; border-radius:10px; padding:8px 36px 8px 12px; font-size:14px; width:220px; outline:none; transition:border-color .15s; }
.store-search-input:focus { border-color:rgba(255,255,255,.3); }
[data-theme="light"] .store-search-input { background:rgba(0,0,0,.05); border-color:rgba(0,0,0,.12); }
.store-search-clear { position:absolute; right:10px; top:50%; transform:translateY(-50%); background:none; border:none; color:#888; cursor:pointer; font-size:16px; line-height:1; padding:0; display:none; }
.store-view-toggle { display:flex; gap:4px; }
.store-view-btn { background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.1); color:inherit; border-radius:8px; width:34px; height:34px; display:flex; align-items:center; justify-content:center; cursor:pointer; transition:background .15s; }
.store-view-btn.active { background:rgba(212,40,40,.2); border-color:rgba(212,40,40,.4); color:#d42828; }
[data-theme="light"] .store-view-btn { background:rgba(0,0,0,.05); border-color:rgba(0,0,0,.1); }
[data-theme="light"] .store-view-btn.active { background:rgba(212,40,40,.1); }

/* Grid view */
.store-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }
@media(min-width:640px){ .store-grid { grid-template-columns:repeat(3,1fr); } }
@media(min-width:1024px){ .store-grid { grid-template-columns:repeat(6,1fr); } }
.store-grid-card { background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.07); border-radius:12px; overflow:hidden; text-decoration:none; color:inherit; display:flex; flex-direction:column; transition:transform .15s, border-color .15s; }
.store-grid-card:hover { transform:translateY(-2px); border-color:rgba(255,255,255,.18); }
[data-theme="light"] .store-grid-card { background:rgba(0,0,0,.03); border-color:rgba(0,0,0,.08); }
[data-theme="light"] .store-grid-card:hover { border-color:rgba(0,0,0,.18); }
.store-grid-img-wrap { aspect-ratio:1/1; overflow:hidden; background:rgba(255,255,255,.04); }
.store-grid-img-wrap img { width:100%; height:100%; object-fit:contain; display:block; }
.store-grid-info { padding:8px; flex:1; display:flex; flex-direction:column; gap:4px; }
.store-grid-name { font-size:13px; font-weight:500; line-height:1.35; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.store-grid-price { font-size:13px; font-weight:700; color:#d42828; margin-top:auto; }
.store-grid-price s { font-weight:400; color:#888; margin-left:4px; font-size:11px; }

/* List view */
.store-list { display:flex; flex-direction:column; gap:10px; }
.store-list-item { background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.07); border-radius:12px; text-decoration:none; color:inherit; display:grid; grid-template-columns:80px 1fr; gap:12px; padding:10px; align-items:center; transition:border-color .15s; }
.store-list-item:hover { border-color:rgba(255,255,255,.18); }
[data-theme="light"] .store-list-item { background:rgba(0,0,0,.03); border-color:rgba(0,0,0,.08); }
[data-theme="light"] .store-list-item:hover { border-color:rgba(0,0,0,.18); }
.store-list-img { width:80px; height:80px; border-radius:8px; overflow:hidden; background:rgba(255,255,255,.04); flex-shrink:0; }
.store-list-img img { width:100%; height:100%; object-fit:contain; display:block; }
.store-list-name { font-size:14px; font-weight:600; line-height:1.4; }
.store-list-price { font-size:14px; font-weight:700; color:#d42828; margin-top:4px; }
.store-list-price s { font-weight:400; color:#888; margin-left:4px; font-size:12px; }

.store-no-results { text-align:center; padding:60px 20px; color:#888; font-size:15px; }

/* Campaign banner */
.campaign-banner { display:grid; grid-template-columns:1fr 1fr; gap:0; background:linear-gradient(135deg,rgba(212,40,40,.08),rgba(99,102,241,.08)); border:1px solid rgba(212,40,40,.2); border-radius:16px; padding:24px; margin-bottom:28px; }
@media(max-width:768px){ .campaign-banner { grid-template-columns:1fr; } }
.campaign-inner { padding:0 24px 0 0; }
@media(max-width:768px){ .campaign-inner { padding:0 0 20px; border-left:none !important; padding-left:0 !important; border-top:1px solid rgba(255,255,255,.08); padding-top:20px; margin-top:8px; } .campaign-inner:first-child { border-top:none; padding-top:0; margin-top:0; } }
.campaign-badge { display:inline-block; padding:4px 10px; border-radius:999px; font-size:11px; font-weight:700; letter-spacing:.5px; background:rgba(212,40,40,.12); color:#f87171; border:1px solid rgba(212,40,40,.25); margin-bottom:10px; }
.campaign-title { font-size:17px; font-weight:800; margin:0 0 8px; line-height:1.3; }
.campaign-desc { font-size:13px; color:#b2b2c7; line-height:1.6; margin:0 0 12px; }
.campaign-rules { font-size:12px; color:#b2b2c7; padding-left:0; list-style:none; margin:0 0 14px; line-height:1.8; }
.campaign-cta { display:inline-block; padding:10px 20px; background:#d42828; color:#fff; border-radius:10px; font-size:13px; font-weight:700; text-decoration:none; transition:background .2s; }
.campaign-cta:hover { background:#b91c1c; }
[data-theme="light"] .campaign-desc, [data-theme="light"] .campaign-rules { color:#4a4a5a; }
[data-theme="light"] .campaign-banner { background:linear-gradient(135deg,rgba(212,40,40,.04),rgba(99,102,241,.04)); }

/* ===== Vending machine (PACK DROP) — namespaced .vm-* ===== */
.vm-shop { --vm-accent:#d42828; --vm-glow:rgba(212,40,40,.55); }
.vm-hidden { display:none !important; }

.vm-viewsel { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.09); border-radius:14px; padding:5px; margin-bottom:16px; }
.vm-viewsel-btn { display:flex; align-items:center; justify-content:center; gap:8px; padding:11px 8px; border:1px solid transparent; border-radius:10px; background:transparent; color:#9aa4b6; font-size:14px; font-weight:700; cursor:pointer; font-family:inherit; transition:background .15s,color .15s,box-shadow .15s; }
.vm-viewsel-btn svg { width:18px; height:18px; flex:0 0 auto; }
.vm-viewsel-btn[aria-selected="true"] { color:#fff; background:linear-gradient(180deg,#e23b3b,#c11f1f); border-color:rgba(212,40,40,.6); box-shadow:0 0 18px var(--vm-glow); }
.vm-viewsel-btn:focus-visible { outline:2px solid #fff; outline-offset:2px; }
[data-theme="light"] .vm-viewsel { background:rgba(0,0,0,.04); border-color:rgba(0,0,0,.1); }
[data-theme="light"] .vm-viewsel-btn { color:#6a6a7a; }

.vm-machine { background:linear-gradient(180deg,#0b1830,#060d1a); border:1px solid rgba(80,140,220,.22); border-radius:18px; padding:14px; box-shadow:inset 0 0 60px rgba(0,0,0,.55); }
.vm-display { text-align:center; background:linear-gradient(180deg,rgba(0,0,0,.5),rgba(0,0,0,.18)); border:1px solid rgba(255,255,255,.06); border-radius:14px; padding:16px 14px; margin-bottom:14px; }
.vm-title { font-size:25px; font-weight:900; letter-spacing:1px; margin:0 0 4px; color:#fff; text-shadow:0 0 18px rgba(212,40,40,.45); }
.vm-subtitle { font-size:13px; color:#c5cede; margin:0 0 8px; }
.vm-statusline { font-size:12px; font-weight:700; color:#f26d6d; margin:0; }
.vm-statusline .vm-dot { display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--vm-accent); margin-right:6px; vertical-align:middle; }

.vm-chips { display:flex; gap:8px; overflow-x:auto; -webkit-overflow-scrolling:touch; scroll-snap-type:x proximity; padding:2px 2px 12px; }
.vm-chips::-webkit-scrollbar { height:0; }
.vm-chip { flex:0 0 auto; scroll-snap-align:start; padding:8px 16px; border-radius:999px; border:1px solid rgba(255,255,255,.14); background:rgba(255,255,255,.05); color:#cfd6e4; font-size:13px; font-weight:600; cursor:pointer; white-space:nowrap; font-family:inherit; }
.vm-chip[aria-pressed="true"] { color:#fff; background:linear-gradient(180deg,#e23b3b,#c11f1f); border-color:rgba(212,40,40,.6); box-shadow:0 0 14px var(--vm-glow); }
.vm-chip:focus-visible { outline:2px solid #fff; outline-offset:2px; }

.vm-slots { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
@media(min-width:768px){ .vm-slots { grid-template-columns:repeat(4,1fr); gap:14px; } }
.vm-slot { display:flex; flex-direction:column; background:linear-gradient(180deg,#161c26,#0d1219); border:1px solid rgba(255,255,255,.08); border-radius:12px; overflow:hidden; }
.vm-slot-code { text-align:center; font-size:11px; font-weight:800; letter-spacing:1px; color:#8ea0bd; padding:5px; background:rgba(0,0,0,.35); border-bottom:1px solid rgba(255,255,255,.05); }
.vm-slot-imgwrap { position:relative; aspect-ratio:3/4; background:rgba(0,0,0,.35); display:flex; align-items:center; justify-content:center; padding:8px; }
.vm-slot-imgwrap img { max-width:100%; max-height:100%; width:auto; height:auto; object-fit:contain; display:block; }
.vm-slot-badge { position:absolute; top:6px; left:6px; font-size:9px; font-weight:800; letter-spacing:.5px; padding:2px 6px; border-radius:6px; background:var(--vm-accent); color:#fff; }
.vm-slot-body { padding:8px; display:flex; flex-direction:column; gap:6px; }
.vm-slot-price { font-size:14px; font-weight:800; color:#fff; text-align:center; }
.vm-slot-price s { font-weight:400; color:#8a94a6; font-size:11px; margin-left:4px; }
.vm-slot-stock { font-size:10px; font-weight:700; text-align:center; display:flex; align-items:center; justify-content:center; gap:4px; min-height:14px; }
.vm-stock-ok { color:#4ade80; } .vm-stock-low { color:#f59e0b; } .vm-stock-out { color:#8a94a6; } .vm-stock-pre { color:#93c5fd; }
.vm-stock-dot { width:6px; height:6px; border-radius:50%; background:currentColor; flex:0 0 auto; }
.vm-slot-btn { width:100%; padding:9px 6px; border-radius:8px; border:1px solid rgba(212,40,40,.5); background:rgba(212,40,40,.1); color:#f26d6d; font-size:12px; font-weight:800; letter-spacing:.5px; cursor:pointer; font-family:inherit; text-transform:uppercase; transition:background .15s,box-shadow .15s; }
.vm-slot-btn:hover { background:rgba(212,40,40,.18); }
.vm-slot-btn:focus-visible { outline:2px solid #fff; outline-offset:2px; }
.vm-slot.vm-selected { border-color:var(--vm-accent); box-shadow:0 0 0 1px var(--vm-accent), 0 0 22px var(--vm-glow); }
.vm-slot.vm-selected .vm-slot-code { color:#fff; background:rgba(212,40,40,.35); }
.vm-slot.vm-selected .vm-slot-btn { background:linear-gradient(180deg,#e23b3b,#c11f1f); color:#fff; }
.vm-slot.vm-soldout .vm-slot-imgwrap img { filter:grayscale(.7); opacity:.45; }
.vm-slot.vm-soldout .vm-slot-btn { border-color:rgba(255,255,255,.12); background:rgba(255,255,255,.04); color:#8a94a6; cursor:not-allowed; }
.vm-soldout-label { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:900; letter-spacing:1px; color:#e5e7eb; background:rgba(0,0,0,.45); }

.vm-panel { margin-top:14px; border:1px solid var(--vm-accent); border-radius:14px; background:linear-gradient(180deg,#141b26,#0c121b); padding:14px; box-shadow:0 0 22px var(--vm-glow); }
.vm-panel-row { display:flex; gap:12px; align-items:flex-start; }
.vm-panel-thumb { width:76px; height:100px; flex:0 0 auto; border-radius:8px; overflow:hidden; background:rgba(0,0,0,.35); display:flex; align-items:center; justify-content:center; }
.vm-panel-thumb img { max-width:100%; max-height:100%; object-fit:contain; }
.vm-panel-info { flex:1; min-width:0; }
.vm-panel-name { font-size:16px; font-weight:800; color:#fff; line-height:1.25; margin:0 0 3px; }
.vm-panel-meta { font-size:12px; color:#aab4c6; margin:0 0 6px; }
.vm-panel-lang { display:inline-block; font-size:10px; font-weight:800; letter-spacing:.5px; padding:2px 7px; border-radius:5px; background:rgba(59,130,246,.2); color:#93c5fd; margin-bottom:6px; text-transform:uppercase; }
.vm-panel-price { font-size:18px; font-weight:900; color:#fff; }
.vm-panel-price s { font-weight:400; color:#8a94a6; font-size:13px; margin-left:6px; }
.vm-panel-actions { display:flex; gap:10px; align-items:center; margin-top:12px; flex-wrap:wrap; }
.vm-stepper { display:flex; align-items:center; border:1px solid rgba(255,255,255,.15); border-radius:10px; overflow:hidden; }
.vm-stepper button { width:40px; height:44px; background:rgba(255,255,255,.05); border:none; color:#fff; font-size:20px; cursor:pointer; font-family:inherit; }
.vm-stepper button:disabled { opacity:.4; cursor:not-allowed; }
.vm-stepper input { width:44px; height:44px; text-align:center; background:transparent; border:none; color:#fff; font-size:16px; font-weight:700; font-family:inherit; -moz-appearance:textfield; }
.vm-stepper input::-webkit-outer-spin-button, .vm-stepper input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.vm-dispense { flex:1; min-width:180px; padding:14px 18px; border:none; border-radius:12px; background:linear-gradient(180deg,#e23b3b,#c11f1f); color:#fff; font-size:15px; font-weight:900; letter-spacing:.5px; cursor:pointer; font-family:inherit; text-transform:uppercase; box-shadow:0 0 20px var(--vm-glow); }
.vm-dispense:disabled { opacity:.6; cursor:not-allowed; }
.vm-dispense:focus-visible { outline:2px solid #fff; outline-offset:2px; }
.vm-panel-error { color:#fca5a5; font-size:12px; margin:8px 0 0; }

.vm-tray { position:sticky; bottom:0; margin-top:16px; background:linear-gradient(180deg,#12161c,#080b10); border:1px solid rgba(80,140,220,.22); border-radius:14px 14px 0 0; padding:12px 14px; box-shadow:0 -6px 24px rgba(0,0,0,.5); }
@media(max-width:768px){ .vm-tray { bottom:calc(64px + env(safe-area-inset-bottom,0px)); } }
.vm-tray-title { text-align:center; font-size:12px; font-weight:800; letter-spacing:1px; color:#c5cede; margin:0 0 8px; text-transform:uppercase; }
.vm-tray-row { display:flex; align-items:center; gap:12px; }
.vm-tray-thumb { width:44px; height:44px; border-radius:8px; overflow:hidden; background:rgba(0,0,0,.35); flex:0 0 auto; display:flex; align-items:center; justify-content:center; }
.vm-tray-thumb img { max-width:100%; max-height:100%; object-fit:contain; }
.vm-tray-summary { flex:1; min-width:0; font-size:13px; color:#e9edf4; }
.vm-tray-summary b { color:#fff; }
.vm-tray-actions { display:flex; gap:8px; flex:0 0 auto; }
.vm-tray-btn { display:inline-flex; align-items:center; padding:10px 16px; border-radius:10px; font-size:13px; font-weight:700; text-decoration:none; cursor:pointer; font-family:inherit; border:1px solid rgba(255,255,255,.15); background:rgba(255,255,255,.06); color:#fff; }
.vm-tray-btn.vm-primary { background:linear-gradient(180deg,#e23b3b,#c11f1f); border-color:rgba(212,40,40,.6); }

.vm-empty { text-align:center; padding:48px 20px; color:#9aa4b6; font-size:14px; }

@keyframes vm-drop { 0%{transform:translateY(-8px) scale(1);opacity:1;} 100%{transform:translateY(120px) scale(.55);opacity:0;} }
.vm-dropping { animation:vm-drop .65s cubic-bezier(.4,.2,.2,1) forwards; pointer-events:none; }

@media(min-width:1024px){ .vm-machine { max-width:860px; margin:0 auto; } }
@media (prefers-reduced-motion: reduce){ .vm-dropping{ animation:none; opacity:0; } .vm-viewsel-btn,.vm-chip,.vm-slot-btn,.vm-dispense{ transition:none; } }
.vm-sr { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }

/* ===== Product-info overlay (preserves the vending look) ===== */
.vm-img-open { cursor:pointer; }
.vm-slot-imgwrap img.vm-img-open:focus-visible { outline:2px solid var(--vm-accent); outline-offset:2px; }
.vm-modal { position:fixed; inset:0; z-index:10000; display:flex; align-items:center; justify-content:center; padding:16px; }
.vm-modal[hidden] { display:none; }
.vm-modal-backdrop { position:absolute; inset:0; background:rgba(4,7,13,.78); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px); }
.vm-modal-card { position:relative; z-index:1; width:100%; max-width:560px; max-height:90vh; overflow:auto; -webkit-overflow-scrolling:touch; background:linear-gradient(180deg,#0f1b31,#070e1c); border:1px solid var(--vm-accent); border-radius:18px; box-shadow:0 0 40px var(--vm-glow),0 20px 60px rgba(0,0,0,.6); padding:16px; animation:vm-modal-in .2s ease; }
@keyframes vm-modal-in { from{ transform:translateY(12px); opacity:0; } to{ transform:none; opacity:1; } }
.vm-modal-x { position:absolute; top:10px; right:10px; z-index:2; width:36px; height:36px; border-radius:50%; border:1px solid rgba(255,255,255,.16); background:rgba(0,0,0,.4); color:#fff; font-size:22px; line-height:1; cursor:pointer; font-family:inherit; }
.vm-modal-x:focus-visible { outline:2px solid #fff; outline-offset:2px; }
.vm-modal-gallery { margin-bottom:12px; }
.vm-modal-main { aspect-ratio:3/4; max-height:44vh; background:rgba(0,0,0,.35); border:1px solid rgba(255,255,255,.06); border-radius:12px; display:flex; align-items:center; justify-content:center; padding:10px; }
.vm-modal-main img { max-width:100%; max-height:100%; object-fit:contain; display:block; }
.vm-modal-thumbs { display:flex; gap:8px; overflow-x:auto; padding:10px 2px 2px; }
.vm-modal-thumbs::-webkit-scrollbar { height:0; }
.vm-modal-thumb { flex:0 0 auto; width:52px; height:52px; border-radius:8px; overflow:hidden; background:rgba(0,0,0,.35); border:1px solid rgba(255,255,255,.12); cursor:pointer; padding:2px; }
.vm-modal-thumb.active { border-color:var(--vm-accent); box-shadow:0 0 10px var(--vm-glow); }
.vm-modal-thumb img { width:100%; height:100%; object-fit:contain; }
.vm-modal-badge { display:inline-block; font-size:10px; font-weight:800; letter-spacing:.5px; padding:3px 8px; border-radius:6px; background:var(--vm-accent); color:#fff; margin-bottom:8px; text-transform:uppercase; }
.vm-modal-title { font-size:20px; font-weight:900; color:#fff; line-height:1.25; margin:0 0 6px; }
.vm-modal-meta { font-size:12px; color:#aab4c6; margin:0 0 8px; }
.vm-modal-price { font-size:22px; font-weight:900; color:#fff; margin-bottom:6px; }
.vm-modal-price s { font-weight:400; color:#8a94a6; font-size:15px; margin-left:8px; }
.vm-modal-desc { font-size:13px; line-height:1.6; color:#c5cede; margin:12px 0; }
.vm-modal-desc p { margin:0 0 8px; }
.vm-modal-desc .vm-modal-short { color:#e9edf4; font-weight:600; }
.vm-modal-skel { height:12px; border-radius:6px; background:linear-gradient(90deg,rgba(255,255,255,.06),rgba(255,255,255,.13),rgba(255,255,255,.06)); background-size:200% 100%; animation:vm-shimmer 1.1s linear infinite; margin:8px 0; }
.vm-modal-skel.s2 { width:80%; } .vm-modal-skel.s3 { width:60%; }
@keyframes vm-shimmer { from{ background-position:200% 0; } to{ background-position:-200% 0; } }
.vm-modal-err { color:#fca5a5; font-size:12px; margin:8px 0 0; }
.vm-modal-actions { display:flex; gap:10px; align-items:center; margin-top:14px; flex-wrap:wrap; }
.vm-modal-fullink { display:inline-block; margin-top:14px; color:#93c5fd; font-size:13px; font-weight:700; text-decoration:none; }
.vm-modal-fullink:hover { text-decoration:underline; }
@media(max-width:480px){ .vm-modal { padding:0; align-items:flex-end; } .vm-modal-card { max-width:none; max-height:92vh; border-radius:18px 18px 0 0; } }
@media (prefers-reduced-motion: reduce){ .vm-modal-card{ animation:none; } .vm-modal-skel{ animation:none; } }
