:root {
  color-scheme: dark;
  --ink: #f6f3ef;
  --ink-soft: #bab7bf;
  --paper: #111113;
  --surface: #19191d;
  --surface-2: #242429;
  --input: #151518;
  --accent: #ff9b41;
  --accent-strong: #ffb267;
  --accent-ink: #1f1208;
  --secondary: #ff9b41;
  --secondary-strong: #ffb267;
  --line: #3e3a42;
  --success: #92ddb1;
  --danger: #ffa3a7;
  --shadow: 0 22px 52px #0008;
  --shadow-small: 0 8px 18px #0003;
  --radius: 1rem;
  --radius-small: .75rem;
  --hero-cast: #362015;
  --hero-base: #19191d;
  --font-display: "Trebuchet MS", "Avenir Next", system-ui, sans-serif;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --header-height: 4.65rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--secondary-strong); }
img { display: block; max-width: 100%; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 75%, white);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 1000;
  padding: .75rem 1rem;
  border-radius: .6rem;
  background: var(--accent);
  color: var(--accent-ink);
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-height);
  padding: .5rem max(1rem, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(18px);
}

.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--ink); text-decoration: none; min-width: 0; }
.brand img { width: 5.75rem; height: 3.35rem; object-fit: contain; flex: 0 0 auto; }
.brand-name { font-family: var(--font-display); font-size: 1.18rem; font-weight: 900; white-space: nowrap; letter-spacing: -.04em; }
.brand-name span { color: var(--accent); }
.main-nav { display: flex; align-items: center; justify-content: flex-end; gap: clamp(.35rem, 2vw, 1.2rem); }
.main-nav a { padding: .55rem .3rem; color: var(--ink); font-weight: 750; text-decoration: none; }
.main-nav a:hover { color: var(--accent-strong); }
.main-nav [hidden] { display: none; }
#catalog-qr-button { white-space: nowrap; }

main { flex: 1; min-width: 0; }
.container { width: min(1180px, calc(100% - 2rem)); margin-inline: auto; }

