/* ==========================================================================
   Woremixe — Boutique
   ========================================================================== */

/* Pièces */
.coin { --c1: #fff2b8; --c2: #f0c14b; --c3: #a8741a; --c4: #6b4509; position: relative; flex: none; display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: -3px;
  background: radial-gradient(circle at 35% 30%, var(--c1) 0 12%, var(--c2) 38%, var(--c3) 78%, var(--c4) 100%);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c4) 70%, transparent), inset 0 -2px 3px rgba(0, 0, 0, .25), 0 1px 3px rgba(0, 0, 0, .5); }
.coin::after { content: ""; position: absolute; inset: 24%; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--c1) 55%, transparent); transform: rotate(45deg); border-radius: 2px; }
.coin-bronze { --c1: #ffd6b0; --c2: #c9814a; --c3: #8a4d22; --c4: #4f2810; }
.coin-lg { width: 30px; height: 30px; }
.coin-xl { width: 56px; height: 56px; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c4) 70%, transparent), inset 0 -4px 8px rgba(0, 0, 0, .3), 0 0 30px color-mix(in srgb, var(--c2) 45%, transparent); }

.wallet-chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid rgba(234, 181, 77, .35); border-radius: 999px; background: rgba(234, 181, 77, .08); font-size: 13.5px; font-variant-numeric: tabular-nums; transition: background-color .2s; }
.wallet-chip:hover { background: rgba(234, 181, 77, .16); }
.wallet-chip strong { margin-right: 6px; font-weight: 700; }
.wallet-chip strong:last-child { margin-right: 0; }

