* {
  box-sizing: border-box;
}
:root {
  font:
    16px/1.5 "Zen Maru Gothic",
    "Microsoft JhengHei",
    sans-serif;
  color: #5a3442;
  background: #fff4f7;
}
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
header {
  text-align: center;
  padding: 20px;
  border-bottom: 2px dotted #f2b6c9;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 26px;
  letter-spacing: 3px;
  color: #b4466c;
}
header p,
.fine {
  font-size: 13px;
  color: #805164;
}
#account {
  justify-content: center;
  margin: 10px auto 0;
}
#account:empty {
  display: none;
}
#content label:has(input:not([type="radio"])),
#content label:has(select) {
  display: grid;
  gap: 3px;
  margin-block: 8px;
}
#content input:not([type="radio"]),
#content select {
  font: inherit;
  max-width: 100%;
  min-height: 44px;
}
#rate {
  background: white;
  border: 1px solid #f2b6c9;
  padding: 4px 12px;
  border-radius: 99px;
  width: fit-content;
  margin: 8px auto 0;
}
main,
footer > div {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 20px;
}
main {
  flex: 1;
}
nav,
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
button,
select,
textarea {
  font: inherit;
}
button,
a,
select {
  min-height: 44px;
  min-width: 44px;
}
button {
  cursor: pointer;
  background: #ffe3ec;
  color: #923655;
  border: 0;
  padding: 8px 14px;
  border-radius: 99px;
  font-weight: 700;
}
button:disabled {
  background: #f0e6ea;
  color: #6e5660;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 3px solid #77314c;
  outline-offset: 2px;
}
#brands button {
  border: 1px solid #f2b6c9;
  background: white;
}
.primary:not(:disabled),
nav button[aria-pressed="true"],
#brands button[aria-pressed="true"] {
  background: #a84065;
  color: white;
}
#categories button {
  font-size: 13px;
  border-radius: 8px;
}
#products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
article {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-radius: 18px;
  background: white;
  box-shadow: 0 2px 0 #f6cdd9;
  overflow-wrap: anywhere;
}
article img {
  width: 100%;
  aspect-ratio: 1 / 1.06;
  object-fit: cover;
  border-radius: 12px;
  background: #fbe4ec;
}
article small,
strong {
  color: #a84065;
  font-weight: 700;
}
article h3 {
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: auto;
}
.prices,
footer > div,
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.prices span,
.fine {
  font-size: 12px;
}
a {
  color: #923655;
  display: inline-flex;
  align-items: center;
}
.fine {
  margin-top: 18px;
}
footer {
  position: sticky;
  bottom: 0;
  background: white;
  border-top: 2px dotted #f2b6c9;
  padding-bottom: env(safe-area-inset-bottom);
}
footer > div {
  padding-block: 10px;
}
#basket {
  background: white;
  color: #5a3442;
  padding-left: 0;
}
dialog {
  border: 0;
  border-radius: 22px 22px 0 0;
  width: min(100%, 540px);
  max-width: 100%;
  max-height: 85dvh;
  margin: auto auto 0;
  padding: 20px;
  color: inherit;
  background: #fff4f7;
  overflow-wrap: anywhere;
}
dialog::backdrop {
  background: #46253170;
}
.dialog-head,
.cart-row {
  border-bottom: 2px dotted #f2b6c9;
  padding-bottom: 12px;
  margin-bottom: 12px;
}
h2 {
  font-size: 20px;
}
label {
  display: grid;
  margin-block: 10px;
  gap: 4px;
}
select,
textarea {
  border: 1px solid #a77687;
  border-radius: 8px;
  padding: 8px;
  background: white;
  color: inherit;
}
textarea {
  width: 100%;
}
@media (min-width: 650px) {
  #products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 900px) {
  #products {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.tools {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.tools input {
  min-width: 0;
  flex: 1;
  font: inherit;
  border: 1px solid #a77687;
  border-radius: 8px;
  padding: 8px 12px;
}
article h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.prices {
  justify-content: flex-start;
  column-gap: 5px;
}
.prices a {
  font-size: 11px;
  min-width: 0;
  min-height: 0;
  margin-left: auto;
  text-decoration: none;
}
.prices a:hover {
  text-decoration: underline;
}
.prices strong {
  font-size: 15px;
}
.dialog-head {
  flex-wrap: nowrap;
  align-items: flex-start;
}
#close {
  font-size: 24px;
  line-height: 1;
  padding: 0;
  flex: 0 0 44px;
}
.summary,
.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
}
.thumb {
  width: 72px;
  height: 86px;
  border-radius: 10px;
  object-fit: cover;
  background: #fbe4ec;
}
.summary div {
  display: grid;
}
.summary span,
.cart-row p {
  font-size: 14px;
}
fieldset {
  border: none;
  margin: 14px 0;
  padding: 0;
}
legend {
  font-weight: bold;
  margin-bottom: 5px;
}
.chip {
  display: inline-flex;
  margin: 2px 5px 2px 0;
  position: relative;
}
.chip input {
  position: absolute;
  opacity: 0;
}
.chip span {
  border: 1px solid #f2b6c9;
  background: white;
  padding: 8px 12px;
  border-radius: 24px;
  cursor: pointer;
}
.chip input:checked + span,
.primary.wide {
  background: #e57a9c;
  color: white;
}
.chip input:focus-visible + span {
  outline: 3px solid #77314c;
}
.chip input:disabled + span {
  text-decoration: line-through;
  color: #806872;
  background: #f0e6ea;
  cursor: default;
}
.wide {
  width: 100%;
}
.actions {
  display: grid;
  margin: 0;
  text-align: right;
}
.cart-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
}
.cart-row h3 {
  font-size: 16px;
}
.stepper {
  grid-column: 2;
}
.stepper button:last-child {
  margin-left: auto;
  background: transparent;
  font-size: 14px;
}
#count {
  display: inline-block;
}
#toast:not(:empty) {
  position: fixed;
  z-index: 1;
  bottom: calc(78px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 18px;
  border-radius: 20px;
  background: #5a3442;
  color: white;
}
#updated {
  margin-top: 4px;
}

