/* Taplix — страница заказа. Использует переменные из styles.css. */

.order-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 24px; align-items: start; }
.panel { padding: 26px 24px; background: linear-gradient(180deg, var(--surface), var(--deep)); border: 1px solid var(--line); border-radius: 22px; }
.panel h2 { font-size: 1.35rem; margin-bottom: 4px; }
.panel .sub { color: var(--muted); font-size: .93rem; margin-bottom: 20px; }
.cart-panel { position: sticky; top: calc(var(--header-h) + 16px); }

.field { display: grid; gap: 8px; margin-top: 20px; }
.field > .label, .field > legend { padding: 0; font-weight: 800; font-size: .92rem; }
fieldset.field { border: 0; margin: 20px 0 0; padding: 0; min-width: 0; }
.field .hint { color: var(--muted); font-size: .85rem; }
.field .error { min-height: 1.2em; color: var(--danger); font-size: .88rem; font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { position: relative; display: block; }
.tile input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.tile > span { display: grid; gap: 2px; align-content: center; min-height: 76px; padding: 12px 14px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line-strong); border-radius: 14px; transition: border-color .2s, background-color .2s; }
.tile strong { font-size: 1rem; }
.tile small { color: var(--muted); font-size: .8rem; line-height: 1.3; }
.tile input:checked + span { background: rgba(23, 140, 255, .16); border-color: var(--light); box-shadow: 0 0 0 1px var(--light) inset; }
.tile input:focus-visible + span { outline: 3px solid var(--light); outline-offset: 2px; }
.tiles.two { grid-template-columns: repeat(2, 1fr); }
.tiles.col { grid-template-columns: 1fr; }
.tiles.col .tile > span { min-height: 0; }

.text-input, .qty-input { width: 100%; min-height: 48px; padding: 0 14px; color: var(--text); background: var(--navy); border: 1px solid var(--line-strong); border-radius: 12px; }
.text-input::placeholder { color: var(--muted); opacity: .8; }
.text-input:focus, .qty-input:focus { border-color: var(--light); outline: none; box-shadow: 0 0 0 3px rgba(85, 200, 255, .25); }
[aria-invalid="true"] { border-color: var(--danger); }

.qty-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: var(--navy); }
.stepper button { width: 46px; min-height: 46px; padding: 0; font-size: 1.3rem; font-weight: 800; color: var(--text); background: transparent; border: 0; }
.stepper button:hover { background: var(--surface); }
.stepper .qty-input { width: 76px; border: 0; border-radius: 0; text-align: center; font-weight: 800; }
.stepper .qty-input:focus { box-shadow: none; background: var(--surface); }
.quick { display: flex; gap: 8px; }
.quick button { min-width: 48px; min-height: 46px; padding: 0 14px; font-weight: 800; color: var(--text); background: rgba(255, 255, 255, .03); border: 1px solid var(--line-strong); border-radius: 12px; }
.quick button:hover { border-color: var(--light); }

.preview { margin-top: 20px; padding: 14px 16px; font-size: .92rem; color: var(--muted); background: rgba(255, 255, 255, .03); border: 1px dashed var(--line-strong); border-radius: 12px; }
.preview strong { color: var(--text); }
.add-actions { margin-top: 22px; }

/* ---- Корзина ----------------------------------------------------------- */
.empty-cart { padding: 28px 12px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 14px; }
.cart-list { display: grid; gap: 12px; }
.cart-item { display: grid; gap: 10px; padding: 14px; background: var(--navy); border: 1px solid var(--line); border-radius: 14px; }
.cart-item-head { display: flex; justify-content: space-between; gap: 12px; }
.cart-item-title { font-weight: 800; overflow-wrap: anywhere; }
.cart-item-meta { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.cart-item-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.cart-item .stepper button { width: 40px; min-height: 44px; }
.cart-item .stepper .qty-input { width: 64px; min-height: 44px; }
.cart-item .sum { font-weight: 800; }
.remove-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; font-size: 1.3rem; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 10px; }
.remove-btn:hover { color: var(--danger); border-color: var(--danger); }
.item-error { color: var(--danger); font-size: .85rem; font-weight: 600; }

.summary { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-strong); display: grid; gap: 8px; }
.summary-row { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: .95rem; }
.summary-row span:last-child { color: var(--text); font-weight: 700; text-align: right; }
.summary-row.save span:last-child { color: var(--ok); }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.summary-total .name { font-weight: 800; }
.summary-total output { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; }
.delivery-note { margin-top: 4px; padding: 12px 14px; color: var(--muted); font-size: .88rem; background: rgba(85, 200, 255, .07); border: 1px solid rgba(85, 200, 255, .25); border-radius: 12px; }
.submit-area { display: grid; gap: 10px; margin-top: 18px; }
.submit-area .hint { color: var(--muted); font-size: .85rem; }
.summary-text { width: 100%; min-height: 120px; padding: 12px; font: .82rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--muted); background: var(--navy); border: 1px solid var(--line); border-radius: 12px; resize: vertical; }
.status { min-height: 1.2em; color: var(--ok); font-size: .88rem; font-weight: 600; }
details.copy-box { margin-top: 4px; }
details.copy-box summary { min-height: 44px; display: flex; align-items: center; color: var(--light); font-weight: 700; cursor: pointer; }
.order-notes { display: grid; gap: 10px; margin-top: 26px; }

@media (max-width: 980px) {
  .order-layout { grid-template-columns: 1fr; }
  .cart-panel { position: static; }
}
@media (max-width: 520px) {
  .tiles { grid-template-columns: 1fr; }
  .tile span { min-height: 0; }
  .panel { padding: 22px 18px; }
  .summary-total output { font-size: 1.6rem; }
}
