/* Shared reset, tokens and components used by both the storefront and the admin panel. */
:root {
  --c-primary: #111111; --c-primary-text: #ffffff; --c-accent: #c2410c; --c-sale: #dc2626; --c-success: #15803d; --c-warning: #b45309; --c-danger: #dc2626; --c-info: #2563eb;
  --c-bg: #ffffff; --c-surface: #f5f5f4; --c-text: #18181b; --c-muted: #71717a; --c-border: #e7e5e4;
  --radius: 6px; --radius-card: 8px; --radius-lg: 14px;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --font-heading: var(--font-body);
  --base-size: 15px; --container: 1320px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06); --shadow: 0 6px 24px rgba(16, 24, 40, .08); --shadow-lg: 0 24px 60px rgba(16, 24, 40, .18);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-body); font-size: var(--base-size); line-height: 1.55; color: var(--c-text); background: var(--c-bg); -webkit-font-smoothing: antialiased; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.015em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--c-info); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { flex: none; }
[hidden] { display: none !important; }
body.modal-open { overflow: hidden; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: var(--radius); border: 1px solid transparent;
  font-weight: 600; font-size: 14px; line-height: 1; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s; user-select: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; }
.btn.disabled { pointer-events: none; }
.btn-primary { background: var(--c-primary); color: var(--c-primary-text); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.15); }
.btn-secondary { background: var(--c-bg); border-color: var(--c-border); color: var(--c-text); }
.btn-secondary:hover:not(:disabled) { border-color: var(--c-text); }
.btn-ghost { background: transparent; color: var(--c-text); }
.btn-ghost:hover:not(:disabled) { background: var(--c-surface); }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.1); }
.btn-link { min-height: auto; padding: 0; color: var(--c-info); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.btn-link:hover { text-decoration: underline; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 15px; }
.btn-block { width: 100%; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after { content: ''; position: absolute; width: 18px; height: 18px; border: 2px solid currentColor; border-color: var(--c-primary-text) transparent var(--c-primary-text) transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-secondary.is-busy::after, .btn-ghost.is-busy::after { border-color: var(--c-text) transparent var(--c-text) transparent; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; color: inherit; transition: background .15s; }
.icon-btn:hover { background: rgba(0, 0, 0, .06); }

/* Forms */
.field { display: grid; gap: 6px; margin: 0 0 14px; font-size: 13px; font-weight: 600; color: var(--c-text); min-width: 0; }
.field > span .opt { color: var(--c-muted); font-weight: 400; }
.field small, .hint { color: var(--c-muted); font-weight: 400; font-size: 12.5px; line-height: 1.45; }
.input, .select, .textarea { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-bg); font-size: 14px; font-weight: 400; transition: border-color .15s, box-shadow .15s; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--c-text); box-shadow: 0 0 0 3px rgba(0, 0, 0, .06); }
.input[readonly] { background: var(--c-surface); }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: var(--radius) 0 0 var(--radius); }
.input-group > .btn, .input-group > .addon { border-radius: 0 var(--radius) var(--radius) 0; }
.input-group .addon { display: grid; place-items: center; padding: 0 12px; background: var(--c-surface); border: 1px solid var(--c-border); border-left: 0; font-size: 13px; color: var(--c-muted); white-space: nowrap; }
.input-group .addon.pre { border-radius: var(--radius) 0 0 var(--radius); border-left: 1px solid var(--c-border); border-right: 0; }
.input-group .addon.pre + .input { border-radius: 0 var(--radius) var(--radius) 0; }
.check { display: inline-flex; align-items: flex-start; gap: 10px; font-size: 14px; font-weight: 500; cursor: pointer; line-height: 1.4; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--c-primary); flex: none; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 38px; height: 22px; border-radius: 999px; background: #d4d4d8; position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.switch input:checked + .track { background: var(--c-success); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--c-info); outline-offset: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; align-items: start; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.4; background: var(--c-surface); color: var(--c-text); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge-success { background: #dcfce7; color: #166534; } .badge-warning { background: #fef3c7; color: #92400e; } .badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; } .badge-muted { background: #f4f4f5; color: #52525b; } .badge-purple { background: #ede9fe; color: #5b21b6; }

