:root {
  --green: #5A1236;
  --yellow: #B97855;
  --ink: #2A2226;
  --muted: #68746d;
  --line: #dce3df;
  --bg: #f5f7f4;
  --panel: #fff;
  --panel-accent: #B97855;
  --header-title: #F5EDE8;
  --visitor-text: #B97855;
  --app-font: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

*,
*::before,
*::after {
  min-width: 0;
}

html {
  overflow-x: hidden;
  background: var(--bg);
}

html.theme-pending body {
  visibility: hidden;
}

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

button, input, select, textarea { font: inherit; }

p,
h1,
h2,
h3,
strong,
span,
small,
label,
button,
input,
select,
textarea,
.row-card,
.catalog-card,
.product-detail-copy {
  overflow-wrap: anywhere;
}

img,
svg,
canvas,
video {
  max-width: 100%;
}

img,
video {
  height: auto;
}

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

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

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

body.is-admin.is-sidebar-collapsed {
  grid-template-columns: 82px 1fr;
}

body:not(.is-admin) .admin-tour-button {
  display: none !important;
}

.sidebar {
  min-width: 0;
  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; }

.sidebar-toggle {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 212, 59, .35);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
  color: #dfe8e2;
  font-weight: 700;
  cursor: pointer;
}

.sidebar-toggle svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
  color: #111914;
  background: var(--yellow);
}

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

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

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

.nav__icon {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

body.is-admin.is-sidebar-collapsed .sidebar {
  padding: 18px 12px;
}

body.is-admin.is-sidebar-collapsed .brand {
  justify-content: center;
  margin-bottom: 16px;
}

body.is-admin.is-sidebar-collapsed .brand > div,
body.is-admin.is-sidebar-collapsed .sidebar-toggle span,
body.is-admin.is-sidebar-collapsed .nav__label {
  display: none;
}

body.is-admin.is-sidebar-collapsed .brand__mark {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
}

body.is-admin.is-sidebar-collapsed .sidebar-toggle {
  width: 48px;
  margin-inline: auto;
  padding: 0;
}

body.is-admin.is-sidebar-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

body.is-admin.is-sidebar-collapsed .nav {
  justify-items: center;
}

body.is-admin.is-sidebar-collapsed .nav__item {
  width: 48px;
  min-height: 48px;
  justify-content: center;
  padding: 0;
}

.workspace {
  min-width: 0;
  padding: 26px;
}

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

.topbar {
  margin-bottom: 22px;
}

body.is-admin .topbar {
  justify-content: flex-end;
}

body.is-admin .topbar .store-heading {
  display: none;
}

body:not(.is-admin) .topbar {
  padding: 18px;
  border: 1px solid rgba(185, 120, 85, .28);
  border-radius: 16px;
  background: #181618;
  color: var(--header-title);
  box-shadow: 0 18px 44px rgba(24, 22, 24, .22);
}

body:not(.is-admin) .store-heading h1 {
  color: var(--header-title);
}

body:not(.is-admin) #sessionLabel {
  color: var(--visitor-text);
}

.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;
}

.auth-icon-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 12px;
  flex: 0 0 auto;
}

.auth-icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-icon-button:hover,
.auth-icon-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(17, 25, 20, .12);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.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 {
  min-width: 0;
  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,
.metric,
.panel,
.alert-card,
.balance-period,
.analytics-charts > article,
.admin-option-group,
.catalog-card,
.cart-products-panel,
.cart-summary-panel,
.checkout-form,
.checkout-summary {
  min-width: 0;
}

.row-card strong,
.row-card span,
.catalog-title,
.catalog-meta,
.cart-page-info strong,
.cart-page-info span,
.product-detail-copy h2,
.product-detail-copy p,
.balance-lines span,
.balance-ratios span {
  overflow-wrap: anywhere;
}

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

.search-input {
  width: min(420px, 100%);
  margin: 12px 0 16px;
}

.customer-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.4fr) minmax(180px, .8fr);
  align-items: start;
}

.customer-row > 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: contain;
  display: block;
}

.catalog-thumb img {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

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

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

.sale-items-workflow {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.manual-sale-items {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .45);
}

.manual-sale-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.inline-sku {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(7, 139, 93, .1);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
}

.sale-item-workflow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .54);
}

