:root {
  --green: #078b5d;
  --yellow: #ffd43b;
  --ink: #17201b;
  --muted: #68746d;
  --line: #dce3df;
  --bg: #f5f7f4;
  --panel: #fff;
  --app-font: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--app-font);
}

button, input, select { font: inherit; }

body:not(.is-admin) {
  grid-template-columns: 1fr;
}

body:not(.is-admin) .sidebar {
  display: none;
}

body.is-admin .nav__item--customer {
  display: none;
}

.sidebar {
  padding: 22px;
  background: #111914;
  color: white;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.brand__mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--yellow);
  color: #111914;
  font-weight: 800;
}

.brand small { color: #b9c7c0; }

.nav {
  display: grid;
  gap: 8px;
}

.nav__item {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  text-align: left;
  color: #dfe8e2;
  background: transparent;
  cursor: pointer;
}

.nav__item.is-active,
.nav__item:hover {
  color: #111914;
  background: var(--yellow);
}

.workspace {
  padding: 26px;
}

.topbar,
.panel__head,
.import-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar {
  margin-bottom: 22px;
}

.store-heading {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.store-heading h1 {
  margin: 0;
}

.store-heading__logo {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 12px;
  font-size: 20px;
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.auth-bar,
.auth-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.auth-form input {
  width: 150px;
}

.login-panel {
  justify-content: flex-end;
  margin-top: 12px;
}

.login-panel input {
  width: 220px;
}

.cart-toggle {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.cart-toggle svg {
  width: 23px;
  height: 23px;
}

.cart-toggle span {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--green);
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.cart-toggle--floating {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 70;
  width: 64px;
  height: 64px;
  border-color: rgba(7, 139, 93, .28);
  box-shadow: 0 18px 38px rgba(7, 139, 93, .24);
}

.cart-toggle--floating svg {
  width: 30px;
  height: 30px;
}

.cart-toggle--floating span {
  top: -9px;
  right: -9px;
  min-width: 27px;
  height: 27px;
  font-size: 14px;
}

.remission-fields {
  display: grid;
  gap: 10px;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: 38px; }
h2 { margin-bottom: 6px; font-size: 20px; }

.eyebrow {
  margin-bottom: 4px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
  font-size: 12px;
}

.muted { color: var(--muted); }

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: white;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.button--primary {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.button--danger {
  border-color: #d13d3d;
  background: #d13d3d;
  color: white;
}

.view { display: none; }
.view.is-active { display: block; }
.is-hidden { display: none !important; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric,
.panel,
.row-card,
.import-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(20, 31, 25, .05);
}

.metric,
.panel,
.row-card,
.import-card {
  padding: 16px;
}

.metric small {
  color: var(--muted);
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.star-panel {
  margin-bottom: 16px;
}

.star-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.star-card {
  display: grid;
  gap: 6px;
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.star-card small,
.star-card span {
  color: var(--muted);
  font-size: 14px;
}

.star-card strong {
  line-height: 1.25;
}

.star-card--wide {
  grid-column: 1 / -1;
}

.stack {
  display: grid;
  gap: 10px;
}

.row-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.row-card > div:last-child {
  text-align: right;
}

.inventory-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) minmax(190px, auto);
  align-items: center;
  width: 100%;
}

.inventory-thumb {
  width: 82px;
  height: 72px;
  flex: 0 0 82px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #eef3ef;
  color: var(--green);
  font-weight: 800;
}

.inventory-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.catalog-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.row-action {
  min-height: 34px;
  margin-top: 8px;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.alert-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left-width: 6px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(20, 31, 25, .05);
}

.alert-card--warning {
  border-left-color: #f2b705;
}

.alert-card--critical {
  border-left-color: #d13d3d;
}

.row-card span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.customer-phone-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.register-panel {
  max-width: 980px;
}

.register-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.register-form textarea {
  grid-column: 1 / -1;
  min-height: 110px;
}

.register-form button {
  justify-self: start;
}

.sales-form {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

input,
select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
}

textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
}

.product-editor {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.product-editor textarea,
.editor-actions {
  grid-column: span 2;
}

.check-line {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.file-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: white;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.file-button input {
  display: none;
}

.image-gallery-preview {
  grid-column: 1 / -1;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .58);
}

.gallery-preview-item {
  width: 92px;
  height: 66px;
  position: relative;
  flex: 0 0 auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
}

.gallery-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gallery-preview-item span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3px;
  background: rgba(8, 15, 11, .78);
  color: white;
  font-size: 11px;
  text-align: center;
}

.editor-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.import-card {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin: 14px 0;
}

.inventory-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 14px 0;
}

.inventory-search strong {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.catalog-hero {
  margin-bottom: 16px;
}

.catalog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.catalog-toolbar {
  margin-bottom: 14px;
}

.catalog-grid {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.catalog-shelf {
  padding: 14px 14px 22px;
  border-bottom: 42px solid #eeeeee;
}

.catalog-shelf:last-child {
  border-bottom: 0;
}

.catalog-shelf__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 26px;
}

.catalog-shelf__head h2 {
  margin: 0;
  font-size: 20px;
}

.catalog-dots {
  display: flex;
  gap: 5px;
}

.catalog-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d8d8d8;
}

.catalog-dots i:first-child {
  background: #3483fa;
}

.catalog-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(220px, calc((100% - 48px) / 5), 280px);
  gap: 12px;
  padding-bottom: 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-padding-inline: 0;
  scroll-snap-type: inline mandatory;
  scrollbar-width: thin;
}

.catalog-card {
  min-width: 0;
  scroll-snap-align: start;
  overflow: hidden;
  border: 1px solid #eef0ed;
  border-radius: 8px;
  background: white;
}

.catalog-thumb {
  aspect-ratio: 1 / 1;
  height: auto;
  padding: 10px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #f5f5f5;
  color: var(--green);
  font-size: 34px;
  font-weight: 800;
  width: 100%;
  border: 0;
  cursor: zoom-in;
}

.catalog-thumb:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: -3px;
}

.catalog-body {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 12px 4px 0;
}

.catalog-body span,
.catalog-body p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.catalog-title {
  min-height: 38px;
  color: #333;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
}

.catalog-meta,
.catalog-stock {
  font-size: 12px;
}

.catalog-old-price {
  color: #777;
  font-size: 12px;
  text-decoration: line-through;
}

.catalog-price-line {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.catalog-price {
  font-size: 23px;
  font-weight: 400;
  line-height: 1.1;
}

.catalog-discount {
  padding: 1px 4px;
  background: #00a650;
  color: white !important;
  font-size: 12px !important;
  font-weight: 700;
}

.catalog-shipping {
  color: #00a650 !important;
  font-size: 13px !important;
}

.catalog-shipping {
  width: fit-content;
  margin-top: 3px !important;
  padding: 2px 4px;
  border-radius: 2px;
  background: #d9f5e7;
  font-weight: 700;
}

.catalog-actions {
  display: grid;
  grid-template-columns: 36px 28px minmax(74px, 1fr);
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.catalog-actions strong {
  text-align: center;
}

.catalog-cart {
  position: sticky;
  top: 20px;
}

.catalog-finish {
  width: 100%;
  margin-top: 6px;
}

.cart-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

.cart-products-panel,
.cart-summary-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 26px rgba(17, 25, 20, .06);
}

.cart-page__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.cart-page-items {
  display: grid;
}

.cart-page-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.cart-page-item:last-child {
  border-bottom: 0;
}

.cart-page-thumb {
  width: 120px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #f4f6f3;
  color: white;
  font-size: 28px;
  font-weight: 900;
}

.cart-page-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cart-page-info {
  display: grid;
  gap: 8px;
}

.cart-page-info span,
.cart-page-info small {
  color: var(--muted);
}

.cart-page-qty {
  display: grid;
  grid-template-columns: 42px 36px 42px;
  gap: 8px;
  align-items: center;
  max-width: 150px;
}

.cart-page-qty strong {
  text-align: center;
}

.cart-page-price {
  white-space: nowrap;
  font-size: 18px;
}

.cart-empty {
  display: grid;
  gap: 8px;
  padding: 24px;
  justify-items: start;
}

.cart-empty span {
  color: var(--muted);
}

.cart-summary-panel {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 14px;
  padding: 18px;
}

.cart-summary-panel h2 {
  margin-bottom: 4px;
  font-size: 18px;
}

.cart-summary-line,
.cart-summary-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.cart-summary-total {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 20px;
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .7fr);
  gap: 16px;
  align-items: start;
}

.checkout-form,
.checkout-summary {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.checkout-form h2,
.checkout-summary h2 {
  margin-bottom: 6px;
  font-size: 18px;
}

.checkout-summary {
  position: sticky;
  top: 20px;
}

.analytics-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
  margin-top: 14px;
}

.map-mode-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 10px;
}