.eyebrow { margin: 0 0 .8rem; color: var(--secondary-strong); font-size: .82rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.page-heading h1 {
  max-width: 17ch;
  margin: 0;
  font-family: var(--font-display);
  line-height: .98;
  letter-spacing: -.055em;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  gap: .5rem;
  padding: .72rem 1.05rem;
  border: 2px solid transparent;
  border-radius: .8rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}
.button:hover { background: var(--accent-strong); transform: translateY(-1px); box-shadow: var(--shadow-small); }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; box-shadow: none; }
.button-secondary { background: var(--secondary); }
.button-secondary:hover { background: var(--secondary-strong); }
.button-ghost { border-color: var(--line); background: var(--surface); color: var(--ink); }
.button-ghost:hover { background: var(--surface-2); border-color: var(--accent); }
.button-danger { background: var(--danger); }
.button-danger:hover { background: #ffc8cb; }
.button-small { min-height: 2.4rem; padding: .5rem .75rem; font-size: .9rem; }
.button-wide { width: 100%; }

.catalog-section { padding: clamp(1rem, 3vw, 2rem) 0 clamp(2rem, 5vw, 4rem); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .4rem 1rem; margin-bottom: 1rem; }
.section-heading h2 { margin: 0; font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.035em; line-height: 1.15; }
.catalog-tools { display: grid; grid-template-columns: minmax(15rem, .7fr) minmax(0, 1fr); align-items: center; gap: 1rem; margin: 0 0 1.5rem; }
.search-wrap { position: relative; }
.search-wrap input { padding-left: 3rem; }
.search-wrap::before, .search-wrap::after { content: ""; position: absolute; pointer-events: none; }
.search-wrap::before { left: 1rem; top: 50%; width: .69rem; height: .69rem; border: 2px solid var(--ink-soft); border-radius: 50%; transform: translateY(-58%); }
.search-wrap::after { left: 1.68rem; top: calc(50% + .33rem); width: .42rem; height: 2px; background: var(--ink-soft); transform: rotate(48deg); }
.category-chips { display: flex; flex-wrap: wrap; gap: .55rem; }
.chip { min-height: 2.45rem; padding: .5rem .85rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 750; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--secondary); background: var(--secondary); color: var(--accent-ink); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: clamp(1rem, 2.4vw, 1.7rem); }
.product-card { overflow: hidden; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-small); transition: transform .18s ease, box-shadow .18s ease; }
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--secondary); }
.product-photo { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-2); }
.product-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.product-card:hover .product-photo img { transform: scale(1.025); }
.photo-placeholder { display: grid; place-items: center; width: 100%; height: 100%; color: var(--secondary); background: repeating-linear-gradient(135deg, transparent 0 16px, #ffffff08 17px 18px), var(--surface-2); font-size: clamp(1.8rem, 5vw, 3.2rem); font-weight: 900; }
.featured-label { position: absolute; top: .75rem; left: .75rem; padding: .38rem .62rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .75rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.product-copy { display: flex; flex: 1; flex-direction: column; padding: 1.15rem; }
.product-category { margin: 0; color: var(--secondary-strong); font-size: .78rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.product-copy h3 { margin: .35rem 0 .55rem; font-family: var(--font-display); font-size: 1.35rem; line-height: 1.15; }
.product-description { display: -webkit-box; overflow: hidden; margin: 0 0 1rem; color: var(--ink-soft); -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.product-footer { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: auto; }
.price { font-family: var(--font-display); font-size: 1.43rem; font-weight: 900; color: var(--accent); white-space: nowrap; }


.page-shell { padding: clamp(2rem, 5vw, 4.5rem) 0; }
.page-heading { margin-bottom: 2rem; }
.page-heading h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
.page-heading p { max-width: 65ch; color: var(--ink-soft); font-size: 1.1rem; }
.back-link { display: inline-flex; margin-bottom: 1.25rem; font-weight: 800; text-decoration: none; }

.panel { padding: clamp(1.1rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-small); }
.panel h2, .panel h3 { margin-top: 0; font-family: var(--font-display); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field { display: grid; gap: .42rem; }
.field-full { grid-column: 1 / -1; }
.field label, .field-label { color: var(--ink); font-size: .9rem; font-weight: 800; }
.field small, .help { color: var(--ink-soft); font-size: .875rem; }
input, textarea, select {
  width: 100%;
  min-height: 3rem;
  padding: .7rem .85rem;
  border: 1.5px solid var(--line);
  border-radius: .72rem;
  background: var(--input);
  color: var(--ink);
}
textarea { min-height: 8rem; resize: vertical; }
select { appearance: none; padding-right: 2.5rem; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.checkbox-row { display: flex; flex-wrap: wrap; gap: 1rem; }
.checkbox { display: flex; align-items: center; gap: .55rem; font-weight: 750; }
.checkbox input { width: 1.2rem; min-height: 1.2rem; accent-color: var(--secondary); }
.hidden-field { position: absolute !important; left: -9999px !important; opacity: 0 !important; pointer-events: none !important; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .7rem; margin-top: 1.25rem; }

.catalog-link-box { display: grid; gap: .7rem; margin: 1rem 0; padding: 1rem; border: 2px dashed var(--secondary); border-radius: var(--radius-small); background: var(--surface-2); }
.catalog-link-box code { overflow-wrap: anywhere; font-size: .85rem; }
.catalog-share { display: grid; grid-template-columns: minmax(12rem, 18rem) minmax(0, 1fr); gap: 1.5rem; align-items: center; }
.catalog-share svg { display: block; width: 100%; height: auto; }

.login-card { width: min(30rem, calc(100% - 2rem)); margin: clamp(2rem, 8vw, 7rem) auto; }
#login-owner-field, #login-point-field { margin-bottom: .85rem; }
.login-card .field[hidden] { display: none; }
.role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: 1rem; }
.role-switch button { padding: .75rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--surface); color: var(--ink); font-weight: 800; cursor: pointer; }
.role-switch button.active { border-color: var(--secondary); background: var(--secondary); color: var(--accent-ink); }

.manage-shell { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); min-height: calc(100vh - 9rem); }
.manage-nav { position: sticky; top: var(--header-height); align-self: start; height: calc(100vh - var(--header-height)); padding: 1.3rem 1rem; border-right: 1px solid var(--line); background: var(--surface); }
.manage-nav h2 { margin: .2rem .6rem 1.2rem; font-family: var(--font-display); font-size: 1.1rem; }
.manage-nav button { display: flex; width: 100%; align-items: center; gap: .6rem; margin-bottom: .3rem; padding: .72rem .75rem; border: 0; border-radius: .7rem; background: transparent; color: var(--ink); font-weight: 750; text-align: left; cursor: pointer; }
.manage-nav button.active { background: var(--surface-2); color: var(--accent); box-shadow: inset 3px 0 var(--accent); }
.manage-nav .nav-logout { margin-top: 1.5rem; color: var(--danger); }
.manage-content { min-width: 0; padding: clamp(1rem, 4vw, 3rem); }
.manage-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.manage-title h1 { margin: 0; font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.035em; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.stat-card { padding: 1.2rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); box-shadow: var(--shadow-small); }
.stat-card span { display: block; color: var(--ink-soft); font-size: .82rem; font-weight: 750; }
.stat-card strong { display: block; margin-top: .25rem; font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.05; }
.cash-panel { margin-top: 1rem; }
.cash-location { max-width: 24rem; margin-top: .75rem; }
.points-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 1rem; align-items: start; }
.point-card h2 { overflow-wrap: anywhere; }
.point-actions { margin-top: 1rem; }
.point-stock-list { display: grid; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.point-stock-list li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .65rem; border: 1px solid var(--line); border-radius: var(--radius-small); }
.point-stock-list .table-product { min-width: 0; overflow-wrap: anywhere; }
.point-stock-quantity { white-space: nowrap; color: var(--accent); }
.cash-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; }
.cash-heading h2 { margin: 0; }
.cash-values { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: .7rem; margin: 1rem 0 0; }
.cash-values div { padding: .65rem .8rem; border-radius: .65rem; background: var(--surface-2); }
.cash-values dt { color: var(--ink-soft); font-size: .85rem; }
.cash-values dd { margin: .14rem 0 0; font-size: 1.2rem; font-weight: 850; overflow-wrap: anywhere; }
.cash-values div:last-child dd { color: var(--accent-strong); }
.cash-history { margin-top: 1rem; }
.cash-history summary { cursor: pointer; }
.cash-history ul { margin-bottom: 0; padding: 0; list-style: none; }
.cash-history li { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .4rem 1rem; padding: .35rem 0; border-top: 1px solid var(--line); }
.form-error { margin: 0; color: var(--danger); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .8rem .9rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--ink-soft); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.table-product { display: flex; align-items: center; min-width: 13rem; gap: .7rem; }
.table-thumb { width: 3rem; height: 3rem; flex: 0 0 auto; border-radius: .55rem; background: var(--surface-2); object-fit: cover; }
.status { display: inline-flex; padding: .25rem .5rem; border-radius: 999px; background: var(--surface-2); color: var(--success); font-size: .75rem; font-weight: 850; }
.status.muted { color: var(--ink-soft); }
.status.cancelled { background: #612e37; color: #ffd2d4; }
.inline-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.category-form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; }
.category-form .field { flex: 1 1 14rem; }
.category-list { list-style: none; margin: 1rem 0 0; padding: 0; }
.category-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; justify-content: space-between; padding: .7rem 0; border-top: 1px solid var(--line); }
.category-list li > div { min-width: 0; overflow-wrap: anywhere; }
.category-list button { flex-shrink: 0; }
.category-actions button { min-height: 2.75rem; }
.category-actions [data-move-category] { min-width: 2.75rem; }

.sale-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(17rem, .7fr); gap: 1.2rem; }
.sale-items { display: grid; gap: .65rem; }
.sale-search, .sale-location { margin-bottom: .85rem; }
.sale-summary { position: sticky; top: 6.5rem; align-self: start; }
.summary-total { display: flex; align-items: baseline; justify-content: space-between; margin: 1rem 0; padding-top: 1rem; border-top: 1px solid var(--line); }
.summary-total strong { font-family: var(--font-display); font-size: 1.8rem; }

