/* Brand colors: #f5821f (orange), #f3f3f3 (light gray), #ffffff (white) */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #333;
}

.layout {
  display: flex;
  min-height: 100vh;
  /* Do not stretch the sidebar to the height of the main column (long pages
     made the nav look like it "ran to infinity"). Main grows; sidebar stays
     viewport-sized and sticky. */
  align-items: flex-start;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #ffffff;
  padding: 1.5rem 0;
  box-shadow: 1px 0 0 rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  display: block;
  padding: 0 1.5rem 1.5rem;
  border-bottom: 1px solid #f3f3f3;
  margin-bottom: 1rem;
}

.sidebar-logo img {
  display: block;
  max-width: 100%;
  height: auto;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: #333;
  text-decoration: none;
  font-weight: 500;
}

.sidebar-nav a:hover {
  background: #f3f3f3;
}

.sidebar-nav a.active {
  background: #f5821f;
  color: #ffffff;
}

/* Cart UI mockup (sidebar + My Products toolbar) — replace when cart is wired */
.sidebar-nav-cart-li {
  list-style: none;
}

.sidebar-nav-cart-mock {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.75rem 1.5rem;
  border: none;
  background: transparent;
  color: #333;
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.sidebar-nav-cart-mock:hover {
  background: #f3f3f3;
}

.sidebar-nav-cart-mock:focus-visible {
  outline: 2px solid #f5821f;
  outline-offset: -2px;
}

.sidebar-nav-cart-mock-text {
  flex: 1;
}

.cart-mock-icon {
  flex-shrink: 0;
  display: block;
}

.cart-mock-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  margin-left: 0.15rem;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
  background: #f5821f;
  color: #ffffff;
  border-radius: 999px;
}

.my-products-toolbar-cart-mock {
  flex: 0 0 auto;
  margin-left: auto;
  display: flex;
  align-items: flex-end;
}

.my-products-cart-mock-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #ffffff;
  color: #333;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.my-products-cart-mock-btn:hover {
  border-color: #f5821f;
  color: #222;
}

.my-products-cart-mock-label {
  line-height: 1;
}

.sidebar-footer {
  margin-top: auto;
}

.sidebar-staff-sync {
  padding: 0.65rem 1.5rem;
  border-top: 1px solid #f3f3f3;
  font-size: 0.6875rem;
  line-height: 1.4;
  color: #666;
}

.sidebar-staff-sync-inner {
  word-break: break-word;
}

.sidebar-staff-sync-label {
  font-weight: 600;
  color: #555;
  margin-right: 0.15rem;
}

.sidebar-staff-sync-value {
  margin-right: 0.25rem;
}

.sidebar-staff-sync-sep {
  margin: 0 0.2rem;
  color: #bbb;
}

.sidebar-staff-sync-muted {
  color: #777;
}

.sidebar-staff-sync-muted code {
  font-size: 0.625rem;
}

.sidebar-staff-sync-error {
  color: #a94442;
}

.sidebar-user {
  padding: 1rem 1.5rem;
  border-top: 1px solid #f3f3f3;
}

.sidebar-user-email {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  color: #666;
  word-break: break-all;
}

.sidebar-logout-form {
  margin: 0;
}

.sidebar-logout-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #f5821f;
  cursor: pointer;
  text-decoration: underline;
}

.sidebar-logout-btn:hover {
  color: #e07318;
}

.main {
  flex: 1;
  background: #f3f3f3;
  padding: 2rem;
  min-width: 0;
}

.page-title {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

.template-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.template-card-image {
  aspect-ratio: 1;
  background: #f3f3f3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 0.875rem;
}

.template-card-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.template-card-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}

.template-card-actions {
  display: flex;
  gap: 0.5rem;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.15s, color 0.15s;
}

.btn-primary {
  background: #f5821f;
  color: #ffffff;
  border-color: #f5821f;
  flex: 1;
}

.btn-primary:hover {
  background: #e07318;
  border-color: #e07318;
  color: #ffffff;
}

.btn-secondary {
  background: #ffffff;
  color: #f5821f;
  border-color: #f5821f;
  flex: 1;
}

.btn-secondary:hover {
  background: #fff8f3;
  color: #e07318;
  border-color: #e07318;
}

/* Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: #ffffff;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
  z-index: 101;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  background: #f5821f;
  color: #ffffff;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.drawer-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.drawer-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  margin: -0.25rem 0 -0.25rem 0.5rem;
}

.drawer-close:hover {
  opacity: 0.9;
}

.drawer-body {
  padding: 1.25rem;
  flex: 1;
}

.drawer-image {
  background: #f3f3f3;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  min-height: 180px;
  overflow: hidden;
}

.drawer-specs {
  margin: 0;
  font-size: 0.9375rem;
}

.drawer-specs dt {
  font-weight: 600;
  color: #333;
  margin-top: 0.75rem;
}

.drawer-specs dt:first-child {
  margin-top: 0;
}

.drawer-specs dd {
  margin: 0.25rem 0 0;
  color: #555;
}

.drawer-winding-icon {
  display: inline-block;
  margin-right: 0.25rem;
}

.drawer-actions {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
  border-top: 1px solid #f3f3f3;
}

.drawer-actions .btn {
  width: 100%;
  font: inherit;
  box-sizing: border-box;
}

.drawer-quantity {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  width: 100%;
}

.drawer-quantity-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.75rem;
}

.drawer-quantity-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #333;
  margin: 0;
  cursor: pointer;
}

.drawer-quantity-measure {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding-top: 0.125rem;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: #666;
}

.drawer-quantity-input {
  width: 5.5rem;
  flex-shrink: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9375rem;
  line-height: 1.3;
  box-sizing: border-box;
}

.drawer-quantity-input:focus {
  outline: 2px solid #f5821f;
  outline-offset: 2px;
}

.drawer-pdf-link {
  color: #0066cc;
  text-decoration: underline;
  font-size: 0.875rem;
  text-align: center;
}

.drawer-pdf-link:hover {
  color: #004499;
}

/* Cart peek panel (sidebar trigger; design-only until cart is wired) */
.cart-peek-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 110;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.cart-peek-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.cart-peek {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #ffffff;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
  z-index: 111;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
}

.cart-peek.is-open {
  transform: translateX(0);
}

.cart-peek-header {
  flex-shrink: 0;
  background: #f5821f;
  color: #ffffff;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cart-peek-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}

.cart-peek-header-meta {
  display: flex;
  align-items: center;
}

.cart-peek-header-meta .cart-mock-badge {
  background: #ffffff;
  color: #f5821f;
}

.cart-peek-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  margin: -0.25rem 0 -0.25rem 0.25rem;
  border-radius: 4px;
}

.cart-peek-close:hover {
  opacity: 0.9;
}

.cart-peek-close:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.cart-peek-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.25rem 1.25rem;
}

.cart-peek-note {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #666;
}

.cart-peek-note--small {
  margin-top: 1rem;
  margin-bottom: 0;
}

.cart-peek-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-peek-line {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  background: #fafafa;
}

.cart-peek-line-thumb {
  width: 3.5rem;
  height: 3.5rem;
  flex-shrink: 0;
  border-radius: 6px;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
}

.cart-peek-line-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cart-peek-line-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}

.cart-peek-line-meta {
  font-size: 0.75rem;
  color: #777;
}

.cart-peek-line-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.cart-peek-qty-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #555;
}

.cart-peek-qty-input {
  width: 4rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.8125rem;
  opacity: 0.65;
}

.cart-peek-remove {
  font-size: 0.8125rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  color: #666;
  cursor: not-allowed;
  opacity: 0.65;
}

.cart-peek-footer {
  flex-shrink: 0;
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid #f3f3f3;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cart-peek-footer .btn {
  width: 100%;
  font: inherit;
  box-sizing: border-box;
}

.cart-peek-footer .btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

@media (prefers-reduced-motion: reduce) {
  .cart-peek-backdrop,
  .cart-peek {
    transition: none;
  }
}

/* Login / landing page */
.login-page {
  min-height: 100vh;
  background: #f3f3f3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-main {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.login-card {
  width: 100%;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  padding: 2rem;
}

.login-card-logo {
  display: block;
  height: auto;
  max-width: 180px;
  margin: 0 auto 1.5rem;
}

.login-title {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
}

.login-lead {
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  color: #555;
}

.login-errors {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #b91c1c;
}

.login-errors li {
  margin: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.login-page .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.login-page label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #333;
}

.login-page input[type="email"],
.login-page input[type="password"] {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #333;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  transition: border-color 0.15s;
}

.login-page input[type="email"]:focus,
.login-page input[type="password"]:focus {
  outline: none;
  border-color: #f5821f;
  box-shadow: 0 0 0 3px rgba(245, 130, 31, 0.2);
}

