/* Safe declarative UI plugin engine */

html {
  font-size: calc(16px * var(--ui-font-scale, 1));
}

.theme-toggle {
  white-space: nowrap;
  background: #eef2ff;
  color: #243b75;
  padding: 8px 10px;
  font-size: 12px;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.ui-scroll-top-button {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  width: 46px;
  height: 46px;
  border-radius: 50%;
  z-index: 60;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.2);
  padding: 0;
  font-size: 22px;
}

.ui-scroll-top-button[hidden] {
  display: none;
}

body.ui-compact .section {
  padding-top: 24px;
  padding-bottom: 24px;
}

body.ui-compact .panel {
  padding: 15px;
}

body.ui-compact .product-body,
body.ui-compact .category-card {
  padding: 12px;
}

body.ui-radius-soft .panel,
body.ui-radius-soft .product-card,
body.ui-radius-soft .category-card,
body.ui-radius-soft .asset-placeholder,
body.ui-radius-soft input,
body.ui-radius-soft select,
body.ui-radius-soft textarea,
body.ui-radius-soft button,
body.ui-radius-soft .button {
  border-radius: 10px;
}

body.ui-radius-square .panel,
body.ui-radius-square .product-card,
body.ui-radius-square .category-card,
body.ui-radius-square .asset-placeholder,
body.ui-radius-square input,
body.ui-radius-square select,
body.ui-radius-square textarea,
body.ui-radius-square button,
body.ui-radius-square .button {
  border-radius: 3px;
}

body.ui-reduced-motion *,
body.ui-reduced-motion *::before,
body.ui-reduced-motion *::after {
  scroll-behavior: auto !important;
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

body.ui-high-contrast {
  filter: contrast(1.08);
}

body.ui-header-static .site-header {
  position: static;
}

body.ui-no-announcement .announcement {
  display: none !important;
}

body.ui-no-search .site-header .search {
  display: none !important;
}

body.ui-no-shop-nav .site-header nav > a[href="/"] {
  display: none !important;
}

body.ui-no-track-nav .site-header nav > a[href="/order/lookup"] {
  display: none !important;
}

body.ui-no-cart-nav .site-header nav > a[href="/cart"] {
  display: none !important;
}

body.ui-no-account-nav .site-header nav > a[href="/account"],
body.ui-no-account-nav .site-header nav > a[href="/login"] {
  display: none !important;
}

body.ui-no-hero .hero {
  display: none !important;
}

body.ui-no-categories [data-section-type="categories"],
body.ui-no-categories .layout-section:has(.category-grid) {
  display: none !important;
}

body.ui-no-filters .filters {
  display: none !important;
}

body.ui-no-ratings .rating,
body.ui-no-ratings .product-rating,
body.ui-no-ratings [data-ui-element="rating"] {
  display: none !important;
}

body.ui-no-sku .product-info > .eyebrow {
  display: none !important;
}

body.ui-no-stock .stock {
  display: none !important;
}

body.ui-no-compare-price .price del {
  display: none !important;
}

body.ui-no-supplier-badge .supplier-strip {
  display: none !important;
}

body.ui-no-like form[action*="/like"] {
  display: none !important;
}

body.ui-no-share .js-share {
  display: none !important;
}

body.ui-no-whatsapp .whatsapp {
  display: none !important;
}

body.ui-no-reviews #reviews {
  display: none !important;
}

body.ui-no-related
  main.wrap.section
  > .product-detail
  ~ section.section:last-of-type {
  display: none !important;
}

body.ui-no-breadcrumbs .breadcrumbs {
  display: none !important;
}

body.ui-no-footer .site-footer {
  display: none !important;
}

body.ui-no-footer-support .footer-grid > div:nth-child(2) {
  display: none !important;
}

body.ui-no-footer-shopping .footer-grid > div:nth-child(3) {
  display: none !important;
}

body.ui-product-cols-2 .product-grid {
  grid-template-columns: repeat(2, 1fr);
}

body.ui-product-cols-3 .product-grid {
  grid-template-columns: repeat(3, 1fr);
}

body.ui-product-cols-4 .product-grid {
  grid-template-columns: repeat(4, 1fr);
}

body.ui-product-cols-5 .product-grid {
  grid-template-columns: repeat(5, 1fr);
}

.plugin-settings {
  margin-top: 14px;
  border-top: 1px solid #eaecf0;
  padding-top: 12px;
}

.plugin-settings summary {
  cursor: pointer;
  font-weight: 800;
  color: #344054;
}

.plugin-settings-form {
  margin-top: 14px;
}

.plugin-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.plugin-control-field {
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  padding: 12px;
  background: #fcfcfd;
  display: grid;
  gap: 6px !important;
}

.plugin-control-field > span:first-child {
  font-weight: 800;
}

.plugin-control-field > small {
  font-weight: 400;
  color: #667085;
}

.plugin-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.plugin-toggle-row input {
  width: auto !important;
}

.theme-toggle:focus-visible,
.ui-scroll-top-button:focus-visible,
.plugin-settings summary:focus-visible,
.plugin-control-field input:focus-visible,
.plugin-control-field select:focus-visible,
.plugin-control-field textarea:focus-visible {
  outline: 3px solid #84adff;
  outline-offset: 2px;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="dark"] body {
  background: #0b1220;
  color: #e5e7eb;
}

