.flash-sale {
  margin-block: clamp(22px, 4vw, 46px);
  padding: clamp(22px, 3vw, 36px) clamp(28px, 3.3vw, 46px);
  background-color: #076734;
  /* Extend only the paint so the centered layout cannot create horizontal scrolling. */
  border-image: linear-gradient(180deg, #076734 28%, #089347 63%, #03c75a) 0 fill / 0 / 0 100vmax;
  color: #fff;
}

.flash-sale-header { text-align: center; }

.flash-sale-header h2 {
  margin: 0;
  font-size: clamp(25px, 3.4vw, 33px);
  font-weight: 820;
  letter-spacing: -.05em;
  line-height: 1.25;
}

.flash-sale-timing {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 9px;
  color: inherit;
  line-height: 1.2;
}

.flash-sale-clock-label { font-size: 14px; font-weight: 720; }

.flash-sale-clock-icon {
  display: grid;
  place-items: center;
}

.flash-sale-clock-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.9;
}

.flash-sale-clock {
  color: inherit;
  font-size: clamp(22px, 2.6vw, 28px);
  font-variant-numeric: tabular-nums;
  font-weight: 830;
  letter-spacing: .01em;
}

.flash-sale-detail { margin-top: 7px; color: inherit; font-size: 14px; }
.flash-sale-content {
  position: relative;
  margin-top: clamp(17px, 2.6vw, 28px);
}

.flash-sale-products {
  --flash-gap: clamp(9px, 1.4vw, 17px);
  position: relative;
  display: grid;
  grid-auto-columns: calc((100% - 4 * var(--flash-gap)) / 5);
  grid-auto-flow: column;
  gap: var(--flash-gap);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}

.flash-sale-products::-webkit-scrollbar { display: none; }

.flash-sale-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  scroll-snap-align: start;
}

.flash-sale-card:focus-visible { outline-offset: -3px; }
.flash-sale-card:hover .flash-sale-product-name { color: var(--accent); }

.flash-sale-photo {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--wash);
}

.flash-sale-photo img { width: 100%; height: 100%; object-fit: cover; }

.flash-sale-product-name {
  flex: 1;
  margin: 0;
  padding: 12px 11px 4px;
  color: var(--heading);
  font-size: 15px;
  font-weight: 710;
  letter-spacing: -.015em;
  line-height: 1.4;
}

.flash-sale-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
  padding: 0 11px 12px;
  font-size: clamp(15px, 1.7vw, 18px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1.3;
}

.flash-sale-discount { color: var(--accent); font-weight: 800; }
.flash-sale-price strong { color: var(--heading); font-weight: 810; }

.flash-sale-controls {
  position: absolute;
  inset-block: 0;
  inset-inline: calc(-1 * clamp(44px, 5vw, 64px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.flash-sale-arrow {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #fff;
  pointer-events: auto;
}

.flash-sale-arrow::before {
  width: 16px;
  height: 16px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(-45deg);
  content: "";
}

.flash-sale-arrow:first-child::before { transform: rotate(135deg); }
.flash-sale-arrow:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.flash-sale-arrow:disabled { cursor: default; opacity: .65; }

@media (max-width: 960px) {
  .flash-sale-products { grid-auto-columns: calc((100% - 3 * var(--flash-gap)) / 3.3); }
}

@media (max-width: 600px) {
  .flash-sale { margin-block: 18px; padding-block: 17px 19px; }
  .flash-sale-header h2 { font-size: 23px; }
  .flash-sale-timing { gap: 7px; margin-top: 5px; }
  .flash-sale-clock-label { font-size: 13px; }
  .flash-sale-clock-icon svg { width: 16px; height: 16px; }
  .flash-sale-clock { font-size: 20px; }
  .flash-sale-content { margin-top: 13px; }

  .flash-sale-products {
    --flash-gap: 8px;
    grid-auto-columns: calc((100% - 2 * var(--flash-gap)) / 2.15);
  }

  .flash-sale-photo { aspect-ratio: 1.18 / 1; }
  .flash-sale-product-name { padding: 8px 8px 3px; font-size: 13px; line-height: 1.3; }
  .flash-sale-price { column-gap: 4px; padding: 0 8px 8px; }
  .flash-sale-arrow::before { width: 12px; height: 12px; }
}

@media (max-width: 360px) {
  .flash-sale-products { grid-auto-columns: calc((100% - var(--flash-gap)) / 2); }
  .flash-sale-price { font-size: 14px; }
}
