.demo-toolbar:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .65rem 1rem;
  margin-top: 1rem;
  padding: .75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8f7f1;
  font-size: .9rem;
}

.demo-toolbar a,
.demo-cart button,
.demo-purchase button,
.demo-dialog-actions button {
  display: inline-block;
  border: 1px solid var(--green);
  border-radius: 5px;
  padding: .5rem .75rem;
  background: var(--green);
  color: #fff;
  font: inherit;
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
  cursor: pointer;
}
.demo-toolbar a:hover,
.demo-cart button:hover:not(:disabled),
.demo-purchase button:hover,
.demo-dialog-actions button:hover {
  background: var(--green-dark);
  color: #fff;
}
.demo-cart button:disabled { opacity: .48; cursor: default; }
.demo-cart button:focus-visible, .demo-purchase :focus-visible, #demo-confirm :focus-visible {
  outline: 3px solid #ae6d37;
  outline-offset: 2px;
}

.demo-price { font-weight: 700; }
.demo-price small { color: var(--muted); font-weight: 400; }
.product-action { align-self: flex-start; }
.demo-purchase { display: grid; gap: .45rem; margin-top: .25rem; }
[data-maker="岩平茶園"] .product-body:has(> .demo-purchase) > .product-info-button { margin-top: auto; }
.demo-purchase label { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .82rem; }
.demo-purchase input {
  width: 4.3rem;
  max-width: 100%;
  padding: .35rem;
  border: 1px solid #a5a294;
  border-radius: 4px;
  color: inherit;
  font: inherit;
}
.demo-purchase button { padding-inline: .25rem; }

.demo-cart {
  margin-bottom: clamp(48px, 8vw, 84px);
  padding: clamp(16px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.demo-cart h2 { margin-bottom: 1rem; }
.demo-items { margin: 0; padding: 0; list-style: none; }
.demo-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(4.5rem, auto) auto;
  align-items: center;
  gap: .65rem 1rem;
  border-bottom: 1px solid var(--line);
  padding-block: .8rem;
}
.demo-qty { display: flex; align-items: center; gap: .55rem; }
.demo-qty button, .demo-cart .demo-remove { background: #fff; color: var(--green-dark); }
.demo-qty button { padding-inline: .65rem; }
.demo-line-total { text-align: right; }
.demo-summary { margin-top: 1rem; }
.demo-total { font-weight: 700; }
.demo-summary > .demo-total { display: flex; justify-content: space-between; gap: .7rem; }
.demo-muted { color: var(--muted); font-size: .82rem; }
.demo-order-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-block: 1rem; }
.demo-order-options section { padding: .9rem; border: 1px solid var(--line); border-radius: 6px; }
#demo-card-option[hidden] + section { grid-column: 1 / -1; }
.demo-order-options h3 { font-size: 1rem; }
.demo-order-options button { margin-top: .6rem; }

#demo-toast:not(:empty) {
  position: fixed;
  z-index: 10000;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 2rem);
  padding: .55rem .85rem;
  border-radius: 6px;
  background: var(--green-dark);
  color: #fff;
  font-size: .875rem;
  pointer-events: none;
}

#demo-confirm {
  width: min(600px, calc(100% - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  padding: clamp(.75rem, 4vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
}
#demo-confirm::backdrop { background: #0008; }
#demo-confirm-content { margin-block: .8rem; }
#demo-confirm table, #demo-order-sheet table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .82rem; }
#demo-confirm th, #demo-confirm td, #demo-order-sheet th, #demo-order-sheet td {
  border: 1px solid var(--line);
  padding: .35rem;
  text-align: right;
  overflow-wrap: anywhere;
}
#demo-confirm :is(th, td):first-child, #demo-order-sheet :is(th, td):first-child { width: 42%; text-align: left; }
#demo-confirm .demo-total, #demo-order-sheet .demo-total { margin-top: .5rem; }
#demo-order-form:not([hidden]) { display: grid; gap: .65rem; font-size: .9rem; }
#demo-order-form fieldset { margin: 0; min-width: 0; border: 1px solid var(--line); }
#demo-order-form label { display: grid; gap: .25rem; }
#demo-order-form fieldset label + label { margin-top: .45rem; }
#demo-order-form .demo-same { display: flex; align-items: center; }
#demo-order-form :is(input:not([type="checkbox"]), select, textarea), #demo-email-text {
  width: 100%;
  padding: .35rem .5rem;
  border: 1px solid #a5a294;
  border-radius: 4px;
  color: inherit;
  font: inherit;
}
.demo-dialog-actions:not([hidden]) { display: flex; flex-wrap: wrap; gap: .55rem; }
.demo-bank-actions { display: flex; flex-wrap: wrap; gap: 0 .5rem; }
#demo-email-draft label { display: block; margin-top: .65rem; font-size: .875rem; }
#demo-email-text { display: block; margin-block: .25rem .65rem; }
#demo-email-status { margin-top: .35rem; }
#demo-order-sheet { display: none; }

@media (max-width: 600px) {
  .demo-line { grid-template-columns: minmax(0, 1fr) auto; gap: .4rem .6rem; }
  .demo-line-total { text-align: left; }
  .demo-cart .demo-remove { justify-self: end; }
  .demo-order-options { grid-template-columns: 1fr; }
}

@media print {
  body.demo-printing > :not(#demo-order-sheet) { display: none !important; }
  body.demo-printing #demo-order-sheet { display: block; color: #000; white-space: pre-wrap; }
  #demo-order-sheet h1 { font-size: 18pt; }
  #demo-order-sheet table { margin-top: .8rem; }
  #demo-order-sheet tr { break-inside: avoid; }
}


.category-nav a[aria-current="page"] {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}
.category-nav.store-nav { margin-block: 0 1rem; }
.demo-cart { scroll-margin-top: 3.25rem; }

.demo-address-totals {
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}
#demo-order-totals { margin-top: .5rem; }
#demo-order-action[hidden], #demo-excel-export[hidden] { display: none; }
#demo-excel-export:disabled { opacity: .5; cursor: default; }
#demo-email-checkout[hidden], #demo-web-checkout[hidden], #demo-web-contact [hidden], #demo-notes-label[hidden] { display: none; }
#demo-web-status:not(:empty) { margin: .75rem 0; font-weight: 700; }

#demo-shipping-rates-title { margin: 0 0 .35rem; color: var(--green-dark); }
[aria-labelledby="demo-shipping-rates-title"] {
  margin-block: 1.5rem;
  padding: clamp(.875rem, 3vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f7f2;
}
#demo-shipping-rates-title + p { margin: 0 0 .75rem; color: var(--muted); font-size: .875rem; }
[aria-labelledby="demo-shipping-rates-title"] > ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
[aria-labelledby="demo-shipping-rates-title"] li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: baseline;
  gap: .75rem;
  padding-block: .625rem;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}
[aria-labelledby="demo-shipping-rates-title"] strong {
  color: var(--green-dark);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

[aria-labelledby="demo-shipping-rates-title"] > h4 { margin:30px 0 12px; }

[aria-labelledby="demo-shipping-rates-title"] > .shipping-size-heading { margin-top:20px; }
