:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --surface: #111111;
  --surface-soft: #1a1a1a;
  --text: #f5f5f0;
  --muted: #888888;
  --border: #262626;
  --dark: #f5f5f0;
  --header-start: #0a0a0a;
  --header-end: #0a0a0a;
  --danger: #cb7b7b;
}

html[data-theme='light'] {
  color-scheme: light;
  --bg: #f5f5f2;
  --surface: #ffffff;
  --surface-soft: #ecece8;
  --text: #0a0a0a;
  --muted: #4d4d4d;
  --border: #e0e0dc;
  --dark: #0a0a0a;
  --header-start: #0a0a0a;
  --header-end: #0a0a0a;
  --danger: #7b2d2d;
}

* { box-sizing: border-box; }
body,
.top-header,
.panel,
.card,
.row-card,
.resume-row,
.placeholder,
.detail-placeholder,
.notice,
.chip,
.stat-box,
.bell-dropdown,
.bell-dropdown-item,
.stock-alert-panel,
.stock-alert-item,
.modal-card,
.receipt-customer div,
.receipt-table thead th,
.receipt-total,
button,
.btn-alt,
input,
textarea,
select {
  transition:
    background-color .22s ease,
    background .22s ease,
    color .22s ease,
    border-color .22s ease,
    box-shadow .22s ease;
}
body { margin: 0; font-family: 'Inter', 'Segoe UI', Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; }
button, input, textarea { font: inherit; }

