.container {
  width: min(1200px, calc(100% - clamp(24px, 8vw, 64px)));
}

html,
body {
  overflow-x: clip;
}

body {
  min-width: 0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.5vw, 18px);
  width: 100%;
  align-items: stretch;
}

.product-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(31, 107, 255, .045);
  opacity: 0;
  transform: translateY(12px);
  transition: transform 300ms cubic-bezier(.2, .8, .2, 1), opacity 300ms cubic-bezier(.2, .8, .2, 1);
  transition-delay: var(--card-stagger, 0ms);
}

.product-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.product-art {
  position: relative;
  flex: none;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(135deg, #eaf1ff, #dce8ff);
}

.product-art::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(105deg, transparent 25%, rgba(255, 255, 255, .62) 48%, transparent 72%);
  transform: translateX(-100%);
}

.product-art.is-loading::before {
  opacity: 1;
  animation: product-shimmer 1.35s ease-in-out infinite;
}

.art-open {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
}

.product-image-track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  touch-action: pan-x;
}

.product-image-track::-webkit-scrollbar {
  display: none;
}

.product-art .card-image {
  display: block;
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  height: 100%;
  object-fit: cover;
  scroll-snap-align: start;
  transition: transform 320ms cubic-bezier(.2, .8, .2, 1);
}

.product-badges {
  position: absolute;
  z-index: 4;
  top: 9px;
  left: 9px;
  display: flex;
  max-width: calc(100% - 58px);
  min-width: 0;
  flex-wrap: wrap;
  gap: 5px;
  pointer-events: none;
}

.product-badges .badge {
  position: static;
  display: block;
  max-width: 100%;
  overflow: hidden;
  padding: 4px 8px;
  border: 1px solid rgba(226, 232, 240, .8);
  border-radius: 20px;
  background: rgba(255, 255, 255, .95);
  color: #34445b;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-badges .badge.negotiable {
  background: #eaf8ef;
  color: #176b3a;
}

.product-badges .badge.featured {
  background: #fff5db;
  color: #805300;
}

.product-badges .badge.subscribed {
  border-color: #c9d8fa;
  background: #eaf1ff;
  color: #174ca6;
}

.heart {
  position: absolute;
  z-index: 5;
  top: 8px;
  right: 8px;
  display: grid;
  width: clamp(34px, 3vw, 40px);
  height: clamp(34px, 3vw, 40px);
  padding: 0;
  place-items: center;
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 50%;
  background: rgba(255, 255, 255, .96);
  color: #64748b;
  box-shadow: 0 3px 10px rgba(15, 23, 42, .12);
  transition: transform 250ms cubic-bezier(.2, .8, .2, 1), opacity 250ms cubic-bezier(.2, .8, .2, 1);
}

.heart svg,
.gallery-step svg,
.product-icon-action svg {
  width: 55%;
  height: 55%;
  flex: none;
  fill: none;
  stroke: currentColor;
}

.heart.saved {
  color: #e11d48;
}

.heart.saved svg {
  fill: #e11d48;
}

.heart.saved {
  animation: heart-pop 300ms cubic-bezier(.2, .8, .2, 1);
}

.gallery-step {
  position: absolute;
  z-index: 5;
  top: 50%;
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 50%;
  background: rgba(255, 255, 255, .76);
  color: #263750;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 250ms cubic-bezier(.2, .8, .2, 1), transform 250ms cubic-bezier(.2, .8, .2, 1);
}

.gallery-prev {
  left: 8px;
}

.gallery-next {
  right: 8px;
}

.gallery-dots {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: 9px;
  left: 0;
  display: flex;
  justify-content: center;
  gap: 5px;
  pointer-events: none;
}

.gallery-dot {
  display: block;
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .68);
  box-shadow: 0 1px 4px rgba(15, 23, 42, .35);
  opacity: .85;
  pointer-events: auto;
  transition: transform 250ms cubic-bezier(.2, .8, .2, 1), opacity 250ms cubic-bezier(.2, .8, .2, 1);
}

.gallery-dot.active {
  opacity: 1;
  transform: scale(1.35);
  background: #fff;
}

.product-body {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
}

