/* Elegant Sale — single stylesheet, mobile-first, no framework.
   Palette, type and component shapes follow myelegant.by. */

/* ---- Fonts ---- */
/* Manrope (body) and Nunito (headings), self-hosted so no third-party
   request is needed. Only the cyrillic and latin subsets are shipped —
   the interface is Russian and lot titles may carry latin brand names. */

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/manrope-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/manrope-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/manrope-600-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/manrope-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/manrope-700-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/manrope-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/nunito-700-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/nunito-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Tokens ---- */

:root {
  /* Brand pink. --accent is the decorative shade taken straight from the
     reference site; it only reaches 3.1:1 on white, so anything carrying
     text — filled buttons, links — uses --accent-ink instead, which is the
     same hue darkened until it clears WCAG AA. */
  --accent: #ff4f81;
  --accent-ink: #dd1f5c;
  --accent-dark: #b81549;
  --accent-soft: #fff0f4;
  --grad: linear-gradient(to right, #7d8dff, #ff4f81);

  /* Text, from the same grey scale as the reference. Its own body copy is
     #adb5bd, which is fine over marketing copy but only reaches 2.2:1 — too
     little for hints, prices and meta, so text uses the darker --muted and
     #adb5bd is kept for lines and idle markers. */
  --fg: #212529;
  --body: #495057;
  --muted: #6c757d;
  --muted-soft: #adb5bd;

  /* Surfaces */
  --bg: #f8f9fa;
  --surface: #fff;
  --border: #e9ecef;
  --border-strong: #dee2e6;

  /* Status. The brand palette has no success colour, so these stay
     semantic; the error red is pulled toward the brand hue. */
  --ok: #1b7a34;
  --ok-bg: #e9f7ee;
  --err: #c92a43;
  --err-bg: #fff0f2;

  --shadow-sm: 0 2px 8px rgba(33, 37, 41, 0.06);
  --shadow-md: 0 8px 24px rgba(33, 37, 41, 0.08);

  --radius: 12px;
  --radius-lg: 16px;
  --pill: 9999px;

  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Nunito", "Manrope", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html {
  font-size: 16px; /* avoid mobile zoom-on-focus */
  -webkit-text-size-adjust: 100%; /* no text inflation on iOS landscape */
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--body);
  background: var(--bg);
  line-height: 1.5;
}

a {
  color: var(--accent-ink);
}

h1,
h2,
h3 {
  font-family: var(--font-head);
  color: var(--fg);
}

h1 {
  font-size: 1.6rem;
  line-height: 1.2;
  overflow-wrap: break-word;
}

:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}

/* ---- Layout ---- */

.hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex;
  align-items: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--fg);
  min-width: 0; /* a long name wraps instead of pushing the cart link off-screen */
}

/* The logo ships at 296x60 and is drawn at half that, so it stays sharp on a
   retina screen. The width is capped rather than fixed so the cart pill keeps
   its room on a narrow phone. */
.brand img {
  display: block;
  width: 148px;
  max-width: 40vw;
  height: auto;
}

/* The cart link is a small pill, echoing the pill buttons on the site. */
.cart-link {
  margin-left: 1rem;
  padding: 0.5rem 1rem;
  border-radius: var(--pill);
  background: var(--accent-soft);
  text-decoration: none;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

.cart-link:hover {
  background: var(--accent-ink);
  color: #fff;
}

/* The page sits on the grey band as a white card, which is where the
   reference site's alternating #fff / #f8f9fa rhythm comes from. */
.wrap {
  max-width: 760px;
  margin: 1.5rem auto;
  padding: 1.5rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.wrap.wide {
  max-width: 1100px;
}

/* On a phone the card would only waste side margin, so it goes full-bleed. */
@media (max-width: 560px) {
  .wrap {
    margin: 0;
    padding: 1rem;
    border-radius: 0;
    box-shadow: none;
  }
}

.ftr {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 1.5rem 1rem 2rem;
}

.ftr p {
  margin: 0 0 0.75rem;
}

.ftr-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
}

/* Footer links are a touch target like any other, so they get the 44px
   height the buttons and form controls already keep. */
.ftr-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--body);
  text-decoration: none;
}

.ftr-links a:hover {
  color: var(--accent-ink);
  text-decoration: underline;
}

