/* Site platform: the upload indicator and banner, the site dialog, consent checkboxes, the cart, checkout and
   order pages (cart.js, uploads.js, the home form in app.js). Colours and type follow style.css. */

/* ---- Helpers ---- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
/* The honeypot field: people never see it, simple bots fill it in. */
.hp-field {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.link-button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.file-button {
  position: relative;
  cursor: pointer;
}
.file-button:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.form-message,
.form-error,
.field-error {
  color: #b3261e;
  font-size: 14px;
  line-height: 1.6;
  margin: 6px 0 0;
}
.form-message:empty,
.form-error:empty,
.field-error:empty {
  display: none;
}

/* ---- Header: upload status, banner about an order's missing files ---- */
.upload-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  line-height: 1.4;
  padding: 7px 12px;
  border-radius: 20px;
  background: #fff4f1;
  color: var(--ink);
  white-space: nowrap;
}
.upload-indicator button {
  border: 1px solid #d5d7d9;
  background: #fff;
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 12px;
  white-space: nowrap;
}
.site-banner {
  margin: 0 5% 10px;
  padding: 14px 18px;
  border-radius: 10px;
  background: #fff4f1;
  border: 1px solid #f7c7bb;
  font-size: 14px;
  line-height: 1.6;
}
.site-banner p {
  margin: 0;
}
.site-banner a {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* Narrower than a wide screen the indicator gets a line of its own under the header, on the right, so the city
   and the cart link are never squeezed. The empty full-width ::after makes the line break; without the
   indicator that line has no height. */
@media (min-width: 801px) and (max-width: 1399px) {
  header {
    flex-wrap: wrap;
    row-gap: 0;
  }
  header::after {
    content: '';
    order: 3;
    flex-basis: 100%;
  }
  /* With wrapping on, the search narrows instead of pushing the cart link to the next line. */
  .search {
    flex: 1 1 120px;
    width: auto;
    max-width: 300px;
  }
  .upload-indicator {
    order: 4;
    margin: 12px 0 0 auto;
  }
}
@media (max-width: 800px) {
  .upload-indicator {
    order: 4;
    width: 100%;
    border-radius: 8px;
    font-size: 12px;
    white-space: normal;
  }
}

/* ---- Dialog (consent before uploads, «Добавлено в корзину») ---- */
dialog.site-dialog {
  max-width: 520px;
}
.site-dialog h2 {
  font-size: 24px;
  margin: 0 0 14px;
}
.site-dialog p {
  font-size: 15px;
  line-height: 1.7;
  margin: 0 0 12px;
}
.site-dialog .consent-links {
  margin: 6px 0 12px 30px;
  font-size: 13px;
}
.nowrap {
  white-space: nowrap;
}
.site-dialog .dialog-note {
  font-size: 14px;
  color: var(--muted);
}
.added-title {
  font-weight: 700;
}
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

/* ---- Consent checkbox (dialog, checkout, home form) ---- */
.consent-check,
.form-field > label.consent-check,
.order-help label.consent-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.6;
  cursor: pointer;
}
.consent-check input,
.order-help .consent-check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--accent);
}
.consent-links {
  font-size: 13px;
  margin: 8px 0 0 30px;
  color: var(--muted);
}
.consent-links a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.order-help .consent-check {
  font-size: 13px;
  margin-bottom: 0;
}
.order-help .consent-links {
  margin-bottom: 16px;
}
.order-help small {
  color: var(--muted);
}

