/* Laravel Shop - one handwritten stylesheet, no build step. */
:root {
    --bg: #f6f5f2;
    --surface: #ffffff;
    --text: #1f2328;
    --muted: #667085;
    --border: #e4e2dd;
    --brand: #6b3e26;
    --brand-ink: #ffffff;
    --ok: #1a7f37;
    --ok-bg: #e7f5ec;
    --warn: #9a6700;
    --warn-bg: #fff4d6;
    --fail: #c62828;
    --fail-bg: #fdecec;
    --info: #3d5a80;
    --info-bg: #eaf0f8;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #16181b;
        --surface: #1f2226;
        --text: #e8e6e3;
        --muted: #9aa1ab;
        --border: #30343a;
        --brand: #c8865f;
        --brand-ink: #16181b;
        --ok-bg: #12301d;
        --warn-bg: #3a2e0b;
        --fail-bg: #3b1515;
        --info-bg: #17263a;
        --ok: #57c27a;
        --warn: #e0b341;
        --fail: #f07575;
        --info: #8fb3e0;
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--brand); }
img { max-width: 100%; height: auto; display: block; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .875em; }
h1 { font-size: 1.75rem; margin: 1.25rem 0 1rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 .75rem; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 480px; }
.muted { color: var(--muted); }
.empty { padding: 2rem; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.inline { display: inline; }

/* Top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; min-height: 56px; }
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; }
.nav a { color: var(--text); text-decoration: none; }
.nav a:hover { color: var(--brand); }
.pill { display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-size: .75rem; text-align: center; }
.footer { padding: 2rem 16px; color: var(--muted); font-size: .875rem; }

/* Buttons and forms */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 40px; padding: .5rem 1rem; border: 1px solid var(--brand); border-radius: 8px;
    background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 600;
    text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .link:focus-visible {
    outline: 2px solid var(--brand); outline-offset: 2px;
}
.btn-secondary { background: transparent; color: var(--brand); }
.btn-small { min-height: 32px; padding: .25rem .6rem; font-size: .875rem; }
.link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; text-decoration: underline; }
.danger { color: var(--fail); }

.form { display: grid; gap: 1rem; }
.form label { display: grid; gap: .3rem; font-weight: 600; font-size: .9rem; }
.form label.check { display: flex; align-items: flex-start; gap: .5rem; font-weight: 400; }
input, select, textarea {
    width: 100%; min-height: 40px; padding: .5rem .65rem;
    border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit;
}
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; margin-top: .3rem; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; display: grid; gap: .6rem; }
legend { font-weight: 600; padding: 0 .3rem; }
.option code { font-weight: 600; }
.row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.row > label { flex: 1 1 140px; }
.qty { width: 5rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 1rem; }
td.actions { margin: 0; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.search { display: flex; gap: .5rem; flex: 1 1 280px; max-width: 420px; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1.25rem; }
.chip { padding: .3rem .8rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); text-decoration: none; font-size: .9rem; }
.chip.active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

/* Catalogue */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.card-media { display: block; aspect-ratio: 4 / 3; background: var(--border); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.noimg { display: flex; height: 100%; min-height: 160px; align-items: center; justify-content: center; color: var(--muted); }
.card-body { display: flex; flex-direction: column; flex: 1; padding: .75rem 1rem 1rem; }
.card-title { font-size: 1rem; margin: 0; }
.card-title a { color: var(--text); text-decoration: none; }
.card-body .muted { margin: .2rem 0 .75rem; font-size: .875rem; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }

.detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; }
.detail-media img { border-radius: var(--radius); }
.price { font-size: 1.4rem; font-weight: 700; }

.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; }
.summary h2:first-child { margin-top: 0; }
.plain { list-style: none; padding: 0; margin: 0 0 1rem; }
.plain li { display: flex; justify-content: space-between; gap: 1rem; padding: .25rem 0; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.table th, .table td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.table .num { text-align: right; white-space: nowrap; }
.thumb { width: 48px; height: 36px; object-fit: cover; border-radius: 4px; }
.preview { max-width: 240px; border-radius: var(--radius); }

/* Status and alerts */
.status, .badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.status.big { font-size: 1rem; padding: .25rem .9rem; }
.status-pending, .badge.warn, .status-warn { background: var(--warn-bg); color: var(--warn); }
.status-paid, .status-shipped, .status-delivered, .badge.ok, .status-ok { background: var(--ok-bg); color: var(--ok); }
.status-cancelled, .status-refunded, .badge.fail, .status-fail { background: var(--fail-bg); color: var(--fail); }
.badge.info, .status-info { background: var(--info-bg); color: var(--info); }

.alert { padding: .75rem 1rem; border-radius: var(--radius); margin: 1rem 0; }
.alert ul { margin: 0; padding-left: 1.2rem; }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }
.alert-fail { background: var(--fail-bg); color: var(--fail); }

/* Diagnostics */
.toc { display: flex; flex-wrap: wrap; gap: .5rem 1rem; padding: .75rem 0; border-bottom: 1px solid var(--border); }
.health td:first-child { width: 4.5rem; }
.health td:nth-child(2) { font-weight: 600; min-width: 10rem; }
.health .row-fail td:nth-child(2) { color: var(--fail); }
.wrap { word-break: break-word; white-space: pre-wrap; }
.output { background: #111; color: #e6e6e6; padding: 1rem; border-radius: var(--radius); overflow-x: auto; white-space: pre-wrap; word-break: break-word; }

/* Pagination (Laravel's bootstrap-5 markup) */
.pagination { display: flex; flex-wrap: wrap; gap: .25rem; list-style: none; padding: 0; margin: 1.25rem 0; }
.page-link { display: block; min-width: 2.25rem; padding: .35rem .6rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); text-align: center; text-decoration: none; }
.page-item.active .page-link { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.page-item.disabled .page-link { color: var(--muted); }
nav[role=navigation] .small, nav[role=navigation] p { font-size: .875rem; color: var(--muted); }
nav[role=navigation] .d-sm-none { display: none; }

@media (max-width: 760px) {
    .detail, .two-col { grid-template-columns: 1fr; }
    h1 { font-size: 1.4rem; }
    .search { max-width: none; }
}
