:root {
  --ink: #4c4c4c;
  --muted: #858585;
  --pink: #666;
  --line: #e1e1e1;
}

html {
  background: #f5f5f5;
}

body {
  width: min(600px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  background: #fff;
  box-shadow: none;
}

.wrap {
  width: calc(100% - 36px);
}

@media (min-width: 621px) {
  .featured-theme {
    width: 100%;
    max-width: none;
  }
}

nav {
  overflow-x: auto;
  overflow-y: hidden;
  gap: 20px;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}

@media (max-width: 620px) {
  nav {
    gap: 16px;
  }
}

@media (hover: hover) and (pointer: fine) {
  nav {
    cursor: grab;
  }

  nav.is-dragging {
    cursor: grabbing;
    user-select: none;
  }
}

/* 데스크톱에서도 모바일 카드 규격을 그대로 사용한다. */
#grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 25px 13px;
}

.thumbnail {
  border-radius: 12px;
}

.meta {
  gap: 4px;
  font-size: 10px;
}

.card h3 {
  gap: 5px;
  font-size: 14px;
}

.logo,
.footer-logo {
  color: #595959;
}

.featured-slide,
.search-toggle:hover,
.product-actions a:hover,
.details .cta,
.device-actions .cta {
  background: #f5f5f5;
}

.featured-slide {
  box-shadow: 0 4px 12px #0000000b;
}

.search-panel #search-clear,
.search-panel .search-close {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.search-panel #search-clear > span,
.search-panel .search-close > span {
  display: block;
  line-height: 1;
  transform: translateY(-1px);
}

.search-panel #search-clear {
  background: #eeeeee;
  color: #666;
}

/* 모달을 열 때 모바일 브라우저가 닫기 버튼에 넣는 원형 강조 표시를 숨긴다. */
.close,
.close:focus-visible {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  outline: 0;
}

.search-panel .search-close,
.search-panel input::placeholder {
  color: #8c8c8c;
}

/* 휴대폰 브라우저가 검색 입력창을 자동 확대하지 않도록 한다. */
.search-panel input {
  font-size: 16px;
}

.site-footer {
  display: block;
  margin-top: 8px;
  padding: 24px 0 46px;
  background: #f5f5f5;
  border-top: 1px solid #e7e7e7;
}

.site-footer .wrap {
  width: calc(100% - 36px);
  position: relative;
}

.business-details {
  color: #777;
  font-size: 11px;
  line-height: 1.75;
}

.business-details p {
  margin: 0;
}

.business-details strong {
  color: #666;
  font-weight: 500;
}

.business-details a {
  color: inherit;
  text-decoration: none;
}

.instagram-link {
  position: absolute;
  right: 0;
  bottom: -3px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: #666;
}

.instagram-link svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

/* 이 파일을 마지막에 불러 홈페이지 UI의 무채색을 유지한다. 상품 이미지는 건드리지 않는다. */
.featured-slide::after {
  background: linear-gradient(to bottom, transparent 6%, #00000065 100%);
}

.featured-copy {
  background: transparent;
}

.search-toggle:hover,
.search-panel button:hover {
  background: #f5f5f5;
}

.search-panel .search-close,
.card .link-note,
.sample,
.zoom {
  color: #777;
}

nav {
  scrollbar-color: #d1d1d1 transparent;
}

.featured-pagination button::before {
  background: #d1d1d1;
}

.featured-pagination button[aria-current="true"]::before {
  background: #666;
}

dialog {
  background: #fff;
  color: var(--ink);
}

dialog::backdrop {
  background: #00000080;
}

.details .cta,
.device-actions .cta,
.cta:disabled,
.product-actions .cta:disabled {
  background: #f5f5f5;
  border-color: #e1e1e1;
  color: #666;
}

.details .cta:hover,
.device-actions .cta:hover,
.product-actions a:hover {
  background: #ebebeb;
}

.card .goods-price,
.details #dialog-price,
.dialog-back,
.related-goods-card strong,
.heading h2 span {
  color: #595959;
}

.related-goods,
.related-goods-card {
  border-color: #e1e1e1;
}

.related-goods-card img {
  background: #fff;
}

.back-to-top {
  position: fixed;
  z-index: 5;
  right: max(16px, calc((100vw - 600px) / 2 + 16px));
  bottom: calc(84px + env(safe-area-inset-bottom));
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  padding: 0;
  border: 1px solid #e1e1e1;
  border-radius: 50%;
  background: #fff;
  color: #777;
  box-shadow: 0 3px 12px #0000001a;
}

.back-to-top[hidden],
body:has(dialog[open]) .back-to-top {
  display: none;
}

.back-to-top svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