/* ---- Cart ---- */
.cart-loading {
  color: var(--muted);
  font-size: 15px;
}
.cart-error p {
  font-size: 15px;
  line-height: 1.7;
}
.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 30px;
  align-items: start;
}
.cart-items {
  display: grid;
  gap: 16px;
}
.cart-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.cart-item.no-image {
  grid-template-columns: minmax(0, 1fr) auto;
}
.cart-item.is-busy {
  opacity: 0.6;
  pointer-events: none;
}
.cart-item-image {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--paper);
}
.cart-item h2 {
  font-size: 18px;
  letter-spacing: 0;
  margin: 0 0 10px;
}
.cart-item h2 a:hover {
  color: var(--accent);
}
.cart-lines {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.6;
}
.cart-lines div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.cart-lines dt {
  color: var(--muted);
}
.cart-lines dt::after {
  content: ':';
}
.cart-lines dd {
  margin: 0;
}
.cart-quantity {
  font-size: 14px;
  font-weight: 700;
  margin: 6px 0 10px;
}
.cart-qty {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  margin: 8px 0 12px;
}
.cart-qty select {
  padding: 8px 10px;
  border: 1px solid #d5d7d9;
  border-radius: 6px;
  background: #fff;
}
.cart-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d5d7d9;
  border-radius: 8px;
  overflow: hidden;
}
.cart-stepper button {
  border: 0;
  background: #fff;
  width: 38px;
  height: 38px;
  font-size: 18px;
}
.cart-stepper button:disabled {
  color: #c3c5c0;
  cursor: default;
}
.cart-stepper input {
  width: 70px;
  height: 38px;
  border: 0;
  border-left: 1px solid #d5d7d9;
  border-right: 1px solid #d5d7d9;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}
.cart-stepper input::-webkit-outer-spin-button,
.cart-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.cart-files {
  margin: 10px 0 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.6;
}
.cart-files p {
  margin: 0 0 6px;
}
.files-count {
  margin: 0 0 6px;
}
.files-done {
  color: #2e7d32;
  font-weight: 700;
  margin: 0;
}
.files-done::before {
  content: '✓ ';
}
.files-bar {
  height: 6px;
  border-radius: 3px;
  background: #ecece6;
  overflow: hidden;
  margin: 4px 0 8px;
}
.files-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.3s;
}
.files-rejected {
  list-style: none;
  padding: 0;
  margin: 6px 0;
}
.files-rejected li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 14px;
  color: #b3261e;
  padding: 4px 0;
}
.files-failed {
  color: #b3261e;
}
.files-reselect {
  margin: 8px 0;
}
.files-reselect .btn {
  padding: 10px 16px;
}
.files-reselect-result {
  margin-top: 8px;
}
.cart-files .files-reselect-result:empty {
  margin: 0;
}
.files-note {
  line-height: 1.6;
}
.files-list summary {
  cursor: pointer;
  font-weight: 600;
  margin-top: 6px;
}
.files-list ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  max-height: 320px;
  overflow: auto;
}
.files-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
}
.files-list li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.files-list li small {
  color: var(--muted);
  white-space: nowrap;
}
.files-list label {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.files-list input {
  width: 64px;
  padding: 5px 6px;
  border: 1px solid #d5d7d9;
  border-radius: 6px;
}
.cart-comment-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 10px 0 4px;
}
.cart-comment {
  width: 100%;
  font: inherit;
  font-size: 14px;
  padding: 9px 11px;
  border: 1px solid #d5d7d9;
  border-radius: 6px;
  resize: vertical;
}
.cart-problem,
.cart-blocker {
  color: #b3261e;
  font-size: 14px;
  line-height: 1.6;
  margin: 8px 0;
}
.cart-item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  text-align: right;
  min-width: 120px;
}
.cart-price {
  font-size: 19px;
  white-space: nowrap;
}
.cart-price-changed {
  font-size: 12px;
  color: var(--muted);
}
.cart-price-request {
  font-size: 14px;
  color: var(--muted);
  max-width: 160px;
}
.cart-remove {
  font-size: 13px;
  color: var(--muted);
}
.cart-summary {
  position: sticky;
  top: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.cart-summary h2 {
  font-size: 22px;
  margin: 0 0 12px;
}
.cart-total {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  margin: 0 0 12px;
}
.cart-summary .btn {
  width: 100%;
  margin: 8px 0 4px;
}
.cart-summary .btn:disabled {
  background: #c3c5c0;
  cursor: not-allowed;
}
.cart-hint {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
.cart-notes {
  margin: 16px 0 0;
  padding: 14px 0 0 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}
.cart-last-order {
  font-size: 15px;
  margin: 0 0 18px;
}
.cart-last-order a {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- Checkout ---- */
.checkout-form {
  max-width: 640px;
}
.checkout-form h2 {
  font-size: 22px;
  margin: 26px 0 12px;
}
.checkout-form h2:first-child {
  margin-top: 0;
}
.form-field {
  margin: 0 0 14px;
}
.form-field > label {
  display: block;
  font-size: 14px;
  margin: 0 0 6px;
}
.form-field > label small {
  color: var(--muted);
}
.form-field input:not([type='checkbox']),
.form-field textarea {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 12px;
  border: 1px solid #d5d7d9;
  border-radius: 6px;
  background: #fff;
  resize: vertical;
}
.form-field [aria-invalid='true'] {
  border-color: #b3261e;
}
.field-hint {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}
.checkout-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0 0 8px;
}
.consent-field {
  margin-top: 22px;
}
.checkout-form .btn {
  margin-top: 14px;
  min-width: 240px;
}
.checkout-form .btn:disabled {
  background: #c3c5c0;
  cursor: not-allowed;
}
.checkout-items {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.5;
}
.checkout-items li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.checkout-items small {
  display: block;
  color: var(--muted);
}
.checkout-items b {
  white-space: nowrap;
  font-weight: 600;
}
.checkout-summary a {
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- Order (thank-you and status) ---- */
.order-page {
  max-width: 850px;
}
.order-facts {
  margin: 20px 0;
  padding: 18px 20px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.7;
}
.order-facts p {
  margin: 0 0 6px;
}
.order-page h2 {
  font-size: 22px;
  margin: 28px 0 10px;
}
.order-files {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  font-size: 15px;
}
.order-files li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 8px 0;
}
.order-files .files-bar {
  grid-column: 1 / -1;
  margin: 0;
}
.order-warning {
  padding: 12px 16px;
  border-radius: 8px;
  background: #fff4f1;
  font-size: 15px;
  line-height: 1.6;
}
.order-page .files-reselect p {
  font-size: 15px;
  line-height: 1.7;
}

@media (max-width: 800px) {
  .cart-layout {
    grid-template-columns: 1fr;
  }
  .cart-summary {
    position: static;
  }
  .cart-item {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px 14px;
    padding: 16px;
  }
  .cart-item.no-image {
    grid-template-columns: 1fr;
  }
  .cart-item-image {
    width: 64px;
    height: 64px;
  }
  .cart-item-side {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }
  .checkout-form .btn {
    width: 100%;
  }
}