.sale-status {
  display: inline-flex;
  width: fit-content;
  margin-top: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.sale-status--pendiente {
  background: rgba(245, 184, 0, .18);
  color: #8a6500;
}

.sale-status--validado {
  background: rgba(7, 139, 93, .12);
  color: #078b5d;
}

.sale-status--reversado {
  background: rgba(210, 57, 57, .12);
  color: #c52828;
}

.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__head {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
}

.product-editor__head h2 {
  margin: 0;
}

.product-editor__head p {
  margin: 0;
}

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

.form-field {
  min-width: 0;
  display: grid;
  gap: 6px;
  align-content: start;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  font-weight: 400;
}

.form-field--wide {
  grid-column: span 2;
}

.form-field--button {
  align-content: stretch;
}

.form-field--button .file-button {
  min-height: 40px;
}

.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;
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
}

.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;
}

.sales-filter-panel {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid rgba(17, 25, 20, .1);
  border-radius: 12px;
  background: rgba(255, 255, 255, .58);
}

.sales-filter-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sales-filter-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.sales-filter-head strong {
  color: var(--muted);
  white-space: nowrap;
}

.sales-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.sales-filter-actions {
  display: flex;
  gap: 10px;
}

.sales-filter-actions .button {
  min-height: 48px;
}

.admin-danger-zone {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(220, 53, 69, .35);
  border-radius: 12px;
  background: rgba(220, 53, 69, .06);
}

.admin-danger-zone h2 {
  margin: 0 0 6px;
}

.admin-danger-zone p:last-child {
  margin-bottom: 0;
}

.expense-filter-panel {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid rgba(17, 25, 20, .1);
  border-radius: 12px;
  background: rgba(255, 255, 255, .58);
}

.expense-filter-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.expense-filter-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.expense-filter-head strong {
  color: var(--muted);
  white-space: nowrap;
}

.expense-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.expense-filter-actions {
  display: flex;
  gap: 10px;
}

.expense-filter-actions .button {
  min-height: 48px;
}

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

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

.catalog-toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  width: min(420px, 100%);
  margin-bottom: 18px;
  padding: 10px 0;
  background: linear-gradient(180deg, var(--bg) 70%, rgba(245, 247, 244, 0));
}

.catalog-toolbar input {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(17, 25, 20, .1);
  border-radius: 14px;
  padding: 0 18px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 12px 30px rgba(17, 25, 20, .08);
  font-size: 16px;
}

.catalog-grid {
  display: grid;
  gap: 22px;
}

.catalog-shelf {
  position: relative;
  overflow: hidden;
  padding: 22px 18px 26px;
  border: 1px solid rgba(17, 25, 20, .08);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(246, 250, 247, .96)),
    var(--panel);
  box-shadow: 0 20px 48px rgba(17, 25, 20, .08);
}

.catalog-shelf::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--panel-accent), var(--green));
}

.catalog-shelf:last-child {
  border-bottom: 1px solid rgba(17, 25, 20, .08);
}

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

.catalog-shelf__head h2 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(19px, 2vw, 28px);
  letter-spacing: 0;
}

.catalog-dots {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid rgba(17, 25, 20, .08);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
}

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

.catalog-dots i:first-child {
  background: var(--green);
}

.catalog-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(250px, calc((100% - 64px) / 4), 330px);
  gap: 16px;
  padding: 4px 2px 14px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-padding-inline: 2px;
  scroll-snap-type: inline mandatory;
  scrollbar-width: thin;
}

.catalog-card {
  min-width: 0;
  width: 100%;
  scroll-snap-align: start;
  overflow: hidden;
  border: 1px solid rgba(17, 25, 20, .08);
  border-radius: 16px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 14px 30px rgba(17, 25, 20, .07);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.catalog-card:hover {
  transform: translateY(-4px);
  border-color: rgba(7, 139, 93, .28);
  box-shadow: 0 22px 42px rgba(17, 25, 20, .13);
}

.catalog-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  height: auto;
  width: calc(100% - 20px);
  margin: 10px;
  padding: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(17, 25, 20, .04), rgba(7, 139, 93, .07)),
    #f7f8f6;
  color: var(--green);
  cursor: zoom-in;
  font-size: 38px;
  font-weight: 900;
}

.catalog-thumb::after {
  content: "Ver detalle";
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(17, 25, 20, .72);
  color: white;
  font-size: 11px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(6px);
  transition: 160ms ease;
}

.catalog-card:hover .catalog-thumb::after,
.catalog-thumb:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

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

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

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

.catalog-title {
  min-height: 40px;
  color: #111914;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.32;
  word-break: normal;
}

