:root {
  --product-ink: #1a1a1a;
  --product-muted: #6b6b6b;
  --product-line: #e4e4e4;
  --product-thumb: #ededed;
  --product-red: #e60023;
  --product-green: #1a9d4b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background: #fff;
  min-height: 100%;
  scrollbar-width: none;
}
html::-webkit-scrollbar { display: none; }

body {
  font-family: -apple-system, "SF Pro Text", "SF Pro Display", BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: -0.24px;
  background: #fff;
  color: var(--product-ink);
  -webkit-font-smoothing: antialiased;
  display: flex;
  justify-content: center;
  min-height: 100svh;
  overflow-x: hidden;
  width: 100%;
}

.product-phone {
  background: #fff;
  isolation: isolate;
  max-width: 430px;
  min-height: 100svh;
  position: relative;
  width: 100%;
  z-index: 1;
}

.product-added-toast {
  background: #1a1a1a;
  border-radius: 0 0 8px 8px;
  color: #fff;
  font-size: 13px;
  left: 50%;
  opacity: 0;
  padding: max(12px, env(safe-area-inset-top)) 14px 10px;
  pointer-events: none;
  position: fixed;
  top: 0;
  transform: translate(-50%, -8px);
  transition: opacity 180ms ease, transform 180ms ease;
  visibility: hidden;
  width: min(430px, 100vw);
  z-index: 100;
}

.product-added-toast[hidden] { display: none; }

.product-added-toast--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
  visibility: visible;
}

.product-added-toast__message {
  display: block;
  font-weight: 600;
  line-height: 1.35;
}