.login-page input[type="email"]::placeholder,
.login-page input[type="password"]::placeholder {
  color: #9ca3af;
}

.login-page .field-error {
  font-size: 0.8125rem;
  color: #b91c1c;
}

.login-submit {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  margin-top: 0.25rem;
}

/* Dashboard (synced data) */
.dashboard-notice {
  background: #fff8f0;
  border: 1px solid #f5821f;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  max-width: 40rem;
}

.dashboard-notice--info {
  background: #f0f7ff;
  border-color: #93c5fd;
}

.dashboard-summary {
  background: #ffffff;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.dashboard-section-title {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #333;
}

.dashboard-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1.25rem;
  margin: 0 0 1rem;
  font-size: 0.875rem;
}

.dashboard-dl dt {
  margin: 0;
  color: #666;
  font-weight: 500;
}

.dashboard-dl dd {
  margin: 0;
  color: #333;
}

.dashboard-error-preview {
  color: #b91c1c;
  word-break: break-word;
}

.dashboard-orders {
  margin-bottom: 2rem;
}

.dashboard-table-wrap {
  overflow-x: auto;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.dashboard-table th,
.dashboard-table td {
  text-align: left;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #f3f3f3;
}

.dashboard-table th {
  font-weight: 600;
  color: #555;
  background: #fafafa;
}

.dashboard-table tbody tr:last-child td {
  border-bottom: none;
}

.dashboard-product-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.dashboard-product-meta {
  margin: 0;
  font-size: 0.75rem;
  color: #666;
}

.dashboard-products .template-card {
  cursor: default;
}

/* Order history (/orders/) */
.order-history-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.order-history-header-main {
  min-width: 0;
}

.order-history-title {
  margin-bottom: 0.35rem;
}

.order-history-subtitle {
  margin: 0;
  font-size: 0.9375rem;
  color: #555;
  max-width: 36rem;
}

.order-history-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  padding: 1rem 1.25rem;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.order-history-filter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.order-history-filter--submit .btn {
  flex: 0 0 auto;
}

.order-history-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #555;
}

.order-history-label--spacer {
  visibility: hidden;
  user-select: none;
}

.order-history-select,
.order-history-input {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #ffffff;
  min-width: 0;
}

.order-history-select {
  min-width: 12rem;
}

.order-history-select:focus-visible,
.order-history-input:focus-visible {
  outline: 2px solid #f5821f;
  outline-offset: 2px;
}

.order-history-apply {
  flex: 0 0 auto;
}

.order-history-clear-wrap {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
}

.order-history-clear {
  color: #f5821f;
  font-weight: 600;
  text-decoration: none;
}

.order-history-clear:hover {
  text-decoration: underline;
}

.order-history-count {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: #666;
}

.order-history-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.order-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  padding: 1rem 1.1rem 0.9rem;
}

.order-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0.7rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #f3f3f3;
}

.order-card-title {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  font-weight: 600;
  color: #333;
}

.order-card-meta {
  margin: 0;
  font-size: 0.8125rem;
  color: #666;
}

.order-card-meta--dates {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
}

.order-card-date-block {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
}

.order-card-meta-sep {
  color: #c4c4c4;
  user-select: none;
}

.order-card-date-label {
  margin-right: 0.35rem;
  font-weight: 500;
}

.order-card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  justify-content: flex-end;
}

.order-status-pill {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid transparent;
}

.order-status-pill--finished {
  color: #166534;
  background: #ecfdf3;
  border-color: #86efac;
}

.order-status-pill--in-progress {
  color: #9a3412;
  background: #fff7ed;
  border-color: #fdba74;
}

.order-status-pill--muted {
  color: #555;
  background: #f3f4f6;
  border-color: #e5e7eb;
}

.order-item-count {
  font-size: 0.8125rem;
  color: #666;
  font-variant-numeric: tabular-nums;
}

.order-card-finished-placeholder {
  color: #888;
  font-style: italic;
  font-variant-numeric: tabular-nums;
}

.order-card-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0.55rem;
}

.order-card-costs {
  margin: 0;
  flex: 1 1 12rem;
  min-width: 0;
}

.order-card-cost-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 0;
  padding: 0.18rem 0;
  font-size: 0.8125rem;
  border-bottom: 1px solid #f3f3f3;
}

.order-card-cost-row:last-of-type {
  border-bottom: none;
}