.catalog-meta {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-self: flex-start;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(7, 139, 93, .08);
  color: var(--green) !important;
  font-size: 12px;
  font-weight: 600;
  white-space: normal;
}

.catalog-stock-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 82px;
  min-height: 26px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.catalog-stock-badge--in {
  background: rgba(7, 139, 93, .12);
  color: #078b5d !important;
  border: 1px solid rgba(7, 139, 93, .22);
}

.catalog-stock-badge--order {
  background: rgba(245, 184, 0, .18);
  color: #8a6500 !important;
  border: 1px solid rgba(245, 184, 0, .32);
}

.catalog-stock-badge--out {
  background: rgba(210, 57, 57, .12);
  color: #c52828 !important;
  border: 1px solid rgba(210, 57, 57, .24);
}

.catalog-old-price {
  color: #7b8580;
  font-size: 14px;
  font-weight: 400;
  text-decoration: line-through;
}

.catalog-price-line {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  max-width: 100%;
}

.catalog-price {
  font-size: 25px;
  font-weight: 400;
  line-height: 1.05;
}

.catalog-discount {
  padding: 2px 5px;
  border-radius: 2px;
  background: #0b9a67;
  color: white !important;
  font-size: 12px !important;
  font-weight: 700;
}

.catalog-card .catalog-shipping {
  display: none !important;
}

.catalog-load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 18px 10px 4px;
  color: var(--muted);
  font-weight: 700;
}

.catalog-load-more__button {
  position: relative;
  isolation: isolate;
  min-height: 52px;
  padding: 0 22px;
  gap: 10px;
  border-radius: 999px;
  overflow: visible;
  font-weight: 800;
  letter-spacing: .01em;
  animation: catalog-load-more-glow 2.4s ease-in-out infinite;
}

.catalog-load-more__button::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -7px;
  border: 2px solid var(--panel-accent);
  border-radius: inherit;
  opacity: .45;
  animation: catalog-load-more-ring 2.4s ease-out infinite;
}

.catalog-load-more__button:hover,
.catalog-load-more__button:focus-visible {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--panel-accent) 22%, transparent),
    0 16px 34px color-mix(in srgb, var(--green) 35%, transparent);
}

.catalog-load-more__arrow {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  font-size: 18px;
  line-height: 1;
}

@keyframes catalog-load-more-glow {
  0%, 100% {
    box-shadow: 0 8px 22px color-mix(in srgb, var(--green) 24%, transparent);
  }
  50% {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--panel-accent) 18%, transparent),
      0 14px 34px color-mix(in srgb, var(--green) 42%, transparent);
  }
}

@keyframes catalog-load-more-ring {
  0% { transform: scale(.94); opacity: .55; }
  70%, 100% { transform: scale(1.12); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .catalog-load-more__button,
  .catalog-load-more__button::before {
    animation: none;
  }
}

.catalog-actions {
  display: grid;
  grid-template-columns: 42px 30px minmax(86px, 1fr);
  gap: 9px;
  align-items: center;
  margin-top: 4px;
}

.catalog-actions .button {
  min-height: 44px;
  border-radius: 12px;
}

.catalog-actions .button--primary {
  box-shadow: 0 10px 20px rgba(7, 139, 93, .2);
}

.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;
}

.field-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.cart-summary-panel select,
.checkout-form select {
  width: 100%;
}

.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;
}

.balance-board {
  display: grid;
  gap: 16px;
}

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

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

