/* Flash Sale v2 — flat retail (TGDD density, no pill slop) */

.mg-ui-v2 .mg-store-fs {
  --fs-accent: var(--store-brand);
  padding-block: 8px 16px;
}

.mg-ui-v2 .mg-store-fs__panel {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--store-border);
}

/* Header */
.mg-ui-v2 .mg-store-fs__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
  background: #fff;
  border-bottom: 1px solid var(--store-border);
}

.mg-ui-v2 .mg-store-fs__header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mg-ui-v2 .mg-store-fs__header-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--fs-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.mg-ui-v2 .mg-store-fs__header-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--store-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mg-ui-v2 .mg-store-fs__header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Day tabs */
.mg-ui-v2 .mg-store-fs__days-wrap {
  padding: 10px 14px 0;
  border-bottom: 1px solid var(--store-border);
}

.mg-ui-v2 .mg-store-fs__days {
  display: flex;
  gap: 6px;
  width: 100%;
  padding-bottom: 8px;
  scrollbar-width: none;
}

@media (min-width: 768px) {
  .mg-ui-v2 .mg-store-fs__days {
    overflow-x: visible;
  }
}

.mg-ui-v2 .mg-store-fs__days::-webkit-scrollbar {
  display: none;
}

.mg-ui-v2 .mg-store-fs__day {
  flex: 1 1 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--store-border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.mg-ui-v2 .mg-store-fs__day-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--store-text);
  white-space: nowrap;
}

.mg-ui-v2 .mg-store-fs__day-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--fs-accent);
  white-space: nowrap;
}

.mg-ui-v2 .mg-store-fs__day-badge--soon {
  color: #b45309;
}

.mg-ui-v2 .mg-store-fs__day--active {
  border-color: var(--fs-accent);
  background: rgba(217, 22, 5, 0.04);
}

.mg-ui-v2 .mg-store-fs__day--active .mg-store-fs__day-label {
  color: var(--fs-accent);
}

.mg-ui-v2 .mg-store-fs__day--past {
  opacity: 0.55;
}

/* Segmented slot tabs */
.mg-ui-v2 .mg-store-fs__slots-wrap {
  padding: 10px 14px 0;
}

.mg-ui-v2 .mg-store-fs__slots {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 4px;
  border-radius: 6px;
  background: #f3f4f6;
  scrollbar-width: none;
}

.mg-ui-v2 .mg-store-fs__slots::-webkit-scrollbar {
  display: none;
}

.mg-ui-v2 .mg-store-fs__slot {
  flex: 1 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.mg-ui-v2 .mg-store-fs__slot-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--store-text);
  white-space: nowrap;
}

