.cart-trigger,
.cart-add,
.cart-icon-button,
.cart-text-button,
.cart-primary {
  font: inherit;
  cursor: pointer;
}

.cart-trigger {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #dedede;
  border-radius: 50%;
  color: var(--ink, #24272a);
  background: #fff;
}

.cart-trigger svg { width: 23px; height: 23px; }
.cart-trigger:hover { border-color: var(--red, #cd2027); color: var(--red, #cd2027); }

.cart-badge {
  position: absolute;
  inset: -5px -5px auto auto;
  min-width: 19px;
  padding: 0 4px;
  border: 1px solid #fff;
  border-radius: 99px;
  background: var(--red, #cd2027);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 17px;
}

.product-card:has(.cart-add) { position: relative; padding-bottom: 57px; }
.cart-add {
  position: absolute;
  right: 11px;
  bottom: 11px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: var(--red, #cd2027);
  color: #fff;
  font-size: 25px;
  line-height: 1;
}

.cart-add:hover, .cart-primary:hover { background: #a6171d; }
.cart-primary:disabled { opacity: .65; cursor: default; }
.cart-detail-add { align-self: flex-start; margin-top: 24px; }

.product-price {
  margin: 9px 0 0;
  color: var(--ink, #24272a);
  font-size: clamp(13px, 1vw, 17px);
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.product-detail-price { margin: 0 0 16px; font-size: clamp(18px, 2vw, 26px); }
.machine-price { margin: 0 0 8px; }
.cart-item-price { margin: 0; font-size: 14px; }

.cart-dialog {
  position: fixed;
  inset: 0 0 auto auto;
  width: min(100%, 480px);
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #fff;
  color: var(--ink, #24272a);
  box-shadow: -12px 0 48px #0002;
}

.cart-dialog[open] { display: flex; flex-direction: column; }
.cart-dialog::backdrop { background: #15141699; }
body:has(.cart-dialog[open]) { overflow: hidden; }
.cart-dialog [hidden], .cart-trigger [hidden] { display: none; }

.cart-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid #e7e7e7;
}

.cart-heading h2 {
  flex: 1;
  margin: 0;
  color: inherit;
  font-size: clamp(21px, 4.5vw, 27px);
  font-weight: 700;
  line-height: 1.2;
}

.cart-icon-button {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #ebeae8;
  color: inherit;
  font-size: 21px;
  line-height: 1;
}

.cart-close { width: 42px; height: 42px; font-size: 25px; }
.cart-icon-button:hover { background: #dfddda; }
.cart-icon-button:disabled { opacity: .45; cursor: default; }

.cart-text-button {
  border: 0;
  padding: 8px 0;
  background: none;
  color: #56595c;
  font-size: 14px;
  font-weight: 700;
}

.cart-text-button:hover { color: var(--red, #cd2027); }
.cart-view { display: flex; flex: 1; flex-direction: column; min-height: 0; margin: 0; }
.cart-content { flex: 1; overflow: auto; overscroll-behavior: contain; padding: 24px; }
.cart-content p { margin: 0 0 16px; color: #56595c; line-height: 1.5; }
.cart-items { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }

.cart-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e7e7e7;
  border-radius: 12px;
  background: #f7f7f6;
}

.cart-item img {
  display: block;
  width: 76px;
  height: 76px;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.cart-item-description { display: grid; gap: 8px; }
.cart-model { color: inherit; font-weight: 700; overflow-wrap: anywhere; }
.cart-model:hover { color: var(--red, #cd2027); }
.cart-quantity { display: flex; align-items: center; gap: 8px; }
.cart-quantity span { min-width: 2ch; text-align: center; font-variant-numeric: tabular-nums; }

.cart-footer { padding: 16px 24px max(20px, env(safe-area-inset-bottom)); border-top: 1px solid #e7e7e7; }
.cart-summary { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.cart-summary strong { text-align: right; white-space: nowrap; }
.cart-price-note { margin: -6px 0 12px; color: #56595c; font-size: 13px; line-height: 1.4; }
.cart-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border: 0;
  border-radius: 9px;
  background: var(--red, #cd2027);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.cart-footer .cart-primary { width: 100%; }
.request-form label { display: block; margin: 0 0 14px; font-size: 15px; font-weight: 700; }
.request-form label span { color: #56595c; font-weight: 400; }
.request-form input:not([type="hidden"]), .request-form textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 9px 10px;
  border: 1px solid #bfbfbd;
  border-radius: 7px;
  background: #fff;
  color: inherit;
  font: 400 16px/1.4 Arial, sans-serif;
}

.request-form input:not([type="hidden"]) { min-height: 44px; }
.request-form textarea { resize: vertical; }
.cart-back { margin-bottom: 12px; }
.request-fields { min-width: 0; padding: 0; margin: 0; border: 0; }
.request-error { margin: 0 0 12px; color: #a6171d; font-size: 14px; line-height: 1.4; }
.request-error:empty { display: none; }
.request-confirmation-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: #e8f3eb;
  color: #21643d;
  font-size: 24px;
  font-weight: 700;
}

.cart-status {
  position: fixed;
  z-index: 30;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 36px);
  padding: 11px 15px;
  border-radius: 9px;
  background: #24272a;
  color: #fff;
  box-shadow: 0 5px 16px #0002;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  pointer-events: none;
}

.cart-status:empty { opacity: 0; }
.cart-status:not(:empty):not(.cart-status-limit)::before {
  content: '';
  flex: none;
  width: 6px;
  height: 11px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: translateY(-2px) rotate(45deg);
}

@media (max-width: 850px) {
  body > header:not(.header) nav { flex-wrap: wrap; row-gap: 8px; }
}

@media (max-width: 420px) {
  .header .header-tools { gap: 6px; }
  .cart-heading, .cart-content, .cart-footer { padding-inline: 16px; }
}

@media (max-width: 360px) {
  .header:has(.cart-trigger) { padding-inline: 10px; gap: 5px; }
  .header:has(.cart-trigger) .brand-logo { width: min(32vw, 112px); }
}