.balance-period {
  min-width: 0;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.balance-period .panel__head {
  padding: 0;
  border: 0;
}

.balance-period .panel__head h2 {
  font-size: 18px;
}

.balance-lines {
  display: grid;
  gap: 8px;
}

.balance-lines > div,
.balance-ratios span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.balance-lines strong,
.balance-ratios strong {
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
}

.balance-total {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 18px;
}

.balance-ratios {
  display: grid;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.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 {
  height: clamp(380px, 58vh, 620px);
  min-height: 380px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e8eee9;
}

.analytics-map .leaflet-container {
  width: 100%;
  height: 100%;
}

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

.map-empty {
  min-height: 380px;
  height: clamp(380px, 58vh, 620px);
  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: min(150px, 36vw);
  aspect-ratio: 1;
  align-self: center;
  justify-self: center;
  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);
  overflow: hidden;
}

.product-detail-panel {
  position: relative;
  width: min(1120px, calc(100vw - 48px));
  height: min(86dvh, 820px);
  max-height: calc(100dvh - 48px);
  display: grid;
  grid-template-columns: minmax(0, 58%) minmax(320px, 42%);
  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: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  gap: clamp(8px, 1.2vw, 14px);
  padding: clamp(14px, 2vw, 24px);
  background: #f4f6f3;
  overflow: hidden;
}

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

.product-detail-image-canvas {
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.product-detail-image-frame:not(.is-zoomed) .product-detail-image-canvas {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: clamp(8px, 1.2vw, 16px);
}

.product-detail-image-frame:not(.is-zoomed) .product-detail-main-image {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-detail-image-frame.is-zoomed {
  display: block;
  overflow: auto;
  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);
  overflow: visible;
}

.product-detail-image-frame.is-zoomed .product-detail-main-image {
  flex: 0 0 auto;
  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.is-active::after {
  content: "Zoom activo";
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(17, 25, 20, .82);
  color: white;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.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%;
  max-height: 70px;
  display: flex;
  justify-content: center;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0;
  scrollbar-width: thin;
}

.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 {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.2vw, 14px);
  padding: clamp(30px, 4vw, 44px) clamp(18px, 2.4vw, 30px) clamp(20px, 2.4vw, 30px);
  overflow: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.product-detail-copy h2 {
  margin: 0;
  padding-right: 42px;
  font-size: clamp(24px, 2.8vw, 38px);
  line-height: 1.12;
  hyphens: auto;
}

.product-detail-copy p {
  max-width: 100%;
  margin: 0;
}

.product-detail-copy .eyebrow,
#productDetailMeta {
  flex: 0 0 auto;
}

#productDetailMeta {
  line-height: 1.4;
}

.product-detail-copy p:last-child {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 8px;
  color: var(--ink);
  font-size: clamp(15px, 1.45vw, 17px);
  line-height: 1.55;
  white-space: pre-line;
  scrollbar-width: thin;
}

@media (max-height: 760px) and (min-width: 861px) {
  .product-detail-panel {
    width: min(1080px, calc(100vw - 40px));
    height: calc(100dvh - 40px);
    max-height: calc(100dvh - 40px);
    grid-template-columns: minmax(0, 60%) minmax(300px, 40%);
  }

  .product-detail-media {
    padding: 14px;
    gap: 8px;
  }

  .product-detail-thumbs {
    max-height: 58px;
  }

  .product-detail-thumbs button {
    width: 58px;
    height: 48px;
  }

  .product-detail-copy {
    padding: 28px 22px 20px;
    gap: 8px;
  }

  .product-detail-copy h2 {
    font-size: clamp(22px, 2.4vw, 32px);
  }
}

.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 80;
  width: min(460px, calc(100vw - 32px));
  min-height: 64px;
  display: grid;
  place-items: center;
  padding: 16px 20px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: #111914;
  color: white;
  box-shadow: 0 24px 70px rgba(17, 25, 20, .28);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  transform: translate(-50%, -46%) scale(.96);
  transition: 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.admin-tour {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  z-index: 2147483000;
  isolation: isolate;
  pointer-events: none;
}

.admin-tour::backdrop {
  background: transparent;
}

.admin-tour__shade {
  position: absolute;
  inset: 0;
  z-index: 2147483000;
  background: rgba(17, 25, 20, .42);
  pointer-events: auto;
}

.admin-tour__card {
  position: fixed;
  z-index: 2147483002;
  width: min(420px, calc(100vw - 24px));
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(17, 25, 20, .32);
  pointer-events: auto;
}

.admin-tour__spotlight {
  position: fixed;
  z-index: 2147483001;
  display: none;
  border: 4px solid var(--yellow);
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(17, 25, 20, .18), 0 18px 50px rgba(17, 25, 20, .24);
  pointer-events: none;
  transition: left 120ms ease, top 120ms ease, width 120ms ease, height 120ms ease;
}

.admin-tour:not(.is-hidden) .admin-tour__spotlight {
  display: block;
}

.admin-tour__head,
.admin-tour__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-tour__head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-tour__close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.admin-tour__card h2 {
  margin: 0;
  font-size: 22px;
}

.admin-tour__card p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.48;
}

.admin-tour-highlight {
  scroll-margin: 120px;
}

body.admin-tour-active {
  overflow: hidden;
}