.app-shell { min-height: 100vh; }
.route-transition {
  animation: route-fade-in .24s ease both;
}
.container { max-width: 1140px; margin: 24px auto; padding: 0 18px; scroll-margin-top: 88px; }
.container--searching { padding-top: 18px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.notice {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .26s ease, transform .26s ease;
}
.notice.notice-error {
  background: rgba(185, 28, 28, 0.12);
  border-color: #b91c1c;
  color: #7f1d1d;
  font-weight: 700;
}
.notice.is-fading {
  opacity: 0;
  transform: translateY(-4px);
}
.center-notice-layer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.18);
  background: color-mix(in srgb, #000 18%, transparent);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.center-notice-layer .notice {
  width: min(520px, 94vw);
  margin: 0;
  padding: 16px 18px;
  text-align: center;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .34);
  animation: admin-notice-pop .22s ease both;
}
.muted { color: var(--muted); font-size: 13px; font-weight: 500; }
.field-error { color: #c62828; font-size: 12px; font-weight: 700; margin: 0; }
.price { font-weight: 700; font-size: 18px; }
.placeholder { height: 110px; border: 1px dashed var(--border); border-radius: 8px; background: var(--surface-soft); display: grid; place-items: center; color: var(--muted); }
.detail-placeholder { height: 220px; margin-bottom: 10px; }

/* Header & nav styles moved to index.css (Vite) */
.admin-brand-text { font-size: 14px; font-weight: 600; margin-right: 4px; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.bell-container { position: relative; }
.bell-btn.has-alerts { border-color: #f59e0b; }
.bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.bell-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  z-index: 1000;
  padding: 12px;
}
.bell-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--text);
}
.bell-dropdown-summary {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
}
.bell-dropdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.bell-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 13px;
}
.bell-dropdown-item.is-critical {
  border-color: #b91c1c;
  background: rgba(185, 28, 28, 0.08);
}
.bell-item-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bell-item-stock { font-size: 11px; color: var(--muted); white-space: nowrap; }
.icon-btn { width: 35px; height: 35px; padding: 0; display: inline-flex; justify-content: center; align-items: center; }
.header-search-trigger {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #6a6a6a;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  display: inline-grid;
  place-items: center;
}
.header-search-trigger svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle {
  width: 50px;
  height: 35px;
  padding: 0;
  border: 1px solid #6a6a6a;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle-track {
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  position: relative;
  transition: background .18s ease;
}
.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s ease, background .18s ease;
}
.theme-toggle-icon {
  position: absolute;
  top: 4px;
  width: 10px;
  height: 10px;
  color: #fff;
  opacity: 0;
  transition: opacity .18s ease;
}
.theme-toggle-icon svg {
  width: 10px;
  height: 10px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle-sun { left: 5px; }
.theme-toggle-moon { right: 5px; }
.theme-toggle.is-dark .theme-toggle-track { background: rgba(255, 255, 255, .38); }
.theme-toggle.is-dark .theme-toggle-thumb { transform: translateX(16px); background: #f5f5f5; }
.theme-toggle.is-dark .theme-toggle-sun,
.theme-toggle.is-light .theme-toggle-moon { opacity: .42; }
.cart-badge { position: absolute; top: -8px; right: -8px; min-width: 18px; height: 18px; border-radius: 999px; background: #f7f7f7; color: #111; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }

/* Catalog card image styles controlled by index.css */
.catalog-results .card {
  animation: catalog-card-fade .34s ease both;
}
.catalog-search-layer {
  position: fixed;
  top: 96px;
  left: 0;
  right: 0;
  z-index: 45;
  display: grid;
  justify-items: center;
  padding: 0 18px;
  pointer-events: none;
}
.catalog-search-panel {
  width: min(820px, 100%);
  position: relative;
  pointer-events: auto;
  background: rgba(34, 34, 34, 0.94);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .3);
  padding: 18px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.catalog-search-layer.is-open .catalog-search-panel {
  animation: catalog-search-in .22s ease both;
}
.catalog-search-layer.is-closing .catalog-search-panel {
  animation: catalog-search-out .22s ease both;
}
.catalog-search-content {
  display: grid;
  gap: 10px;
  padding-right: 40px;
}
.catalog-search-content input {
  width: 100%;
  min-height: 46px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 11px 13px;
  outline: none;
}
.catalog-search-content input:focus {
  border-color: var(--border);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}
.search-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--border);
  display: inline-grid;
  place-items: center;
  line-height: 1;
}
.product-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.58);
  background: color-mix(in srgb, #000 58%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: product-modal-backdrop .22s ease both;
}
.product-modal {
  position: relative;
  width: min(1080px, 96vw);
  max-height: min(860px, 90vh);
  overflow: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
  gap: 22px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 26px 80px rgba(0, 0, 0, .42);
  animation: product-modal-in .28s cubic-bezier(.2, .8, .2, 1) both;
}
.product-modal-close {
  z-index: 2;
}
.product-modal-gallery {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.product-modal-main-image {
  min-height: 430px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--text) 8%, transparent), transparent 36%),
    linear-gradient(140deg, var(--surface-soft), var(--surface));
  display: grid;
  place-items: center;
  overflow: hidden;
}
.product-modal-main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-modal-main-image span {
  max-width: 72%;
  color: var(--muted);
  font-size: clamp(18px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: .16em;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
  opacity: .52;
}
.product-modal-thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.product-modal-thumb {
  min-height: 82px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--muted);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.product-modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-modal-thumb.active {
  border-color: var(--border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.product-modal-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  min-width: 0;
}
.product-modal-info h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 46px);
  line-height: 1;
  letter-spacing: -.04em;
}
.product-modal-info p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.product-modal-info .price {
  margin-top: 10px;
  color: var(--text);
  font-size: 24px;
}
.product-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.product-detail-grid div {
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-soft);
  padding: 12px;
  display: grid;
  gap: 6px;
}
.product-detail-grid strong {
  font-size: 15px;
}
.product-detail-grid .stock-detail-card {
  align-self: start;
  min-height: 0;
  padding: 10px 12px;
  gap: 3px;
}
.stock-detail-card strong {
  font-size: 18px;
  line-height: 1;
}
.measurement-list {
  list-style: none;
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
.measurement-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
.measurement-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.measurement-list span {
  color: var(--muted);
  font-size: 13px;
}
.measurement-list strong {
  text-align: right;
}
.product-modal-actions {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
}
.product-modal-actions input {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 10px;
}

.card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.checkout-actions { flex-wrap: nowrap; justify-content: flex-start; min-height: 40px; }
.checkout-actions > button,
.checkout-actions > .btn-alt {
  width: 170px;
  flex: 0 0 170px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.card-actions input, .stack input, .stack textarea, .filter-row input { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); padding: 9px; }
.card-actions input { width: 86px; }
.qty-slot { width: 86px; min-width: 86px; opacity: 0; transform: translateX(6px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.qty-slot.open { opacity: 1; transform: translateX(0); pointer-events: auto; }
.qty-slot input { width: 100%; }
button, .btn-alt { border: 0; background: var(--dark); color: var(--surface); padding: 9px 11px; border-radius: 8px; text-decoration: none; cursor: pointer; }
.btn-alt { background: #595959; color: #f5f5f5; }
.btn-back-fixed {
  width: 170px;
  flex: 0 0 170px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.btn-danger { background: var(--danger); color: #fff; }
button:disabled { opacity: .6; cursor: not-allowed; }

.stack { display: grid; gap: 8px; }
.row-card { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); padding: 10px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.row-card.column { align-items: stretch; display: grid; gap: 8px; }
.cart-item {
  max-height: 170px;
  overflow: hidden;
  transform-origin: center;
  transition:
    opacity .24s ease,
    transform .24s ease,
    max-height .28s ease,
    padding .24s ease,
    border-color .24s ease,
    background .24s ease;
}
.cart-item.is-removing {
  max-height: 0;
  opacity: 0;
  transform: translateX(18px) scale(.98);
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
  pointer-events: none;
}
.resume-row { margin-top: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); padding: 10px; display: flex; justify-content: space-between; align-items: center; }

.pagination { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
.spacer-top { margin-top: 10px; }
.search-row, .filter-row { display: grid; gap: 8px; grid-template-columns: 1fr auto auto; align-items: center; }
.filter-row { grid-template-columns: 1.4fr 1fr 1fr auto auto; }
.triple { display: grid; gap: 8px; grid-template-columns: repeat(3, 1fr); }
.method { display: inline-flex; align-items: center; gap: 8px; }
.method input[type='checkbox'], .method input[type='radio'] { width: auto; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { border: 1px solid var(--border); border-radius: 999px; padding: 3px 8px; font-size: 11px; color: var(--muted); background: var(--surface-soft); }
.stats-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.stat-box { border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); padding: 10px; display: grid; gap: 5px; }
.stat-box span { color: var(--muted); font-size: 12px; }
.stat-box strong { font-size: 20px; }
.stat-box-warning {
  border-color: #b45309;
  background: rgba(245, 158, 11, 0.10);
}
.stock-alert-panel {
  border-color: #b45309;
  background: rgba(245, 158, 11, 0.08);
}
.stock-alert-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.stock-alert-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-soft);
}
.stock-alert-item.is-critical {
  border-color: #b91c1c;
  background: rgba(185, 28, 28, 0.08);
}
.stock-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.18);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.45);
}
.stock-badge.is-critical {
  background: rgba(185, 28, 28, 0.14);
  color: #7f1d1d;
  border-color: #b91c1c;
}
.product-editor.is-low-stock {
  border-color: #f59e0b;
}
.product-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.login-screen { min-height: 100vh; display: grid; place-items: center; }
.login-card { max-width: 450px; width: 100%; }
.brand-center { display: grid; justify-content: center; margin-bottom: 8px; }
.product-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.product-search-inline { min-width: min(620px, 100%); }
.products-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 12px; align-items: start; }
.sticky-panel { position: sticky; top: 14px; }
.compact-stack .product-editor { gap: 6px; padding: 8px; }
.compact-stack .product-editor input,
.compact-stack .product-editor textarea { padding: 7px; font-size: 13px; }
.product-editor { animation: item-fade-in .22s ease both; transition: opacity .22s ease, transform .22s ease; }
.product-editor.is-removing { opacity: 0; transform: translateX(8px); pointer-events: none; }
.product-list {
  display: grid;
  gap: 8px;
}
.product-list-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
  overflow: hidden;
  animation: item-fade-in .2s ease both;
}
.product-list-item.is-removing {
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
}
.product-list-summary {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 48px minmax(160px, 1fr) auto auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.product-list-summary:hover,
.product-list-summary:focus-visible {
  background: rgba(238, 238, 238, 0.05);
}
.product-list-thumb {
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.product-list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-list-main {
  display: grid;
  gap: 3px;
}
.product-list-main small,
.product-list-meta {
  color: var(--muted);
  font-size: 12px;
}
.chip.is-muted {
  opacity: .65;
}
.product-edit-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid var(--border);
  background: rgba(34, 34, 34, 0.7);
  animation: admin-panel-open .2s ease both;
}
.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.admin-field {
  display: grid;
  gap: 6px;
}
.admin-field > span,
.admin-field-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}
.admin-field input,
.admin-field textarea,
.admin-field select {
  width: 100%;
}
.admin-field select {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 9px;
}
.product-images-editor {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(42, 42, 42, 0.72);
  padding: 10px;
  display: grid;
  gap: 8px;
}
.product-images-editor textarea {
  min-height: 46px;
  resize: vertical;
}
.image-editor-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.product-image-previews {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  min-height: 90px;
}
.product-image-preview {
  position: relative;
  width: 88px;
  height: 88px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.product-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.image-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.45);
  color: white;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 150ms ease;
}
.image-remove-btn:hover,
.image-remove-btn:focus-visible {
  background: rgba(220, 38, 38, 0.95);
}
.carousel-admin-list {
  display: grid;
  gap: 12px;
}
.carousel-admin-card {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  transition: opacity 180ms ease, transform 180ms ease;
}
.carousel-admin-card--new {
  margin-bottom: 14px;
  background: var(--surface);
}
.carousel-admin-card.is-removing {
  opacity: 0;
  transform: translateY(6px);
}
.carousel-slide-preview {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 16 / 9;
  align-self: start;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.carousel-slide-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
}
.carousel-slide-preview img.is-cropped {
  position: absolute;
  inset: auto;
  max-width: none;
  max-height: none;
  object-fit: fill;
}
.carousel-slide-fields {
  min-width: 0;
  display: grid;
  align-content: space-between;
  gap: 12px;
}
.carousel-slide-fields .admin-form-grid {
  min-width: 0;
}
.carousel-slide-fields .admin-field,
.carousel-slide-fields .card-actions {
  min-width: 0;
}
.compact-method {
  min-height: 36px;
  align-items: center;
  padding: 0 10px;
}
.modal-overlay.hero-crop-overlay {
  place-items: center;
  padding: max(12px, 2vh);
  overflow: auto;
}
.modal-card.hero-cropper-card {
  width: min(1280px, 98vw);
  max-height: min(94vh, 980px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  overflow: hidden;
}
.hero-crop-layout {
  display: grid;
  grid-template-rows: minmax(340px, 1fr) minmax(180px, 260px);
  gap: 12px;
  min-height: 0;
}
.hero-crop-overview,
.hero-crop-workspace {
  position: relative;
  width: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #050505;
}
.hero-crop-overview {
  min-height: 180px;
  padding: 10px;
}
.hero-crop-overview-canvas {
  position: relative;
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 240px;
  overflow: hidden;
  border-radius: 8px;
  background: #0a0a0a;
}
.hero-crop-workspace {
  min-height: 0;
  padding: 10px;
}
.hero-crop-overview-canvas img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  object-position: center center;
  display: block;
}
.hero-crop-selection {
  position: absolute;
  z-index: 1;
  border: 2px solid rgba(255, 255, 255, .92);
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .48), 0 10px 24px rgba(0, 0, 0, .34);
  pointer-events: none;
}
.hero-crop-frame {
  position: relative;
  width: min(100%, 1120px);
  aspect-ratio: 16 / 9;
  max-height: calc(94vh - 270px);
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .86);
  border-radius: 12px;
  background: #111;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .34), 0 18px 50px rgba(0, 0, 0, .38);
  cursor: grab;
  touch-action: none;
}
.hero-crop-frame.is-dragging {
  cursor: grabbing;
}
.hero-crop-frame img {
  position: absolute;
  max-width: none;
  max-height: none;
  object-fit: fill;
  user-select: none;
  pointer-events: none;
}
.hero-crop-guides {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, transparent 33.333%, rgba(255, 255, 255, .42) 33.333%, rgba(255, 255, 255, .42) calc(33.333% + 1px), transparent calc(33.333% + 1px), transparent 66.666%, rgba(255, 255, 255, .42) 66.666%, rgba(255, 255, 255, .42) calc(66.666% + 1px), transparent calc(66.666% + 1px)),
    linear-gradient(to bottom, transparent 33.333%, rgba(255, 255, 255, .42) 33.333%, rgba(255, 255, 255, .42) calc(33.333% + 1px), transparent calc(33.333% + 1px), transparent 66.666%, rgba(255, 255, 255, .42) 66.666%, rgba(255, 255, 255, .42) calc(66.666% + 1px), transparent calc(66.666% + 1px));
  pointer-events: none;
}
.hero-crop-controls {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}
.hero-crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.file-btn {
  position: relative;
  overflow: hidden;
}
.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.42); background: color-mix(in srgb, #000 42%, transparent); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 18px; z-index: 50; }
.modal-card { width: min(860px, 96vw); max-height: 86vh; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; box-shadow: 0 14px 35px rgba(0, 0, 0, .28); }
.admin-create-overlay {
  place-items: start center;
  padding-top: max(18px, 4vh);
}
.admin-create-card {
  width: min(980px, 96vw);
  max-height: min(88vh, 820px);
}
.waiting-overlay { z-index: 55; }
.waiting-card {
  width: min(680px, 94vw);
  max-width: 680px;
  min-height: 250px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 10px;
  padding: 28px;
}
.waiting-spinner {
  width: 56px;
  height: 56px;
  border: 4px solid rgba(63, 63, 63, 0.3);
  border-top-color: var(--dark);
  border-radius: 999px;
  animation: waiting-spin 1s linear infinite;
}
.orders-compact { margin-top: 10px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-soft); }
.orders-head { display: grid; grid-template-columns: 70px 1.6fr 1fr 1fr 120px 1.4fr; gap: 8px; padding: 8px 10px; font-size: 12px; font-weight: 700; border-bottom: 1px solid var(--border); background: var(--surface); }
.orders-row { display: grid; grid-template-columns: 70px 1.6fr 1fr 1fr 120px 1.4fr; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); align-items: center; }
.orders-row:last-child { border-bottom: 0; }
.orders-row span { display: grid; gap: 2px; font-size: 12px; }
.orders-row small { color: var(--muted); font-size: 11px; }
.orders-row .card-actions { justify-content: flex-end; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.receipt-card { border-color: #9a9a9a; }
.receipt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 10px; }
.receipt-head h3 { margin: 0 0 4px; letter-spacing: .4px; }
.receipt-head p { margin: 0; }
.receipt-customer { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 12px; }
.receipt-customer div { border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); padding: 8px; display: grid; gap: 3px; }
.receipt-customer span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.receipt-table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.receipt-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px; }
.receipt-table thead th { text-align: left; padding: 8px 10px; background: var(--surface-soft); border-bottom: 1px solid var(--border); }
.receipt-table tbody td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.receipt-table tbody tr:last-child td { border-bottom: 0; }
.receipt-total { margin-top: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 10px; display: flex; justify-content: space-between; align-items: center; background: var(--surface-soft); }

