:root {
    color-scheme: light;
    --paper: #faf6f1;
    --white: #fffdfb;
    --ink: #2b2023;
    --muted: #6d5e62;
    --wine: #782839;
    --dark: #541725;
    --line: #e8dad6;
    --serif: "Playfair Display", Georgia, serif;
    font: 16px/1.55 "DM Sans", system-ui, sans-serif;
    color: var(--ink);
    background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .24em; }
button, .button, input, select, textarea { font: inherit; }
button, .button {
    display: inline-flex; justify-content: center; align-items: center;
    min-height: 43px; width: fit-content; padding: .62rem 1.1rem;
    border: 1px solid transparent; border-radius: .35rem; text-decoration: none;
    background: var(--wine); color: white; font-weight: 700; cursor: pointer;
}
button:hover, .button:hover { background: var(--dark); }
button:disabled { opacity: .55; cursor: default; }
.secondary { color: var(--dark); background: var(--white); border-color: var(--line); }
.secondary:hover { color: var(--dark); background: #f2e5e4; }
:focus-visible { outline: 3px solid #a34e5f; outline-offset: 3px; }
.wrap { width: min(1180px, calc(100% - 3rem)); margin-inline: auto; }
.top, .page-title, .person { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.shop-header, .admin-header { border-bottom: 1px solid var(--line); background: var(--white); }
.top { min-height: 76px; }
.top nav, .actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.top nav a, .brand { text-decoration: none; }
.top nav a:hover { text-decoration: underline; }
.brand { display: flex; align-items: center; gap: .65rem; font: 600 1.45rem var(--serif); }
.brand img { width: 48px; height: 48px; object-fit: cover; border-radius: 50%; }
#bag-count { background: #f2e5e4; padding: .1rem .4rem; border-radius: .5rem; }
.hero { background: #f3e5e3; }
.hero-inner { display: grid; grid-template-columns: .9fr 1.1fr; align-items: center; gap: 2rem; }
.hero-inner > div { padding-block: 3rem; }
.hero img { width: 100%; height: clamp(320px, 39vw, 500px); object-fit: cover; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; margin: 0 0 .75rem; }
h1 { font-size: clamp(2.25rem, 6vw, 5.2rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.65rem); }
h3 { font-size: 1.28rem; }
.hero p { max-width: 29ch; font-size: 1.16rem; margin: 1rem 0 1.6rem; color: var(--muted); }
p { margin: .55rem 0 1rem; }
.branch-bar { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.branch-bar form { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.branch-bar select { width: auto; min-width: 13rem; }
.branch-bar p { margin: .55rem 0 0; color: var(--muted); }
.section { padding: clamp(2.1rem, 5vw, 4rem) 0; }
.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px,100%),1fr)); gap: 1rem; }
.product { overflow: hidden; border: 1px solid var(--line); background: var(--white); border-radius: .6rem; }
.product img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.product > div { padding: 1rem; }
.product p { margin-bottom: .5rem; }
.count { display: flex; align-items: center; gap: .55rem; margin-top: .65rem; }
.count input { width: 4.25rem; }
.checkout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 2rem; border-top: 1px solid var(--line); }
.total { border-top: 1px solid var(--line); padding-top: .75rem; display: flex; justify-content: space-between; }
.card, .metrics > div, .record { background: var(--white); border: 1px solid var(--line); border-radius: .55rem; padding: 1.1rem; }
label { display: grid; gap: .3rem; font-weight: 600; }
input, select, textarea {
    display: block; width: 100%; min-width: 0; padding: .54rem .65rem;
    border: 1px solid #cdbab8; border-radius: .35rem; color: var(--ink); background: white;
}
input[type=checkbox] { width: auto; accent-color: var(--wine); }
textarea { min-height: 4.7rem; resize: vertical; }
[hidden] { display: none !important; }
small, .muted { color: var(--muted); }
form.card, .stack, .login form { display: grid; gap: .8rem; }
footer { border-top: 1px solid var(--line); background: #f3e5e3; }
.notice, .error { padding: .75rem 1rem; border-radius: .4rem; }
.notice { color: #20563e; background: #e8f2ea; }
.error, .low { color: #862436; background: #f8e8eb; }
.low { display: inline-block; padding: .12rem .4rem; border-radius: .25rem; }
.admin-main { padding-block: 2rem 4rem; }
.admin h1 { font-size: clamp(2rem, 4vw, 3rem); }
.page-title form { align-items: end; }
.tabs { display: flex; flex-wrap: wrap; gap: .45rem; border-bottom: 1px solid var(--line); margin-bottom: 1.3rem; }
.tabs a { padding: .65rem .7rem; text-decoration: none; }
.tabs a[aria-current] { color: var(--wine); border-bottom: 3px solid var(--wine); font-weight: 700; }
.metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: .75rem; margin-bottom: 1rem; }
.metrics strong { display: block; font-size: 1.5rem; color: var(--wine); }
.record { margin-block: .65rem; }
.record + h2, .metrics + h2 { margin-top: 1.7rem; }
summary { cursor: pointer; font-weight: 700; }
summary span { font-weight: 500; margin-left: .7rem; color: var(--muted); }
details[open] > summary { margin-bottom: .9rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(190px,100%),1fr)); gap: .85rem; align-items: end; }
fieldset { min-width: 0; border: 1px solid var(--line); padding: .85rem; border-radius: .4rem; }
legend { font-weight: 700; }
.check { display: flex; align-items: center; gap: .5rem; }
.edit { border-top: 1px solid var(--line); padding-top: .9rem; margin-top: .9rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--white); text-align: left; }
td, th { padding: .65rem .8rem; border-bottom: 1px solid var(--line); }
.login { width: min(430px, calc(100% - 2rem)); margin: 4rem auto; }
@media (max-width: 650px) {
    .wrap { width: calc(100% - 1.5rem); }
    .hero-inner, .checkout { grid-template-columns: 1fr; gap: 1rem; }
    .hero-inner > div { padding-block: 1.6rem 0; }
    .hero img { height: 270px; }
    .top { min-height: 66px; }
    .top nav { gap: .55rem; font-size: .9rem; }
    .brand img { width: 36px; height: 36px; }
    .brand span { font-size: 1.15rem; }
    .products { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; }
    .product > div { padding: .65rem; }
    .product h3 { font-size: 1.1rem; }
    .count { flex-wrap: wrap; }
    .page-title { align-items: start; flex-direction: column; margin-bottom: .5rem; }
    .metrics { grid-template-columns: 1fr; }
}