body.admin-tour-active .toast,
body.admin-tour-active .cart-toggle--floating,
body.admin-tour-active .product-detail-modal,
body.admin-tour-active .dialog {
  z-index: 2147482990;
}

.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;
}

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

.panel__head--compact {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

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

@media (max-width: 1280px) {
  body.is-admin {
    grid-template-columns: 230px 1fr;
  }

  body.is-admin.is-sidebar-collapsed {
    grid-template-columns: 82px 1fr;
  }

  .workspace {
    padding: 22px;
  }

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

  .catalog-row {
    grid-auto-columns: clamp(230px, calc((100% - 32px) / 3), 310px);
  }

  .analytics-layout,
  .cart-page,
  .checkout-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .analytics-side,
  .cart-summary-panel,
  .checkout-summary {
    position: static;
  }

  .analytics-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .analytics-filters .button {
    grid-column: 1 / -1;
  }

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

@media (max-width: 1024px) {
  body.is-admin {
    grid-template-columns: 1fr;
  }

  body.is-admin.is-sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    padding: 16px;
  }

  .sidebar-toggle {
    display: none;
  }

  body.is-admin.is-sidebar-collapsed .sidebar {
    padding: 16px;
  }

  body.is-admin.is-sidebar-collapsed .brand {
    justify-content: flex-start;
    margin-bottom: 14px;
  }

  body.is-admin.is-sidebar-collapsed .brand > div,
  body.is-admin.is-sidebar-collapsed .nav__label {
    display: block;
  }

  body.is-admin.is-sidebar-collapsed .brand__mark {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  body.is-admin.is-sidebar-collapsed .nav {
    justify-items: stretch;
  }

  body.is-admin.is-sidebar-collapsed .nav__item {
    width: auto;
    min-height: 42px;
    justify-content: center;
    padding: 0 12px;
  }

  .brand {
    margin-bottom: 14px;
  }

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

  .nav__item {
    text-align: center;
  }

  .workspace {
    padding: 18px;
  }

  .analytics-charts,
  .analytics-grids,
  .admin-options-grid,
  .balance-grid,
  .balance-grid--two {
    grid-template-columns: 1fr;
  }

  .product-detail-panel {
    width: min(820px, calc(100vw - 32px));
    grid-template-columns: 1fr;
    grid-template-rows: minmax(260px, 48dvh) minmax(0, 1fr);
    height: min(94dvh, 920px);
    max-height: calc(100dvh - 32px);
    overflow: hidden;
  }

  .product-detail-media {
    min-height: 0;
    height: auto;
  }

  .product-detail-copy {
    min-height: 0;
    overflow: hidden;
  }
}

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

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

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

.theme-preview-field {
  grid-column: span 2;
}

.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-form { align-items: stretch; flex-direction: column; }
  .auth-bar {
    width: 100%;
    align-items: center;
    flex-direction: row;
    justify-content: flex-start;
  }
  .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, .sales-filters, .expense-filters, .analytics-layout, .analytics-grids, .analytics-filters, .analytics-charts, .pie-wrap, .analytics-detail-grid, .admin-list-form, .admin-user-form, .admin-options-grid, .theme-form, .balance-grid, .balance-grid--two { grid-template-columns: 1fr; }
  .theme-preview,
  .theme-preview-field,
  .form-field--wide { grid-column: auto; }
  .analytics-map, .map-empty { height: 380px; min-height: 320px; }
  .bar-row { grid-template-columns: 1fr; }
  .bar-row span,
  .chart-label b,
  .bar-row strong {
    white-space: normal;
  }
  .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; }
  .customer-row { grid-template-columns: 1fr; }
  .inventory-row { grid-template-columns: 72px minmax(0, 1fr); }
  .inventory-row > div:last-child { grid-column: 1 / -1; }
  .row-card > div:last-child,
  .customer-row > div:last-child { text-align: left; }
  .row-actions { justify-content: flex-start; }
  .dialog__actions { justify-content: stretch; }
  .admin-tour__card {
    max-height: calc(100vh - 24px);
    overflow-y: auto;
  }
  .admin-tour__actions {
    align-items: stretch;
    flex-direction: column;
  }
  .top-actions { justify-content: stretch; }
  .sales-filter-head,
  .sales-filter-actions,
  .expense-filter-head,
  .expense-filter-actions,
  .admin-danger-zone {
    align-items: stretch;
    flex-direction: column;
  }
  .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-toolbar { width: 100%; position: static; padding-top: 0; }
  .catalog-shelf { padding: 18px 12px 20px; border-radius: 14px; }
  .catalog-shelf__head { align-items: flex-start; flex-direction: column; margin-bottom: 14px; }
  .catalog-shelf__head h2 { font-size: 18px; }
  .catalog-row { grid-auto-columns: minmax(250px, calc(100vw - 58px)); gap: 12px; }
  .catalog-thumb { aspect-ratio: 4 / 3; height: auto; }
  .catalog-price { font-size: 24px; }
  .cart-toggle--floating { right: 16px; bottom: 16px; width: 58px; height: 58px; }
  .product-detail-modal { padding: 12px; align-items: center; overflow: hidden; }
  .product-detail-panel {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(320px, 54dvh) minmax(0, 1fr);
    width: min(100%, 760px);
    height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px);
  }
  .product-detail-media {
    min-height: 0;
    height: auto;
    padding: 16px;
  }
  .product-detail-main-image { max-height: 100%; }
  .product-detail-copy {
    min-height: 0;
    padding: 22px 18px;
    overflow: hidden;
  }
  .product-detail-copy h2 {
    font-size: clamp(22px, 7vw, 30px);
  }
  .product-detail-copy p:last-child {
    font-size: 15px;
  }
}

