/* Weit & Werk shop: the website's look — sage on cream, Montserrat with Cormorant for accents. */
@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant";
  src: url("fonts/cormorant-latin-italic.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  --sage: #68735D;
  --sage-deep: #565f4c;
  --sage-soft: #a7ae9d;
  --cream: #F7F4EA;
  --cream-deep: #EFEADB;
  --paper: #FCFAF4;
  --line: rgba(104, 115, 93, .22);
  --rust: #9C5A36;
  --max: 1120px;
  --serif: "Cormorant", "Cormorant Garamond", Georgia, serif;
  --sans: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--sage);
  font: 400 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
main { flex: 1; padding-bottom: 72px; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 3px; }
::selection { background: var(--sage); color: var(--cream); }
.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }

/* Header and footer, as on the website */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--cream) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; flex-shrink: 0; }
.brand img { width: 40px; }
.brand span { font-size: .85rem; letter-spacing: .3em; font-weight: 500; }
.nav { display: flex; gap: 1.8rem; align-items: center; }
.nav a {
  text-decoration: none; font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 500;
  padding: .3rem 0; border-bottom: 1px solid transparent; white-space: nowrap;
}
.nav a:hover, .nav a[aria-current] { border-bottom-color: currentColor; }
.badge {
  display: inline-grid; place-items: center; min-width: 1.5em; height: 1.5em; padding: 0 .4em; margin-left: .2em;
  border-radius: 999px; background: var(--sage); color: var(--cream); letter-spacing: 0; font-size: .7rem;
}
@media (max-width: 640px) {
  .brand span { display: none; }
  .nav { gap: 1rem; }
  .nav a { letter-spacing: .1em; font-size: .68rem; }
}
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; font-size: .72rem; letter-spacing: .08em; }
.site-footer .wrap { display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap; }
.site-footer span { margin-right: auto; }
.site-footer a, .site-footer .link { text-decoration: none; text-transform: uppercase; letter-spacing: .2em; font-weight: 500; font-size: .72rem; }
.site-footer a:hover { text-decoration: underline; }

/* Type */
.intro { padding: clamp(40px, 6vw, 72px) 0 clamp(20px, 3vw, 32px); }
.eyebrow {
  font-size: .7rem; font-weight: 500; letter-spacing: .32em; text-transform: uppercase;
  margin: 0 0 1rem; display: flex; align-items: center; gap: .9rem;
}
.eyebrow::before { content: ""; width: 32px; height: 1px; background: currentColor; opacity: .6; }
h1, h2, h3 { font-weight: 400; margin: 0; line-height: 1.25; }
h1 { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem); letter-spacing: .05em; text-transform: uppercase; font-weight: 300; }
.intro h1 + p { margin-top: .8rem; }
h2 { font-size: 1rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 500; margin: 0 0 1rem; }
.note { font-size: .85rem; color: var(--sage); opacity: .85; }
.empty { padding: 48px 0; font-family: var(--serif); font-style: italic; font-size: 1.5rem; }
.back { margin: 32px 0 0; font-size: .8rem; letter-spacing: .1em; }
.back a { text-decoration: none; }
small { font-size: .75rem; opacity: .8; font-weight: 400; }

/* Messages */
.flash, .error {
  margin: 24px 0 0; padding: .9rem 1.2rem; border-radius: 12px; font-size: .9rem;
  border-left: 3px solid var(--sage); background: var(--paper);
}
.error { border-left-color: var(--rust); color: var(--rust); }
.error-text { color: var(--rust); }

/* Buttons */
.button, button.button {
  display: inline-block; text-decoration: none; cursor: pointer; font: inherit;
  font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; font-weight: 500;
  padding: .95rem 1.8rem; border: 1px solid var(--sage); border-radius: 999px;
  background: var(--sage); color: var(--cream); transition: background .25s, color .25s, border-color .25s;
}
.button:hover, .button:focus-visible { background: var(--sage-deep); border-color: var(--sage-deep); }
.button.ghost { background: transparent; color: var(--sage); }
.button.ghost:hover { background: var(--sage); color: var(--cream); }
.button.danger { background: var(--rust); border-color: var(--rust); }
.button:disabled { opacity: .45; cursor: not-allowed; background: var(--sage); }
button.small {
  font: inherit; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 500; cursor: pointer;
  padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--sage); background: transparent; color: var(--sage);
}
button.small:hover { background: var(--sage); color: var(--cream); }
button.link {
  font: inherit; background: none; border: 0; padding: 0; color: inherit; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
button.link.danger { color: var(--rust); }
form.inline { display: inline; }
.actions { display: flex; gap: .8rem; flex-wrap: wrap; justify-content: flex-end; margin-top: 24px; }

/* Filters */
.filters { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 32px; }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chips a {
  text-decoration: none; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 500;
  padding: .5rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper);
}
.chips a:hover { border-color: var(--sage); }
.chips a[aria-current] { background: var(--sage); color: var(--cream); border-color: var(--sage); }
.admin-nav { margin-bottom: 32px; }
.search input { min-width: min(260px, 100%); }