.product-added-toast__actions {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

.product-added-toast__actions button {
  appearance: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 0;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.product-added-toast__actions button:disabled {
  cursor: default;
  opacity: 0.55;
}

.product-screen { padding: 16px 18px 32px; }
.product-start-catalog #product-screen-main { display: none; }
.product-start-catalog #product-screen-catalog[hidden] { display: block; }

.product-screen__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.product-screen__title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.product-start-catalog:not(.product-catalog-title-ready) #product-catalog-title { visibility: hidden; }
.product-hide-catalog-category #product-catalog-category-filter { display: none; }

.product-screen__head-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.product-icon-btn {
  border: none;
  background: none;
  color: var(--product-ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 4px;
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.product-icon-btn b {
  background: #111114;
  border-radius: 999px;
  color: #fff;
  display: grid;
  font-size: 7px;
  font-weight: 700;
  height: 12px;
  letter-spacing: normal;
  line-height: 1;
  margin: 0;
  min-width: 12px;
  padding: 0 3px;
  -webkit-font-smoothing: auto;
  place-items: center;
  position: absolute;
  right: 0;
  top: 0;
  width: auto;
}
.product-icon-btn:hover,
.product-icon-btn:focus,
.product-icon-btn:active { background: none; outline: none; }


.product-field { display: block; margin-bottom: 20px; margin-top: -10px; -webkit-tap-highlight-color: transparent; }
.product-field__label { display: block; font-size: 15px; font-weight: 500; color: var(--product-ink); margin-bottom: 12px; }
.product-field__input-wrap { position: relative; display: block; }
.product-field__search-icon {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--product-muted);
  pointer-events: none;
}
.product-field__input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--product-line);
  font-size: 16px;
  padding: 6px 26px 10px 32px;
  color: var(--product-ink);
  outline: none;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}
.product-field__input::placeholder { color: #9a9a9a; }
.product-field__input:focus { outline: none; border-bottom-color: var(--product-ink); }
.product-field__clear {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: var(--product-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 4px;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.product-field__clear[hidden] { display: none; }

.product-count-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}
.product-count { font-size: 13px; color: var(--product-muted); }
.product-add-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: none;
  color: var(--product-ink);
  padding: 0;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.product-list { display: flex; flex-direction: column; }
.product-item {
  display: flex;
  align-items: stretch;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--product-line);
}
.product-item:first-child { padding-top: 0; }
.product-item:last-child { border-bottom: none; }

.product-thumb {
  width: 68px;
  flex: 0 0 68px;
  background: var(--product-thumb);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  animation: product-skeleton-pulse 1.1s ease-in-out infinite;
}
.product-thumb--loaded {
  animation: none;
}
.product-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.product-thumb--loaded img {
  opacity: 1;
}

.product-item__main { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.product-item__name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-item__brand { font-size: 14px; font-weight: 500; color: var(--product-ink); }
.product-item__meta { font-size: 13px; font-weight: 400; color: #6E6E73; }
.product-item__price { font-size: 15px; font-weight: 500; color: var(--product-ink); margin-top: 2px; }

@keyframes product-skeleton-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.product-list.product-is-loading .product-thumb,
.product-grid.product-is-loading .product-card__image-wrap {
  animation: product-skeleton-pulse 1.1s ease-in-out infinite;
}
.product-list.product-is-loading .product-thumb img,
.product-grid.product-is-loading .product-card__image-wrap img {
  visibility: hidden;
}
.product-list.product-is-loading .product-skel-real,
.product-grid.product-is-loading .product-skel-real {
  width: fit-content;
  max-width: 100%;
  color: transparent;
  background: var(--product-thumb);
  border-radius: 6px;
  animation: product-skeleton-pulse 1.1s ease-in-out infinite;
}
.product-grid.product-is-loading .product-card__badge,
.product-grid.product-is-loading .product-card__add,
.product-list.product-is-loading .product-item__remove {
  visibility: hidden;
}

.product-item__remove {
  flex-shrink: 0;
  align-self: center;
  border: none;
  background: var(--product-line);
  color: var(--product-red);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.product-empty { text-align: center; color: var(--product-muted); padding: 60px 0; font-size: 14px; line-height: 1.6; }


.product-section-label { font-size: 13px; font-weight: 400; color: #6E6E73; margin-bottom: 10px; }

.product-category-scroll {
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: auto;
  padding: 3px 0 5px;
  scrollbar-width: none;
  width: 100%;
  margin: 0 0 20px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scroll-padding-left: 0;
  scroll-padding-right: 0;
  touch-action: auto;
}
.product-category-scroll::-webkit-scrollbar {
  display: none;
}
.product-category-scroll:focus-visible {
  outline: 2px solid rgba(201, 166, 70, 0.34);
  outline-offset: -2px;
}

.product-category-track {
  align-items: center;
  box-sizing: border-box;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  min-height: 30px;
  min-width: 100%;
  padding: 0;
  width: max-content;
}

.product-category-chip {
  align-items: center;
  background: #fff;
  border: 1px solid var(--product-line);
  border-radius: 999px;
  box-sizing: border-box;
  color: var(--product-ink);
  display: inline-flex;
  gap: 6px;
  flex: 0 0 auto;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  justify-content: center;
  line-height: 1.15;
  min-height: 34px;
  min-width: max-content;
  padding: 0 15px;
  scroll-snap-align: start;
  white-space: nowrap;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}
.product-category-chip--active { background: var(--product-ink); color: #fff; border-color: var(--product-ink); }
.product-category-chip--has-count { padding-right: 10px; }
.product-category-chip-count {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  margin-left: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}
.product-category-chip--active .product-category-chip-count { background: rgba(255, 255, 255, 0.22); }
.product-category-chip--skeleton {
  display: none;
  background: var(--product-thumb);
  border-color: transparent;
  color: transparent;
  pointer-events: none;
  animation: product-skeleton-pulse 1.1s ease-in-out infinite;
}
.product-category-chip--skeleton .product-category-chip-count {
  visibility: hidden;
}
.product-category-track--loading .product-category-chip:not(.product-category-chip--skeleton) {
  display: none;
}
.product-category-track--loading .product-category-chip--skeleton {
  display: inline-flex;
}


.product-price-filter { margin-bottom: 24px; }
.product-price-filter__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 400;
  color: #6E6E73;
  margin-bottom: 16px;
}
.product-price-filter__head span:last-child { font-size: 15px; font-weight: 500; color: var(--product-ink); }

.product-price-slider {
  position: relative;
  height: 20px;
  margin: 6px 10px 0;
}
.product-price-slider__track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  transform: translateY(-50%);
  background: var(--product-line);
  border-radius: 999px;
}
.product-price-slider__range {
  position: absolute;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: #6E6E73;
  border-radius: 999px;
}
.product-price-slider__handle {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 1.5px solid #6E6E73;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.product-price-slider__handle:active { cursor: grabbing; }
.product-price-slider--disabled {
  opacity: 0.45;
  pointer-events: none;
}
@keyframes product-price-skeleton-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
.product-price-filter--loading .product-price-slider {
  opacity: 1;
  pointer-events: none;
}
.product-price-filter--loading .product-price-filter__head span:last-child {
  visibility: hidden;
  position: relative;
  min-width: 110px;
  display: inline-block;
}
.product-price-filter--loading .product-price-filter__head span:last-child::after {
  content: "";
  position: absolute;
  inset: 2px -4px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--product-thumb) 25%, #f6f6f6 50%, var(--product-thumb) 75%);
  background-size: 200% 100%;
  visibility: visible;
  animation: product-price-skeleton-shimmer 1.2s linear infinite;
}
.product-price-filter--loading .product-price-slider__handle,
.product-price-filter--loading .product-price-slider__range {
  visibility: hidden;
}
.product-price-filter--loading .product-price-slider__track {
  background: linear-gradient(90deg, var(--product-thumb) 25%, #f6f6f6 50%, var(--product-thumb) 75%);
  background-size: 200% 100%;
  animation: product-price-skeleton-shimmer 1.2s linear infinite;
}


.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 0;
  margin: 0 -18px;
}
.product-card:nth-child(odd) .product-card__name,
.product-card:nth-child(odd) .product-card__brand,
.product-card:nth-child(odd) .product-card__row {
  margin-left: 18px;
  margin-right: 9px;
}
.product-card:nth-child(even) .product-card__name,
.product-card:nth-child(even) .product-card__brand,
.product-card:nth-child(even) .product-card__row {
  margin-left: 9px;
  margin-right: 18px;
}

.product-card { min-width: 0; }
.product-card:nth-child(odd) .product-card__image-wrap { border-right: 1px solid #fff; }
.product-card__image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--product-thumb);
  border-radius: 0;
  overflow: hidden;
  margin-bottom: 10px;
  animation: product-skeleton-pulse 1.1s ease-in-out infinite;
}
.product-card__image-wrap--loaded {
  animation: none;
}
.product-card__image-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.product-card__image-wrap--loaded img {
  opacity: 1;
}
.product-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #fff;
  color: var(--product-ink);
  font-size: 12px;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: 999px;
}
.product-card__add {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--product-ink);
  color: #fff;
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}
.product-card__add--added { background: var(--product-muted); opacity: 0.85; cursor: not-allowed; }

.product-card__name { font-size: 13px; font-weight: 500; color: var(--product-ink); margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-card__brand { font-size: 13px; font-weight: 500; color: var(--product-ink); margin-bottom: 10px; }

.product-card__row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 400; color: #6E6E73; margin-bottom: 2px; }
.product-card__row span:last-child { color: #4B5563; font-weight: 400; }
.product-card__row--profit span:first-child { color: #C9A646; }
.product-card__row--profit span:last-child { color: #C9A646; font-weight: 400; }

@media (hover: hover) and (pointer: fine) {
  html,
  body { background: #000; }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .product-field__input { border-bottom-width: 0.5px; }
  .product-item { border-bottom-width: 0.5px; }
  .product-category-chip { border-width: 0.5px; }
}