@media print {
  body { background: #fff !important; color: #111 !important; }
  .top-header, .no-print, .notice, .chips { display: none !important; }
  .container { max-width: 100%; margin: 0; padding: 0; }
  .panel { border: 0; box-shadow: none; background: #fff; margin: 0; padding: 0; }
  .receipt-card { display: block; border: 0 !important; }
  .app-shell main > :not(.receipt-card) { display: none !important; }
  .receipt-customer div, .receipt-total, .receipt-table-wrap { background: #fff; }
}

@keyframes item-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes admin-panel-open {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes admin-notice-pop {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes route-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes catalog-search-in {
  from { opacity: 0; transform: translateY(-28px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes catalog-search-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-28px) scale(.98); }
}
@keyframes catalog-card-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes product-modal-backdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes product-modal-in {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes waiting-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .route-transition,
  .product-modal-overlay,
  .product-modal,
  .catalog-results .card {
    animation: none;
  }
}

@media (max-width: 900px) {
  .triple, .search-row, .filter-row { grid-template-columns: 1fr; }
  .catalog-search-layer { top: 126px; }
  .catalog-search-panel { padding: 16px; }
  .catalog-search-content { padding-right: 34px; }
  .product-modal-overlay { padding: 12px; align-items: start; overflow: auto; }
  .product-modal { grid-template-columns: 1fr; width: 100%; max-height: none; padding: 16px; margin-top: 10px; }
  .product-modal-main-image { min-height: 300px; }
  .product-detail-grid, .product-modal-actions { grid-template-columns: 1fr; }
  .row-card { flex-direction: column; align-items: flex-start; }
  .resume-row, .pagination { flex-direction: column; align-items: flex-start; }
  .checkout-actions { flex-wrap: wrap; justify-content: flex-start; }
  .checkout-actions > button, .checkout-actions > .btn-alt { min-width: 0; width: 100%; }
  .stats-grid { grid-template-columns: 1fr; }
  .product-toolbar { align-items: stretch; }
  .product-search-inline { min-width: 100%; }
  .carousel-admin-card { grid-template-columns: 1fr; }
  .modal-card.hero-cropper-card { max-height: 94vh; }
  .hero-crop-layout { grid-template-rows: minmax(220px, 1fr) minmax(160px, 220px); }
  .hero-crop-workspace { min-height: 220px; padding: 8px; }
  .hero-crop-overview { min-height: 160px; }
  .hero-crop-overview-canvas { max-height: 200px; }
  .hero-crop-frame { width: 100%; max-height: calc(94vh - 260px); }
  .hero-crop-actions { justify-content: flex-start; }
  .product-list-summary { grid-template-columns: 42px 1fr; }
  .product-list-meta, .product-list-summary .chip, .product-list-summary .stock-badge { justify-self: start; }
  .admin-form-grid { grid-template-columns: 1fr; }
  .products-layout { grid-template-columns: 1fr; }
  .sticky-panel { position: static; }
  .orders-head { display: none; }
  .orders-row { grid-template-columns: 1fr; border-bottom: 1px dashed var(--border); }
  .orders-row .card-actions { justify-content: flex-start; }
  .receipt-customer { grid-template-columns: 1fr; }
}