.map-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.map-legend i {
  width: min(260px, 42vw);
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #078b5d, #ffd43b, #f28c28, #d13d3d);
}

.analytics-map {
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e8eee9;
}

.map-count-label {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #111914;
  font-weight: 800;
}

.map-empty {
  min-height: 520px;
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.analytics-side {
  display: grid;
  gap: 10px;
}

.analytics-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
  gap: 10px;
  margin: 12px 0 14px;
}

.analytics-grids {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.analytics-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.analytics-charts > article {
  min-height: 260px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.analytics-grids h2,
.analytics-side h2,
.analytics-charts h2 {
  font-size: 16px;
}

.chart-bars {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(140px, 2fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 36px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 14px;
  cursor: pointer;
}

.bar-row:hover .bar-track,
.bar-row:focus-visible .bar-track {
  outline: 2px solid rgba(7, 139, 93, .24);
  outline-offset: 2px;
}

.bar-row span,
.chart-label b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-row strong {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eee9;
}

.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.chart-label {
  min-width: 0;
  display: flex !important;
  gap: 8px;
  align-items: center;
  color: var(--ink) !important;
  font-weight: 700;
}

.chart-label i {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: 3px;
}

.chart-label b {
  display: block;
  min-width: 0;
  font-size: 13px;
}

.pie-wrap {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.pie-chart {
  width: 150px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--line);
}

.pie-legend {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.pie-legend-item {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pie-legend-item {
  min-height: 34px;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.pie-legend-item strong {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.pie-legend-item:hover,
.pie-legend-item:focus-visible {
  color: var(--ink);
}

.analytics-detail {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.analytics-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 16px;
}

.analytics-detail-grid h2 {
  font-size: 16px;
}

.catalog-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.catalog-form {
  display: grid;
  gap: 10px;
}

.form-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf6;
}

.account-card {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

body:not(.is-guest) .account-card {
  display: none;
}

.account-card h2 {
  margin-bottom: 0;
}

.catalog-form textarea {
  min-height: 80px;
}

.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.cart-line span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.cart-line .catalog-actions {
  grid-column: 1 / -1;
  grid-template-columns: 42px 42px;
}

.product-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 15, 11, .62);
}

.product-detail-panel {
  position: relative;
  width: min(1080px, 96vw);
  max-height: 92vh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  overflow: hidden;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 28px 70px rgba(0, 0, 0, .28);
}

.product-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.product-detail-media {
  position: relative;
  min-height: 520px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  background: #f4f6f3;
}

.product-detail-image-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  border-radius: 8px;
  scrollbar-width: thin;
}

.product-detail-image-canvas {
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  display: grid;
  place-items: center;
}

.product-detail-main-image {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  transition: transform .18s ease;
  transform-origin: center;
}

.product-detail-image-frame.is-zoomed {
  display: block;
  background: #eef2ee;
  cursor: grab;
  touch-action: none;
  overscroll-behavior: contain;
}

.product-detail-image-frame.is-zoomed .product-detail-image-canvas {
  width: auto;
  height: auto;
  min-width: calc(100% + 1px);
  min-height: calc(100% + 1px);
}

.product-detail-image-frame.is-zoomed .product-detail-main-image {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.product-detail-image-frame.is-panning {
  cursor: grabbing;
}

.product-detail-image-toolbar {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.product-detail-nav,
.product-detail-zoom {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  color: var(--ink);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 8px 18px rgba(20, 31, 25, .12);
}

.product-detail-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 30px;
  line-height: 1;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(6px);
}

.product-detail-nav[data-detail-prev] {
  left: 18px;
}

.product-detail-nav[data-detail-next] {
  right: 18px;
}

.product-detail-nav:hover,
.product-detail-zoom:hover {
  background: white;
}

.product-detail-zoom {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
}

.product-detail-zoom.is-active {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.product-detail-zoom svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-detail-thumbs {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0;
}

.product-detail-thumbs button {
  width: 72px;
  height: 58px;
  flex: 0 0 auto;
  padding: 3px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
}

.product-detail-thumbs button.is-active {
  border-color: var(--green);
}

.product-detail-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.product-detail-initials {
  width: min(460px, 72vw);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-size: clamp(56px, 12vw, 130px);
  font-weight: 900;
}

.product-detail-copy {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 44px 28px 28px;
  overflow-y: auto;
}

.product-detail-copy h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
}

.product-detail-copy p:last-child {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.55;
  white-space: pre-line;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #111914;
  color: white;
  opacity: 0;
  transform: translateY(10px);
  transition: 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.dialog {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 25, 20, .55);
}

.dialog.is-visible {
  display: flex;
}

.dialog__panel {
  width: min(520px, 100%);
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(17, 25, 20, .24);
}

.dialog__message {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

.dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.nav__item--admin {
  border: 1px solid rgba(255, 212, 59, .35);
}

.admin-list-form {
  grid-template-columns: 1.1fr repeat(3, minmax(0, 1fr)) auto;
}

.theme-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.theme-form input[type="color"] {
  min-height: 44px;
  padding: 4px;
}

.theme-preview {
  display: flex;
  grid-column: span 2;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.admin-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.admin-option-group {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.admin-option-row {
  align-items: center;
}

.admin-option-row.is-muted {
  opacity: .62;
}

@media (max-width: 860px) {
  body { grid-template-columns: 1fr; }
  .sidebar { padding: 14px; }
  .nav { grid-template-columns: repeat(2, 1fr); }
  .workspace { padding: 16px; }
  .topbar, .panel__head, .auth-bar, .auth-form { align-items: stretch; flex-direction: column; }
  .store-heading { justify-content: flex-start; }
  .store-heading__logo { width: 46px; height: 46px; flex-basis: 46px; }
  .auth-form input, .login-panel input { width: 100%; }
  .metric-grid, .form-grid, .star-grid, .catalog-layout, .cart-page, .checkout-layout, .product-editor, .inventory-search, .customer-phone-form, .register-form, .sales-form, .analytics-layout, .analytics-grids, .analytics-filters, .analytics-charts, .pie-wrap, .analytics-detail-grid, .admin-list-form, .admin-options-grid, .theme-form { grid-template-columns: 1fr; }
  .theme-preview { grid-column: auto; }
  .analytics-map, .map-empty { min-height: 380px; }
  .bar-row { grid-template-columns: 1fr; }
  .product-editor textarea, .editor-actions { grid-column: auto; }
  .register-form textarea { grid-column: auto; }
  .register-form button { justify-self: stretch; }
  .row-card, .alert-card { flex-direction: column; }
  .inventory-row { grid-template-columns: 72px minmax(0, 1fr); }
  .inventory-row > div:last-child { grid-column: 1 / -1; }
  .row-card > div:last-child { text-align: left; }
  .row-actions { justify-content: flex-start; }
  .dialog__actions { justify-content: stretch; }
  .top-actions { justify-content: stretch; }
  .map-mode-toolbar { display: grid; grid-template-columns: 1fr; }
  .map-legend { align-items: flex-start; flex-direction: column; }
  .map-legend i { width: 100%; }
  .catalog-cart, .cart-summary-panel, .checkout-summary { position: static; }
  .cart-page__head { align-items: stretch; flex-direction: column; }
  .cart-page-item { grid-template-columns: 92px minmax(0, 1fr); }
  .cart-page-thumb { width: 92px; }
  .cart-page-price { grid-column: 1 / -1; }
  .catalog-shelf { padding: 12px; border-bottom-width: 28px; }
  .catalog-shelf__head { margin-bottom: 14px; }
  .catalog-shelf__head h2 { font-size: 17px; }
  .catalog-row { grid-auto-columns: minmax(240px, calc(100vw - 72px)); }
  .catalog-thumb { aspect-ratio: 1 / 1; height: auto; }
  .catalog-price { font-size: 21px; }
  .cart-toggle--floating { right: 16px; bottom: 16px; width: 58px; height: 58px; }
  .product-detail-modal { padding: 12px; align-items: start; overflow-y: auto; }
  .product-detail-panel { grid-template-columns: 1fr; max-height: none; }
  .product-detail-media { min-height: 320px; padding: 16px; }
  .product-detail-media img { max-height: 58vh; }
  .product-detail-copy { padding: 22px 18px; }
}