.order-card-cost-row dt {
  margin: 0;
  font-weight: 500;
  color: #555;
}

.order-card-cost-row dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #333;
}

.order-card-cost-row--total {
  padding-top: 0.35rem;
  border-bottom: none;
}

.order-card-cost-row--total dt {
  font-weight: 600;
  color: #333;
}

.order-card-order-again {
  flex: 0 0 auto;
  align-self: center;
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  font-size: 0.8125rem;
}

.order-line-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
}

.order-line-list-frame {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid #f3f3f3;
}

.order-line-list-head,
.order-line-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 9.5rem 5.5rem;
  column-gap: 0.75rem;
  align-items: center;
}

.order-line-list-head {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #666;
  padding: 0 0 0.4rem;
  border-bottom: 1px solid #e8e8e8;
}

.order-line-head-cell {
  min-width: 0;
}

.order-line-head-qty,
.order-line-head-unit,
.order-line-metric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.order-line-head-product {
  text-align: left;
}

.order-line-item {
  padding: 0.35rem 0;
  font-size: 0.875rem;
  border-bottom: 1px solid #f3f3f3;
}

.order-line-product {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.order-line-image {
  flex: 0 0 3.5rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 6px;
  background: #f3f3f3;
  overflow: hidden;
}

.order-line-image-btn {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: zoom-in;
}

.order-line-image-btn:focus {
  outline: none;
}

.order-line-image-btn:focus-visible {
  outline: 2px solid #f5821f;
  outline-offset: 2px;
}

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

.order-line-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0.2rem;
  box-sizing: border-box;
  color: #999;
  font-size: 0.6875rem;
  line-height: 1.15;
  text-align: center;
}

.order-line-name {
  min-width: 0;
  color: #333;
  word-break: break-word;
}

.order-line-metric-value {
  color: #555;
  font-weight: 500;
}

.order-line-placeholder {
  color: #999;
  font-weight: 500;
  font-style: italic;
}

.order-line-data-note {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #777;
}

.order-card-details {
  margin: 0;
  font-size: 0.8125rem;
}

.order-card-details-summary {
  cursor: pointer;
  font-weight: 600;
  color: #f5821f;
  list-style: none;
  font-size: 0.8125rem;
}

.order-card-details-summary::-webkit-details-marker {
  display: none;
}

.order-card-details-summary::before {
  content: "";
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  margin-right: 0.4rem;
  border-right: 2px solid #f5821f;
  border-bottom: 2px solid #f5821f;
  transform: rotate(-45deg);
  vertical-align: 0.12rem;
}

.order-card-details[open] .order-card-details-summary::before {
  transform: rotate(45deg);
  vertical-align: 0.05rem;
}

.order-line-list-frame .order-line-list--full {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  border-top: none;
}

.order-empty-state {
  background: #ffffff;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  font-size: 0.9375rem;
  color: #555;
}

.order-empty-state p {
  margin: 0;
}

.order-history-pagination {
  margin-top: 1.5rem;
}

.order-history-pagination-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.order-history-page-current {
  font-size: 0.875rem;
  color: #666;
}

.order-history-page-link {
  flex: 0 0 auto;
}

@media (prefers-reduced-motion: reduce) {
  .order-card-details-summary::before {
    transition: none;
  }
}

@media (max-width: 640px) {
  .order-card-badges {
    justify-content: flex-start;
  }

  .order-line-list-head,
  .order-line-item {
    grid-template-columns: minmax(0, 1fr) 6.75rem 4.25rem;
    column-gap: 0.5rem;
  }

  .order-line-list-head {
    font-size: 0.625rem;
  }

  .order-line-item {
    align-items: start;
  }
}

@media (min-width: 1280px) {
  .order-history-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
  }
}

/* Cart checkout (/cart/checkout/) */
.cart-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.cart-page-title {
  margin-bottom: 0.2rem;
}

.cart-page-subtitle {
  margin: 0;
  font-size: 0.8125rem;
  color: #666;
}

.cart-ready-pill {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #166534;
  background: #ecfdf3;
  border: 1px solid #86efac;
}

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20rem;
  gap: 1rem 1.15rem;
  align-items: start;
}

.cart-main-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem 0.9rem;
  margin-bottom: 0.65rem;
}

.cart-main-back-link {
  color: #f5821f;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
}

.cart-main-back-link:hover {
  text-decoration: underline;
}

.cart-main-bulk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.cart-main-bulk-select {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: #555;
}