/* En-tête */
.shop-hero::before { background-position: 30% 60%; }
.shop-hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 32px; align-items: center; padding-block: 44px; }
.wallet-card { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 18px; border: 1px solid rgba(234, 181, 77, .3); border-radius: var(--r-lg); background: linear-gradient(160deg, rgba(234, 181, 77, .12), rgba(14, 17, 29, .9) 55%); box-shadow: var(--shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.wallet-balance { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r); background: rgba(0, 0, 0, .25); }
.wallet-balance small { display: block; color: var(--text-3); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.wallet-balance strong { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.wallet-card .button { grid-column: 1 / -1; }
.wallet-guest { grid-column: 1 / -1; margin: 0; color: var(--text-2); font-size: 13px; text-align: center; }

.shop-closed { display: flex; align-items: center; gap: 18px; }
.shop-closed .i { color: var(--gold); width: 36px; height: 36px; }
.shop-closed p { color: var(--text-2); }

/* Barre d'outils */
.shop-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.shop-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.shop-tabs::-webkit-scrollbar { display: none; }
.shop-tabs button { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 14px; font-weight: 500; transition: all .2s; }
.shop-tabs button:hover { color: #fff; border-color: var(--border-2); }
.shop-tabs button[aria-selected="true"] { color: #fff; border-color: rgba(90, 174, 255, .5); background: rgba(26, 140, 255, .14); }
.tab-count { min-width: 22px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--text-2); font-size: 11.5px; }
.shop-search { position: relative; flex: 0 1 280px; margin: 0; }
.shop-search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.shop-search input { padding-left: 38px; min-height: 40px; border-radius: 999px; }

/* Produits */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.product-card { --accent: var(--blue); position: relative; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; }
.product-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: 0 20px 44px rgba(0, 0, 0, .45), 0 16px 50px -24px var(--accent); }
.product-card[data-cat="mounts"] { --accent: var(--violet); }
.product-card[data-cat="services"] { --accent: var(--cyan); }
.product-card[data-cat="gold"] { --accent: var(--gold); }
.product-card[data-cat="boosts"] { --accent: var(--green); }
.product-card.is-featured { border-color: rgba(234, 181, 77, .45); }
.product-art { position: relative; aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 110%, color-mix(in srgb, var(--accent) 50%, transparent), transparent 65%), linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, var(--surface-2)), var(--surface)); border-bottom: 1px solid var(--border); }
.product-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.product-card:hover .product-art img { transform: scale(1.05); }
.product-emblem { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 18px; transform: rotate(45deg); border: 1px solid color-mix(in srgb, var(--accent) 70%, white 10%); background: color-mix(in srgb, var(--accent) 16%, rgba(5, 6, 12, .85)); box-shadow: 0 0 34px color-mix(in srgb, var(--accent) 45%, transparent); transition: transform .4s var(--ease); }
.product-emblem .i { width: 34px; height: 34px; transform: rotate(-45deg); color: color-mix(in srgb, var(--accent) 55%, white); stroke-width: 1.6; }
.product-card:hover .product-emblem { transform: rotate(45deg) scale(1.08); }
.product-flag { position: absolute; top: 12px; left: 12px; }
.product-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; }
.product-meta { color: color-mix(in srgb, var(--accent) 50%, white); font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.product-body h3 { font-size: 18px; }
.product-body p { flex: 1; color: var(--text-2); font-size: 13.5px; }
.product-limit { color: var(--text-3); font-size: 12px; }
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.prices { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.price { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-variant-numeric: tabular-nums; }
.price-gold { color: #ffd98f; }
.price-bronze { color: #f0b48a; }
.price-or { color: var(--text-3); font-size: 12px; }

/* Packs */
.coins-section { margin-top: 48px; }
.secure-note { display: inline-flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 13px; white-space: nowrap; }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.pack-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 20px 20px; text-align: center; border: 1px solid var(--border); border-radius: var(--r-lg); background: radial-gradient(circle at 50% 0%, rgba(234, 181, 77, .14), transparent 60%), var(--surface); transition: transform .25s var(--ease), border-color .25s; }
.pack-card:hover { transform: translateY(-4px); border-color: rgba(234, 181, 77, .45); }
.pack-card.is-highlight { border-color: rgba(234, 181, 77, .6); box-shadow: 0 0 0 1px rgba(234, 181, 77, .3), 0 20px 50px -20px rgba(234, 181, 77, .45); }
.pack-flag { position: absolute; top: -11px; padding: 4px 12px; border-radius: 999px; background: linear-gradient(180deg, #f5c867, var(--gold-2)); color: #1d1406; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.pack-card h3 { font-size: 16px; color: var(--text-2); }
.pack-amount { font-size: 28px; font-variant-numeric: tabular-nums; }
.pack-amount small { display: block; color: #ffd98f; font-size: 13px; font-weight: 600; }
.pack-bonus { display: inline-flex; align-items: center; gap: 6px; min-height: 20px; color: #f0b48a; font-size: 12.5px; }
.pack-card .button { width: 100%; margin-top: 6px; font-size: 16px; }
.waiver { margin-top: 16px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; }
.waiver input { margin-top: 1px; }

.delta-plus { color: #9ff0c8; font-weight: 600; white-space: nowrap; }
.delta-minus { color: var(--text); white-space: nowrap; }
.cms-table-wrap .coin { margin-right: 6px; }

/* Fenêtre d'achat */
.shop-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 0; border: 1px solid var(--border-3); border-radius: 18px; background: linear-gradient(180deg, var(--surface-2), var(--surface)); color: var(--text); box-shadow: 0 40px 100px rgba(0, 0, 0, .7); }
.shop-dialog::backdrop { background: rgba(3, 4, 9, .72); backdrop-filter: blur(4px); }
.shop-dialog[open] { animation: dialogIn .25s var(--ease); }
.dialog-close { position: absolute; top: 10px; right: 10px; margin: 0; }
.buy-head { display: flex; gap: 16px; align-items: center; padding: 22px 22px 18px; border-bottom: 1px solid var(--border); background: radial-gradient(circle at 0% 0%, rgba(234, 181, 77, .12), transparent 60%); }
.buy-art { --accent: var(--gold); width: 88px; height: 88px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 14px; background: rgba(0, 0, 0, .3); }
.buy-art img { width: 100%; height: 100%; object-fit: cover; }
.buy-art .product-emblem { width: 56px; height: 56px; border-radius: 12px; }
.buy-art .product-emblem .i { width: 26px; height: 26px; }
.buy-head h2 { margin: 6px 0 4px; font-size: 22px; padding-right: 30px; }
.buy-head p { color: var(--text-2); font-size: 13.5px; }
#buy-form { padding: 18px 22px 22px; }
.buy-block { margin: 0 0 16px; padding: 0; border: 0; }
.buy-block legend { margin-bottom: 10px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.buy-characters { display: grid; gap: 8px; max-height: 230px; overflow-y: auto; padding: 2px; }
.buy-character, .buy-currency { position: relative; display: flex; align-items: center; gap: 12px; margin: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); background: rgba(255, 255, 255, .02); color: var(--text); cursor: pointer; transition: border-color .2s, background-color .2s; }
.buy-character input, .buy-currency input { position: absolute; opacity: 0; pointer-events: none; }
.buy-character:hover, .buy-currency:hover { border-color: var(--border-2); }
.buy-character:has(input:checked), .buy-currency:has(input:checked) { border-color: var(--gold); background: rgba(234, 181, 77, .09); box-shadow: 0 0 0 1px rgba(234, 181, 77, .35); }
.buy-character:has(input:focus-visible), .buy-currency:has(input:focus-visible) { outline: 2px solid var(--blue-hi); outline-offset: 2px; }
.buy-character strong, .buy-currency strong { display: block; font-size: 14px; }
.buy-character small, .buy-currency small { color: var(--text-3); font-size: 12px; font-weight: 400; }
.buy-currencies { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.buy-summary { min-height: 22px; margin: 4px 0 0; color: var(--text-2); font-size: 14px; }
.summary-warn { color: #ffb3bd; }
#buy-form .form-actions { margin-top: 14px; }
#buy-form > .form-help { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; }
.is-loading { opacity: .7; pointer-events: none; }
@keyframes dialogIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }

@media (max-width: 960px) {
  .shop-hero-inner { grid-template-columns: 1fr; padding-block: 28px; }
  .shop-toolbar { flex-direction: column; align-items: stretch; }
  .shop-search { flex-basis: auto; }
}
@media (max-width: 640px) {
  .wallet-chip { display: none; }
  .product-grid { grid-template-columns: 1fr; }
  .wallet-balance strong { font-size: 18px; }
  #buy-form .form-actions .button { width: 100%; }
}

/* Tableaux boutique : pas de coupure au milieu des montants et badges */
.price, .pill, .delta-plus, .delta-minus { white-space: nowrap; }
#order-list td, #ledger-list td, #admin-order-list td, #wallet-result td { overflow-wrap: normal; word-break: normal; }
#order-list td:first-child, #ledger-list td:first-child, #admin-order-list td:nth-child(2), #wallet-result td:first-child { white-space: nowrap; color: var(--text-3); font-size: 13px; }
#order-list table, #ledger-list table { min-width: 520px; }
#admin-order-list table { min-width: 980px; }
@media (max-width: 640px) {
  .shop-page .view-head { flex-direction: column; align-items: flex-start; }
  .pack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pack-card { padding: 24px 12px 14px; }
  .pack-amount { font-size: 22px; }
  .coin-xl { width: 42px; height: 42px; }
}
