/* =========================================================
   Versa Polska – magazyn
   Kolory z logo: granat, błękit, pomarańcz.
   ========================================================= */
:root {
  --navy-900: #141b2b;
  --navy-800: #1b2438;
  --navy-700: #26314a;
  --sky-500: #60a5cd;
  --sky-100: #e6f1f8;
  --blue-600: #1f6fae;
  --blue-700: #185a8e;
  --orange-600: #d9420f;
  --orange-700: #b9370b;
  --orange-50: #fdf0eb;

  --green-700: #15803d;
  --green-50: #ecf8f0;
  --red-700: #b42318;
  --red-50: #fdeeec;
  --amber-700: #a15c07;
  --amber-50: #fdf5e6;

  --bg: #f3f5f9;
  --surface: #ffffff;
  --border: #e2e7ef;
  --border-strong: #cdd5e1;
  --text: #172033;
  --text-2: #475569;
  --muted: #6b7a90;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(20, 27, 43, .06);
  --shadow: 0 1px 3px rgba(20, 27, 43, .06), 0 6px 16px -4px rgba(20, 27, 43, .08);
  --shadow-lg: 0 10px 40px -8px rgba(20, 27, 43, .25);
  --ring: 0 0 0 4px rgba(96, 165, 205, .35);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1;
}
a { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--blue-700); text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
.icon { flex-shrink: 0; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .85em; letter-spacing: .01em; }