/* Product grid */
.grid { list-style: none; padding: 0; margin: 0; display: grid; gap: clamp(16px, 3vw, 32px); grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }
.card a { text-decoration: none; display: block; }
.card .photo { border-radius: 18px; overflow: hidden; background: var(--cream-deep); aspect-ratio: 1; }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.card a:hover img { transform: scale(1.04); }
.card h2 { font-size: .85rem; letter-spacing: .08em; text-transform: none; font-weight: 500; margin: 14px 0 2px; }
.price { margin: 0; font-family: var(--serif); font-style: italic; font-size: 1.3rem; }
.price.big { font-size: 2rem; margin-top: .6rem; }
.stock { margin: 2px 0 0; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 500; }
.stock.low { color: var(--rust); }
.stock.out { color: var(--rust); opacity: .8; }

/* Product page */
.product { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 6vw, 80px); margin-top: 24px; align-items: start; }
.photo.large { border-radius: 24px; overflow: hidden; background: var(--cream-deep); aspect-ratio: 1; display: grid; place-items: center; }
.photo.large img { width: 100%; height: 100%; object-fit: cover; }
.details h1 { margin-top: 8px; }
.buy { display: flex; align-items: end; gap: 1rem; flex-wrap: wrap; margin: 24px 0 8px; }
.buy label { display: grid; gap: .3rem; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 500; }
@media (max-width: 760px) { .product { grid-template-columns: 1fr; } }

/* Forms */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: clamp(20px, 4vw, 36px); margin-top: 24px; }
.panel.narrow, .narrow { max-width: 480px; }
section.panel.narrow { margin: clamp(32px, 6vw, 64px) auto 0; }
.panel h1 { margin-bottom: 24px; }
.form { display: grid; gap: 1.1rem; }
.form label { display: grid; gap: .35rem; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 500; }
.form label small { text-transform: none; letter-spacing: 0; }
.form label.check { display: flex; gap: .6rem; align-items: center; text-transform: none; letter-spacing: 0; font-size: .85rem; font-weight: 400; }
.form h2 { margin-top: .6rem; margin-bottom: 0; }
input, select, textarea {
  font: inherit; font-size: .95rem; color: var(--sage-deep); letter-spacing: 0; text-transform: none;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; width: 100%;
}
input[type=checkbox] { width: auto; accent-color: var(--sage); }
input[type=file] { padding: .5rem; background: var(--cream); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--sage-soft); outline-offset: 1px; border-color: var(--sage); }
textarea { resize: vertical; line-height: 1.6; }
.row { display: grid; grid-template-columns: 1fr 2fr; gap: 1rem; }
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 4vw, 40px); align-items: start; }
.columns.panel .actions, .columns > .actions { grid-column: 1 / -1; }
form.columns.panel { display: grid; }
@media (max-width: 760px) { .columns, .row { grid-template-columns: 1fr; } }
details.danger summary { cursor: pointer; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 500; color: var(--rust); }
details.danger form { margin-top: 1rem; }
.panel.danger { border-color: rgba(156, 90, 54, .3); }

/* Tables: the cart and the admin lists */
.lines { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .9rem; }
.lines th { text-align: left; font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 500; padding: .6rem .5rem; border-bottom: 1px solid var(--line); }
.lines td { padding: .8rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.lines tfoot th { border-bottom: 0; font-size: .8rem; padding-top: 1rem; }
.lines .num { text-align: right; white-space: nowrap; }
.lines .item { display: flex; align-items: center; gap: .9rem; }
.lines .item img { border-radius: 10px; flex-shrink: 0; width: 56px; height: 56px; object-fit: cover; }
.lines .item a { text-decoration: none; font-weight: 500; }
.lines tr.inactive { opacity: .55; }
.qty { display: flex; gap: .5rem; align-items: center; }
.qty select { width: auto; padding: .4rem .6rem; }
.qty input[type=number] { width: 5.5rem; padding: .4rem .6rem; }
.qty input[type=number].out { border-color: var(--rust); color: var(--rust); }
.qty input:not([type]) { padding: .4rem .7rem; }
@media (max-width: 760px) {
  .lines thead { display: none; }
  .lines, .lines tbody, .lines tr, .lines td { display: block; width: 100%; }
  .lines tr { border-bottom: 1px solid var(--line); padding: .6rem 0; }
  .lines td { border: 0; padding: .3rem 0; }
  .lines td[data-label]::before { content: attr(data-label) ": "; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 500; }
  .lines .num { text-align: left; }
  .lines tfoot tr { display: flex; justify-content: space-between; }
  .lines tfoot th { display: inline; }
}

/* Checkout summary */
.summary { list-style: none; padding: 0; margin: 0; }
.summary li, .total { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.total { font-weight: 600; border-bottom: 0; }

/* Admin overview */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 16px; margin-bottom: 40px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 20px 24px; text-decoration: none; display: grid; gap: .2rem; }
a.stat:hover { border-color: var(--sage); }
.stat strong { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 2.2rem; line-height: 1.1; }
.stat span { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 500; }
.list { padding-left: 1.2rem; }
@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
  .card h2 { font-size: .78rem; letter-spacing: .04em; }
  .price { font-size: 1.1rem; }
}
form.columns > div { display: grid; gap: 1.1rem; align-content: start; }