@media (max-width: 480px) {
  .prices {
    display: grid;
    grid-template-columns: 1fr auto;
  }
  .prices strong {
    grid-column: 1 / -1;
  }
  .prices a {
    white-space: nowrap;
  }
}

[hidden] {
  display: none !important;
}
header {
  position: relative;
}
#favorites {
  margin-top: 8px;
}
#list-title,
#detail h2 {
  margin-block: 8px 14px;
}
nav {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 3px 0;
}
nav > * {
  flex-shrink: 0;
}
nav > span {
  font-size: 13px;
  font-weight: bold;
}
.filter-actions,
.quantity {
  display: flex;
  align-items: center;
  gap: 12px;
}
.filter-actions {
  justify-content: space-between;
}
.filter-actions label {
  display: flex;
  align-items: center;
  min-height: 44px;
}
#status {
  font-size: 14px;
  margin: 8px 0;
}
.photo {
  position: relative;
}
.photo > a,
.photo img {
  display: block;
  width: 100%;
}
.heart {
  font-size: 24px;
  background: white;
  line-height: 1;
  border: 1px solid #f2b6c9;
}
.photo .heart {
  position: absolute;
  top: 6px;
  right: 6px;
}
.badge {
  display: inline-block;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 13px;
  font-weight: bold;
}
.photo .badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  pointer-events: none;
}
.in_stock {
  color: #245b41;
  background: #e0f5e9;
}
.preorder {
  color: #58407d;
  background: #f1e8ff;
}
.sold_out {
  color: #494750;
  background: #eeeef1;
}
article h3 a {
  min-height: 0;
  display: inline;
  color: inherit;
  text-decoration: none;
}
.product-layout {
  display: grid;
  gap: 18px;
  margin: 14px 0 26px;
  background: white;
  border-radius: 18px;
  padding: 14px;
}
.product-layout > img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fbe4ec;
  border-radius: 12px;
}
.product-layout small,
.detail-price {
  display: block;
}
.detail-price {
  font-size: 28px;
}
.product-layout .badge,
.product-layout a {
  margin-inline: 8px;
}
.quantity,
.product-layout form {
  margin-block: 12px;
}
.related {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.related article {
  flex: 0 0 160px;
}
footer {
  z-index: 1;
}
#toast {
  z-index: 2;
}
@media (max-width: 699px) {
  header {
    padding: 12px 75px;
  }
  header > svg {
    width: 32px;
    height: 16px;
  }
  #favorites {
    position: absolute;
    top: 15px;
    right: 10px;
    margin: 0;
    padding-inline: 8px;
  }
  #rate {
    white-space: nowrap;
    padding: 2px 8px;
  }
  nav {
    margin-bottom: 4px;
    gap: 5px;
  }
  nav button {
    padding: 6px 10px;
  }
  main {
    padding: 10px 12px;
  }
}
@media (min-width: 700px) {
  .product-layout {
    grid-template-columns: 1fr 1fr;
    padding: 24px;
  }
  #favorites {
    position: absolute;
    top: 22px;
    right: max(20px, calc((100% - 1040px) / 2));
  }
}
