:root {
  --ui-font: system-ui, "Segoe UI", sans-serif;
  --ui-control: 2.75rem;
  --ui-action: 3rem;
  --ui-gap: .75rem;
  --ui-radius: .625rem;
  --ui-focus: #36816a;
}

html body {
  font-family: var(--ui-font);
  font-size: 1rem;
  line-height: 1.55;
}

body :is(h1, h2, h3, .service-card h3, .toolbar h2) {
  font-family: var(--ui-font);
  font-weight: 740;
  line-height: 1.18;
  letter-spacing: -.025em;
}

body :is(button, input, select, textarea) {
  font-family: inherit;
}

body :is(button, [role="button"], input[type="submit"], input[type="button"]) {
  min-width: var(--ui-control);
  min-height: var(--ui-control);
  font-size: .9375rem;
  font-weight: 650;
  line-height: 1.3;
}

body :is(a.primary, a.secondary, .visit, .shop-nav a, footer nav a, summary, .design-upload, .upload-label) {
  min-height: var(--ui-control);
}

body :is(button, a.primary, a.secondary, .upload-label, .design-upload) {
  overflow-wrap: anywhere;
}

body :is(a.primary, a.secondary, .visit, .shop-nav a, footer nav a) {
  display: inline-flex;
  align-items: center;
}

body :is(.primary, .secondary, .choose, .solid, .outline) {
  border-radius: var(--ui-radius);
  font-size: .9375rem;
  padding: .6875rem 1rem;
}

body :is(button, a, input):is(.primary, .secondary, .solid) {
  min-height: var(--ui-action);
  justify-content: center;
  text-align: center;
}

body :is(button, a, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--ui-focus);
  outline-offset: 3px;
}

body :is(.shop-nav, .header-actions, #filters, .subclass-list, .member-list, .hero-buttons, .catalog-actions, .design-actions, .face-tabs, .zoom-controls, .cart-art-actions, .order-service-actions, .editor-footer) {
  gap: var(--ui-gap);
}

body :is(.hero-buttons, .design-actions, .face-tabs, .cart-art-actions, .order-service-actions, .editor-footer) {
  flex-wrap: wrap;
}

body :is(.hero-buttons, .catalog-actions, .editor-footer) > :is(button, a) {
  margin-block: 0;
}

body :is(.modal, .editor-body) :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="hidden"], [type="file"]), select, textarea) {
  font-size: 1rem;
  min-height: var(--ui-control);
}

body .modal :is(label, .hint, .checkout-item, .cartrow .cart-remove, .kit-note .text-button) {
  font-size: .875rem;
}

body .modal h2 {
  font-size: clamp(1.375rem, 4vw, 1.875rem);
}

body .modal > .close {
  font-size: 1.5rem;
  padding: 0;
}

body .modal > h2:first-of-type,
body .modal > .design-title {
  padding-inline-end: 2.5rem;
}

body .details h3 { font-size: clamp(1rem, 2vw, 1.25rem); }
body .details p { font-size: .875rem; }
body .details .product-price { font-size: clamp(1.125rem, 2vw, 1.375rem); }
body .details .hint { font-size: .8125rem; }
body .details .choose { font-size: .875rem; }
body #filters .shop-kind { border-radius: .875rem; padding: .75rem 1rem; }
body #filters .shop-kind strong { font-size: 1rem; }
body #filters .shop-kind small { font-size: .875rem; }
body .catalog-actions { margin-block: 1rem; }
body .subclass-list button,
body .member-list button { padding: .625rem .875rem; border-radius: var(--ui-radius); }
body .sort-label select { min-height: var(--ui-control); font-size: .9375rem; }
body .commerce-hero h1 { font-size: clamp(2.25rem, 5vw, 3.625rem); line-height: 1.06; }

@media (max-width: 750px) {
  body .shop-header { column-gap: .5rem; }
  body .header-actions { gap: .5rem; min-width: 0; }
  body .header-actions button { font-size: .8125rem; padding-inline: .5rem; }
  body .shop-nav { padding-block: .25rem; }
  body .hero-buttons > :is(a, button) { flex: 1 1 10rem; }
  body .details .choose { padding-inline: .5rem; }
}

