.sc-surface {
  background: var(--sc-bg-app);
  color: var(--sc-text-main);
  /* Note: padding-bottom removed — ios-page wrapper (padding: 24px 16px 100px)
     already clears the sticky cart bar. Stacking both caused 196px gap. */
}

/* ==========================================================================
   Rule 1 — high-density feed cards, 12-16px radius, soft shadow,
   crisp typography hierarchy
   ========================================================================== */
.sc-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  padding: 16px;
  max-width: 1080px;
  margin: 0 auto;
}

@media (max-width: 640px) {
    .sc-feed {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
        padding: 12px;
    }
}

.sc-product-card {
  background: var(--sc-bg-card);
  border: 1px solid var(--sc-border-light);
  border-radius: var(--sc-radius-card);
  box-shadow: var(--sc-shadow-card);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.sc-product-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.09);
  transform: translateY(-1px);
}

.sc-product-card__thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  background: var(--sc-primary-purple-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sc-primary-purple);
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
}

.sc-product-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sc-product-card__badge {
  display: inline-block;
  align-self: flex-start;
  background: var(--sc-primary-purple-light);
  color: var(--sc-primary-purple);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--sc-radius-pill);
}

.sc-product-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--sc-text-main);
  margin: 0;
  line-height: 1.3;
}

.sc-product-card__desc {
  font-size: 12.5px;
  color: var(--sc-text-muted);
  margin: 0;
  line-height: 1.4;
}

.sc-product-card__meta {
  font-size: 11.5px;
  color: var(--sc-text-subtle);
  margin: 0;
}

.sc-product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.sc-product-card__price {
  font-size: 16px;
  font-weight: 700;
  color: var(--sc-text-main);
}

.sc-product-card__price-unit {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--sc-text-subtle);
}

/* ==========================================================================
   Rule 2 — ADD button that morphs into a "- 1 +" stepper, no reload
   ========================================================================== */
.sc-stepper {
  --sc-stepper-width: 92px;
  width: var(--sc-stepper-width);
  height: 36px;
  position: relative;
}

.sc-stepper__add,
.sc-stepper__control {
  position: absolute;
  inset: 0;
  border-radius: 10px;
}

.sc-stepper__add {
  background: var(--sc-bg-card);
  border: 1.5px solid var(--sc-primary-purple);
  color: var(--sc-primary-purple);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: var(--sc-shadow-card);
  transition: background 0.12s ease, opacity 0.12s ease;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sc-stepper__add:hover {
  background: var(--sc-primary-purple-light);
}

.sc-stepper__control {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: var(--sc-primary-purple);
  color: #fff;
  padding: 0 10px;
  box-shadow: var(--sc-shadow-card);
}

.sc-stepper.is-active .sc-stepper__add { display: none; }
.sc-stepper.is-active .sc-stepper__control { display: flex; }

.sc-stepper__btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 6px 4px;
}

.sc-stepper__count {
  font-size: 14px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}

/* ==========================================================================
   Rule 3 — sticky floating bottom cart bar, shown only when items > 0
   ========================================================================== */
.sc-cart-bar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 1048px;
  margin: 0 auto;
  background: var(--sc-primary-purple);
  color: #fff;
  border-radius: var(--sc-radius-card);
  box-shadow: var(--sc-shadow-cart-bar);
  padding: 12px 18px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 30;
  cursor: pointer;
  border: none;
  width: calc(100% - 32px);
  text-align: left;
  font: inherit;
}
@media (min-width: 1024px) {
    .sc-cart-bar {
        /* offset for sidebar: uses 16rem to match Tailwind w-64 */
        width: calc(100% - 16rem - 32px);
        left: calc(16rem + 16px);
    }
}

.sc-cart-bar.is-visible {
  display: flex;
}

.sc-cart-bar__summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sc-cart-bar__count {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.85;
}

.sc-cart-bar__total {
  font-size: 15px;
  font-weight: 700;
}

.sc-cart-bar__cta {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   Alert / warning treatment (uses alert tokens — e.g. queue backlog notice)
   ========================================================================== */
.sc-alert-banner {
  max-width: 1080px;
  margin: 12px auto 0;
  padding: 10px 16px;
  background: var(--sc-alert-bg);
  color: var(--sc-alert-text);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sc-alert-banner__action {
  background: var(--sc-alert-button);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.sc-empty-state {
  text-align: center;
  color: var(--sc-text-muted);
  padding: 60px 20px;
  font-size: 14px;
}