@media (max-width: 640px) {
  h1 { font-size: clamp(30px, 11vw, 38px); }
  h2 { font-size: 18px; }

  .workspace {
    padding: 12px;
  }

  .sidebar {
    padding: 12px;
  }

  .brand {
    align-items: flex-start;
  }

  .brand__mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }

  .nav {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .nav__item {
    min-height: 40px;
    padding: 0 10px;
    font-size: 14px;
  }

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

  .metric strong {
    font-size: 24px;
  }

  .import-card,
  .cart-page__head {
    align-items: stretch;
    flex-direction: column;
  }

  .button,
  input,
  select,
  textarea {
    width: 100%;
  }

  .auth-bar .button,
  .auth-bar .auth-icon-button,
  .row-actions .button,
  .catalog-actions .button,
  .cart-page-qty .button,
  .admin-tour__close,
  .cart-toggle {
    width: auto;
  }

  .catalog-row {
    grid-auto-columns: minmax(220px, calc(100vw - 40px));
  }

  .catalog-thumb {
    margin: 8px;
    width: calc(100% - 16px);
    padding: 10px;
  }

  .catalog-actions {
    grid-template-columns: 42px 28px minmax(90px, 1fr);
  }

  .cart-page-item {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .cart-page-thumb {
    width: 78px;
  }

  .cart-page-qty {
    grid-template-columns: 38px 32px 38px;
  }

  .pie-wrap {
    justify-items: center;
  }

  .pie-chart {
    width: min(180px, 62vw);
  }

  .pie-legend-item {
    align-items: flex-start;
  }

  .pie-legend-item strong {
    white-space: normal;
    text-align: right;
  }

  .analytics-map,
  .map-empty {
    height: min(70vh, 420px);
    min-height: 300px;
  }

  .product-detail-modal {
    padding: 8px;
  }

  .product-detail-panel {
    grid-template-rows: minmax(320px, 56dvh) minmax(0, 1fr);
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
  }

  .product-detail-media {
    min-height: 0;
    padding: 12px;
  }

  .product-detail-nav,
  .product-detail-zoom {
    width: 38px;
    height: 38px;
  }

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

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

  .product-detail-thumbs {
    justify-content: flex-start;
    max-height: 60px;
  }

  .product-detail-thumbs button {
    width: 62px;
    height: 52px;
  }
}

@media (max-width: 420px) {
  .nav {
    grid-template-columns: 1fr;
  }

  .catalog-row {
    grid-auto-columns: calc(100vw - 32px);
  }

  .catalog-actions {
    grid-template-columns: 40px 24px minmax(82px, 1fr);
    gap: 7px;
  }

  .catalog-price {
    font-size: 22px;
  }

  .catalog-discount {
    font-size: 11px !important;
  }

  .inventory-row {
    grid-template-columns: 1fr;
  }

  .inventory-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .cart-toggle--floating {
    right: 12px;
    bottom: 12px;
  }

  .product-detail-panel {
    grid-template-rows: minmax(330px, 58dvh) minmax(0, 1fr);
  }

  .product-detail-copy {
    padding: 18px 14px;
  }

  .product-detail-copy h2 {
    font-size: clamp(20px, 8vw, 26px);
  }
}
