:root {
  color-scheme: light;
  --paper: #fcf8f3;
  --surface: #fffdf9;
  --ink: #302125;
  --muted: #675358;
  --plum: #673748;
  --plum-dark: #4b2533;
  --line: #e5d8d2;
  --blush: #f4e5e5;
  --heading: 'Playfair Display', Georgia, serif;
  --body: 'DM Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.55 var(--body); }
button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
:focus-visible { outline: 2px solid var(--plum); outline-offset: 4px; }
.preview-bar :focus-visible { outline-color: white; }
img { display: block; max-width: 100%; }
.shell { width: min(1160px, calc(100% - 88px)); margin-inline: auto; }

.preview-bar { display: flex; min-height: 38px; align-items: center; justify-content: center; gap: 14px; padding: 4px 16px; background: var(--plum-dark); color: #fff8f9; font-size: 0.79rem; }
.preview-bar button { padding: 3px 0; border: 0; background: transparent; color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.preview-bar button span { margin-left: 3px; }
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.header-inner { min-height: 88px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; width: fit-content; }
.brand:hover { text-decoration: none; }
.brand img { width: 52px; height: 52px; border-radius: 50%; object-fit: contain; mix-blend-mode: multiply; }
.brand strong, .brand small { display: block; }
.brand strong { font: 600 1.25rem/1.2 var(--heading); white-space: nowrap; }
.brand small { color: var(--muted); font-size: 0.69rem; white-space: nowrap; margin-top: 4px; }
.header-inner nav { display: flex; align-items: center; gap: 31px; font-weight: 600; font-size: 0.9rem; }
.main-shop-link { color: var(--plum); }
.basket-button { justify-self: end; display: inline-flex; gap: 8px; align-items: center; background: transparent; border: 1px solid var(--line); border-radius: 28px; padding: 8px 12px; font-size: 0.875rem; font-weight: 600; }
.basket-button:hover { background: var(--blush); }
.basket-button svg, .dispatch svg { width: 19px; height: 19px; flex: none; stroke: var(--plum); stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.basket-count { display: grid; place-items: center; min-width: 23px; min-height: 23px; padding: 0 4px; border-radius: 20px; background: var(--blush); color: var(--plum-dark); }

.product-page { padding-top: 33px; }
.browse-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; min-height: 24px; color: var(--muted); font-size: 0.875rem; }
.browse-row > span span { margin-inline: 8px; color: #8a7379; }
.browse-row label { display: flex; align-items: center; gap: 8px; }
.browse-row select { max-width: 185px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 5px; padding: 4px 8px; }
.product-layout { display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: start; gap: clamp(44px, 7vw, 105px); }
.product-photo { position: relative; display: grid; place-items: center; align-self: start; aspect-ratio: 1 / 1.07; overflow: hidden; margin: 0; background: #efdbd7; border: 1px solid #eaded9; border-radius: 4px; }
.product-photo img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; object-position: center 53%; }
.product-photo figcaption { padding: 12px 20px; color: var(--plum-dark); background: var(--surface); border-radius: 4px; }
.sample-label { position: absolute; left: 18px; bottom: 18px; color: var(--plum-dark); background: var(--surface); padding: 5px 10px; border-radius: 4px; font-size: 0.78rem; font-weight: 600; }
.product-copy { min-width: 0; padding: clamp(13px, 2vw, 32px) 0 4px; }
.category { color: var(--plum); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
h1, h2 { font-family: var(--heading); font-weight: 600; }
.product-copy h1 { margin: 11px 0 13px; max-width: 530px; font-size: clamp(2.35rem, 4.35vw, 4rem); line-height: 1.05; letter-spacing: -0.042em; text-wrap: balance; overflow-wrap: anywhere; }
.price { margin: 0; color: var(--plum); font-size: 1.45rem; font-weight: 700; }
.description { color: var(--muted); margin: 15px 0 24px; max-width: 47ch; }
fieldset { border: 0; min-width: 0; padding: 0; margin: 0 0 19px; }
legend { padding: 0; margin-bottom: 8px; font-weight: 700; font-size: 0.92rem; }
.colour-options { display: flex; flex-wrap: wrap; gap: 8px; }
.colour-options label { position: relative; }
.colour-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.colour-options label > span { display: flex; align-items: center; gap: 7px; min-height: 42px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); font-size: 0.9rem; cursor: pointer; }
.colour-options input:checked + span { box-shadow: inset 0 0 0 1px var(--plum); border-color: var(--plum); background: #f8eded; }
.colour-options input:focus-visible + span { outline: 2px solid var(--plum); outline-offset: 3px; }
.swatch { width: 13px; height: 13px; border-radius: 50%; background: var(--swatch); border: 1px solid rgb(48 33 37 / 13%); }
.field { display: grid; gap: 6px; font-size: 0.92rem; font-weight: 700; }
.field input:not([type='file']), .field textarea { width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid #dbcbc6; border-radius: 5px; color: var(--ink); background: var(--surface); font-weight: 400; }
.field input::placeholder, .field textarea::placeholder { color: #827072; }
.field textarea { resize: vertical; }
.field small, .field-help { color: var(--muted); font-size: 0.81rem; font-weight: 400; }
.primary, .secondary { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-height: 44px; padding: 9px 16px; border: 1px solid var(--plum); border-radius: 5px; font-weight: 700; font-size: 0.93rem; text-align: center; }
.primary { background: var(--plum); color: white; }
.primary:hover { background: var(--plum-dark); }
.primary:disabled { opacity: 0.6; cursor: wait; }
.secondary { background: var(--surface); color: var(--plum-dark); }
.secondary:hover { background: var(--blush); text-decoration: none; }
.add-button { display: flex; justify-content: space-between; width: 100%; min-height: 52px; margin-top: 20px; }
.dispatch { display: flex; align-items: flex-start; gap: 11px; margin-top: 19px; padding: 13px; border-radius: 5px; background: #f6ebe7; color: var(--plum-dark); font-size: 0.88rem; }
.dispatch svg { margin-top: 2px; }
.dispatch small { display: block; margin-top: 1px; font-size: 0.8rem; color: var(--muted); }
.custom-section { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-block: 52px 48px; padding: 25px 26px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.custom-section h2 { margin: 0; font-size: 1.5rem; }
.custom-section p { margin: 4px 0 0; color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.875rem; }
.footer-inner { min-height: 74px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }

.editor-page { padding-block: 33px 52px; }
.editor-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 24px; }
.editor-heading h1 { margin: 6px 0 3px; font-size: clamp(2.1rem, 4vw, 3.2rem); line-height: 1.1; }
.editor-heading p { margin: 0; color: var(--muted); }
.back-link { color: var(--plum); font-weight: 700; font-size: 0.9rem; }
.editor-layout { display: grid; grid-template-columns: minmax(210px, 0.36fr) minmax(0, 1fr); align-items: start; gap: 20px; }
.editor-card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 23px; }
.editor-card h2 { margin: 0 0 13px; font-size: 1.45rem; }
#editor-form > .field, #editor-form > .field-pair { margin-bottom: 15px; }
.form-top { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 8px; }
#editor-status { color: var(--plum); font-size: 0.875rem; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dispatch-fields { margin-bottom: 15px; }
.dispatch-fields legend span { color: var(--muted); font-weight: 500; }
.dispatch-fields .field-help { margin: 5px 0 0; }
.catalogue button { display: block; width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 5px; margin: 5px 0; padding: 9px 10px; text-align: left; font-size: 0.9rem; overflow-wrap: anywhere; }
.catalogue button[aria-current='true'] { border-color: var(--plum); background: var(--blush); }
.upload-row { display: flex; align-items: center; gap: 10px; }
.upload-row input { min-width: 0; width: 100%; color: var(--muted); }
.upload-row img { width: 56px; height: 56px; object-fit: cover; border-radius: 5px; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 9px; padding-top: 3px; }

dialog { position: fixed; inset: 0 0 0 auto; width: min(100%, 430px); max-width: none; height: 100%; max-height: none; border: 0; margin: 0; padding: 0; color: var(--ink); background: var(--surface); box-shadow: -15px 0 45px #3021252b; }
dialog::backdrop { background: #30212563; }
.drawer-inner { padding: 23px; }
.drawer-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 16px; }
.drawer-heading h2 { margin: 0; font-size: 1.7rem; }
.close-button { width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); font-size: 1.5rem; }
.basket-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.basket-line small { display: block; color: var(--muted); }
.basket-line > div:last-child { text-align: right; }
.remove-button { display: block; margin: 3px 0 0 auto; padding: 2px 0; border: 0; background: transparent; color: var(--plum); text-decoration: underline; }
.basket-summary { margin-top: 16px; }
.basket-summary div { display: flex; justify-content: space-between; }
.basket-summary p, .preview-note { color: var(--muted); font-size: 0.88rem; }

@media (max-width: 890px) {
  .shell { width: calc(100% - 48px); }
  .header-inner { gap: 14px; }
  .header-inner nav { gap: 16px; }
  .product-layout { gap: 31px; }
  .product-copy { padding-top: 5px; }
}
@media (max-width: 690px) {
  .shell { width: calc(100% - 32px); }
  .header-inner { grid-template-columns: 1fr auto; gap: 7px 10px; min-height: auto; padding-block: 10px; }
  .header-inner nav { grid-row: 2; grid-column: 1 / -1; justify-content: center; padding: 5px 0 0; border-top: 1px solid var(--line); }
  .brand strong { font-size: 1.12rem; }
  .brand small { font-size: 0.66rem; }
  .brand img { width: 42px; height: 42px; }
  .brand { gap: 7px; }
  .basket-button { gap: 4px; padding-inline: 7px; }
  .basket-button > span:nth-child(2) { display: none; }
  .browse-row { flex-wrap: wrap; margin-bottom: 12px; }
  .product-page, .editor-page { padding-top: 22px; }
  .product-layout { grid-template-columns: minmax(0, 1fr); gap: 23px; }
  .product-photo { aspect-ratio: 1.11 / 1; }
  .product-copy h1 { text-wrap: initial; margin-top: 8px; }
  .custom-section { margin-block: 32px; padding: 18px; }
  .editor-heading { align-items: start; }
  .editor-heading .secondary { flex: none; }
  .editor-layout { grid-template-columns: 1fr; gap: 13px; }
  .editor-card { padding: 16px; }
}
@media (max-width: 355px) { .brand small { display: none; } .editor-heading { flex-wrap: wrap; } }