.cart-main-bulk-remove {
  font-size: 0.75rem;
  padding: 0.3rem 0.55rem;
}

.cart-lines-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.cart-lines-head,
.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.2fr) 7rem 6.5rem 6.5rem 2rem;
  gap: 0.65rem;
  align-items: center;
  padding: 0.75rem 0.9rem;
}

.cart-lines-head {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #666;
  border-bottom: 1px solid #ececec;
}

.cart-lines-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cart-line {
  border-bottom: 1px solid #f0f0f0;
}

.cart-line:last-child {
  border-bottom: none;
}

.cart-line-product {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
}

.cart-line-thumb {
  width: 2.8rem;
  height: 2.8rem;
  flex-shrink: 0;
  border-radius: 6px;
  background: #efefef;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a8a8a;
  font-size: 0.625rem;
  font-weight: 600;
}

.cart-line-name,
.cart-line-sku {
  margin: 0;
}

.cart-line-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #333;
}

.cart-line-sku {
  margin-top: 0.15rem;
  font-size: 0.6875rem;
  color: #777;
}

.cart-line-warning {
  display: inline-block;
  margin-top: 0.2rem;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 600;
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fdba74;
}

.cart-line-specs {
  margin: 0;
  font-size: 0.75rem;
  color: #555;
}

.cart-line-qty {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.cart-line-qty button,
.cart-line-qty input {
  height: 1.75rem;
  border: 1px solid #d6d6d6;
  border-radius: 4px;
  background: #fff;
  color: #555;
}

.cart-line-qty button {
  width: 1.75rem;
  padding: 0;
}

.cart-line-qty input {
  width: 2.2rem;
  text-align: center;
  font-size: 0.75rem;
}

.cart-line-price,
.cart-line-total {
  margin: 0;
  text-align: right;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  color: #333;
}

.cart-line-total {
  font-weight: 600;
}

.cart-line-remove {
  border: none;
  background: transparent;
  color: #999;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

.cart-lines-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-top: 1px solid #ececec;
}

.cart-clear-btn {
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
}

.cart-lines-footer-total {
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: #555;
}

.cart-lines-footer-total strong {
  font-size: 1.1rem;
  color: #333;
  font-variant-numeric: tabular-nums;
}

.cart-empty-suggestion {
  margin-top: 0.65rem;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  font-size: 0.8125rem;
}

.cart-empty-suggestion p {
  margin: 0 0 0.2rem;
  color: #555;
}

.cart-empty-suggestion a {
  color: #f5821f;
  font-weight: 600;
  text-decoration: none;
}

.cart-empty-suggestion a:hover {
  text-decoration: underline;
}

.cart-summary {
  position: sticky;
  top: 1rem;
}

.cart-summary-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  padding: 0.9rem;
}

.cart-summary-title {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #555;
}

.cart-summary-dl {
  margin: 0;
}

.cart-summary-dl > div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
}

.cart-summary-dl dt {
  margin: 0;
  color: #666;
}

.cart-summary-dl dd {
  margin: 0;
  color: #333;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cart-summary-grand-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0.6rem 0 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid #ececec;
}

.cart-summary-grand-total span {
  font-size: 0.9375rem;
  color: #333;
  font-weight: 600;
}

.cart-summary-grand-total strong {
  font-size: 1.35rem;
  color: #f5821f;
  font-variant-numeric: tabular-nums;
}

.cart-summary-field {
  display: block;
  margin-bottom: 0.65rem;
}

.cart-summary-field span {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #555;
}

.cart-summary-field textarea,
.cart-summary-field select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d6d6d6;
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 0.75rem;
  color: #444;
  padding: 0.5rem 0.55rem;
}

.cart-summary-note {
  margin: 0.35rem 0 0.65rem;
  font-size: 0.6875rem;
  color: #666;
}

.cart-summary-note--muted {
  margin-top: 0.5rem;
  color: #999;
}

.cart-submit-btn {
  width: 100%;
}

@media (max-width: 1180px) {
  .cart-layout {
    grid-template-columns: 1fr;
  }

  .cart-summary {
    position: static;
  }
}

@media (max-width: 900px) {
  .cart-lines-head {
    display: none;
  }

  .cart-line {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.45rem;
  }

  .cart-line-price,
  .cart-line-total,
  .cart-line-specs {
    text-align: left;
  }

  .cart-line-qty {
    justify-content: flex-start;
  }

  .cart-line-remove {
    justify-self: end;
  }
}