.photo-editor { min-width: 0; margin: 0; padding: .8rem; border: 1px solid var(--line); border-radius: .85rem; }
.photo-editor legend { padding: 0 .3rem; font-weight: 800; }
.photo-editor .help { margin-block: 0 .7rem; }
.photo-slot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: .7rem; }
.photo-slot-grid + .help { margin-top: .85rem; }
.photo-slot { display: grid; align-content: start; min-width: 0; padding: .7rem; gap: .5rem; border: 1px solid var(--line); border-radius: .75rem; }
.photo-slot label { font-size: .88rem; font-weight: 800; }
.photo-slot input { min-width: 0; width: 100%; font-size: .85rem; }
.image-preview, .photo-empty { display: grid; overflow: hidden; height: 6rem; place-items: center; border-radius: .55rem; background: var(--surface-2); }
.image-preview img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.image-preview-cropped { position: relative; width: min(100%, 8rem); height: auto; aspect-ratio: 4 / 3; justify-self: center; }
.product-photo img.cover-image-cropped, .image-preview img.cover-image-cropped, .cover-crop-frame img {
  position: absolute;
  max-width: none;
  object-fit: fill;
}
.product-card:hover .product-photo .cover-image-cropped { transform: none; }
.photo-empty { border: 1px dashed var(--line); color: var(--ink-soft); font-size: .85rem; }
.photo-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.photo-slot .button { padding-inline: .65rem; font-size: .82rem; }