.ftr-legal {
  margin: 0;
  color: var(--muted);
}

/* ---- Flash messages ---- */

.msg {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.msg-ok {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid var(--ok);
}

.msg-err {
  background: var(--err-bg);
  color: var(--err);
  border: 1px solid var(--err);
}

/* ---- Forms ---- */

.field {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 0.9rem;
}

.field label {
  margin-bottom: 0.35rem;
  font-weight: 600;
  color: var(--fg);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 2.75rem; /* 44px touch target */
  padding: 0.5rem 0.9rem;
  font-size: 1rem;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: inherit;
}


.field.err input,
.field.err select,
.field.err textarea {
  border-color: var(--err);
}

.err-text {
  color: var(--err);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.btn,
.btn-sec,
a.btn,
a.btn-sec,
button.btn,
button.btn-sec {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem; /* 44px touch target */
  padding: 0.65rem 2rem;
  font-family: inherit;
  font-weight: 700;
  line-height: 1.2;
  border-radius: var(--pill);
  border: 1px solid transparent;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}

/* Filled pink pill — the site's primary action. */
.btn,
button.btn,
a.btn {
  background: var(--accent-ink);
  color: #fff;
  border-color: var(--accent-ink);
}

.btn:hover,
button.btn:hover,
a.btn:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

/* White pill on a soft shadow — the site's secondary action. */
.btn-sec,
button.btn-sec,
a.btn-sec {
  background: var(--surface);
  color: var(--fg);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-sec:hover,
button.btn-sec:hover,
a.btn-sec:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.check,
.radio {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem; /* the whole label is the touch target */
  font-weight: normal;
  margin-right: 1rem;
  cursor: pointer;
}

.check input,
.radio input {
  width: 1.25rem;
  height: 1.25rem;
  min-height: 0;
  margin: 0 0.5rem 0 0;
  flex-shrink: 0;
  accent-color: var(--accent-ink);
}

/* A radio group: fieldset + legend, styled like a plain .field. */
fieldset.field {
  border: 0;
  margin: 0 0 0.9rem;
  padding: 0;
  min-width: 0;
}

fieldset.field legend {
  padding: 0;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.actions {
  margin: 1rem 0;
}

.actions .btn,
.actions .btn-sec {
  margin: 0 0.5rem 0.5rem 0;
}

@media (max-width: 480px) {
  .actions .btn,
  .actions .btn-sec {
    display: block;
    width: 100%;
    margin-right: 0;
  }
}

/* ---- Tables ---- */

.scroll {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.6rem;
  border: 1px solid var(--border);
  text-align: left;
}

.table th {
  background: var(--bg);
  color: var(--fg);
}

.table input {
  width: 5rem;
  min-height: 2.75rem;
  padding: 0.4rem;
  font-size: 1rem; /* under 16px, iOS zooms in on focus */
  font-family: inherit;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}

/* On phones a wide table becomes one card per row; each cell is labelled
   from its data-label attribute. */
@media (max-width: 560px) {
  .table-stack thead {
    display: none;
  }

  .table-stack,
  .table-stack tbody,
  .table-stack tfoot,
  .table-stack tr,
  .table-stack th,
  .table-stack td {
    display: block;
    width: 100%;
  }

  .table-stack tr {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
  }

  .table-stack th,
  .table-stack td {
    border: 0;
    border-bottom: 1px solid var(--border);
  }

  .table-stack tr > :last-child {
    border-bottom: 0;
  }

  .table-stack td[data-label] {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .table-stack td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    margin-right: 1rem;
  }

  .table-stack tfoot tr {
    display: flex;
    justify-content: space-between;
    background: var(--bg);
  }

  .table-stack tfoot th {
    width: auto;
    border: 0;
  }
}

/* ---- SKU search (home) ---- */

.hint {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 0.3rem;
}

.steps {
  display: flex;
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.steps li {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--border);
}

.steps li + li {
  margin-left: 0.25rem;
}

.steps .steps-n {
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Steps run light brand to deep brand rather than green to pink: a finished
   step is progress, not a success state, and green is off-palette here. */
.steps .done {
  border-bottom-color: var(--accent);
}

.steps .done .steps-n {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.steps .current {
  color: var(--fg);
  font-weight: 700;
  border-bottom-color: var(--accent);
}

.steps .current .steps-n {
  border-color: var(--accent-ink);
  background: var(--accent-ink);
  color: #fff;
}

.search {
  max-width: 32rem;
}

.search-row {
  display: flex;
}

.search-row input {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.125rem;
  letter-spacing: 0.03em;
}

.search-row .btn {
  flex-shrink: 0;
  margin-left: 0.5rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.result,
.panel,
.lot {
  max-width: 32rem;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.result-bad {
  border-color: var(--err);
  background: var(--err-bg);
  /* Contains the floated .lot-photo-sm, so a tall thumbnail cannot spill
     out of the notice. */
  display: flow-root;
}

.panel-ok {
  border-color: var(--ok);
  background: var(--ok-bg);
}

.panel p {
  margin: 0 0 0.5rem;
}

.panel .actions,
.lot .actions {
  margin-bottom: 0;
}

.lot {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

/* The item photo. A fixed aspect box so the card does not jump as the image
   loads, and `contain` rather than `cover` because cropping is the wrong
   trade when the buyer is judging the object itself. */
.lot-photo {
  margin: 0 0 0.9rem;
}

.lot-photo img {
  display: block;
  width: 100%;
  /* Square, because stock runs from tall vases to wide carpets and a
     landscape box would letterbox the tall ones badly. */
  aspect-ratio: 1;
  max-height: 20rem;
  object-fit: contain;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.lot-photo figcaption {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* On the unavailable notice the photo is a reminder, not the subject. */
.lot-photo-sm {
  float: right;
  width: 6.5rem;
  margin: 0 0 0.5rem 0.9rem;
}

.lot-photo-sm img {
  aspect-ratio: 1;
}

.lot-photo-sm figcaption {
  font-size: 0.75rem;
  line-height: 1.3;
}

.lot-title {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  line-height: 1.25;
  overflow-wrap: break-word;
}

.lot-meta {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.lot-price {
  margin: 0 0 1rem;
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-ink);
}

.lot-total {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.lot-total output {
  font-weight: 700;
}

.stepper {
  display: flex;
  align-items: stretch;
}

.field .stepper input {
  width: 5.5rem;
  flex: 0 0 auto;
  text-align: center;
  font-size: 1.125rem;
  -moz-appearance: textfield;
}

.stepper input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper-btn {
  width: 2.75rem;
  min-height: 2.75rem;
  flex-shrink: 0;
  font-size: 1.4rem;
  line-height: 1;
  font-family: inherit;
  color: var(--accent-dark);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  cursor: pointer;
}

.stepper-btn:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.stepper-btn[hidden] {
  display: none;
}

.stepper-btn:first-child {
  margin-right: 0.5rem;
}

.stepper-btn:last-child {
  margin-left: 0.5rem;
}

.stepper-btn:disabled {
  color: var(--muted);
  cursor: default;
}

.steps-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Narrow screens: only the current step is named; the others show their
   number, which is still read out because the label is only hidden visually. */
@media (max-width: 480px) {
  .steps li:not(.current) {
    flex: 0 0 auto;
    padding-right: 0.75rem;
  }

  .steps li.current {
    flex: 1 1 auto;
  }

  .steps li:not(.current) .steps-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
}

/* ---- Admin ---- */

/* The admin is an internal tool working through dense tables, so it takes
   the brand colours and type but not the buyer pages' pills, big radii and
   card frame — those cost vertical space in a long list of lots. */

body.admin .btn,
body.admin .btn-sec,
body.admin button.btn,
body.admin button.btn-sec,
body.admin a.btn,
body.admin a.btn-sec {
  padding: 0.65rem 1.1rem;
  font-weight: 600;
  border-radius: var(--radius);
  box-shadow: none;
}

body.admin .wrap {
  margin: 0 auto;
  padding: 1rem;
  border-radius: 0;
  box-shadow: none;
}

body.admin .hdr nav a {
  margin-right: 1rem;
  font-weight: 600;
  white-space: nowrap;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.inline {
  display: inline;
}

.danger {
  color: var(--err);
}

.zero {
  color: var(--err);
  font-weight: 700;
}

.history {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Admin: the stored image shown next to a lot's or category's upload field. */
.thumb {
  max-width: 160px;
  max-height: 160px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  display: block;
}
