/* Tebex glue for the Chunkverse store. cv-base.css and cv-store.css are the design; this file only styles
   what Exo's main.js adds at runtime (popups, toasts, quantity steppers, the basket popup) and the few
   Tebex-only bits the static design never had. Same tokens, same square corners. */

[hidden] { display: none !important; }

/* ---------- add to basket controls ---------- */
.product-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.product-actions.updating, .basket.updating, .actions.updating { opacity: .55; pointer-events: none; }
.sp-price del, .sp-package-sub del { color: var(--muted); font-size: 14px; margin-right: 6px; }
.sp-package-sub del { font-size: inherit; }

.sp-qty { display: inline-flex; align-items: stretch; border: 1px solid var(--line-strong); background: var(--surface-2); height: 42px; }
.sp-qty button { background: none; border: 0; color: var(--heading); font: 700 16px var(--body); padding: 0 12px; cursor: pointer; }
.sp-qty button:hover { background: var(--surface); }
.sp-qty .open-basket { font: 600 13px var(--body); color: var(--muted); padding: 0 6px; order: 4; }
.sp-qty .increase { order: 3; }
.sp-qty .quantity { order: 2; width: 42px; text-align: center; background: none; border: 0; color: var(--heading); font: 700 15px var(--body); -moz-appearance: textfield; }
.sp-qty .quantity::-webkit-outer-spin-button, .sp-qty .quantity::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- popups (basket, login, options, gift) ---------- */
html.no-scroll { overflow: hidden; }
.popup { --fade-duration: 200ms; position: fixed; inset: 0; z-index: 100; background: rgba(3, 7, 14, .72); transition: opacity var(--fade-duration); }
.popup[hidden] { display: none !important; }
.popup-scroll-cont { position: absolute; inset: 0; overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 40px; }
.popup-content { position: relative; width: 100%; max-width: 520px; background: var(--bg); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 28px 26px 24px; color: var(--text); }
.popup-loading .popup-content { min-height: 160px; }
.popup-loading .popup-content::after { content: ""; position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px;
  background: var(--brand); animation: cv-spin 1s linear infinite; }
@keyframes cv-spin { to { transform: rotate(360deg); } }
.popup-close { position: absolute; top: 0; right: 0; width: 42px; height: 42px; background: none; border: 0; color: transparent; font-size: 0; cursor: pointer; z-index: 2; }
.popup-close::before, .popup-close::after { content: ""; position: absolute; left: 12px; top: 20px; width: 18px; height: 2px; background: var(--muted); transform: rotate(45deg); }
.popup-close::after { transform: rotate(-45deg); }
.popup-close:hover::before, .popup-close:hover::after { background: var(--heading); }
.popup h2 { font: 400 30px var(--display); color: var(--heading); margin: 0 0 8px; }

/* the basket opens wide, as the design's basket page */
.basket-popup .popup-content { max-width: 960px; padding: 26px 26px 22px; }
.basket-popup .sp-title { margin-top: 0; }
.store-product-popup .popup-content { max-width: 960px; }

/* forms inside popups (login, options, gift) */
.store-form input[type="text"], .store-form input[type="number"], .store-form select {
  width: 100%; background: var(--surface); border: 1px solid var(--line); color: var(--heading); font: 500 15px var(--body); padding: 11px 14px; border-radius: 0; }
.store-form input:focus, .store-form select:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.store-form .field { margin: 14px 0 0; }
.store-form .field p { margin: 0 0 8px; color: var(--text); }
.store-form .field-inline { display: flex; gap: 10px; align-items: center; }
.store-form .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.store-form .btn-primary, .store-form .btn-secondary { display: inline-flex; align-items: center; justify-content: center; font: 700 15px var(--body); padding: 10px 18px;
  border: 0; border-radius: 0; cursor: pointer; text-decoration: none; }