.product-category {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: #1f6bff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-title {
  display: -webkit-box;
  min-width: 0;
  min-height: 2.7em;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #172033;
  font-size: clamp(14px, calc(1.2vw + 10px), 17px);
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  cursor: pointer;
  text-decoration: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-title:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.product-price-row {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.product-price {
  min-width: 0;
  color: #0b1f4d;
  font-size: clamp(15px, 1.3vw + 10px, 21px);
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.product-old-price {
  color: #7b8798;
  font-size: 12px;
}

.product-sub {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  margin: 0;
  overflow: hidden;
  color: #536174;
  font-size: 12px;
  line-height: 1.45;
  white-space: nowrap;
}

.product-sub svg {
  width: 14px;
  height: 14px;
  flex: none;
  color: #64748b;
}

.product-sub span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seller-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid #edf1f6;
  color: #536174;
  font-size: 11px;
  line-height: 1.3;
}

.seller-line .avatar {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: #eaf1ff;
  color: #1f6bff;
  font-size: 9px;
  font-weight: 800;
}

.seller-name {
  min-width: 0;
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seller-verified {
  display: grid;
  width: 14px;
  height: 14px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: #1f6bff;
  color: #fff;
}

.seller-verified svg {
  width: 10px;
  height: 10px;
  stroke-width: 2.5;
}

.meta-icon {
  display: grid;
  width: 13px;
  height: 13px;
  flex: none;
  margin-left: auto;
  place-items: center;
  color: #64748b;
}

.meta-icon svg {
  width: 13px;
  height: 13px;
}

.seller-time {
  flex: none;
  color: #536174;
  font-size: 10px;
  white-space: nowrap;
}

.product-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid #edf1f6;
}

.product-actions .btn {
  min-width: 0;
  min-height: 42px;
  padding: 0 11px;
  border-radius: 12px;
  font-size: 13px;
  white-space: nowrap;
  transition: transform 250ms cubic-bezier(.2, .8, .2, 1), opacity 250ms cubic-bezier(.2, .8, .2, 1);
}

.product-details-action {
  flex: 1 1 0;
  justify-content: center;
}

.product-actions .product-icon-action {
  display: grid;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  flex: 0 0 40px;
  padding: 0;
  place-items: center;
  border-radius: 12px;
}

.product-actions .whatsapp-short {
  background: #eaf8ef;
  color: #176b3a;
}

.product-actions .cart-card-action {
  background: #eaf1ff;
  color: #1f6bff;
}

.product-actions .cart-card-action.icon-bump {
  animation: cart-icon-bump 350ms cubic-bezier(.2, .8, .2, 1);
}

.product-skeleton {
  pointer-events: none;
}

.skeleton-art {
  background: linear-gradient(135deg, #eaf1ff, #f6f8fc);
}

.skeleton-art::before {
  opacity: 1;
  animation: product-shimmer 1.35s ease-in-out infinite;
}

.product-skeleton .product-body {
  gap: 10px;
}

.skeleton-line {
  display: block;
  height: 10px;
  border-radius: 8px;
  background: linear-gradient(90deg, #e8edf5 20%, #f7f9fc 50%, #e8edf5 80%);
  animation: skeleton-wave 1.35s ease-in-out infinite;
}

.skeleton-category {
  width: 44%;
  height: 8px;
}

.skeleton-title {
  width: 83%;
  height: 32px;
}

.skeleton-price {
  width: 55%;
  height: 19px;
}

.skeleton-meta {
  width: 90%;
  height: 11px;
}

.skeleton-actions {
  width: 100%;
  height: 42px;
  margin-top: auto;
}

.product-empty {
  grid-column: 1 / -1;
}

.product-empty .empty-illustration {
  color: #1f6bff;
}

.product-card:focus-within {
  border-color: #9bbcff;
  box-shadow: 0 0 0 3px rgba(31, 107, 255, .15);
}

.product-card button:focus-visible {
  position: relative;
  z-index: 6;
  outline: 3px solid rgba(31, 107, 255, .65);
  outline-offset: 2px;
}

.product-card .btn:active,
.product-card .heart:active {
  transform: scale(.97);
}

.product-card .gallery-step:active {
  transform: translateY(-50%) scale(.97);
}

@media (min-width: 600px) and (max-width: 1099px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 599px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .product-body {
    gap: 5px;
    padding: 10px;
  }

  .product-title {
    min-height: 2.7em;
    font-size: 13px;
  }

  .product-price {
    font-size: 15px;
  }

  .product-sub {
    font-size: 10px;
  }

  .seller-line .avatar,
  .product-sub {
    display: none;
  }

  .seller-line {
    gap: 5px;
    padding-top: 7px;
    font-size: 10px;
  }

  .seller-time {
    font-size: 9px;
  }

  .product-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding-top: 8px;
  }

  .product-actions .product-details-action {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 40px;
    padding-inline: 8px;
    font-size: 12px;
  }

  .product-actions .product-icon-action {
    width: 100%;
    min-width: 0;
    height: 40px;
    flex: none;
  }
}

@media (max-width: 339px) {
  .header-row {
    gap: 4px;
  }

  .header-row .menu-toggle {
    width: 36px;
    min-width: 36px;
    min-height: 40px;
    height: 40px;
    padding: 0;
  }

  .header-row .brand {
    gap: 5px;
    font-size: 12px;
  }

  .header-row .brand-mark {
    width: 29px;
    height: 29px;
    border-radius: 9px;
  }

  .header-actions {
    gap: 3px;
  }

  .header-actions .icon-button {
    width: 34px;
    min-width: 34px;
    min-height: 38px;
    height: 38px;
  }

  .header-actions [data-action="search-focus"] {
    display: none;
  }

  .product-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-body {
    padding: 13px;
  }

  .product-title {
    font-size: 15px;
  }

  .product-price {
    font-size: 18px;
  }

  .product-sub {
    display: flex;
    font-size: 12px;
  }

  .seller-line .avatar {
    display: grid;
  }

  .product-actions {
    grid-template-columns: repeat(2, 40px);
    justify-content: end;
  }

  .product-actions .product-details-action {
    grid-column: 1 / -1;
  }
}

@media (hover: hover) and (min-width: 768px) {
  .product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(31, 107, 255, .14);
    transition-delay: 0ms;
  }

  .product-card:hover .card-image {
    transform: scale(1.04);
  }

  .product-card:hover .gallery-step,
  .product-card:focus-within .gallery-step {
    opacity: 1;
    pointer-events: auto;
  }
}

@keyframes product-shimmer {
  to {
    transform: translateX(100%);
  }
}

@keyframes skeleton-wave {
  50% {
    opacity: .55;
  }
}

@keyframes heart-pop {
  50% {
    transform: scale(1.14);
  }
}

@keyframes cart-icon-bump {
  50% {
    transform: scale(1.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-card,
  .product-art .card-image,
  .product-actions .btn,
  .heart,
  .gallery-step,
  .gallery-dot {
    transition-duration: .01ms;
    transition-delay: 0ms;
  }

  .product-art.is-loading::before,
  .product-skeleton .skeleton-line,
  .heart.saved,
  .product-actions .cart-card-action.icon-bump {
    animation: none;
  }
}
