/* ==========================================================================
   Shared design system — used by both the store and the admin panel
   ========================================================================== */
:root {
    --primary: #0a7d52;
    --primary-600: #086b46;
    --primary-700: #06583a;
    --primary-50: #e8f6ef;
    --primary-100: #c9ebdb;
    --accent: #ff6b2c;
    --accent-600: #e85a1d;
    --accent-50: #fff1ea;

    --ink: #0f172a;
    --ink-2: #1e293b;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --line: #e2e8f0;
    --line-2: #eef2f7;
    --bg: #f5f7fb;
    --surface: #ffffff;

    --success: #12a150;
    --success-50: #e7f7ee;
    --warning: #d97706;
    --warning-50: #fff6e5;
    --danger: #dc2626;
    --danger-50: #fdecec;
    --info: #2563eb;
    --info-50: #eaf1ff;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow: 0 6px 24px -10px rgba(15, 23, 42, .18);
    --shadow-lg: 0 24px 60px -24px rgba(15, 23, 42, .28);
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --transition: .18s ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
h1, h2, h3, h4, h5 { margin: 0 0 .5em; line-height: 1.25; letter-spacing: -.01em; color: var(--ink); }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid rgba(10, 125, 82, .35); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Buttons ---------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent; font-weight: 600; font-size: 14px; line-height: 1.2; cursor: pointer; transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition); white-space: nowrap; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); color: #fff; box-shadow: 0 6px 16px -6px rgba(10,125,82,.6); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-600); color: #fff; box-shadow: 0 6px 16px -6px rgba(255,107,44,.6); }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-light { background: var(--line-2); color: var(--ink); }
.btn-light:hover { background: var(--line); color: var(--ink); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-lg { padding: 14px 26px; font-size: 16px; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn-icon { width: 38px; height: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; height: 32px; }
.btn .spinner { width: 16px; height: 16px; border-width: 2px; }

/* Forms ------------------------------------------------------------------ */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; color: var(--ink-2); }
.form-label .req { color: var(--danger); }
.form-hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.form-control, .form-select { width: 100%; padding: 10px 13px; font: inherit; font-size: 14.5px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); transition: border-color var(--transition), box-shadow var(--transition); }
.form-control:focus, .form-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(10,125,82,.14); }
.form-control::placeholder { color: var(--muted-2); }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--danger); }
.form-control[readonly] { background: var(--line-2); }
textarea.form-control { min-height: 110px; resize: vertical; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath d='M5.5 7.5 10 12l4.5-4.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; padding-right: 36px; }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 5px; }
.input-group { display: flex; }
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn, .input-group .input-addon { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-addon { display: inline-flex; align-items: center; padding: 0 12px; background: var(--line-2); border: 1px solid var(--line); border-left: 0; color: var(--muted); font-size: 14px; }
.input-prefix { border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important; border-left: 1px solid var(--line) !important; border-right: 0 !important; }
.input-group .input-prefix + .form-control { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { width: 40px; height: 22px; border-radius: 22px; background: #cbd5e1; position: relative; transition: background var(--transition); flex-shrink: 0; }
.switch .slider::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform var(--transition); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::after { transform: translateX(18px); }
.switch input:focus-visible + .slider { outline: 3px solid rgba(10,125,82,.35); }

/* Alerts & flash ---------------------------------------------------------- */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; border: 1px solid transparent; margin-bottom: 12px; }
.alert > i { margin-top: 3px; }
.alert span { flex: 1; }
.alert-close { background: none; border: 0; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; opacity: .6; padding: 0 2px; }
.alert-close:hover { opacity: 1; }
.alert-success { background: var(--success-50); color: #0b6b36; border-color: #bfe8cf; }
.alert-error, .alert-danger { background: var(--danger-50); color: #991b1b; border-color: #f7c7c7; }
.alert-warning { background: var(--warning-50); color: #92400e; border-color: #fbdca6; }
.alert-info { background: var(--info-50); color: #1e40af; border-color: #c5d6fb; }

/* 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.5; white-space: nowrap; }
.badge-success { background: var(--success-50); color: #0b7a3e; }
.badge-warning { background: var(--warning-50); color: #b45309; }
.badge-danger { background: var(--danger-50); color: #b91c1c; }
.badge-info { background: var(--info-50); color: #1d4ed8; }
.badge-neutral { background: var(--line-2); color: var(--muted); }
.badge-primary { background: var(--primary-50); color: var(--primary-700); }
.badge-accent { background: var(--accent); color: #fff; }

/* Pagination -------------------------------------------------------------- */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.page-link { min-width: 38px; height: 38px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; }
.page-link:hover { border-color: var(--primary); color: var(--primary); }
.page-link.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-link.disabled, .page-link.dots { color: var(--muted-2); pointer-events: none; }
.page-link.dots { border-color: transparent; background: none; }

/* Spinner, skeleton, toast ----------------------------------------------- */
.spinner { width: 22px; height: 22px; border: 3px solid rgba(0,0,0,.12); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #eef2f7 25%, #f7f9fc 37%, #eef2f7 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.toast-stack { position: fixed; z-index: 3000; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 40px); }
.toast { display: flex; align-items: center; gap: 12px; min-width: 260px; max-width: 380px; padding: 13px 16px; border-radius: var(--radius); background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; animation: toastIn .25s ease; }
.toast i { font-size: 18px; }
.toast-success i { color: #4ade80; }
.toast-error i { color: #f87171; }
.toast-info i { color: #60a5fa; }
.toast.hide { animation: toastOut .25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px); } }

/* Modal ------------------------------------------------------------------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 2000; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop.open { display: flex; animation: fadeIn .15s ease; }
.modal { background: var(--surface); border-radius: var(--radius-lg); width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow: auto; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-header h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 22px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Empty state --------------------------------------------------------------- */
.empty-state { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-state .empty-icon { width: 72px; height: 72px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--primary-50); color: var(--primary); font-size: 28px; margin-bottom: 16px; }
.empty-state h3 { color: var(--ink); font-size: 18px; margin-bottom: 6px; }

/* Utilities --------------------------------------------------------------- */
.text-muted { color: var(--muted) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-primary { color: var(--primary) !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.small { font-size: 13px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; } .align-center { align-items: center; } .justify-between { justify-content: space-between; } .gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .flex-wrap { flex-wrap: wrap; } .flex-1 { flex: 1; }
.w-100 { width: 100%; }
.hidden, [hidden] { display: none !important; }
.nowrap { white-space: nowrap; }
.strike { text-decoration: line-through; color: var(--muted-2); }
