/* Colors and fonts follow the main site biuu.pl (styles.css). */
:root {
  --ink: #1f1a24;
  --ink-soft: #5a5263;
  --bg: #fbf9f7;
  --bg-alt: #f3eef0;
  --card: #fff;
  --line: #e6dfe3;
  --berry: #6b5b95;
  --berry-dark: #4e4170;
  --gold-text: #7f6024;
  --danger: #b42318;
  --ok-bg: #e8f5ec;
  --ok-ink: #116932;
  --radius: 14px;
  --serif: "Cormorant Garamond", "Playfair Display", Didot, "Bodoni 72", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font: 16px/1.55 var(--sans); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--berry); }
a:hover { color: var(--berry-dark); }
h1, h2 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); }
p { margin: 0 0 1em; }
.muted { color: var(--ink-soft); }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.page { padding-block: 24px 48px; min-height: 70vh; }

/* header */
.top { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 10; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.brand { color: #fff; text-decoration: none; font: 500 1.5rem var(--serif); }
.brand:hover { color: #fff; }
.brand em { color: #c9a35a; }
.brand-tag { font: 600 .7rem var(--sans); text-transform: uppercase; letter-spacing: .1em; margin-left: 8px; padding: 2px 6px; border: 1px solid #ffffff55; border-radius: 6px; vertical-align: middle; }
.menu { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.menu a, .menu .link { color: #fff; text-decoration: none; font-size: .95rem; }
.menu a:hover, .menu .link:hover { text-decoration: underline; color: #fff; }
.foot { color: var(--ink-soft); font-size: .85rem; padding-block: 24px; border-top: 1px solid var(--line); }

/* forms and buttons */
.inline { display: inline; margin: 0; }
.btn { display: inline-block; border: 0; border-radius: 10px; padding: 10px 18px; background: var(--berry); color: #fff; font: 600 .95rem var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--berry-dark); color: #fff; }
.btn.ghost { background: transparent; color: var(--berry); border: 1px solid var(--berry); }
.btn.ghost:hover { background: var(--bg-alt); color: var(--berry-dark); }
.btn.danger { background: var(--danger); }
.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.field { display: grid; gap: 4px; margin-bottom: 14px; }
.field > span { font-weight: 600; font-size: .9rem; }
.password { position: relative; }
.password input { padding-right: 48px; }
.password input::-ms-reveal { display: none; }
.password .reveal { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 8px; padding: 0; background: transparent; color: var(--ink-soft); cursor: pointer; }
.password .reveal::before { content: ""; display: block; width: 20px; height: 20px; margin: auto; background: currentColor; mask: url(/img/oko.svg) center / contain no-repeat; }
.password .reveal[aria-pressed="true"]::before { mask-image: url(/img/oko-ukryj.svg); }
.password .reveal:hover { background: var(--bg-alt); color: var(--berry); }
input, select, textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--berry); outline-offset: 1px; }
.check { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; }
.check input { width: auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.narrow { max-width: 460px; margin: 24px auto; }
.error { color: var(--danger); background: #fdecea; border-radius: 10px; padding: 10px 14px 10px 28px; }
p.error { padding-left: 14px; }
.flash { background: var(--ok-bg); color: var(--ok-ink); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; }
.danger-zone { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }

/* catalog */
.head-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.filters input { flex: 2 1 220px; width: auto; }
.filters select { flex: 1 1 180px; width: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 16px; }
.tile { display: grid; grid-template-rows: 1fr auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tile:hover { border-color: var(--berry); }
.tile-link { position: relative; display: grid; align-content: start; text-decoration: none; color: var(--ink); }
.tile-link:hover { color: var(--ink); }
.tile-order { padding: 0 12px 12px; }
.tile img { aspect-ratio: 1; object-fit: cover; width: 100%; background: var(--bg-alt); }
.tile-name { padding: 10px 12px 0; font-weight: 600; }
.tile-meta { display: flex; justify-content: space-between; gap: 8px; padding: 4px 12px 12px; color: var(--ink-soft); font-size: .9rem; }
.tile-meta strong { color: var(--gold-text); }
.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.product img { border-radius: var(--radius); background: var(--bg-alt); width: 100%; aspect-ratio: 1; object-fit: contain; }
.product-photo { position: relative; display: block; align-self: start; cursor: zoom-in; }
.zoom-hint { position: absolute; right: 10px; bottom: 10px; padding: 4px 10px; border-radius: 99px; background: rgb(31 26 36 / .7); color: #fff; font-size: .8rem; text-decoration: none; }
.line-photo { cursor: zoom-in; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; }
.admin-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 16px 0; }
.admin-edit .badge { margin: 0; }
.admin-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 16px 0; }
.admin-edit .badge { margin: 0; }
.facts strong { color: var(--gold-text); font-size: 1.2rem; }
.desc { margin-top: 20px; }
@media (max-width: 720px) { .product { grid-template-columns: 1fr; gap: 16px; } }

/* admin */
.rows { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.row > a, .row > div:first-child { flex: 1; min-width: 0; display: grid; text-decoration: none; color: var(--ink); }
.row > a.line-photo { flex: none; display: block; }
.row img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--bg-alt); }
.row.off { opacity: .55; }
.row .price { color: var(--gold-text); font-weight: 600; white-space: nowrap; }
.row .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { justify-self: start; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--bg-alt); margin-top: 4px; }
.status-blocked { opacity: .6; }
.stack { display: grid; gap: 0; max-width: 640px; }
.photo { display: flex; gap: 16px; align-items: end; flex-wrap: wrap; margin-bottom: 14px; }
.photo img { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; }
.photo .field { flex: 1; margin: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
table.log { border-collapse: collapse; width: 100%; font-size: .85rem; }
.log th, .log td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.log th { background: var(--bg-alt); }
.log tr.bad td { background: #fdf3f2; }
.log .path { word-break: break-all; font-family: ui-monospace, Consolas, monospace; }
.log .details { display: block; white-space: pre-wrap; word-break: break-all; font-size: .8rem; color: var(--ink-soft); margin-top: 4px; }
.nowrap { white-space: nowrap; }
.htmx-request #lista, #lista.htmx-request { opacity: .5; transition: opacity .2s; }

/* access codes */
h2 { font-size: 1.5rem; margin-top: .2em; }
.card + .card, .head-row + .card, .flash + .card, .rows + .card { margin-top: 16px; }
.small { font-size: .88rem; }
.center { text-align: center; }
.center form { display: flex; justify-content: center; margin: 20px 0 8px; }
.btn.big { font-size: 1.1rem; padding: 14px 28px; }
.code-input { font: 600 1.4rem ui-monospace, Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; text-align: center; }
.code-big { font: 700 clamp(2rem, 9vw, 2.8rem) ui-monospace, Consolas, monospace; letter-spacing: .1em; margin: 8px 0 12px; color: var(--berry-dark); }
.steps { text-align: left; display: inline-block; margin: 0 0 8px; }
.invite { border-color: var(--ok-ink); background: var(--ok-bg); }
.message { white-space: pre-wrap; word-break: break-word; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font: .95rem/1.5 var(--sans); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.wa { background: #15803d; }
.btn.wa:hover { background: #116932; }
.row .actions, .row > form { flex-shrink: 0; }

/* orders */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.qty { display: flex; align-items: center; gap: 6px; margin: 0; }
.qty .btn.add { width: 100%; }
.qty .step { padding: 8px 0; width: 40px; font-size: 1.1rem; line-height: 1; }
.qty input { width: 64px; text-align: center; padding: 8px 4px; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button, .qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.tile-order .qty.has input { flex: 1; }
.htmx-request.qty { opacity: .6; }
.product-order { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 20px; }
.count { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 99px; background: #c9a35a; color: var(--ink); font-size: .78rem; font-weight: 700; line-height: 1.5; }
/* Order lines: the staff picks the goods by the photo, so the photo is large.
   Desktop: photo on the left, all other parts stacked on the right. Phone: photo at full width on top. */
.lines .row { display: grid; grid-template-columns: clamp(200px, 30vw, 280px) minmax(0, 1fr); column-gap: 16px; row-gap: 8px; align-items: start; }
.lines .row > .line-photo { grid-column: 1; grid-row: 1 / span 6; }
.lines .row > :not(.line-photo) { grid-column: 2; min-width: 0; }
.lines .row > div:nth-child(2) { display: grid; gap: 2px; }
.lines .row > .price { justify-self: end; font-size: 1.05rem; }
.lines .row > form.inline { justify-self: start; }
.lines .row img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 10px; }
@media (max-width: 520px) {
  .lines .row { grid-template-columns: minmax(0, 1fr); }
  .lines .row > .line-photo, .lines .row > :not(.line-photo) { grid-column: 1; grid-row: auto; }
  .lines .row > .line-photo { max-width: 360px; width: 100%; justify-self: center; }
}
.total { text-align: right; margin: 14px 0 0; font-size: 1.1rem; }
.total strong { color: var(--gold-text); }
.pre { white-space: pre-wrap; }
.qty-admin { width: 80px; text-align: center; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { padding: 6px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--card); text-decoration: none; font-size: .9rem; }
.chip.on { background: var(--berry); border-color: var(--berry); color: #fff; }
.order-submitted { border-color: var(--gold-text); }
.order-submitted .badge, .badge.order-submitted { background: #fbf1dc; color: var(--gold-text); }
.order-confirmed .badge, .badge.order-confirmed { background: var(--ok-bg); color: var(--ok-ink); }
.order-done, .order-cancelled { opacity: .7; }
.card + .danger-zone, .card + form.danger-zone { margin-top: 24px; }
@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile-name { padding: 8px 10px 0; font-size: .92rem; }
  .tile-meta { padding: 2px 10px 10px; font-size: .82rem; flex-wrap: wrap; }
  .tile-order { padding: 0 8px 10px; }
  .qty { gap: 4px; }
  .qty .step { width: 32px; }
  .qty input { width: 0; min-width: 0; flex: 1; }
}
.badge.out { background: #fdecea; color: var(--danger); }
.badge.new, .flash.new { background: #fbf1dc; color: var(--gold-text); }
.badge.fresh { background: var(--berry); color: #fff; }
.tile-fresh { position: absolute; top: 8px; left: 8px; margin: 0; box-shadow: 0 1px 3px rgb(0 0 0 / .25); }
.flash.new a { color: var(--gold-text); font-weight: 600; }
.row.off .price { text-decoration: line-through; }
.line-edit { display: flex; align-items: center; gap: 10px; }
.line-edit .check { margin: 0; font-size: .9rem; }
.history { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.history li { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; padding: 6px 10px; border-radius: 8px; }
.history li.new { background: #fbf1dc; }
.history .who { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 1px 6px; border-radius: 6px; background: var(--bg-alt); }
.history .who.client { color: var(--berry-dark); }
.history .who.admin { color: var(--ink-soft); }
/* variants and line notes */
.variant { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 6px; background: var(--bg-alt); color: var(--berry-dark); font-size: .85rem; font-weight: 600; }
.qty { flex-wrap: wrap; }
.qty .line-note { flex: 1 0 100%; padding: 6px 10px; font-size: .88rem; text-align: left; }
.variant-pick select { flex: 1; min-width: 0; width: auto; padding: 8px 6px; }
.variant-pick .btn.add { width: auto; flex: 0 0 auto; }
.in-order { margin: 6px 0 0; color: var(--ink-soft); }
.variants { margin-top: 20px; }
.variants h2 { font-size: 1.2rem; }
.variants .row > div:first-child { flex: 1; }
.line-edit { flex-wrap: wrap; }
.line-edit .line-note { flex: 1 0 160px; padding: 6px 10px; font-size: .88rem; }
.field small { font-size: .82rem; }
/* bulk photo import */
.import-status { margin-top: 20px; }
.import-progress { font-weight: 600; }
.import-log { font-size: .88rem; max-height: 320px; overflow-y: auto; padding-left: 28px; }
.import-log .ok { color: var(--ok-ink); }
.import-log .duplicate { color: var(--ink-soft); }
.import-log .error { background: none; padding: 0; }
.btn:disabled { opacity: .5; cursor: wait; }
.reviews { display: grid; gap: 12px; }
.review { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 16px; align-items: start; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.review-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--bg-alt); }
.review-fields { display: grid; gap: 6px; align-content: start; }
.review-fields .field { margin-bottom: 6px; }
.review-fields .error { margin: 0; }
.review.done { grid-template-columns: 96px minmax(0, 1fr); border-color: var(--ok-ink); background: var(--ok-bg); }
.review.gone { display: block; opacity: .7; }
.htmx-request.review { opacity: .6; }
@media (max-width: 520px) { .review { grid-template-columns: 1fr; } }
@media (pointer: fine) { .menu .pair-link { display: none; } }
.qty .step:disabled { opacity: .35; cursor: default; }
.menu .who { color: #ffffffcc; font-size: .9rem; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.in-stock { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--ink-soft); }
.in-stock .qty-admin { width: 96px; }
.in-stock > span { min-width: 3.2em; }
.in-stock .qty-admin::placeholder { font-size: .8rem; }
.section-title { margin: 24px 0 12px; }
/* Photo viewer (app.js, a[data-zoom]): the full photo on the same page. */
.zoom { padding: 0; border: 0; margin: 0; width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; background: rgb(15 12 18 / .96); color: #fff; }
.zoom::backdrop { background: rgb(15 12 18 / .85); }
.zoom-body { width: 100%; height: 100%; overflow: auto; display: grid; place-items: center; }
.zoom-body img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; }
.zoom.full .zoom-body { display: block; }
.zoom.full .zoom-body img { max-width: none; max-height: none; cursor: zoom-out; }
.zoom-close { position: fixed; top: 12px; right: 12px; z-index: 1; width: 44px; height: 44px; border: 0; border-radius: 99px; background: rgb(255 255 255 / .9); color: var(--ink); font-size: 1.2rem; cursor: pointer; }
.zoom-tip { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); margin: 0; padding: 4px 12px; border-radius: 99px; background: rgb(0 0 0 / .55); font-size: .85rem; white-space: nowrap; pointer-events: none; }
html.zoom-open { overflow: hidden; }