/* Product cards (My Products page) */
#product-grid .template-card-image {
  min-width: 0;
  min-height: 0;
}

#product-grid .product-card-img {
  min-width: 0;
  min-height: 0;
}

#product-grid .product-card-img:not(.product-card-img--revealed) {
  opacity: 0;
  transform: translateY(10px);
}

#product-grid .product-card-img--revealed {
  opacity: 1;
  transform: none;
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

.product-card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (prefers-reduced-motion: reduce) {
  #product-grid .product-card-img:not(.product-card-img--revealed) {
    opacity: 0;
    transform: none;
  }

  #product-grid .product-card-img--revealed {
    opacity: 1;
    transition: none;
  }
}

.product-card-placeholder {
  font-size: 0.8125rem;
  color: #aaa;
}

.product-card-meta {
  margin: 0;
  font-size: 0.75rem;
  color: #888;
  background: #f9f9f9;
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
}

.drawer-product-img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
}

.drawer-product-thumb-btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
  text-align: center;
}

.drawer-product-thumb-btn:focus {
  outline: none;
}

.drawer-product-thumb-btn:focus-visible {
  outline: 2px solid #f5821f;
  outline-offset: 2px;
}

.product-image-viewer {
  position: relative;
  margin: 0;
  padding: 0;
  border: none;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  background: transparent;
  overflow: hidden;
  box-sizing: border-box;
}

.product-image-viewer::backdrop {
  background: rgba(0, 0, 0, 0.82);
}

.product-image-viewer-scrim {
  position: absolute;
  inset: 0;
  z-index: 0;
  cursor: pointer;
}

.product-image-viewer-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 100%;
  box-sizing: border-box;
  padding: 2.75rem 1rem 1.5rem;
  pointer-events: none;
}

.product-image-viewer-img {
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  pointer-events: auto;
}

.product-image-viewer-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  margin: 0;
  padding: 0.35rem 0.65rem;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.product-image-viewer-close:hover {
  background: #ffffff;
}

.product-image-viewer-close:focus {
  outline: none;
}

.product-image-viewer-close:focus-visible {
  outline: 2px solid #f5821f;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .product-image-viewer-close {
    box-shadow: none;
  }
}

/* My Products search & sort toolbar */
.my-products-catalog {
  margin-bottom: 0.5rem;
}

.my-products-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.5rem;
  margin-bottom: 1.25rem;
}

.my-products-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 0.35rem;
}

.my-products-search-field {
  flex: 1 1 220px;
  min-width: 0;
  max-width: 28rem;
}

.my-products-search-inner {
  position: relative;
}

.my-products-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9375rem;
}

.my-products-search-input:focus {
  outline: none;
  border-color: #f5821f;
  box-shadow: 0 0 0 2px rgba(245, 130, 31, 0.25);
}

.my-products-search-input:focus-visible {
  outline: 2px solid #f5821f;
  outline-offset: 2px;
}

.my-products-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 20;
  margin: 0.2rem 0 0;
  padding: 0.25rem 0;
  list-style: none;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  max-height: 14rem;
  overflow-y: auto;
}

.my-products-suggestion-item {
  padding: 0.45rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.my-products-suggestion-item:hover,
.my-products-suggestion-item.is-active {
  background: #f3f3f3;
}

.my-products-sort-field {
  flex: 0 1 auto;
}

.my-products-sort-select {
  min-width: 14rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.875rem;
  background: #ffffff;
}

.my-products-sort-select:focus-visible {
  outline: 2px solid #f5821f;
  outline-offset: 2px;
}

.my-products-card-fields {
  flex: 0 1 100%;
  min-width: 0;
}

.my-products-card-fields-summary {
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: #333;
  list-style: none;
}

.my-products-card-fields-summary::-webkit-details-marker {
  display: none;
}

.my-products-card-fields-summary::before {
  content: "";
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  margin-right: 0.35rem;
  border-right: 2px solid #666;
  border-bottom: 2px solid #666;
  transform: rotate(-45deg);
  vertical-align: 0.15rem;
  transition: transform 0.15s ease;
}

.my-products-card-fields[open] .my-products-card-fields-summary::before {
  transform: rotate(45deg);
  vertical-align: 0.05rem;
}

.my-products-card-fields-panel {
  margin-top: 0.65rem;
  padding: 0.75rem 1rem;
  background: #fafafa;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  max-width: 36rem;
}

.my-products-card-fields-fieldset {
  margin: 0 0 0.75rem;
  padding: 0;
  border: none;
}

.my-products-card-fields-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
  color: #444;
  cursor: pointer;
}