/* ---------- Header ---------- */
.site-header {
  background: linear-gradient(180deg, var(--navy-800), var(--navy-900));
  color: #fff; position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04), 0 4px 20px -8px rgba(0, 0, 0, .4);
}
.header-inner {
  max-width: 1160px; margin: 0 auto; padding: 0 24px; height: 72px;
  display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 14px; color: #fff; }
.brand:hover { text-decoration: none; color: #fff; }
.brand img { height: 46px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, .14); }
.brand-text strong { font-size: 14px; font-weight: 600; }
.brand-text span { font-size: 12px; color: #9fb0c8; }
.main-nav { display: flex; gap: 4px; flex: 1; }
.main-nav a {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px;
  color: #c3cede; font-weight: 500; font-size: 14px; white-space: nowrap; transition: background .15s, color .15s;
}
.main-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.main-nav a.active { background: rgba(96, 165, 205, .18); color: #fff; box-shadow: inset 0 0 0 1px rgba(96, 165, 205, .35); }
.user-menu { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--sky-500), var(--blue-600)); color: #fff; font-weight: 700; font-size: 14px; text-transform: uppercase;
}
.user-name { color: #dbe3ee; font-size: 14px; font-weight: 500; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; cursor: pointer;
  background: transparent; color: #9fb0c8; transition: background .15s, color .15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- Layout ---------- */
.page { max-width: 1160px; margin: 0 auto; padding: 32px 24px 96px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 700; }
.page-head p { margin: 6px 0 0; color: var(--text-2); }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 500; margin-bottom: 14px; font-size: 14px; }
.back-link:hover { color: var(--text); text-decoration: none; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card-body { padding: 24px; }
.card-title { font-size: 15px; font-weight: 650; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.card-title .icon { color: var(--sky-500); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 > .field { margin-bottom: 0; }
.layout-aside { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.sticky { position: sticky; top: 96px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap;
  transition: background .15s, box-shadow .15s, transform .05s, border-color .15s;
  text-decoration: none !important;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary { background: var(--blue-600); color: #fff; box-shadow: 0 1px 2px rgba(24, 90, 142, .3); }
.btn-primary:hover { background: var(--blue-700); color: #fff; }
.btn-accent { background: var(--orange-600); color: #fff; box-shadow: 0 1px 2px rgba(185, 55, 11, .3); }
.btn-accent:hover { background: var(--orange-700); color: #fff; }
.btn-success { background: var(--green-700); color: #fff; }
.btn-success:hover { background: #116632; color: #fff; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: #f7f9fc; color: var(--text); border-color: #b8c3d3; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 9px; }
.btn-lg { height: 52px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.label .opt { font-weight: 400; color: var(--muted); }
.help { font-size: 13px; color: var(--muted); margin-top: 6px; }
input[type=text], input[type=password], input[type=number], input[type=email], textarea, select {
  width: 100%; height: 46px; padding: 0 14px; font: inherit; font-size: 15px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 12px 14px; resize: vertical; min-height: 96px; }
input:hover, textarea:hover { border-color: #b3bfd0; }
input:focus, textarea:focus { outline: none; border-color: var(--sky-500); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: #9aa7b8; }
input:disabled { background: #f1f4f8; color: var(--muted); cursor: not-allowed; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.has-error input, .has-error textarea { border-color: var(--red-700); }
.errorlist { list-style: none; margin: 6px 0 0; padding: 0; color: var(--red-700); font-size: 13px; font-weight: 500; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 48px; }
.input-suffix span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }

/* Stepper −/+ */
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.stepper:focus-within { border-color: var(--sky-500); box-shadow: var(--ring); }
.stepper button {
  width: 40px; border: 0; background: #f6f8fb; color: var(--text-2); cursor: pointer; display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.stepper button:hover:not(:disabled) { background: var(--sky-100); color: var(--blue-700); }
.stepper button:disabled { opacity: .4; cursor: not-allowed; }
.stepper input {
  width: 72px; height: 44px; border: 0; border-radius: 0; text-align: center; font-weight: 700; font-size: 16px;
  box-shadow: none !important; padding: 0 4px;
}
.stepper.is-disabled { background: #f1f4f8; }
.stepper.is-changed { border-color: var(--orange-600); box-shadow: 0 0 0 3px rgba(217, 66, 15, .15); }

/* ---------- Search hero ---------- */
.search-hero { padding: 28px; margin-bottom: 24px; }
.search-box { display: flex; gap: 10px; }
.search-input { position: relative; flex: 1; }
.search-input .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-input input { height: 54px; padding-left: 48px; font-size: 17px; border-radius: 12px; }
.search-box .btn { height: 54px; padding: 0 26px; border-radius: 12px; font-size: 16px; }
.search-hint { margin-top: 12px; font-size: 13px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip-link {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: #eef2f7; color: var(--text-2);
  font-size: 13px; font-weight: 500; border: 1px solid transparent;
}
.chip-link:hover { background: var(--sky-100); color: var(--blue-700); border-color: #c6dff0; text-decoration: none; }
.results-meta { display: flex; justify-content: space-between; align-items: center; margin: 0 4px 12px; color: var(--text-2); font-size: 14px; }
.results-meta strong { color: var(--text); }

/* ---------- Tables ---------- */
.table-card { overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); background: #f8fafc; padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #fafbfd; }
.table tr.is-changed { background: var(--orange-50) !important; }
.t-center { text-align: center !important; }
.t-right { text-align: right !important; }
.product-name { font-weight: 600; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.product-name .icon { opacity: 0; color: var(--muted); transition: opacity .15s; }
a.product-name:hover { color: var(--blue-700); text-decoration: none; }
a.product-name:hover .icon { opacity: 1; }
.product-sku { display: block; margin-top: 2px; color: var(--muted); font-family: var(--mono); font-size: 12.5px; }
.price { font-weight: 700; font-size: 15px; white-space: nowrap; }
.price small { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 2px; }

/* ---------- Badges ---------- */
.stock-pill {
  display: inline-flex; align-items: center; justify-content: center; min-width: 64px; padding: 4px 10px; border-radius: 999px;
  font-weight: 700; font-size: 13.5px; white-space: nowrap;
}
.stock-pill.in { background: var(--green-50); color: var(--green-700); box-shadow: inset 0 0 0 1px rgba(21, 128, 61, .15); }
.stock-pill.out { background: #f1f4f8; color: #8794a8; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--green-700); }
.badge.no { color: var(--red-700); }
.delivery { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; color: var(--amber-700); font-weight: 500; }
.ask { display: block; margin-top: 4px; font-size: 13px; color: var(--text-2); }

/* ---------- Alerts / messages ---------- */
.messages { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 10px; }
.alert {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid; font-size: 14.5px; animation: slide-in .25s ease-out;
}
.alert .icon { margin-top: 1px; }
.alert.success { background: var(--green-50); border-color: #bfe5cc; color: #0f5a2b; }
.alert.info { background: var(--sky-100); border-color: #c6dff0; color: #164a73; }
.alert.warning { background: var(--amber-50); border-color: #f1d8a8; color: #7a4505; }
.alert.error { background: var(--red-50); border-color: #f4c7c1; color: #8f1c13; }
@keyframes slide-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: 56px 24px; }
.empty-icon {
  width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 18px; display: grid; place-items: center;
  background: var(--sky-100); color: var(--blue-600);
}
.empty-icon.warn { background: var(--orange-50); color: var(--orange-600); }
.empty h2 { font-size: 19px; margin-bottom: 8px; }
.empty p { margin: 0 auto; max-width: 440px; color: var(--text-2); }
.empty .cta { font-weight: 700; color: var(--text); font-size: 16px; margin-top: 10px; }
.empty .actions-row { margin-top: 22px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Segmented tabs ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.segmented { display: inline-flex; padding: 4px; background: #e6ebf2; border-radius: 12px; gap: 2px; }
.segmented a {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 9px;
  color: var(--text-2); font-weight: 600; font-size: 14.5px; transition: background .15s, color .15s, box-shadow .15s;
}
.segmented a:hover { color: var(--text); text-decoration: none; }
.segmented a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.segmented a.active .icon { color: var(--orange-600); }
.toolbar-search { display: flex; gap: 8px; flex: 1; max-width: 460px; }
.toolbar-search .search-input input { height: 44px; font-size: 15px; padding-left: 42px; }
.toolbar-search .search-input .icon { left: 14px; }

/* Sticky save bar */
.savebar {
  position: sticky; bottom: 16px; margin-top: 16px; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 12px 12px 20px; border-radius: 14px; background: var(--navy-800); color: #dbe3ee;
  box-shadow: var(--shadow-lg); transition: transform .2s, opacity .2s;
}
.savebar .status { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.savebar .dot { width: 10px; height: 10px; border-radius: 50%; background: #4b5b78; }
.savebar.dirty .dot { background: var(--orange-600); box-shadow: 0 0 0 4px rgba(217, 66, 15, .25); }
.savebar.dirty .status { color: #fff; font-weight: 600; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 20px; color: var(--text-2); font-size: 14px; }

/* ---------- Order ---------- */
.qty-list { display: grid; gap: 10px; }
.qty-item {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: #fbfcfe;
  transition: border-color .15s, background .15s;
}
.qty-item.is-active { border-color: #c6dff0; background: var(--sky-100); }
.qty-item.is-empty { opacity: .65; }
.qty-item .wh { display: flex; align-items: center; gap: 12px; }
.qty-item .wh-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; color: var(--blue-600); }
.qty-item .wh strong { display: block; font-size: 15px; }
.qty-item .wh small { font-size: 13px; }
.summary-list { margin: 0; display: grid; gap: 12px; }
.summary-list div { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.summary-list dt { color: var(--text-2); }
.summary-list dd { margin: 0; font-weight: 600; text-align: right; }
.summary-product { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px dashed var(--border-strong); }
.summary-product h2 { font-size: 17px; margin-bottom: 4px; }
.summary-total { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: baseline; }
.summary-total span { color: var(--text-2); font-size: 14px; }
.summary-total strong { font-size: 24px; letter-spacing: -.02em; }
.summary-note { font-size: 12.5px; color: var(--muted); margin-top: 4px; text-align: right; }

/* Thank you */
.thanks-hero { text-align: center; padding: 40px 24px 32px; }
.success-mark {
  width: 76px; height: 76px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--green-50); color: var(--green-700); box-shadow: 0 0 0 10px rgba(21, 128, 61, .07);
  animation: pop .4s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.thanks-hero h1 { font-size: 30px; margin-bottom: 8px; }
.thanks-hero p { color: var(--text-2); margin: 0; font-size: 16px; }
.order-no { display: inline-block; margin-top: 14px; padding: 6px 14px; border-radius: 999px; background: #eef2f7; font-weight: 600; font-size: 14px; color: var(--text-2); }
.addresses { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.address-card { position: relative; overflow: hidden; }
.address-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(180deg, var(--sky-500), var(--orange-600)); }
.address-card h3 { font-size: 17px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.address-card h3 .icon { color: var(--orange-600); }
.address-line { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 0; color: var(--text-2); font-size: 14.5px; }
.address-line .icon { color: var(--muted); margin-top: 2px; }
.address-line.main { color: var(--text); font-weight: 500; white-space: pre-line; }
.section-title { font-size: 18px; font-weight: 700; margin: 32px 0 14px; }

/* ---------- Login ---------- */
.auth-body {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(217, 66, 15, .22), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(96, 165, 205, .25), transparent 60%),
    var(--navy-900);
}
.auth-wrap { width: 100%; max-width: 420px; }
.auth-logo { display: block; margin: 0 auto 28px; height: 92px; width: auto; }
.auth-card { padding: 32px; border-radius: 20px; border: 0; box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 22px; margin-bottom: 6px; }
.auth-card .sub { color: var(--text-2); margin: 0 0 24px; font-size: 14.5px; }
.auth-foot { text-align: center; color: #7d8ba3; font-size: 13px; margin-top: 20px; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon input { padding-left: 44px; height: 50px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout-aside { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .user-name { display: none; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .header-inner { height: auto; padding: 12px 16px; flex-wrap: wrap; gap: 12px; }
  .brand img { height: 38px; }
  .brand-text { display: none; }
  .user-menu { margin-left: auto; }
  .main-nav { order: 3; flex-basis: 100%; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; margin: 0 -4px; }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a { padding: 8px 12px; }
  .page { padding: 20px 16px 96px; }
  .page-head h1 { font-size: 22px; }
  .search-hero { padding: 16px; }
  .search-box { flex-direction: column; }
  .grid-2 { grid-template-columns: 1fr; }
  .card-body { padding: 18px; }
  .toolbar-search { max-width: none; flex-basis: 100%; }

  /* Tabela -> karty */
  .table-responsive thead { display: none; }
  .table-responsive, .table-responsive tbody, .table-responsive tr, .table-responsive td { display: block; width: 100%; }
  .table-responsive tr { padding: 14px 16px; border-bottom: 1px solid var(--border); }
  .table-responsive tbody tr:last-child { border-bottom: 0; }
  .table-responsive td { padding: 4px 0; border: 0; text-align: left !important; }
  .table-responsive td[data-label] { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .table-responsive td[data-label]::before { content: attr(data-label); font-size: 13px; color: var(--muted); font-weight: 500; }
  .table-responsive td.cell-main { padding-bottom: 8px; }
  .table-responsive td.cell-action { padding-top: 10px; }
  .table-responsive td.cell-action .btn { width: 100%; }
  .savebar { flex-direction: column; align-items: stretch; padding: 14px; }
}

.qty-item .wh small b { white-space: nowrap; }
@media (max-width: 760px) {
  .qty-item { padding: 12px; }
  .qty-item .wh-icon { display: none; }
  .stepper input { width: 56px; }
}

.segmented a { white-space: nowrap; }
@media (max-width: 760px) {
  .segmented { display: flex; width: 100%; }
  .segmented a { flex: 1; justify-content: center; padding: 9px 8px; font-size: 13.5px; gap: 6px; }
}
@media (max-width: 400px) {
  .segmented a .icon { display: none; }
}

/* ---------- Koszyk: przycisk w nagłówku ---------- */
.cart-btn {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 12px;
  border-radius: 10px; color: #dbe3ee; font-weight: 600; font-size: 14px; background: rgba(255, 255, 255, .06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); transition: background .15s, color .15s; margin-right: 6px;
}
.cart-btn:hover, .cart-btn.active { background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none; }
.cart-badge {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--orange-600); color: #fff; font-size: 12px; font-weight: 700; transition: transform .2s;
}
.cart-badge.is-empty { background: rgba(255, 255, 255, .14); color: #9fb0c8; }
.cart-badge.bump { animation: bump .35s ease-out; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* „w koszyku: N” pod przyciskiem w wynikach */
.cell-action form { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 4px; margin: 0; }
.in-cart { font-size: 12px; color: var(--green-700); font-weight: 500; }
.in-cart.is-empty { visibility: hidden; }

/* Toasty */
.toast-region { position: fixed; top: 88px; right: 24px; z-index: 100; display: grid; gap: 10px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 16px; max-width: 380px;
  border-radius: 12px; background: var(--navy-800); color: #fff; box-shadow: var(--shadow-lg); font-size: 14px;
  animation: toast-in .25s ease-out;
}
.toast .icon { color: #6ee7a0; }
.toast.warn .icon { color: #fbbf74; }
.toast a { color: #9fd0f0; font-weight: 600; white-space: nowrap; }
.toast.hide { opacity: 0; transform: translateY(-6px); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Koszyk: strona ---------- */
.cart-list { overflow: hidden; }
.cart-line { padding: 20px 24px; border-bottom: 1px solid var(--border); }
.cart-line:last-child { border-bottom: 0; }
.cart-line-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.cart-line-price { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.cart-line-price .price { font-size: 17px; }
.cart-cells { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cart-cell {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 10px 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius); background: #fbfcfe; transition: border-color .15s, background .15s;
}
.cart-cell.is-active { border-color: #c6dff0; background: var(--sky-100); }
.cart-cell.is-empty { opacity: .6; }
.cart-cell small { display: block; font-size: 12.5px; }
.cart-cell .stepper input { width: 56px; }
.cart-cell .stepper button { width: 36px; }
.cart-line-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.link-danger {
  display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 4px 6px; border-radius: 6px;
  color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.link-danger:hover { color: var(--red-700); background: var(--red-50); }

@media (max-width: 760px) {
  .cart-label { display: none; }
  .cart-btn { padding: 0 10px; }
  .cart-line { padding: 16px; }
  .cart-cells { grid-template-columns: 1fr; }
  .toast-region { left: 16px; right: 16px; top: 120px; }
  .toast { max-width: none; }
  .cell-action form { align-items: stretch; width: 100%; }
  .in-cart { text-align: center; }
}

/* Nagłówek – więcej pozycji w menu */
.header-inner { gap: 20px; }
.brand-text span, .brand-text strong { white-space: nowrap; }
.main-nav a { padding: 9px 12px; }
@media (max-width: 1220px) { .brand-text { display: none; } }
@media (max-width: 1060px) and (min-width: 761px) { .main-nav a { padding: 9px 10px; font-size: 13.5px; } .main-nav a .icon { display: none; } }

/* ---------- Paginacja ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.pager-pages { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.pager-btn, .pager-num {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; border-radius: 10px;
  font-weight: 600; font-size: 14px; color: var(--text); text-decoration: none !important; transition: background .15s, border-color .15s;
}
.pager-btn { padding: 0 14px; background: var(--surface); border: 1px solid var(--border-strong); }
.pager-btn:hover { background: #f7f9fc; color: var(--text); border-color: #b8c3d3; }
.pager-btn.is-disabled { opacity: .45; pointer-events: none; }
.pager-num { min-width: 40px; padding: 0 8px; border: 1px solid transparent; color: var(--text-2); }
.pager-num:hover { background: var(--surface); border-color: var(--border); color: var(--text); }
.pager-num.is-current { background: var(--navy-800); color: #fff; }
.pager-ellipsis { display: inline-grid; place-items: center; min-width: 28px; color: var(--muted); }
.pager-info { text-align: center; color: var(--muted); font-size: 13px; margin: 10px 0 0; }
@media (max-width: 760px) {
  .pager-btn span { display: none; }
  .pager-btn { padding: 0 12px; }
}

.similar-note { color: var(--amber-700); }
.similar-note .icon { margin-right: 6px; vertical-align: -3px; }
.similar-note strong { color: var(--text); }

/* ---------- Lista zamówień ---------- */
.seg-count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgba(23, 32, 51, .08); font-size: 12px; display: inline-grid; place-items: center; }
.segmented a.active .seg-count { background: var(--orange-50); color: var(--orange-700); }
.order-list { overflow: hidden; }
.order-row { border-bottom: 1px solid var(--border); }
.order-row:last-child { border-bottom: 0; }
.order-row summary {
  list-style: none; cursor: pointer; display: grid; align-items: center; gap: 16px; padding: 16px 20px;
  grid-template-columns: 56px 92px minmax(120px, 1fr) minmax(160px, 1.6fr) 70px 110px 108px 20px;
  transition: background .12s;
}
.order-row summary::-webkit-details-marker { display: none; }
.order-row summary:hover { background: #fafbfd; }
.order-row[open] summary { background: #f6f8fb; border-bottom: 1px solid var(--border); }
.order-id { font-weight: 700; color: var(--text-2); font-family: var(--mono); font-size: 13.5px; }
.order-when { display: flex; flex-direction: column; font-size: 14px; line-height: 1.25; }
.order-when small { color: var(--muted); font-size: 12px; }
.order-who { font-weight: 600; }
.order-what { font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-qty { text-align: right; font-weight: 600; font-size: 14px; }
.order-sum { text-align: right; }
.chev { color: var(--muted); transition: transform .2s; display: grid; place-items: center; }
.order-row[open] .chev { transform: rotate(180deg); }
.order-detail { padding: 4px 4px 16px; background: #fbfcfe; }
.order-detail .table td, .order-detail .table th { background: transparent; }
.order-detail-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 16px 0; font-size: 14px; flex-wrap: wrap; }
.mail-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; justify-self: start; }
.mail-pill.ok { background: var(--green-50); color: var(--green-700); }
.mail-pill.no { background: var(--amber-50); color: var(--amber-700); }
.notes-cell { max-width: 260px; font-size: 14px; color: var(--text-2); }

@media (max-width: 900px) {
  .order-row summary { grid-template-columns: auto 1fr auto; gap: 6px 12px; padding: 14px 16px; }
  .order-when { flex-direction: row; gap: 6px; grid-column: 2; font-size: 13px; }
  .order-who { grid-column: 1 / 3; grid-row: 2; }
  .order-what { grid-column: 1 / 4; grid-row: 3; white-space: normal; }
  .order-qty { grid-column: 1; grid-row: 4; text-align: left; }
  .order-sum { grid-column: 2; grid-row: 4; text-align: left; }
  .mail-pill { grid-column: 3; grid-row: 1; }
  .chev { grid-column: 3; grid-row: 4; }
  .order-id { grid-row: 1; }
}

/* Nagłówek z 5 pozycjami menu */
@media (max-width: 1380px) { .brand-text, .user-name { display: none; } }
@media (max-width: 1180px) and (min-width: 761px) { .cart-label { display: none; } .cart-btn { padding: 0 10px; } }

/* ---------- Status realizacji ---------- */
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-size: 14px; font-weight: 600;
}
.chip:hover { color: var(--text); text-decoration: none; border-color: #b8c3d3; }
.chip.active { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip .dot.open { background: var(--orange-600); }
.chip .dot.done { background: var(--green-700); }
.chip.active .dot.done { background: #6ee7a0; }

.status-form { margin: 0; }
.status-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 8px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.status-btn.open { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-2); }
.status-btn.open:hover { border-color: var(--green-700); color: var(--green-700); background: var(--green-50); }
.status-btn.open .box { width: 14px; height: 14px; border: 2px solid currentColor; border-radius: 4px; }
.status-btn.done { background: var(--green-50); border: 1px solid #bfe5cc; color: var(--green-700); }
.status-btn.done small { font-weight: 500; opacity: .75; }
.status-btn.done:hover { background: #fff; border-color: var(--border-strong); color: var(--text-2); }
.status-btn:focus-visible { outline: none; box-shadow: var(--ring); }

.order-row summary { grid-template-columns: 56px 92px minmax(110px, 1fr) minmax(140px, 1.5fr) 64px 104px 100px auto 20px; }
.order-row.is-done summary .order-who, .order-row.is-done summary .order-what,
.order-row.is-done summary .order-sum, .order-row.is-done summary .order-qty { opacity: .55; }
tr.is-done td:not(:last-child) { opacity: .55; }

@media (max-width: 1100px) {
  .status-btn.open span:not(.box) { display: none; }
  .status-btn.open { padding: 0 9px; }
}
@media (max-width: 900px) {
  .order-row summary { grid-template-columns: auto 1fr auto; }
  .status-form { grid-column: 1 / 4; grid-row: 5; }
  .status-btn.open span:not(.box) { display: inline; }
  .chev { grid-row: 1; grid-column: 3; display: none; }
}

/* Stała szerokość kolumn, żeby wiersze zrealizowane się nie przesuwały */
@media (min-width: 901px) {
  .order-row summary { grid-template-columns: 48px 88px minmax(110px, 1fr) minmax(140px, 1.5fr) 64px 104px 100px 200px 20px; }
  .order-row .status-form { display: flex; justify-content: flex-end; }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .order-row summary { grid-template-columns: 48px 88px minmax(100px, 1fr) minmax(120px, 1.3fr) 60px 100px 96px 150px 20px; }
}
.table td[data-label="Ilość"] { white-space: nowrap; }

.status-badge { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.status-badge.open { background: var(--amber-50); color: var(--amber-700); }
.status-badge.done { background: var(--green-50); color: var(--green-700); }
.status-badge small { font-weight: 500; opacity: .75; }

/* „Moje” – bez kolumny e-mail, więcej miejsca na produkty */
@media (min-width: 901px) {
  .order-list.mine .order-row summary { grid-template-columns: 48px 88px minmax(110px, 1fr) minmax(200px, 2fr) 64px 110px 190px 20px; }
}

/* Telefon: filtry w jednym rzędzie, widoczna strzałka rozwijania */
@media (max-width: 760px) {
  .filter-chips { width: 100%; flex-wrap: nowrap; }
  .chip { flex: 1; justify-content: center; padding: 0 8px; font-size: 13px; gap: 5px; }
}
@media (max-width: 900px) {
  .order-row summary .chev { display: grid; grid-column: 3; grid-row: 4; }
  .order-list.mine .status-form { grid-column: 1 / 4; grid-row: 5; }
}

/* Telefon: stały pasek „Zamów” w koszyku */
.mobile-checkout { display: none; }
@media (max-width: 900px) {
  .mobile-checkout {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; bottom: 12px; z-index: 30; padding: 10px 10px 10px 16px; border-radius: 14px;
    background: var(--navy-800); color: #fff; box-shadow: var(--shadow-lg);
  }
  .mobile-checkout small { display: block; color: #9fb0c8; font-size: 12px; }
  .mobile-checkout strong { font-size: 18px; }
  .layout-aside > aside .btn-block { display: none; }
}