.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.theme-card { padding: 1rem; border: 2px solid var(--line); border-radius: 1rem; background: var(--input); color: var(--ink); cursor: pointer; }
.theme-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.theme-card img { width: 100%; height: clamp(5rem, 12vw, 8rem); object-fit: contain; }
.theme-card strong { display: block; margin-top: .7rem; text-align: center; }

.empty-state { padding: clamp(2rem, 6vw, 4rem); border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink-soft); text-align: center; }
.empty-state strong { display: block; margin-bottom: .3rem; color: var(--ink); font-family: var(--font-display); font-size: 1.35rem; }
.loading-screen { display: grid; min-height: 55vh; place-content: center; color: var(--ink-soft); text-align: center; }
.loader { width: 3rem; height: 3rem; margin: 0 auto; border: .35rem solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast-region { position: fixed; right: 1rem; bottom: 1rem; z-index: 100; display: grid; width: min(25rem, calc(100% - 2rem)); gap: .6rem; }
.toast { padding: .9rem 1rem; border-left: .35rem solid var(--secondary); border-radius: .75rem; background: var(--surface-2); color: var(--ink); box-shadow: var(--shadow); animation: toast-in .2s ease-out; }
.toast.error { border-left-color: #ff6b78; }
@keyframes toast-in { from { opacity: 0; transform: translateY(.6rem); } }

.modal { width: min(48rem, calc(100% - 1.5rem)); max-height: calc(100vh - 2rem); padding: 0; border: 0; border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: 0 30px 100px rgba(0,0,0,.28); }
.modal::backdrop { background: #000a; backdrop-filter: blur(4px); }
.modal-inner { padding: clamp(1rem, 4vw, 2rem); }
.modal-header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.modal-header h2 { margin: 0; font-family: var(--font-display); font-size: 1.8rem; }
.modal-close { flex: 0 0 auto; width: 2.6rem; height: 2.6rem; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); font-size: 1.2rem; cursor: pointer; }
.modal:has(.catalog-qr-display) { width: min(25rem, calc(100% - 1.5rem)); }
.catalog-qr-display { width: min(100%, 18rem); margin-inline: auto; overflow: hidden; border-radius: var(--radius-small); background: white; }
.catalog-qr-display svg { display: block; width: 100%; height: auto; }
.catalog-qr-help { margin: .9rem 0 0; text-align: center; }
.cover-crop-modal { width: min(33rem, calc(100% - 1.5rem)); max-height: calc(100dvh - 1.5rem); }
.cover-crop-frame {
  position: relative;
  width: min(100%, 27rem);
  margin-inline: auto;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  background: var(--surface-2);
  border-radius: var(--radius-small);
}
.cover-crop-frame:active { cursor: grabbing; }
.cover-crop-frame img { pointer-events: none; user-select: none; }
.cover-crop-frame img[hidden] { display: none; }
.cover-crop-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .4rem .8rem;
  align-items: center;
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}
.cover-crop-controls input { min-width: 0; width: 100%; min-height: 2rem; accent-color: var(--accent); }

.site-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1.25rem; padding: 1.2rem clamp(1rem, 4vw, 4rem); border-top: 1px solid var(--line); background: var(--surface); }
.site-footer div { display: grid; }
.site-footer span { color: var(--ink-soft); font-size: .85rem; }
.site-footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.15rem; }
.site-footer-links a:not([hidden]) { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--ink-soft); font-size: .875rem; text-underline-offset: .2em; }
.site-footer-links a:hover { color: var(--ink); }
.site-footer-contact a { gap: .45rem; }
.site-footer-contact svg { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; color: var(--accent); }