html[data-theme="dark"] .panel,
html[data-theme="dark"] .empty,
html[data-theme="dark"] .metric,
html[data-theme="dark"] table,
html[data-theme="dark"] .category-card,
html[data-theme="dark"] .product-card,
html[data-theme="dark"] .review,
html[data-theme="dark"] .cart-row,
html[data-theme="dark"] .order-admin,
html[data-theme="dark"] .user-card,
html[data-theme="dark"] .plugin-card,
html[data-theme="dark"] .route-card,
html[data-theme="dark"] .feature-switch,
html[data-theme="dark"] .login-card {
  background: #111827;
  border-color: #334155;
  color: #e5e7eb;
}

html[data-theme="dark"] .muted,
html[data-theme="dark"] .panel-head p,
html[data-theme="dark"] .activity span,
html[data-theme="dark"] .activity small,
html[data-theme="dark"] .product-body p,
html[data-theme="dark"] .product-meta span,
html[data-theme="dark"] .breadcrumbs,
html[data-theme="dark"] .lead,
html[data-theme="dark"] .message small,
html[data-theme="dark"] .route-card small,
html[data-theme="dark"] .feature-switch small,
html[data-theme="dark"] .plugin-card p,
html[data-theme="dark"] .user-card-head span {
  color: #a5b4c7;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: #0f172a !important;
  color: #e5e7eb !important;
  border-color: #475569 !important;
}

html[data-theme="dark"] code {
  background: #1e293b;
  color: #dbeafe;
}

html[data-theme="dark"] .ghost {
  background: #111827;
  color: #e5e7eb;
  border-color: #475569;
}

html[data-theme="dark"] .security-note,
html[data-theme="dark"] .integration-status,
html[data-theme="dark"] .supplier-strip,
html[data-theme="dark"] .admin-reply {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}

html[data-theme="dark"] .site-header {
  background: rgba(15, 23, 42, 0.96);
  border-bottom-color: #334155;
}

html[data-theme="dark"] .site-header nav a {
  color: #dbe3ee;
}

html[data-theme="dark"] .hero {
  background: #0f172a;
  border-bottom-color: #334155;
}

html[data-theme="dark"] .hero p {
  color: #b7c3d4;
}

html[data-theme="dark"] .asset-placeholder,
html[data-theme="dark"] .asset-mini {
  background: linear-gradient(135deg, #111827, #172033);
  border-color: #475569;
  color: #94a3b8;
}

html[data-theme="dark"] .product-media,
html[data-theme="dark"] .product-card,
html[data-theme="dark"] .category-card {
  border-color: #334155;
}

html[data-theme="dark"] .site-footer {
  background: #020617;
  color: #cbd5e1;
}

html[data-theme="dark"] .site-footer a {
  color: #dbeafe;
}

html[data-theme="dark"] .summary .total,
html[data-theme="dark"] .success-card dl div,
html[data-theme="dark"] .review,
html[data-theme="dark"] .cart-row {
  border-color: #334155;
}

html[data-theme="dark"] .message {
  background: #1e293b;
}

html[data-theme="dark"] .message.admin {
  background: #172554;
}

html[data-theme="dark"] .admin-main {
  background: #0b1220;
}

html[data-theme="dark"] .admin-side {
  background: #020617;
}

html[data-theme="dark"] .admin-side nav a.active,
html[data-theme="dark"] .admin-side nav a:hover {
  background: #1e293b;
}

html[data-theme="dark"] .admin-top h1,
html[data-theme="dark"] .plugin-settings summary {
  color: #f8fafc;
}

html[data-theme="dark"] .plugin-control-field {
  background: #0f172a;
  border-color: #334155;
}

html[data-theme="dark"] .integration-nav {
  background: #0b1220;
}

html[data-theme="dark"] .integration-nav a {
  background: #111827;
  border-color: #334155;
}

html[data-theme="dark"] th {
  color: #94a3b8;
}

html[data-theme="dark"] td,
html[data-theme="dark"] th {
  border-bottom-color: #334155;
}

html[data-theme="dark"] .theme-toggle {
  background: #1e293b;
  color: #dbeafe;
  border-color: #475569;
}

html[data-theme="dark"] .main-product-asset,
html[data-theme="dark"] .hero-asset,
html[data-theme="dark"] .path-list img,
html[data-theme="dark"] .product-media,
html[data-theme="dark"] .account-orders,
html[data-theme="dark"] .account-orders-table tr,
html[data-theme="dark"] .track-summary > div {
  background: #111827;
  border-color: #334155;
  color: #e5e7eb;
}

html[data-theme="dark"] .account-orders-table th {
  background: #0f172a;
  color: #a5b4c7;
}

html[data-theme="dark"] .account-orders-table td,
html[data-theme="dark"] .account-empty-row .empty {
  border-color: #334155;
}

html[data-theme="dark"] .account-orders-table td::before,
html[data-theme="dark"] .account-no-documents,
html[data-theme="dark"] .track-intro p,
html[data-theme="dark"] .track-summary dt,
html[data-theme="dark"] .track-timeline time,
html[data-theme="dark"] .track-timeline small {
  color: #a5b4c7;
}

@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="enabled"]) *,
  html:not([data-motion="enabled"]) *::before,
  html:not([data-motion="enabled"]) *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 980px) {
  body.ui-product-cols-3 .product-grid,
  body.ui-product-cols-4 .product-grid,
  body.ui-product-cols-5 .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .plugin-control-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  body.ui-product-cols-2 .product-grid,
  body.ui-product-cols-3 .product-grid,
  body.ui-product-cols-4 .product-grid,
  body.ui-product-cols-5 .product-grid {
    grid-template-columns: 1fr;
  }
  .theme-toggle {
    padding: 7px 9px;
  }
}