/* base.css: tokens, reset, the one menu bar, buttons, forms, notices.
   Loaded on every page, store and admin alike. */

:root {
    --ink: #1d1c1a;          /* menu bar and dark buttons only */
    --text: #4b4843;         /* body text: soft, still easy to read */
    --head: #2e2c28;         /* headings and strong labels */
    --ink-soft: #3a3835;
    --paper: #f4f4f2;
    --card: #ffffff;
    --line: #e3e1dc;
    --muted: #6b6862;
    --accent: #f29a1f;
    --accent-dark: #d98308;
    --ok: #1f6f43;
    --ok-bg: #e3f3ea;
    --warn: #8a5a00;
    --warn-bg: #fdf0d5;
    --danger: #b3392f;
    --radius: 10px;
    --maxw: 1200px;
    --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--paper);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.25; margin: 0; color: var(--head); }
h1 { font-size: 1.7rem; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; font-weight: 650; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- The menu bar (same markup on every page) ---------- */

.site-header { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 50; }
.bar {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 20px;
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 0 24px;
}
.brand {
    font-weight: 700;
    letter-spacing: .14em;
    font-size: 1.05rem;
    text-decoration: none;
    color: #fff;
    white-space: nowrap;
}
.brand span { opacity: .5; }


.brand span {
  animation: pulseOpacity 2s ease-in-out infinite alternate;
}

@keyframes pulseOpacity {
  0% {
    opacity: 0.1;
  }
  100% {
    opacity: 0.5;
  }
}

.brand em {
    font-style: normal;
    font-size: .68rem;
    letter-spacing: .04em;
    font-weight: 700;
    background: var(--accent);
    color: var(--ink);
    padding: 2px 7px;
    border-radius: 4px;
    margin-left: 10px;
    vertical-align: middle;
}

.nav { display: flex; align-self: stretch; flex: 1; gap: 2px; }
.nav a {
    display: flex;
    align-items: center;
    padding: 0 14px;
    border-bottom: 3px solid transparent;
    color: #cfccc5;
    text-decoration: none;
    font-weight: 500;
    font-size: .95rem;
    white-space: nowrap;
}
.nav a:hover { color: #fff; }
.nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--accent); }

.bar-end { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.util {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 6px;
    background: var(--ink-soft);
    color: #fff;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    white-space: nowrap;
}
.util:hover { background: #4a4743; }
.util[aria-current="page"] { background: var(--accent); color: var(--ink); }
.badge {
    min-width: 1.4em;
    padding: 0 .4em;
    border-radius: 999px;
    background: var(--accent);
    color: var(--ink);
    font-size: .78rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.5;
}
.badge.is-empty { background: #5a5651; color: #e6e3dd; }
.util[aria-current="page"] .badge { background: var(--ink); color: #fff; }

/* Two rows only when one row cannot fit. */
@media (max-width: 700px) {
    .bar { flex-wrap: wrap; padding: 0 12px; gap: 0 12px; }
    .brand { order: 1; padding: 14px 0 10px; }
    .bar-end { order: 2; padding: 8px 0 4px; }
    .nav { order: 3; flex: 1 0 100%; }
    .nav a { flex: 1; justify-content: center; padding: 10px 4px; font-size: .92rem; white-space: nowrap; }
}
@media (max-width: 360px) { .nav a { font-size: .84rem; padding: 10px 2px; } }

/* ---------- Page frame ---------- */

.page { max-width: var(--maxw); margin: 0 auto; padding: 24px 20px 60px; }
.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 20px;
}
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.panel { padding: 22px; }
.back { display: inline-block; margin-bottom: 14px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; }
.back:hover { color: var(--head); }

.empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--muted);
    background: var(--card);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}
.empty .btn { margin: 4px; }

.notice { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; font-size: .94rem; }
.notice-ok { background: var(--ok-bg); color: var(--ok); }
.notice-warn { background: var(--warn-bg); color: var(--warn); }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    color: var(--head);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { background: #f0efec; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-soft); }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }

.small { font-size: .88rem; }
.check { display: flex; align-items: center; gap: 8px; font-size: .92rem; margin: 8px 0 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent-dark); }
.btn-sm { padding: 6px 12px; font-size: .88rem; }

.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; font-size: .9rem; color: var(--head); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-btn.danger { color: var(--danger); }
.link-btn.muted { color: var(--muted); font-weight: 500; }

/* ---------- Forms ---------- */

.field { margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { display: block; color: var(--head); font-weight: 600; font-size: .9rem; margin-bottom: 5px; padding: 0; }
input[type="text"], input[type="search"], input[type="email"], input[type="url"], input[type="tel"],
input[type="number"], input[type="password"], textarea, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cfccc5;
    border-radius: 8px;
    background: #fff;
    font: inherit;
    color: var(--text);
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(242, 154, 31, .4); border-color: var(--accent-dark); }
.has-error input, .has-error textarea { border-color: var(--danger); }
.err { display: block; color: var(--danger); margin-top: 4px; font-size: .86rem; }
.hint { display: block; color: var(--muted); font-size: .84rem; margin: 2px 0 10px; }

.js .no-js-only { display: none; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}

/* Item details (size, mount, fabric, choices) shown as chips: cart, order page, manager */
.spec-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.spec-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; background: #efeeea; color: #4a4741; font-size: .8rem; font-weight: 600; }
.spec-fabric img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }
.spec-notes { margin: 3px 0 0; font-size: .84rem; color: var(--muted); max-width: 48ch; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