@media (max-width: 380px) {
  body .grid { grid-template-columns: minmax(0, 1fr); }
  body .shop-header .logo { font-size: 1.125rem; }
  body .header-actions .account-header { max-width: 6rem; }
}

#order-form {
  display: grid;
  gap: 1.5rem;
}

#order-form .checkout-section {
  min-width: 0;
  padding: clamp(1rem, 4vw, 1.5rem);
  border: 1px solid #dce5df;
  border-radius: .875rem;
  background: #fff;
}

#order-form .checkout-section h3 {
  margin: 0 0 1rem;
  font-size: 1.125rem;
}

#order-form label {
  display: block;
  margin: 1rem 0 .375rem;
  color: #263f35;
  font-weight: 600;
  line-height: 1.35;
}

#order-form :is(input:not([type="checkbox"], [type="radio"], [type="hidden"]), select) {
  width: 100%;
  min-height: 2.75rem;
  margin: 0;
  padding: .625rem .75rem;
  border: 1px solid #aebfb5;
  border-radius: .5rem;
}

#order-form .checkout-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .875rem;
}

#order-form #shipping-panel {
  min-width: 0;
  margin: 1.25rem 0 0;
  padding: 1rem;
  border: 1px solid #dce5df;
  background: #f7faf8;
}

#order-form legend {
  padding-inline: .375rem;
  font-weight: 650;
}

#saved-address-panel:not(:empty) {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #dce5df;
}

#saved-address-panel label { margin-top: 0; }

#order-form :is(#calculate-shipping, #use-saved-address, #order-send) {
  margin-top: 1rem;
  min-height: 2.75rem;
  padding: .625rem .875rem;
  border-radius: .5rem;
}

#order-form #use-saved-address {
  background: #fff;
  color: #116149;
  border: 1px solid #aebfb5;
}

#order-form #order-send { min-height: 3rem; }

#order-form :is(p[role="status"], p[role="alert"]):empty { display: none; }
#order-form p { margin-block: .75rem 0; }
#order-form .checkout-review { padding: .75rem 1rem; border-radius: .75rem; background: #f7faf8; }
#order-form .checkout-review summary { padding-block: .5rem; }
#order-form #shipping-options:not(:empty) { margin-top: 1rem; }
#order-form button:disabled { opacity: .58; cursor: not-allowed; }

@media (max-width: 480px) {
  #order-form .checkout-fields { grid-template-columns: minmax(0, 1fr); gap: 0; }
  #order-form #shipping-panel { padding-inline: .75rem; }
  #order-form :is(#calculate-shipping, #use-saved-address) { width: 100%; }
}

.bag.cart-guide {
  outline: 3px solid #facc15;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: no-preference) {
  .bag.cart-guide { animation: cart-guide-pulse 1s ease-in-out 3; }
}

@keyframes cart-guide-pulse {
  0%, 100% { box-shadow: 0 0 0 0 #facc1500; }
  50% { box-shadow: 0 0 0 8px #facc1566; }
}

.cart-sync-retry {
  position: relative;
  margin: .75rem 0 1rem;
  padding: .75rem 3.5rem .75rem .75rem;
  border: 1px solid #e7cc91;
  border-radius: .625rem;
  background: #fff8e7;
  color: #523900;
}

.modal .cart-sync-retry > button {
  min-height: 2.75rem;
  padding: .5rem .75rem;
  border: 1px solid #c48a21;
  border-radius: .5rem;
  background: #ffedc3;
  color: #523900;
  font-size: .8125rem;
}

.cart-sync-retry .cart-sync-help { margin: 0; }
.cart-sync-help summary {
  position: absolute;
  inset: .25rem .25rem auto auto;
  display: grid;
  place-items: center;
  width: 2.75rem;
  min-height: 2.75rem;
  border-radius: .5rem;
  color: #694800;
  font-weight: 750;
  list-style: none;
  cursor: pointer;
}
.cart-sync-help summary::-webkit-details-marker { display: none; }
.cart-sync-help summary:hover, .cart-sync-help[open] summary { background: #ffedc3; }
.cart-sync-help p { margin: .25rem 0 .75rem; font-size: .875rem; }
