html {
  scroll-behavior: smooth;
}
input[placeholder="Bạn cần tìm?"] {
  pointer-events: auto !important;
}
dialog.catalog {
  border: 0;
  border-radius: 16px;
  padding: 24px;
  width: min(900px, 94vw);
  max-height: 88vh;
  color: #252525;
  box-shadow: 0 24px 80px #00000033;
  overscroll-behavior: contain;
}
dialog.catalog::backdrop {
  background: #00000077;
}
.catalog .close {
  float: right;
  font-size: 28px;
  padding: 0 10px;
  line-height: 1;
  min-height: 36px;
}
.catalog h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 35px 20px 0;
  line-height: 1.4;
}
.catalog h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 24px 0 12px;
}
.catalog .results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.catalog .item {
  border: 1px solid #eeeeee;
  border-radius: 10px;
  padding: 12px;
  text-align: left;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.catalog .item:hover {
  border-color: #ed1d1d;
  box-shadow: 0 4px 16px #ed1d1d11;
}
.catalog .item img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}
.item-name {
  line-height: 1.5;
  font-size: 14px;
}
.item strong {
  display: block;
  color: #ed1d1d;
  margin-top: auto;
}
.catalog-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.catalog-controls input {
  flex: 1 0 100%;
  min-width: 0;
  border: 1px solid #cccccc;
  border-radius: 8px;
  padding: 12px;
}
.catalog-controls select {
  border: 1px solid #dddddd;
  border-radius: 8px;
  padding: 10px;
  background: white;
  flex: 1;
  min-width: 0;
}
.catalog-summary {
  margin: 16px 0;
  color: #666666;
  font-size: 14px;
}
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-top: 24px;
}
.pagination button {
  border: 1px solid #dddddd;
  padding: 8px 16px;
  border-radius: 8px;
}
.pagination button:disabled {
  opacity: 0.4;
  cursor: default;
}
.product-strip {
  overflow-x: auto !important;
  scrollbar-width: thin;
  scrollbar-color: #ed1d1d #eeeeee;
}
.product-strip > div {
  width: max-content;
}
.detail-hero {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: center;
}
.detail-hero > img {
  width: 240px;
  height: 240px;
  object-fit: contain;
}
.detail-price {
  font-size: 28px;
  font-weight: 700;
  color: #ed1d1d;
  margin-bottom: 12px;
}
.detail-status {
  font-size: 14px;
  color: #666666;
  margin-bottom: 12px;
}
.detail-hero label {
  display: block;
  margin: 14px 0;
  font-size: 14px;
}
.detail-hero select {
  display: block;
  width: 100%;
  border: 1px solid #dddddd;
  border-radius: 8px;
  padding: 10px;
  margin-top: 8px;
  background: white;
}
.primary-action {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: #ed1d1d;
  color: #ffffff !important;
  border-radius: 8px;
  padding: 12px 20px;
  margin-top: 16px;
  font-weight: 600;
  min-height: 44px;
}
.product-description {
  line-height: 1.75;
  overflow-wrap: anywhere;
}
.product-description p {
  margin: 10px 0;
}
.product-description h2,
.product-description h3,
.product-description h4 {
  margin: 20px 0 10px !important;
  font-size: 18px !important;
}
.product-description img {
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 16px auto;
}
.product-description table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.product-description th,
.product-description td {
  border: 1px solid #dddddd;
  padding: 8px;
  text-align: left;
}
.product-description ul,
.product-description ol {
  padding-left: 24px;
  list-style: revert;
}
.cart-row {
  display: grid;
  grid-template-columns: 64px 1fr auto auto;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #eeeeee;
  padding: 12px 0;
}
.cart-row img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}
.cart-row button {
  color: #c41212;
}
.image-placeholder {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: #ed1d1d;
  font-size: 14px;
  font-weight: 700;
}
.loading {
  padding: 24px 0;
  color: #666666;
}
.catalog :focus-visible {
  outline: 2px solid #ed1d1d;
  outline-offset: 3px;
}
@media (max-width: 700px) {
  .catalog .results {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 500px) {
  dialog.catalog {
    padding: 18px;
  }
  .catalog-controls {
    gap: 8px;
  }
  .catalog .results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .detail-hero {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .detail-hero > img {
    margin: auto;
    width: 200px;
    height: 200px;
  }
  .cart-row {
    grid-template-columns: 48px 1fr auto;
    gap: 10px;
  }
  .cart-row strong {
    grid-column: 2;
  }
  .cart-row button {
    grid-column: 3;
    grid-row: 1;
  }
  .cart-row img {
    width: 48px;
    height: 48px;
  }
  .pagination {
    gap: 12px;
  }
}
