/* ==========================================================================
   LUX storefront — additions on top of the design stylesheet
   ========================================================================== */
[hidden] { display: none !important; }
.muted { color: var(--muted); }

/* ---------- My catalog pick ---------- */
.product__pick { position: absolute; top: 18px; right: 18px; z-index: 2; cursor: pointer; }
.product__pick input { position: absolute; opacity: 0; pointer-events: none; }
.product__pick span:not(.visually-hidden) {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .92); border: 2px solid color-mix(in srgb, var(--c) 45%, #fff);
  color: transparent; box-shadow: var(--shadow-sm); transition: background .2s, border-color .2s, color .2s, transform .15s;
}
.product__pick span .icon { width: 18px; height: 18px; stroke-width: 3; }
.product__pick:hover span:not(.visually-hidden) { border-color: var(--c); color: color-mix(in srgb, var(--c) 40%, #fff); }
.product__pick input:checked + span { background: var(--c); border-color: var(--c); color: #fff; }
.product__pick input:focus-visible + span { outline: 3px solid rgba(44, 154, 108, .5); }
.product__pick input:disabled + span { transform: scale(.92); opacity: .7; }

.product__unavailable {
  display: flex; align-items: center; justify-content: center; width: 100%;
  min-height: 42px; padding: .65em 1.1em; border-radius: 999px;
  background: #e4e9e6; color: #6b7872; font-weight: 800; font-size: .85rem; line-height: 1.2;
}

/* ---------- Catalog view switch ---------- */
.view-switch-row {
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap; margin-bottom: 22px;
}
.view-switch {
  display: inline-flex; gap: 4px; padding: 5px;
  border-radius: 999px; background: #fff; border: 1.5px solid var(--line);
}
.view-switch__setup {
  font-weight: 700; font-size: .9rem; color: var(--g700);
}
.view-switch__setup:hover { text-decoration: underline; }
.picker-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 22px; padding: 14px 18px; border-radius: 16px;
  background: #fff; border: 1.5px solid var(--line); font-weight: 600;
}
.picker-bar b { color: var(--g700); font-weight: 900; }
.view-switch__item {
  display: inline-flex; align-items: center; gap: 8px; padding: .65em 1.25em; border-radius: 999px;
  font-weight: 700; font-size: .92rem; color: var(--muted); transition: background .2s, color .2s;
}
.view-switch__item .icon { width: 18px; height: 18px; }
.view-switch__item:hover { color: var(--g700); }
.view-switch__item.is-active { background: var(--g700); color: #fff; }
.view-switch__count {
  min-width: 24px; padding: .1em .55em; border-radius: 999px; text-align: center;
  font-size: .78rem; background: var(--g100); color: var(--g700);
}
.view-switch__item.is-active .view-switch__count { background: rgba(255, 255, 255, .2); color: #fff; }
.view-switch__tools {
  margin-left: auto; display: flex; align-items: center; gap: 14px;
}
.layout-switch {
  display: inline-flex; gap: 4px; padding: 4px;
  border-radius: 14px; background: #fff; border: 1.5px solid var(--line);
}
.layout-switch__item {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 10px; color: var(--muted); transition: background .2s, color .2s;
}
.layout-switch__item .icon { width: 18px; height: 18px; }
.layout-switch__item:hover { color: var(--g700); background: var(--g50); }
.layout-switch__item.is-active { background: var(--g700); color: #fff; }

/* ---------- Scrollable category list ---------- */
@media (min-width: 1025px) {
  .sidebar__cats .cat-list {
    /* Seven single-line rows: padding .7em*2 + line-height 1.55 at .92rem, plus the 3px gaps. */
    max-height: calc(7 * 2.714rem + 6 * 3px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--g300) transparent;
  }
}

/* ---------- Catalog table ---------- */
.catalog--table { grid-template-columns: minmax(0, 1fr); }
.catalog--table .cat-group { margin: 0; }
.sheet-scroll {
  overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: #fff;
}
.sheet { width: 100%; min-width: 760px; border-collapse: collapse; table-layout: fixed; }
.sheet thead th:nth-child(1), .sheet td:nth-child(1) { width: 64px; }
.sheet thead th:nth-child(3), .sheet td:nth-child(3) { width: 110px; }
.sheet thead th:nth-child(4), .sheet td:nth-child(4) { width: 120px; }
.sheet thead th:nth-child(5), .sheet td:nth-child(5) { width: 230px; }
.sheet thead th {
  height: 36px; padding: 0 10px;
  background: #f7fbf9; border-bottom: 1px solid var(--line); text-align: left;
  font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
}
.sheet thead th:nth-child(n+3) { text-align: center; }
.sheet td { border-bottom: 1px solid var(--line); padding: 0 10px; vertical-align: middle; }
.sheet .product--row { display: table-row; height: 50px; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.sheet .product--row:hover { transform: none; box-shadow: none; }
.sheet .product--row td { height: 50px; max-height: 50px; overflow: hidden; }
.sheet tbody .product--row:nth-child(even) td { background: #f7fbf9; }
.sheet .product--row:hover td { background: var(--g100); }
.sheet-group__bar th { padding: 0; background: color-mix(in srgb, var(--c) 12%, #fff); border-bottom: 1px solid var(--line); }
.sheet-group__toggle {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 42px; padding: 0 12px;
  color: var(--c); font-weight: 800; text-align: left;
}
.sheet-group__toggle:hover { background: color-mix(in srgb, var(--c) 8%, transparent); }
.sheet-group__chevron { width: 18px; height: 18px; transition: transform .2s; }
.sheet-group.is-collapsed .sheet-group__chevron { transform: rotate(-90deg); }
.sheet-group.is-collapsed .product--row { display: none; }
.sheet-group__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-group__count { margin-left: auto; flex: none; font-size: .78rem; color: var(--muted); }
.product-row__media { text-align: center; }
.product-row__media img {
  width: 30px; height: 40px; object-fit: contain; border-radius: 6px;
  display: block; margin: 0 auto; background: #fff; cursor: zoom-in;
}
.sheet-preview {
  position: fixed; z-index: 80; width: 258px; aspect-ratio: 3 / 4;
  pointer-events: none; border-radius: 14px; overflow: hidden;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: scale(.86);
  transform-origin: right center;
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.sheet-preview.is-on { opacity: 1; visibility: visible; transform: none; }
.sheet-preview img { width: 100%; height: 100%; object-fit: cover; display: block; background: #fff; }
.product-row__media .icon { width: 26px; height: 26px; color: var(--c); }
.product-row__name { min-width: 0; }
.product-row__name b, .product-row__name > span {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.15;
}
.product-row__name b { font-size: .84rem; font-weight: 800; }
.product-row__name > span { margin-top: 1px; font-size: .72rem; font-weight: 500; color: var(--muted); }
.product-row__num { margin-right: .45em; color: var(--muted); font-weight: 700; }
.product-row__price, .product-row__pack { text-align: center; font-weight: 800; font-size: .88rem; white-space: nowrap; }
.product-row__price { color: var(--c); }
.sheet .product__actions {
  display: flex; flex-direction: row; align-items: center; justify-content: flex-end;
  min-height: 0; gap: 8px;
}
.sheet .qty { flex-wrap: nowrap; }
.sheet .stepper { height: 34px; }
.sheet .stepper button { width: 30px; }
.sheet .stepper .icon { width: 14px; height: 14px; }
.sheet .qty__pack { height: 34px; min-width: 42px; padding: 0 8px; font-size: .78rem; }
.sheet .product__unavailable {
  width: auto; min-height: 0; margin: 0; align-self: center;
  padding: .28em .7em; font-size: .75rem;
}

/* ---------- Order statuses ---------- */
.status--formed { background: #fff4dc; color: #9a6200; }
.status--in_progress { background: #e3f0ff; color: #1d5fa8; }
.status--shipped { background: #ece6ff; color: #5b3fb5; }
.status--paid { background: var(--g100); color: var(--g800); }
.status--cancelled { background: #fdecea; color: #b3261e; }

.order__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.order__actions form { display: inline-flex; }

/* ---------- Alerts & errors ---------- */
.alert { margin: 14px 0 0; padding: 12px 16px; border-radius: 12px; font-size: .9rem; font-weight: 600; }
.alert--error { background: #fdecea; color: #b3261e; }
.field__error.is-visible { display: block; margin-top: 6px; }

/* ---------- Shop profile ---------- */
.account-profile { max-width: 640px; padding: 32px 0 96px; }
.profile-form { display: grid; gap: 14px; }
.profile-form .btn { margin-top: 4px; }

/* ---------- Order edit ---------- */
.input--qty { width: 110px; padding: .55em .7em; text-align: center; font-weight: 700; }
.order-table--edit td { vertical-align: middle; }
.order-table--edit td:nth-child(4) { text-align: right; }
.order-table--edit tr.is-removed td:not(:last-child) { opacity: .45; text-decoration: line-through; }
.order-table--edit tr.is-removed .input--qty { text-decoration: none; }
.order-add { padding-top: 16px; border-top: 1px solid var(--line); }
.order-add__row { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto; gap: 10px; align-items: center; }
.order-add__row .select { width: 100%; min-width: 0; }

@media (max-width: 640px) {
  .view-switch { display: flex; flex: 1 1 220px; }
  .view-switch__item { flex: 1; justify-content: center; padding: .65em .8em; font-size: .85rem; }
  .view-switch__tools { margin-left: auto; }
  .order-add__row { grid-template-columns: 1fr 1fr; }
  .order-add__row .select { grid-column: 1 / -1; }
  .product__pick { top: 12px; right: 12px; }
  .qty { flex-wrap: wrap; }
  .qty__pack { height: 34px; font-size: .75rem; }
}