/* Toasts */
.toast-root { position: fixed; z-index: 9999; right: 18px; bottom: 18px; display: grid; gap: 10px; width: min(380px, calc(100vw - 36px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border-radius: 10px; background: #18181b; color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; line-height: 1.45;
  opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s var(--ease); }
.toast.show { opacity: 1; transform: none; }
.toast span { flex: 1; }
.toast button { color: #a1a1aa; }
.toast-success .icon:first-child { color: #4ade80; } .toast-error { background: #7f1d1d; } .toast-error .icon:first-child { color: #fecaca; } .toast-info .icon:first-child { color: #93c5fd; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; padding: 16px; background: rgba(9, 9, 11, .5); opacity: 0; transition: opacity .2s; overflow-y: auto; }
.modal-backdrop.show { opacity: 1; }
.modal { width: 100%; background: var(--c-bg); color: var(--c-text); border-radius: 14px; box-shadow: var(--shadow-lg); transform: translateY(12px) scale(.98); transition: transform .25s var(--ease); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal-backdrop.show .modal { transform: none; }
.modal-sm { max-width: 420px; } .modal-md { max-width: 560px; } .modal-lg { max-width: 820px; } .modal-xl { max-width: 1120px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--c-border); }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-text { margin: 0; color: var(--c-muted); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--c-border); }

/* Loading & empty */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--c-border); border-top-color: var(--c-text); animation: spin .7s linear infinite; display: inline-block; }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 60px 20px; color: var(--c-muted); font-size: 14px; }
.skeleton { background: linear-gradient(90deg, #f1f1f1 0, #e8e8e8 40px, #f1f1f1 80px); background-size: 800px 100%; animation: shimmer 1.2s infinite linear; border-radius: 6px; }
.empty-state { display: grid; justify-items: center; gap: 6px; padding: 56px 20px; text-align: center; color: var(--c-muted); }
.empty-state .icon { color: #a1a1aa; margin-bottom: 6px; }
.empty-state h3 { margin: 0; color: var(--c-text); font-size: 17px; }
.empty-state p { margin: 0 0 10px; max-width: 420px; }

.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: #f0f9ff; color: #075985; font-size: 13px; line-height: 1.5; border: 1px solid #bae6fd; }
.callout.warn { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.callout.danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.callout.success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.callout code, .code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: rgba(0, 0, 0, .05); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
.divider { height: 1px; background: var(--c-border); margin: 14px 0; }
.callout > .icon { margin-top: 1px; }

/* Rich text output */
.prose { line-height: 1.75; }
.prose h2, .prose h3, .prose h4 { margin: 1.6em 0 .6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose img { border-radius: var(--radius-card); margin: 1em 0; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote { margin: 1.2em 0; padding: .4em 1.2em; border-left: 3px solid var(--c-border); color: var(--c-muted); }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--c-border); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--c-surface); }

.muted { color: var(--c-muted); }
.text-sm { font-size: 13px; } .text-xs { font-size: 12px; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.end { justify-content: flex-end; }
.stack { display: grid; gap: 12px; }
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }

/* Drop-down lists. Chromium browsers (Edge, Chrome) let the opened list be styled like the rest of the design
   ("customizable select"); other browsers keep their own list. Forms keep using the real <select>. */
@supports (appearance: base-select) {
  select.select, body .pill-select select { appearance: base-select; }
  select.select::picker-icon, body .pill-select select::picker-icon { display: none; }
  select.select::picker(select), body .pill-select select::picker(select) {
    appearance: base-select; margin-block: 6px; padding: 6px; min-width: anchor-size(width); max-height: min(340px, 55vh); overflow-y: auto;
    border: 1px solid var(--c-border); border-radius: 12px; background: var(--c-bg, #fff); color: var(--c-text); box-shadow: 0 16px 40px rgba(16, 24, 40, .16);
  }
  select.select option, body .pill-select select option { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }
  select.select option:hover, select.select option:focus-visible, body .pill-select select option:hover, body .pill-select select option:focus-visible { background: var(--c-surface); outline: none; }
  select.select option:checked, body .pill-select select option:checked { background: var(--a-accent-soft, var(--c-surface)); color: var(--a-accent, var(--c-text)); font-weight: 600; }
  select.select option::checkmark, body .pill-select select option::checkmark { order: 1; margin-left: auto; color: var(--a-accent, var(--c-text)); }
  select.select option:disabled { opacity: .45; cursor: not-allowed; background: none; }
  select.select optgroup { padding-top: 6px; font-size: 12px; font-weight: 700; color: var(--c-muted); }
  select.select optgroup option { color: var(--c-text); }
}