.my-products-card-fields-option:last-of-type {
  margin-bottom: 0;
}

.my-products-card-fields-option input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.my-products-card-fields-error {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  color: #a94442;
}

@media (prefers-reduced-motion: reduce) {
  .my-products-card-fields-summary::before {
    transition: none;
  }
}

.product-card-attr .product-card-attr-label {
  font-weight: 600;
}

.my-products-no-matches .my-products-clear-search {
  margin-left: 0.75rem;
  vertical-align: middle;
}

/* My Products grid summary & infinite scroll */
.products-scroll-footer,
.products-scroll-sentinel {
  overflow-anchor: none;
}

.products-grid-summary {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: #666;
}

.products-scroll-hint {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  color: #888;
}

.products-scroll-footer {
  margin-top: 0.5rem;
}

.products-scroll-status {
  padding: 1rem 0 1.25rem;
}

.products-scroll-status-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: #666;
  font-size: 0.875rem;
}

.products-scroll-primary {
  text-align: left;
}

.products-scroll-spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #e8e8e8;
  border-top-color: #f5821f;
  border-radius: 50%;
  flex-shrink: 0;
  animation: products-scroll-spin 0.7s linear infinite;
}

@keyframes products-scroll-spin {
  to {
    transform: rotate(360deg);
  }
}

.products-scroll-end {
  margin: 0;
  padding: 1rem 0 0.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: #888;
}

/* Global error toast (bottom-right); see fo_error_toast.js */
.fo-error-toast-host {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  max-width: calc(100vw - 2rem);
  pointer-events: none;
}

.fo-error-toast {
  pointer-events: auto;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.75rem 0.75rem 0.65rem;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-left: 4px solid #f5821f;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.fo-error-toast--visible {
  transform: translateX(0);
  opacity: 1;
}

.fo-error-toast-msg {
  margin: 0 0 0.6rem;
  font-size: 0.875rem;
  line-height: 1.35;
  color: #333;
}

.fo-error-toast-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.fo-error-toast-btn {
  font-size: 0.8125rem;
  padding: 0.35rem 0.65rem;
}