@media (max-width: 960px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manage-shell { grid-template-columns: 1fr; }
  .manage-nav { position: sticky; top: var(--header-height); z-index: 20; display: flex; height: auto; overflow-x: auto; padding: .65rem 1rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .manage-nav h2 { display: none; }
  .manage-nav button { width: auto; flex: 0 0 auto; margin: 0 .25rem 0 0; white-space: nowrap; }
  .manage-nav .nav-logout { margin-top: 0; margin-left: auto; }
  .sale-grid { grid-template-columns: 1fr; }
  .sale-summary { position: static; }
}

@media (max-width: 720px) {
  :root { --header-height: 3.9rem; }
  .site-header { padding: .38rem .8rem; gap: .4rem; }
  .brand { gap: .35rem; }
  .brand img { width: 3.6rem; height: 2.68rem; }
  .brand-name { font-size: .96rem; }
  .main-nav { gap: .35rem; }
  .main-nav a { font-size: .88rem; }
  .main-nav .button { font-size: .8rem; padding-inline: .45rem; }
  .catalog-tools { grid-template-columns: 1fr; }
  .catalog-share { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .catalog-share #catalog-qr { max-width: 18rem; }
  .product-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field-full { grid-column: auto; }
  .theme-grid { grid-template-columns: 1fr; }
  .theme-card { display: grid; grid-template-columns: 8rem 1fr; align-items: center; }
  .theme-card strong { margin: 0; text-align: left; }
  .manage-content { padding: 1rem; }
  .manage-title { align-items: flex-start; flex-direction: column; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 460px) {
  .stat-grid { grid-template-columns: 1fr; }
}

.catalog-hero {
  display: grid;
  grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr);
  align-items: center;
  gap: 1.25rem;
  padding: clamp(1.3rem, 4vw, 3rem);
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: radial-gradient(ellipse at 77% 54%, var(--hero-cast) 0, transparent 62%), var(--hero-base);
  box-shadow: var(--shadow-small);
}
.catalog-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: repeating-linear-gradient(135deg, transparent 0 22px, #ffffff08 23px 24px);
  mask-image: linear-gradient(100deg, transparent 10%, black 95%);
}
.hero-copy h1 { margin: 0; max-width: 12ch; font: 900 clamp(2.35rem, 5.7vw, 4.8rem)/.98 var(--font-display); letter-spacing: -.065em; }
.hero-copy .eyebrow { color: var(--accent); }
.hero-copy > p:last-child { margin: 1rem 0 0; color: var(--ink-soft); font-size: clamp(.95rem, 2vw, 1.13rem); }
.hero-logo { justify-self: center; width: 100%; max-width: 34rem; max-height: 22rem; object-fit: contain; }
.hero-decor { display: none; pointer-events: none; }
[data-theme="christmas"] .catalog-hero::before {
  background: radial-gradient(circle, #f3f7ff80 0 1px, transparent 2px) 12px 17px / 47px 39px,
              radial-gradient(circle, #f3f7ff66 0 1px, transparent 2px) 0 0 / 91px 62px;
  mask-image: linear-gradient(100deg, transparent 12%, black 95%);
}
[data-theme="christmas"] .hero-decor { position: absolute; display: flex; top: -.1rem; right: 2rem; gap: 1.3rem; padding: 0 1rem; border-top: 2px solid #648b6e; transform: rotate(3deg); }
[data-theme="christmas"] .hero-decor i { width: .36rem; height: .55rem; border-radius: .15rem .15rem .35rem .35rem; background: #ffd394; box-shadow: 0 1px 11px #ff9e2e; }
[data-theme="christmas"] .hero-decor i:nth-child(even) { background: #fb827c; box-shadow: 0 1px 9px #d65a53; }
[data-theme="easter"] .catalog-hero::before { background: radial-gradient(ellipse, #cbb1f233 0 1px, transparent 3px) 0 0 / 30px 28px; }
[data-theme="easter"] .hero-decor { position: absolute; right: .85rem; bottom: .75rem; display: flex; gap: .42rem; align-items: end; opacity: .85; }
[data-theme="easter"] .hero-decor i { width: .86rem; height: 1.12rem; border-radius: 50%; transform: rotate(-18deg); background: repeating-linear-gradient(0deg, #cbb1f2 0 4px, #f5d8f4 4px 6px); }
[data-theme="easter"] .hero-decor i:nth-child(2) { transform: rotate(16deg); background: repeating-linear-gradient(0deg, #99cfa5 0 4px, #e5edb4 4px 6px); }
[data-theme="easter"] .hero-decor i:nth-child(3) { background: repeating-linear-gradient(0deg, #eeaaac 0 4px, #f6d6a5 4px 6px); }
[data-theme="easter"] .hero-decor i:nth-child(4) { margin: 0 .3rem .3rem .35rem; width: .42rem; height: .42rem; background: #ffc976; box-shadow: 0 -.3rem #eac9fd, 0 .3rem #eac9fd, -.3rem 0 #eac9fd, .3rem 0 #eac9fd; }
[data-theme="easter"] .hero-decor i:nth-child(5) { display: none; }

.chip:hover, .theme-card:hover { border-color: var(--secondary); }
.gallery-photo, .gallery-placeholder { width: 100%; height: auto; max-height: 56vh; min-height: 10rem; border-radius: .72rem; background-color: var(--input); object-fit: contain; }
.gallery-placeholder { height: 14rem; }
.gallery-thumbnails { display: flex; overflow-x: auto; gap: .55rem; padding: .35rem; margin-top: .65rem; }
.gallery-thumbnails button { flex: 0 0 3.7rem; padding: .18rem; border: 1px solid var(--line); border-radius: .52rem; background: var(--surface-2); cursor: pointer; }
.gallery-thumbnails button[aria-pressed="true"] { border-color: var(--accent); }
.gallery-thumbnails img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: .33rem; }

.logo-variant-section { border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: 1.4rem; }
.variant-grid { grid-template-columns: repeat(2, minmax(0, 17rem)); }
.manage-nav button:hover { background: var(--surface-2); }
.sale-item { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) auto; align-items: center; gap: .8rem; padding: .75rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); }
.sale-item[hidden] { display: none; }
.sale-photo { width: 4.2rem; height: 4.2rem; border-radius: .58rem; background-color: var(--surface-2); object-fit: cover; }
.sale-item-copy { display: grid; gap: .12rem; min-width: 0; overflow-wrap: anywhere; }
.sale-item-copy .price { font-size: 1.22rem; }
.sale-stock { color: var(--ink-soft); font-size: .875rem; }
.quantity-stepper { display: grid; grid-template-columns: 2.75rem 3rem 2.75rem; gap: .25rem; }
.quantity-stepper button { border: 1px solid var(--line); border-radius: .65rem; background: var(--surface-2); color: var(--ink); font-size: 1.45rem; font-weight: 750; min-height: 2.75rem; cursor: pointer; }
.quantity-stepper button[data-step="1"]:not(:disabled) { background: var(--accent); color: var(--accent-ink); }
.quantity-stepper button[data-step="1"]:not(:disabled):hover { background: var(--accent-strong); }
.quantity-stepper button:disabled { opacity: .45; cursor: not-allowed; }
.quantity-stepper input { appearance: textfield; min-height: 2.75rem; padding: .25rem; text-align: center; }
.quantity-stepper input::-webkit-inner-spin-button, .quantity-stepper input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.sale-note { margin: .9rem 0; }
.sale-note summary { cursor: pointer; padding: .42rem 0; }
.sale-note textarea { min-height: 4.8rem; margin-top: .3rem; }
.summary-total strong { color: var(--accent); }
.sale-notice { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; padding: .7rem .9rem; margin-bottom: 1rem; border: 1px solid var(--success); border-radius: var(--radius-small); background: var(--surface); }
.history-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: .85rem; }
.history-card { display: flex; flex-direction: column; gap: .75rem; padding: 1rem; }
.history-heading, .history-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem; }
.history-heading .help { display: block; }
.history-heading time { font-variant-numeric: tabular-nums; }
.history-card ul { margin: 0; padding-left: 1.2rem; overflow-wrap: anywhere; }
.history-actions { margin-top: auto; }

@media (max-width: 720px) {
  .catalog-hero { grid-template-columns: minmax(0, 1fr); gap: .9rem; padding: .7rem .55rem 1.15rem; }
  .hero-logo { grid-row: 1; width: 100%; height: auto; max-width: none; max-height: none; }
  /* The metallic variant has wider transparent margins on the sides. */
  .hero-logo[src$="/standard-metal.png"] { width: 115%; }
  .hero-copy { margin-inline: .5rem; }
  .hero-copy .eyebrow { margin-bottom: .42rem; }
  .hero-copy h1 { font-size: clamp(2rem, 8.5vw, 3.2rem); max-width: 16ch; }
  .hero-copy > p:last-child { margin-top: .55rem; }
  [data-theme="christmas"] .hero-decor { right: .85rem; gap: .8rem; }
  [data-theme="easter"] .hero-decor { bottom: 1rem; opacity: .52; }
  .variant-grid { grid-template-columns: 1fr; }
  body:has(.seller-shell) .site-header { position: static; }
  .seller-shell .manage-nav {
    position: static;
    align-items: center;
    gap: .35rem;
    overflow: visible;
    padding-block: .45rem;
  }
  .seller-shell .manage-nav button { min-height: 2.75rem; margin: 0; padding: .55rem .7rem; }
  .seller-shell .manage-nav .nav-logout { margin-left: auto; }
  .seller-sale { padding-bottom: 5rem; }
  .seller-sale .sale-checkout {
    position: fixed;
    z-index: 25;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: minmax(0, .65fr) minmax(0, 1fr);
    align-items: center;
    gap: .75rem;
    padding: .65rem 1rem calc(.65rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 -8px 30px #0005;
  }
  .seller-sale .summary-total { display: grid; margin: 0; padding: 0; border: 0; line-height: 1.12; }
  .seller-sale .summary-total span { font-size: .875rem; }
  .seller-sale .summary-total strong { font-size: clamp(1.2rem, 5vw, 1.55rem); white-space: nowrap; }
  body:has(.seller-sale) .toast-region { bottom: 5.1rem; }
  body:has(.seller-sale) .site-footer { padding-bottom: 5.75rem; }
}
@media (max-width: 460px) {
  .sale-item { grid-template-columns: 4rem minmax(0, 1fr); padding: .7rem; gap: .56rem .74rem; }
  .sale-photo { width: 4rem; height: 4rem; }
  .quantity-stepper { grid-column: 1 / -1; justify-content: end; }
}
@media (max-width: 365px) {
  .brand img { display: none; }
}

@media (max-width: 430px) {
  .site-header:has(#install-button:not([hidden])) .brand img { display: block; }
  .site-header:has(#install-button:not([hidden])) .brand-name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