.store-form .btn-primary { background: #1fbe55; color: #fff; box-shadow: inset 0 -4px 0 #0f8a37; }
.store-form .btn-primary:hover { background: #22d15e; }
.store-form .btn-secondary { background: #fff; color: var(--ink); box-shadow: inset 0 -4px 0 #b9c6d6, 0 0 0 1px #b9c6d6; }
.store-form .link-text { align-self: center; color: var(--link); }
.store-product-options .product-title { font: 400 28px var(--display); color: var(--heading); margin: 0 0 6px; }

/* login (page and popup) */
.sp-login h2 { font: 400 34px var(--display); color: var(--heading); margin: 0 0 6px; }
.sp-login p { color: var(--muted); margin: 0; }
.sp-login-form { display: flex; gap: 10px; margin-top: 16px; }
.sp-login-form input { flex: 1; }
.sp-login-link span { padding: 4px 6px; }

/* ---------- basket ---------- */
.sp-line { grid-template-columns: 64px 1fr; grid-auto-flow: column; grid-auto-columns: auto; }
.sp-line b a { color: inherit; }
.sp-line-ph { width: 64px; height: 64px; background: var(--surface-2); }
.sp-line .sp-qty { height: 36px; }
.sp-empty { color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 18px 20px; margin: 0; }
.sp-summary .kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.sp-summary .kv span { color: var(--muted); }
.sp-summary .kv b { color: var(--heading); }
@media (max-width: 720px) {
  .sp-line { grid-auto-flow: row; grid-template-columns: 48px 1fr auto; }
  .sp-line-ph { width: 48px; height: 48px; }
  .sp-line .sp-qty { grid-column: 2; justify-self: start; }
  .sp-login-form { flex-direction: column; }
  .popup-scroll-cont { padding: 0; }
  .popup-content, .basket-popup .popup-content { max-width: none; min-height: 100%; border: 0; padding: 22px 16px; }
}

/* ---------- toasts (main.js) ---------- */
.toaster { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px;
  width: max-content; max-width: calc(100vw - 32px); }
.toaster .toast { position: static; transform: none; opacity: 1; pointer-events: auto; display: flex; align-items: center; gap: 14px;
  background: var(--chrome); color: #fff; border: 1px solid var(--chrome-line); border-left: 4px solid var(--brand); padding: 10px 12px 10px 16px; transition: opacity .2s; }
.toaster .toast[hidden] { display: flex !important; opacity: 0; }
.toaster .toast p { margin: 0; }
.toaster .toast-error { border-left-color: #ff5a5a; }
.toaster .toast-success { border-left-color: #2fd35a; }
.toaster .toast-close { background: none; border: 0; color: #8d9bb0; font: 600 13px var(--body); cursor: pointer; }

/* ---------- sidebar modules on the home page ---------- */
.sp-modules:not(:has(.sp-goal, .widget)) { display: none; }
/* The goal card spans the row; any other enabled module (Recent Payments, Top Customer...) sits under it. */
.sp-modules .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.sp-modules .sp-goal { grid-column: 1 / -1; }
.sp-modules .widget-recent { grid-column: 1 / -1; }
.widget { background: var(--surface); border: 1px solid var(--line); padding: 18px 20px; }
.widget-title { font: 400 22px var(--display); color: var(--heading); margin: 0 0 12px; }
.widget .empty { color: var(--muted); margin: 0; }
.widget img.avatar { width: 32px; height: 32px; image-rendering: pixelated; flex: none; }
.widget-recent .purchases { display: flex; flex-wrap: wrap; gap: 8px; }
.widget .purchase, .widget-top-donator .widget-content { display: flex; align-items: center; gap: 10px; }
.widget-recent .purchase { background: var(--surface-2); padding: 6px 12px 6px 6px; }
.widget .purchase h6, .widget .username { margin: 0; font: 600 14px var(--body); color: var(--heading); }
.widget .purchase p, .widget .purchase time { margin: 0; font-size: 12.5px; color: var(--muted); }
.widget .progress { height: 10px; background: var(--surface-2); }
.widget .progress-bar { height: 100%; background: var(--brand); }

/* text from the Tebex panel (category descriptions, custom pages) */
.text-content p { margin: 0 0 12px; }
.text-content a { color: var(--link); }