.mg-ui-v2 .mg-store-fs__slot-badge {
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.mg-ui-v2 .mg-store-fs__slot-badge--live {
  background: rgba(217, 22, 5, 0.1);
  color: var(--fs-accent);
}

.mg-ui-v2 .mg-store-fs__slot-badge--soon {
  background: #fef3c7;
  color: #b45309;
}

.mg-ui-v2 .mg-store-fs__slot-badge--ended {
  background: #f1f5f9;
  color: var(--store-text-muted);
}

.mg-ui-v2 .mg-store-fs__slot--active {
  background: #fff;
  border-color: var(--store-border);
  border-bottom: 2px solid var(--fs-accent);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.mg-ui-v2 .mg-store-fs__slot--active .mg-store-fs__slot-label {
  color: var(--fs-accent);
  font-weight: 700;
}

.mg-ui-v2 .mg-store-fs__slot--ended {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Panel body */
.mg-ui-v2 .mg-store-fs__panel-body {
  min-height: 280px;
}

.mg-ui-v2 .mg-store-fs__carousel {
  --fs-card-gap: 4px;
  position: relative;
  padding-block: 10px;
  min-height: 272px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mg-ui-v2 .mg-store-fs__viewport {
  overflow: hidden;
  background: #fff;
}

.mg-ui-v2 .mg-store-fs__track {
  display: flex;
  align-items: stretch;
  will-change: transform;
  background: #fff;
}

.mg-ui-v2 .mg-store-fs__item {
  flex: 0 0 var(--fs-item-basis, 20%);
  min-width: 0;
  padding: 0 calc(var(--fs-card-gap, 4px) / 2);
  display: flex;
  background: #fff;
}

.mg-ui-v2 .mg-store-fs__loading {
  display: flex;
  justify-content: center;
  padding: 32px;
}

/* Grid layout */
.mg-ui-v2 .mg-store-fs__grid {
  display: grid;
  grid-template-columns: repeat(var(--fs-grid-cols, 5), minmax(0, 1fr));
  gap: 10px;
  padding: 10px 14px 14px;
}

/* Spotlight layout */
.mg-ui-v2 .mg-store-fs__spotlight {
  display: grid;
  grid-template-columns: minmax(220px, 34%) 1fr;
  align-items: stretch;
  gap: 12px;
  padding: 10px 14px 14px;
  min-height: 280px;
}

.mg-ui-v2 .mg-store-fs__spotlight-hero,
.mg-ui-v2 .mg-store-fs__spotlight-rail {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mg-ui-v2 .mg-store-fs__spotlight-rail .mg-store-fs__carousel {
  flex: 1;
  min-height: 0;
  padding-block: 0;
  justify-content: center;
}

/* Product cards */
.mg-ui-v2 .mg-store-fs-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 8px;
  border: 1px solid var(--store-border);
  border-radius: 6px;
  background: #fff;
}

.mg-ui-v2 .mg-store-fs-card--compact {
  min-height: 268px;
}

.mg-ui-v2 .mg-store-fs-card--standard {
  min-height: 300px;
}

.mg-ui-v2 .mg-store-fs-card--hero {
  min-height: 100%;
  padding: 12px;
}

.mg-ui-v2 .mg-store-fs-card__media {
  position: relative;
  display: block;
}

.mg-ui-v2 .mg-store-fs-card--compact .mg-store-fs-card__media,
.mg-ui-v2 .mg-store-fs-card--standard .mg-store-fs-card__media {
  height: 130px;
}

.mg-ui-v2 .mg-store-fs-card--hero .mg-store-fs-card__media {
  flex: 1;
  min-height: 160px;
  max-height: 240px;
}

.mg-ui-v2 .mg-store-fs-card__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mg-ui-v2 .mg-store-fs-card__badge {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 1;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--fs-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}



.mg-ui-v2 .mg-store-fs-card__body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  padding-top: 6px;
}

.mg-ui-v2 .mg-store-fs-card__name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.35;
  color: var(--store-text);
  min-height: 2.7em;
}

.mg-ui-v2 .mg-store-fs-card--hero .mg-store-fs-card__name {
  font-size: 14px;
  -webkit-line-clamp: 3;
  min-height: 4em;
}

.mg-ui-v2 .mg-store-fs-card__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.mg-ui-v2 .mg-store-fs-card__price-now {
  font-size: 15px;
  font-weight: 800;
  color: #e11d48;
}

.mg-ui-v2 .mg-store-fs-card--hero .mg-store-fs-card__price-now {
  font-size: 18px;
}

.mg-ui-v2 .mg-store-fs-card__price-old {
  font-size: 11px;
  color: var(--store-text-muted);
  text-decoration: line-through;
}

.mg-ui-v2 .mg-store-fs-card__price-contact {
  font-size: 13px;
  font-weight: 600;
  color: var(--fs-accent);
}

.mg-ui-v2 .mg-store-fs-card__price-teaser {
  min-height: 40px;
}

.mg-ui-v2 .mg-store-fs-card--hero .mg-store-fs-card__price-teaser {
  min-height: 48px;
}

/* Keep CTA row aligned whether progress is present or not */
.mg-ui-v2 .mg-store-fs-card__spacer {
  flex: 1 1 auto;
  min-height: 8px;
}

.mg-ui-v2 .mg-store-fs-card__cta-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 32px;
  margin-top: 4px;
  padding: 0 10px;
  border: 1px solid var(--store-border, #e5e7eb);
  border-radius: 4px;
  background: #fff;
  color: var(--store-text, #212b36);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  box-sizing: border-box;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background 0.15s ease;
}

.mg-ui-v2 .mg-store-fs-card__cta-link:hover {
  border-color: var(--fs-accent);
  color: var(--fs-accent);
  background: #fff;
}

.mg-ui-v2 .mg-store-fs-card__progress {
  margin-top: auto;
}

.mg-ui-v2 .mg-store-fs-card__progress-track {
  height: 4px;
  border-radius: 2px;
  background: #f1f5f9;
  overflow: hidden;
}

.mg-ui-v2 .mg-store-fs-card__progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--fs-accent);
}

.mg-ui-v2 .mg-store-fs-card__progress-label {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  color: var(--store-text-muted);
}

.mg-ui-v2 .mg-store-fs-card__buy {
  width: 100%;
  height: 32px;
  margin-top: 4px;
  padding: 0 10px;
  border: 1px solid var(--fs-accent);
  border-radius: 4px;
  background: #fff;
  color: var(--fs-accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.mg-ui-v2 .mg-store-fs-card__buy:hover:not(:disabled) {
  background: var(--fs-accent);
  color: #fff;
}

.mg-ui-v2 .mg-store-fs-card__buy:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Countdown + view all */
.mg-ui-v2 .mg-store-fs__countdown {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.mg-ui-v2 .mg-store-fs__countdown-label {
  font-size: 12px;
  color: var(--store-text-muted);
  margin-right: 4px;
  white-space: nowrap;
}

.mg-ui-v2 .mg-store-fs__countdown-unit {
  min-width: 28px;
  padding: 4px 5px;
  border-radius: 4px;
  background: #1f2937;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.mg-ui-v2 .mg-store-fs__countdown-sep {
  font-weight: 700;
  color: var(--store-text);
}

.mg-ui-v2 .mg-store-fs__view-all {
  font-size: 12px;
  font-weight: 600;
  color: var(--fs-accent);
  white-space: nowrap;
}

.mg-ui-v2 .mg-store-fs__view-all:hover {
  text-decoration: underline;
}

@media (min-width: 768px) and (max-width: 991px) {
  .mg-ui-v2 .mg-store-fs__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-inline: 12px;
  }
}

@media (max-width: 767px) {
  .mg-ui-v2 .mg-store-fs__days-wrap {
    padding-inline: 12px;
  }

  .mg-ui-v2 .mg-store-fs__days {
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .mg-ui-v2 .mg-store-fs__day {
    flex: 0 0 calc((100% - 24px) / 5);
    min-width: 68px;
    padding: 6px 8px;
    scroll-snap-align: start;
  }

  .mg-ui-v2 .mg-store-fs__day-label {
    font-size: 13px;
  }

  .mg-ui-v2 .mg-store-fs__day-badge {
    font-size: 9px;
  }

  .mg-ui-v2 .mg-store-fs__header {
    flex-wrap: wrap;
    min-height: auto;
    padding: 10px 12px;
  }

  .mg-ui-v2 .mg-store-fs__header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .mg-ui-v2 .mg-store-fs__slots-wrap {
    padding-inline: 12px;
  }

  .mg-ui-v2 .mg-store-fs__slot {
    flex: 0 0 auto;
  }

  .mg-ui-v2 .mg-store-fs__slot-badge {
    display: none;
  }

  .mg-ui-v2 .mg-store-fs__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-inline: 12px;
  }

  .mg-ui-v2 .mg-store-fs__spotlight {
    grid-template-columns: 1fr;
    padding-inline: 12px;
  }
}

/* Sale listing page */
.mg-ui-v2 .mg-store-sale-page {
  padding: clamp(16px, 2vw, 28px) 0 clamp(32px, 4vw, 48px);
}

.mg-ui-v2 .mg-store-sale-page__panel {
  border: 1px solid var(--store-border);
  border-radius: var(--store-radius-md);
  background: var(--store-bg);
  box-shadow: var(--store-shadow-sm);
  overflow: hidden;
}

.mg-ui-v2 .mg-store-sale-page__title {
  margin: 0;
  padding: 20px 16px 8px;
  font-size: var(--store-fs-xl);
  font-weight: 700;
}

.mg-ui-v2 .mg-store-sale-page__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.mg-ui-v2 .mg-store-sale-page__empty {
  margin: 0;
  padding: 24px 16px 32px;
  color: var(--store-text-muted);
  text-align: center;
}

@media (max-width: 1199px) {
  .mg-ui-v2 .mg-store-sale-page__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .mg-ui-v2 .mg-store-sale-page__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .mg-ui-v2 .mg-store-sale-page__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-inline: 12px;
  }
}