@media (max-width: 480px) {
  .fo-error-toast-host {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    align-items: stretch;
  }

  .fo-error-toast {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fo-error-toast {
    transition: opacity 0.12s ease;
    transform: none;
  }

  .fo-error-toast--visible {
    opacity: 1;
  }
}

/* Skeleton placeholders (infinite scroll loading) */
.product-card-skeleton {
  pointer-events: none;
  cursor: default;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  overflow-anchor: none;
}

.product-card-skeleton--leaving {
  transition: opacity 0.28s ease-out;
  opacity: 0;
}

.product-card-skeleton-image {
  background: linear-gradient(90deg, #ececec 0%, #f5f5f5 50%, #ececec 100%);
  background-size: 200% 100%;
  animation: product-skeleton-shimmer 1.2s ease-in-out infinite;
}

.product-card-skeleton-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.product-card-skeleton-line {
  height: 0.65rem;
  border-radius: 4px;
  background: linear-gradient(90deg, #ececec 0%, #f5f5f5 50%, #ececec 100%);
  background-size: 200% 100%;
  animation: product-skeleton-shimmer 1.2s ease-in-out infinite;
}

.product-card-skeleton-line--short {
  width: 55%;
}

@keyframes product-skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.products-scroll-sentinel {
  height: 1px;
}

@media (prefers-reduced-motion: no-preference) {
  #product-grid article.product-card.product-card--scroll-enter {
    opacity: 0;
    transform: translateY(12px);
    animation: product-card-scroll-enter 0.58s ease-out forwards;
    animation-delay: var(--product-card-scroll-enter-delay, 0ms);
  }
}

@keyframes product-card-scroll-enter {
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .products-scroll-spinner {
    animation: none;
    border-top-color: #ccc;
  }

  .product-card-skeleton-image,
  .product-card-skeleton-line {
    animation: none;
    background: #ececec;
  }

  .product-card-skeleton--leaving {
    transition: none;
  }
}

/* Drawer specification sub-section */
.drawer-spec-section-title {
  margin: 1.5rem 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Staff tools (/staff/) */
.staff-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  padding: 0.75rem 0 1.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.staff-subnav a {
  font-weight: 600;
  color: #f5821f;
  text-decoration: none;
}

.staff-subnav a:hover {
  text-decoration: underline;
}

.staff-link-list {
  margin: 1rem 0;
  padding-left: 1.25rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.staff-attr-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  margin: 1rem 0 0;
}

.staff-attr-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #555;
}

.staff-attr-search {
  min-width: 10rem;
  flex: 1;
  max-width: 22rem;
  padding: 0.4rem 0.5rem;
  font: inherit;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.staff-attr-filter {
  padding: 0.4rem 0.5rem;
  font: inherit;
  border: 1px solid #ccc;
  border-radius: 4px;
  min-width: 10rem;
}

.staff-attr-count {
  font-size: 0.875rem;
  color: #666;
  margin-left: auto;
}

.staff-table-wrap {
  overflow: auto;
  max-height: min(70vh, 32rem);
  margin: 0.75rem 0 1rem;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  background: #fff;
}

.staff-table-wrap .staff-table {
  margin: 0;
}

.staff-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.staff-table th,
.staff-table td {
  border: 1px solid #e8e8e8;
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: middle;
}

.staff-table th {
  background: #f9f9f9;
}

.staff-table-wrap .staff-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f9f9f9;
  box-shadow: 0 1px 0 #e8e8e8;
}

.staff-drag-cell {
  width: 2.75rem;
  text-align: center;
  vertical-align: middle;
}

.staff-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  min-height: 2rem;
  padding: 0;
  margin: 0;
  border: 1px solid #ccc;
  background: #fafafa;
  border-radius: 4px;
  cursor: grab;
  font-size: 1rem;
  line-height: 1;
  color: #555;
}

.staff-drag-handle:hover {
  background: #eee;
}

.staff-drag-handle:focus-visible {
  outline: 2px solid #f5821f;
  outline-offset: 1px;
}

.staff-drag-handle:active {
  cursor: grabbing;
}

tr.staff-attr-row-dragging > td {
  opacity: 0.65;
}

tr.staff-attr-row-drag-over > td {
  box-shadow: inset 0 3px 0 #f5821f;
}

.staff-order-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.staff-sort-order {
  max-width: 5.5rem;
  width: 5rem;
  min-width: 0;
  padding: 0.25rem 0.35rem;
  font: inherit;
}

.staff-order-actions {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.staff-move-btn {
  padding: 0.25rem 0.35rem;
  min-width: 7.5rem;
  font-size: 0.65rem;
  line-height: 1.15;
  white-space: normal;
  text-align: center;
  border: 1px solid #ccc;
  background: #fafafa;
  border-radius: 4px;
  cursor: pointer;
  color: #333;
}

.staff-move-btn:hover {
  background: #eee;
}

.staff-move-btn:focus-visible {
  outline: 2px solid #f5821f;
  outline-offset: 1px;
}

.staff-attr-id-cell .staff-attr-slug {
  font-size: 0.8125rem;
  word-break: break-word;
}

.staff-attr-duomuo {
  font-size: 0.75rem;
  color: #666;
  margin-top: 0.2rem;
}

.staff-table abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
}

.staff-import-form {
  margin: 0.5rem 0 1rem;
}

.staff-hint {
  color: #666;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.staff-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.staff-modal[hidden] {
  display: none;
}

.staff-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.staff-modal-panel {
  position: relative;
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  max-width: 32rem;
  width: calc(100% - 2rem);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.staff-modal-panel h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.staff-modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.staff-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 32rem;
}

.staff-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.staff-form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #333;
}

.staff-form-group input[type="text"],
.staff-form-group input[type="email"],
.staff-form-group input[type="password"],
.staff-form-group select {
  width: 100%;
  padding: 0.5rem 0.625rem;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: #333;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  transition: border-color 0.15s;
}

.staff-form-group input[type="text"]:focus,
.staff-form-group input[type="email"]:focus,
.staff-form-group input[type="password"]:focus,
.staff-form-group select:focus {
  outline: none;
  border-color: #f5821f;
  box-shadow: 0 0 0 3px rgba(245, 130, 31, 0.2);
}

.staff-form-group .staff-hint {
  margin: 0;
}

.staff-form-group .field-error {
  font-size: 0.8125rem;
  color: #b91c1c;
  margin: 0;
  padding: 0;
  list-style: none;
}

.staff-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.staff-form-actions {
  margin-top: 0.5rem;
}
