/* ================================================================
   THRIFT Design System — Pages & Animations
   Page-specific layouts and global animations.
   ================================================================ */

/* ── Animations (keyframes) ───────────────────────────────── */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes tickerScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-3px); }
}
@keyframes flyLeft {
  to { transform: translateX(-120vw) rotate(-20deg); opacity: 0; }
}
@keyframes flyRight {
  to { transform: translateX(120vw) rotate(20deg); opacity: 0; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Page entrance */
.main { animation: pageIn 0.28s var(--ease-out); }

/* Card stagger — first 12 children get increasing delays */
.masonry .item-card                { animation: cardIn 0.4s var(--ease-out) both; }
.masonry .item-card:nth-child(1)   { animation-delay:   0ms; }
.masonry .item-card:nth-child(2)   { animation-delay:  50ms; }
.masonry .item-card:nth-child(3)   { animation-delay: 100ms; }
.masonry .item-card:nth-child(4)   { animation-delay: 150ms; }
.masonry .item-card:nth-child(5)   { animation-delay: 200ms; }
.masonry .item-card:nth-child(6)   { animation-delay: 250ms; }
.masonry .item-card:nth-child(7)   { animation-delay: 300ms; }
.masonry .item-card:nth-child(8)   { animation-delay: 350ms; }
.masonry .item-card:nth-child(9)   { animation-delay: 400ms; }
.masonry .item-card:nth-child(10)  { animation-delay: 450ms; }
.masonry .item-card:nth-child(11)  { animation-delay: 500ms; }
.masonry .item-card:nth-child(12)  { animation-delay: 550ms; }


/* ══════════════════════════════════════════════════════════════
   HOME PAGE
   ══════════════════════════════════════════════════════════════ */

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-10) var(--space-4) var(--space-9);
}
.hero--split {
  flex-direction: row;
  align-items: center;
  gap: var(--space-10);
  text-align: left;
  padding: var(--space-10) var(--space-4);
}

.hero__impact {
  flex: 0 0 320px;
  background: linear-gradient(140deg, var(--color-accent-light) 0%, var(--bg-surface) 100%);
  border: 1px solid rgba(58, 125, 68, 0.18);
  border-radius: var(--radius-2xl);
  padding: var(--space-8) var(--space-7);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-7) var(--space-8);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
/* Decorative soft circle in corner */
.hero__impact::before {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(58,125,68,0.10) 0%, transparent 70%);
  pointer-events: none;
}
.hero__impact::after {
  content: "";
  position: absolute;
  bottom: -30px; left: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(58,125,68,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.impact-stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.impact-stat__icon {
  font-size: var(--text-xl);
  line-height: 1;
  margin-bottom: var(--space-1);
}
.impact-stat__value {
  font-size: var(--text-3xl);
  font-weight: var(--weight-extrabold);
  color: var(--color-accent);
  letter-spacing: var(--tracking-tight);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.impact-stat__label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-top: var(--space-1);
}

.hero__text { flex: 1; }

.hero__title {
  font-size: clamp(var(--text-3xl), 5.5vw, var(--text-5xl));
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-4);
}

.hero__sub {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 480px;
  margin-bottom: var(--space-7);
  line-height: var(--leading-relaxed);
}
.hero--split .hero__sub { max-width: 440px; }

.hero__search {
  display: flex;
  gap: var(--space-2);
  width: 100%;
  max-width: 540px;
  margin-bottom: var(--space-6);
}

.hero__input {
  flex: 1;
  padding: var(--space-3) var(--space-5);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  background: var(--bg-surface);
  transition: border-color var(--dur-normal) ease, box-shadow var(--dur-normal) ease;
  box-shadow: var(--shadow-sm);
}
.hero__input:hover   { border-color: var(--border-strong); }
.hero__input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--shadow-glow);
}
.hero__search .btn {
  border-radius: var(--radius-lg);
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.hero__actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.hero--split .hero__actions { justify-content: flex-start; }

@media (max-width: 900px) {
  .hero--split {
    flex-direction: column;
    gap: var(--space-6);
    text-align: center;
    align-items: center;
    padding: var(--space-8) var(--space-4);
  }
  .hero--split .hero__sub     { max-width: 100%; }
  .hero--split .hero__search  { margin-left: auto; margin-right: auto; }
  .hero--split .hero__actions { justify-content: center; }
}

@media (max-width: 900px) {
  .hero__impact {
    flex: none;
    width: 100%;
    max-width: 380px;
    padding: var(--space-6);
    gap: var(--space-5) var(--space-6);
  }
  .impact-stat__value { font-size: var(--text-2xl); }
}

/* ── Eco Ticker ───────────────────────────────────────────── */
.eco-ticker {
  overflow: hidden;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-3) 0;
  margin: var(--space-7) 0;
}
.eco-ticker__track {
  display: inline-block;
  white-space: nowrap;
  animation: tickerScroll 35s linear infinite;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  letter-spacing: var(--tracking-wide);
}

/* ── Category Grid ────────────────────────────────────────── */
.categories { margin-top: var(--space-7); }
.categories__heading {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-5);
}
.categories__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--space-3);
}
.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  transition:
    border-color var(--dur-normal) ease,
    transform var(--dur-slow) var(--ease-out),
    box-shadow var(--dur-slow) var(--ease-out);
}
.category-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.category-card__icon {
  font-size: 1.75rem;
  transition: transform var(--dur-slow) var(--ease-spring);
}
.category-card:hover .category-card__icon {
  animation: iconFloat 0.5s var(--ease-out);
}
.category-card__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}


/* ══════════════════════════════════════════════════════════════
   RESULTS / BROWSE PAGE
   ══════════════════════════════════════════════════════════════ */
.results-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-8);
  align-items: start;
}
@media (max-width: 800px) {
  .results-layout { grid-template-columns: 1fr; }
}

.filters {
  position: sticky;
  top: calc(var(--nav-h) + var(--space-7));
  padding: var(--space-5);
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xs);
}
@media (max-width: 800px) {
  .filters { display: none; }
}

.filters__heading {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.results-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}
.results-header__title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
}
.results-header__count {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}


/* ══════════════════════════════════════════════════════════════
   DISCOVER / SWIPE PAGE
   ══════════════════════════════════════════════════════════════ */
.swipe-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: calc(100dvh - var(--nav-h) - var(--bottom-nav-h));
  width: 100%;
  overflow: hidden;
  padding: var(--space-4) var(--space-4) var(--space-3);
  box-sizing: border-box;
}

.swipe-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 400px;
  flex-shrink: 0;
  margin-bottom: var(--space-3);
}
.swipe-top__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
}

.swipe-stack {
  position: relative;
  width: 100%;
  max-width: 400px;
  flex: 1;
  min-height: 0;
  margin: 0 auto;
}
.swipe-stack__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: var(--space-3);
}
.swipe-card {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-surface);
  box-shadow: var(--shadow-lg);
  touch-action: none;
  user-select: none;
  will-change: transform;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.swipe-card--back1 { transform: scale(0.95) translateY(10px); z-index: 1; opacity: 0.7; }
.swipe-card--back2 { transform: scale(0.90) translateY(20px); z-index: 0; opacity: 0.4; }

.swipe-card__img {
  width: 100%;
  height: 65%;
  object-fit: cover;
}
.swipe-card__body {
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.swipe-card__seller {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-accent);
  text-decoration: none;
}
.swipe-card__seller:hover { text-decoration: underline; }
.swipe-card__badge {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-accent);
}
.swipe-card__price {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
}
.swipe-card__title {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.swipe-card__meta {
  display: flex;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* Swipe direction overlays */
.swipe-card__overlay {
  position: absolute;
  top: var(--space-5);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-lg);
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--tracking-wider);
  border-radius: var(--radius-md);
  border: 3px solid;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease;
}
.swipe-card__overlay--skip {
  left: var(--space-5);
  color: var(--color-error);
  border-color: var(--color-error);
  transform: rotate(-12deg);
}
.swipe-card__overlay--save {
  right: var(--space-5);
  color: var(--color-success);
  border-color: var(--color-success);
  transform: rotate(12deg);
}

/* Card type badges (positioned over image) */
.swipe-card__type-badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 5;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  border-radius: var(--radius-md);
  pointer-events: none;
}
.swipe-card__type-badge--offer {
  background: var(--color-accent);
  color: white;
}
.swipe-card__type-badge--inventory {
  background: rgba(0, 0, 0, 0.6);
  color: white;
}

/* Price variants */
.swipe-card__price--offer {
  color: var(--color-accent);
}
.swipe-card__price--original {
  font-size: var(--text-sm);
  font-weight: var(--weight-normal);
  text-decoration: line-through;
  opacity: 0.6;
}
.swipe-card__price--style {
  font-style: italic;
  color: var(--text-secondary);
  font-size: var(--text-base);
}

/* Card type body tints */
.swipe-card__body--style {
  background: linear-gradient(to bottom, rgba(59, 130, 246, 0.06), rgba(59, 130, 246, 0.12));
}
.swipe-card__body--inventory {
  background: linear-gradient(to bottom, rgba(34, 197, 94, 0.06), rgba(34, 197, 94, 0.12));
}
.swipe-card__body--special_offer {
  background: linear-gradient(to bottom, rgba(234, 179, 8, 0.06), rgba(234, 179, 8, 0.14));
}

.swipe-card.fly-left  { animation: flyLeft 0.45s var(--ease-out) forwards; }
.swipe-card.fly-right { animation: flyRight 0.45s var(--ease-out) forwards; }

/* Swipe action bar */
.swipe-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  margin-top: var(--space-4);
  flex-shrink: 0;
}
.swipe-btn {
  width: 56px; height: 56px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  background: var(--bg-surface);
  font-size: var(--text-xl);
  display: flex; align-items: center; justify-content: center;
  transition:
    background var(--dur-normal) ease,
    border-color var(--dur-normal) ease,
    transform var(--dur-fast) var(--ease-spring),
    box-shadow var(--dur-normal) ease;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.swipe-btn:active { transform: scale(0.92); }
.swipe-btn--skip:hover {
  border-color: var(--color-error);
  color: var(--color-error);
  box-shadow: 0 4px 14px rgba(214,69,69,.2);
}
.swipe-btn--save:hover {
  border-color: var(--color-success);
  color: var(--color-success);
  box-shadow: 0 4px 14px rgba(61,153,112,.2);
}
.swipe-counter {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-tertiary);
  min-width: 40px;
  text-align: center;
}

/* Swipe hint overlay — sits inside .swipe-stack (position:relative) */
.swipe-hint {
  position: absolute;
  inset: 0;
  background: var(--bg-overlay);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 10;
  cursor: pointer;
  animation: fadeInUp 0.3s ease both;
}
.swipe-hint__action {
  text-align: center;
  color: var(--text-inverse);
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
}
.swipe-hint__icon {
  display: block;
  font-size: var(--text-3xl);
  margin-bottom: var(--space-2);
}


/* ══════════════════════════════════════════════════════════════
   ITEM DETAIL PAGE
   ══════════════════════════════════════════════════════════════ */
.detail {
  max-width: 960px;
  margin: 0 auto;
}
.detail__back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: color var(--dur-normal) ease, background var(--dur-normal) ease;
}
.detail__back:hover {
  color: var(--text-primary);
  background: var(--bg-inset);
}

.detail__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: start;
}
@media (max-width: 700px) {
  .detail__grid { grid-template-columns: 1fr; gap: var(--space-5); }
}

/* Gallery */
.detail__gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.detail__main-img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
.detail__thumbs {
  display: flex;
  gap: var(--space-2);
}
.detail__thumb {
  width: 64px; height: 64px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--dur-normal) ease, border-color var(--dur-normal) ease;
}
.detail__thumb:hover { opacity: 0.85; }
.detail__thumb--active {
  opacity: 1;
  border-color: var(--color-accent);
}

/* Info panel */
.detail__info {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.detail__badge {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-accent);
  letter-spacing: var(--tracking-wide);
}
.detail__title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
}
.detail__price {
  font-size: var(--text-3xl);
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--tracking-tight);
}
.detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-sm);
}
.detail__condition {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-weight: var(--weight-semibold);
  font-size: var(--text-xs);
}
.detail__condition--new       { background: var(--color-success-light); color: var(--color-success); }
.detail__condition--excellent { background: var(--color-info-light);    color: var(--color-info); }
.detail__condition--good      { background: var(--color-accent-light);  color: var(--color-accent); }
.detail__condition--fair      { background: #fff3e0; color: #e67e22; }
.detail__condition--poor      { background: var(--color-error-light);   color: var(--color-error); }

.detail__location {
  color: var(--text-secondary);
}

.detail__description {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}

.detail__specs {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  padding: var(--space-4);
  background: var(--bg-inset);
  border-radius: var(--radius-md);
}
.detail__spec-key {
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
}
.detail__spec-val {
  color: var(--text-primary);
}

.detail__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-3);
}
.detail__tag {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-full);
  background: var(--color-accent-light);
  color: var(--text-accent);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}
.detail__tag:hover {
  background: var(--color-accent);
  color: var(--text-inverse);
}

.detail__cta {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.detail__cta .btn {
  flex: 1;
}

.detail__save-btn {
  width: 100%;
  padding: var(--space-4);
  font-size: var(--text-md);
  border-radius: var(--radius-lg);
}
.detail__save-btn--saved {
  background: var(--color-success);
  color: var(--text-inverse);
  border-color: var(--color-success);
}

.detail__actions {
  display: flex;
  gap: var(--space-3);
}


/* ══════════════════════════════════════════════════════════════
   SELL FORM / EDIT FORM
   ══════════════════════════════════════════════════════════════ */
.sell-form {
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
}

.sell-form__section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.sell-form__section-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-secondary);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.sell-form__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.form-group--full { grid-column: 1 / -1; }

@media (max-width: 500px) {
  .sell-form__fields { grid-template-columns: 1fr; }
  .form-group--full  { grid-column: 1; }
}

/* Upload zone */
.sell-upload {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-inset);
  transition: border-color var(--dur-normal) ease, background var(--dur-normal) ease;
  cursor: pointer;
}
.sell-upload:hover {
  border-color: var(--border-strong);
  background: var(--color-gray-100);
}
.sell-upload--has-image {
  border-style: solid;
  border-color: var(--border-subtle);
  background: var(--color-gray-900);
}

.sell-upload__preview {
  width: 100%; height: 100%;
  object-fit: contain;
}

.sell-upload__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-tertiary);
}
.sell-upload__icon   { font-size: 2.5rem; opacity: 0.5; }
.sell-upload__text   { font-size: var(--text-sm); font-weight: var(--weight-medium); }
.sell-upload__actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.sell-upload__action {
  padding: var(--space-2) var(--space-4);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color var(--dur-normal) ease, background var(--dur-normal) ease;
}
.sell-upload__action:hover {
  border-color: var(--border-strong);
  background: var(--bg-inset);
}

.sell-upload__change {
  position: absolute;
  top: var(--space-3); right: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background var(--dur-fast) ease;
}
.sell-upload__change:hover { background: #fff; }

/* Analyse button */
.btn--analyse {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: var(--color-accent-light);
  border: 1.5px solid var(--color-accent);
  border-radius: var(--radius-md);
  color: var(--color-accent-hover);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  transition: background var(--dur-normal) ease, color var(--dur-normal) ease, box-shadow var(--dur-normal) ease;
}
.btn--analyse:hover {
  background: var(--color-accent);
  color: var(--text-inverse);
  box-shadow: 0 4px 14px rgba(184,147,95,.3);
}
.btn--analyse .btn__icon { font-size: var(--text-md); line-height: 1; }

/* ── Unified image tray ─────────────────────────────────────────────── */
.img-tray {
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-inset);
}

.img-tray__main {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

.img-tray__main-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.img-tray__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-6);
  text-align: center;
  color: var(--text-tertiary);
}

.img-tray__placeholder-icon { font-size: 2.5rem; opacity: 0.5; }

.img-tray__placeholder-text {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.img-tray__placeholder-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: center;
  margin-top: var(--space-2);
}

.img-tray__strip-wrap {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-3);
  background: var(--bg-surface);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.img-tray__strip {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  min-height: 76px;
}

.img-tray__item {
  position: relative;
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: border-color var(--dur-fast) ease;
  user-select: none;
}

.img-tray__item--focused { border-color: var(--color-accent); }
.img-tray__item--drag-over { border-color: var(--text-primary); opacity: 0.5; }

.img-tray__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: calc(var(--radius-sm) - 2px);
  pointer-events: none;
}

.img-tray__num {
  position: absolute;
  top: 2px; left: 3px;
  font-size: 0.6rem;
  font-weight: var(--weight-bold);
  color: #fff;
  background: rgba(0,0,0,.55);
  border-radius: 3px;
  padding: 1px 3px;
  line-height: 1.4;
  pointer-events: none;
}

.img-tray__badge {
  position: absolute;
  bottom: 2px; left: 3px;
  font-size: 0.55rem;
  color: #fff;
  background: var(--color-accent);
  border-radius: 3px;
  padding: 1px 3px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.img-tray__remove {
  position: absolute;
  top: -5px; right: -5px;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: none;
  background: var(--text-primary);
  color: var(--text-inverse);
  font-size: 0.7rem;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  display: none;
  z-index: 2;
}

.img-tray__item:hover .img-tray__remove { display: block; }

.img-tray__add {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}

.img-tray__add:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}


/* ══════════════════════════════════════════════════════════════
   ACCOUNT PAGE
   ══════════════════════════════════════════════════════════════ */
.account-page {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.account-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.account-section__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

/* Form rows */
.account-form__row {
  margin-bottom: var(--space-4);
}

.account-form__label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.account-form__inline {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.account-form__inline .input {
  flex: 1;
}

/* Detail rows */
.account-detail {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) 0;
}

.account-detail + .account-detail {
  border-top: 1px solid var(--border-subtle);
}

.account-detail__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  min-width: 120px;
}

.account-detail__value {
  font-size: var(--text-base);
  color: var(--text-primary);
}

/* SIFT integration */
.sift-status {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-inset);
}

.sift-status__indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.sift-status__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sift-status__dot--linked {
  background: var(--color-success);
  box-shadow: 0 0 0 3px var(--color-success-light);
}

.sift-status__dot--unlinked {
  background: var(--text-tertiary);
  box-shadow: 0 0 0 3px var(--bg-muted);
}

.sift-status__dot--checking {
  background: var(--text-tertiary);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

.sift-status__actions {
  margin-left: auto;
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-shrink: 0;
}

@media (max-width: 520px) {
  .sift-status {
    flex-direction: column;
    align-items: stretch;
  }
  .sift-status__actions {
    margin-left: 0;
    width: 100%;
  }
  .sift-status__actions .btn {
    flex: 1;
    text-align: center;
  }
}

.sift-status__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-3);
}

/* Tier grid */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
}

.tier-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  text-align: center;
  transition: border-color var(--dur-normal) ease, box-shadow var(--dur-normal) ease;
}

.tier-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.tier-card--current {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}

.tier-card__name {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
}

.tier-card__price {
  font-size: var(--text-2xl);
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--tracking-tight);
}

.tier-card__period {
  font-size: var(--text-sm);
  font-weight: var(--weight-normal);
  color: var(--text-secondary);
}

.tier-card__badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-accent);
  padding: var(--space-1) var(--space-3);
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-accent);
}

/* Alerts */
.alert {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.alert--success {
  background: var(--color-success-light);
  color: var(--color-success);
  border: 1px solid var(--color-success);
}

.alert--info {
  background: var(--color-info-light, #e8f4fd);
  color: var(--color-info, #2196f3);
  border: 1px solid var(--color-info, #2196f3);
}

/* Danger button */
.btn--danger {
  background: var(--color-error);
  color: var(--text-inverse);
  border: 1.5px solid var(--color-error);
}

.btn--danger:hover {
  background: transparent;
  color: var(--color-error);
}

/* Accent button */
.btn--accent {
  background: var(--color-accent);
  color: var(--text-inverse);
  border: 1.5px solid var(--color-accent);
}

.btn--accent:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}


/* ══════════════════════════════════════════════════════════════
   ADMIN PANEL
   ══════════════════════════════════════════════════════════════ */

/* Layout */
.admin-layout {
  display: flex;
  gap: var(--space-8);
  min-height: calc(100vh - var(--nav-h) - var(--space-7) * 2);
}

.admin-sidebar {
  flex: 0 0 220px;
  position: sticky;
  top: calc(var(--nav-h) + var(--space-7));
  align-self: flex-start;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.admin-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.admin-sidebar__link {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  transition: background var(--dur-normal) ease, color var(--dur-normal) ease;
}

.admin-sidebar__link:hover {
  background: var(--bg-inset);
  color: var(--text-primary);
}

.admin-sidebar__link--active {
  background: var(--color-accent-light);
  color: var(--text-accent);
  font-weight: var(--weight-semibold);
}

.admin-content {
  flex: 1;
  min-width: 0;
}

@media (max-width: 800px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar {
    flex: none;
    position: static;
    width: 100%;
  }
  .admin-sidebar__nav { flex-direction: row; flex-wrap: wrap; gap: var(--space-2); }
}

/* Stat cards */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

.admin-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
}

.admin-stat-card__value {
  font-size: var(--text-3xl);
  font-weight: var(--weight-extrabold);
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.admin-stat-card__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
}

/* Table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.admin-table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.admin-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background: var(--bg-inset);
}

/* Badges */
.admin-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  line-height: 1.4;
}

.admin-badge--admin {
  background: #f3e8ff;
  color: #7c3aed;
}

.admin-badge--active {
  background: var(--color-success-light);
  color: var(--color-success);
}

.admin-badge--trial {
  background: var(--color-info-light, #e8f4fd);
  color: var(--color-info, #2196f3);
}

.admin-badge--cancelled {
  background: var(--color-error-light);
  color: var(--color-error);
}

.admin-badge--redeemed {
  background: var(--bg-inset);
  color: var(--text-secondary);
}

.admin-badge--revoked {
  background: #fff3e0;
  color: #e67e22;
}

/* Search input */
.admin-search {
  width: 100%;
  max-width: 400px;
  padding: var(--space-2) var(--space-4);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  background: var(--bg-surface);
  margin-bottom: var(--space-5);
  transition: border-color var(--dur-normal) ease;
}

.admin-search:focus {
  outline: none;
  border-color: var(--border-focus);
}

/* Admin nav link accent */
.nav__link--admin {
  color: #7c3aed !important;
  font-weight: var(--weight-semibold);
}


/* ══════════════════════════════════════════════════════════════
   INVITATION LANDING PAGE
   ══════════════════════════════════════════════════════════════ */

.invite-page {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--space-10) var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.invite-page__tier-card {
  width: 100%;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-7);
  text-align: center;
  margin-bottom: var(--space-6);
  transition: border-color var(--dur-normal) ease, box-shadow var(--dur-normal) ease;
}

.invite-page__tier-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
}

.invite-page__trial-badge {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  background: var(--color-info-light, #e8f4fd);
  color: var(--color-info, #2196f3);
}

.invite-page__cta {
  display: inline-block;
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  border-radius: var(--radius-lg);
  text-align: center;
  text-decoration: none;
}


/* ══════════════════════════════════════════════════════════════
   STORE DASHBOARD
   ══════════════════════════════════════════════════════════════ */
.store-dashboard {
  max-width: 960px;
  margin: 0 auto;
}

.store-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.store-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
}

.store-stat-card__value {
  font-size: var(--text-3xl);
  font-weight: var(--weight-extrabold);
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.store-stat-card__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
}

.store-actions {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

/* Category breakdown bar */
.store-category-bar {
  height: 8px;
  background: var(--color-accent);
  border-radius: var(--radius-sm);
  min-width: 4px;
}

/* Condition distribution */
.store-condition-dist {
  display: flex;
  height: 32px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-4);
}

.store-condition-dist__segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: #fff;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}

.store-condition-dist__segment--new       { background: var(--color-success); }
.store-condition-dist__segment--excellent { background: var(--color-info); }
.store-condition-dist__segment--good      { background: var(--color-accent); }
.store-condition-dist__segment--fair      { background: #e67e22; }
.store-condition-dist__segment--poor      { background: var(--color-error); }

.store-condition-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.store-condition-legend__item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.store-condition-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Inventory toolbar */
.inventory-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  align-items: center;
}

.inventory-toolbar__search {
  flex: 1;
  min-width: 200px;
  height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: border-color var(--dur-normal) ease, box-shadow var(--dur-normal) ease;
}

.inventory-toolbar__search:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

.inventory-toolbar__select {
  height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  min-width: 140px;
}

.inventory-toolbar__select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

.inventory-summary {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

@media (max-width: 600px) {
  .inventory-toolbar {
    flex-direction: column;
  }
  .inventory-toolbar__search,
  .inventory-toolbar__select {
    width: 100%;
    min-width: 0;
  }
}


/* ══════════════════════════════════════════════════════════════
   STORE SETTINGS
   ══════════════════════════════════════════════════════════════ */
.store-settings {
  max-width: 960px;
  margin: 0 auto;
}

.store-settings__grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--space-8);
  align-items: start;
}

@media (max-width: 800px) {
  .store-settings__grid {
    grid-template-columns: 1fr;
  }
}

.store-settings__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.store-settings__preview {
  position: sticky;
  top: calc(var(--nav-h) + var(--space-7));
}

/* Preview card */
.store-preview {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.store-preview__banner {
  width: 100%;
  height: 120px;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-hover) 100%);
  position: relative;
  overflow: hidden;
}

.store-preview__banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-preview__info {
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: -32px;
  position: relative;
}

.store-preview__logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  border: 3px solid var(--bg-surface);
  overflow: hidden;
}

.store-preview__name {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  margin-top: var(--space-2);
}

.store-preview__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
  line-height: var(--leading-normal);
}

.slug-preview {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}


/* ══════════════════════════════════════════════════════════════
   PUBLIC STOREFRONT
   ══════════════════════════════════════════════════════════════ */
.store-public {
  --store-brand: var(--color-accent);
}

.store-banner {
  width: 100vw;
  min-height: 240px;
  background: linear-gradient(135deg, var(--store-brand, var(--color-accent)) 0%, var(--store-brand, var(--color-accent))88 100%);
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: flex-end;
  margin-top: calc(-1 * var(--space-7));
  margin-bottom: 0;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0 var(--content-pad);
}

.store-banner__overlay {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-8) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #fff;
}

/* Dark overlay for readability over images */
.store-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.5) 100%);
  pointer-events: none;
}

.store-banner__logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-3);
}

.store-banner__logo--letter {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--store-brand, var(--color-accent));
  color: #fff;
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
}

.store-banner__name {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.store-banner__desc {
  font-size: var(--text-base);
  opacity: 0.9;
  max-width: 480px;
  line-height: var(--leading-relaxed);
  text-shadow: 0 1px 4px rgba(0,0,0,0.2);
  margin-top: var(--space-2);
}

.store-public__content {
  max-width: 960px;
  margin: var(--space-8) auto 0;
}


/* ══════════════════════════════════════════════════════════════
   SELLER IDENTITY ON ITEM CARDS
   ══════════════════════════════════════════════════════════════ */
.item-card__seller {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  transition: color var(--dur-normal) ease;
  display: block;
}

a.item-card__seller:hover {
  color: var(--color-accent);
}


/* ══════════════════════════════════════════════════════════════
   ACCOUNT PAGE POLISH
   ══════════════════════════════════════════════════════════════ */
.account-page__header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}

.account-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  flex-shrink: 0;
}


/* ══════════════════════════════════════════════════════════════
   EMPTY STATE ENHANCEMENTS
   ══════════════════════════════════════════════════════════════ */
.empty-state__illustration {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  margin-bottom: var(--space-2);
}

.empty-state__illustration::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px dashed var(--border);
  border-radius: 50%;
  animation: spin 20s linear infinite;
}

.empty-state__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  margin-top: var(--space-2);
}

.empty-state__pill {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  transition: border-color var(--dur-normal) ease, color var(--dur-normal) ease, background var(--dur-normal) ease;
}

.empty-state__pill:hover {
  border-color: var(--color-accent);
  color: var(--text-accent);
  background: var(--color-accent-light);
}


/* ══════════════════════════════════════════════════════════════
   ALERT ERROR VARIANT
   ══════════════════════════════════════════════════════════════ */
.alert--error {
  background: var(--color-error-light);
  color: var(--color-error);
  border: 1px solid var(--color-error);
}


/* ══════════════════════════════════════════════════════════════
   MICRO-INTERACTIONS
   ══════════════════════════════════════════════════════════════ */
html {
  scroll-padding-top: calc(var(--nav-h) + var(--space-4));
}

/* Card entrance stagger for store public page */
.store-public .masonry .item-card { animation: cardIn 0.4s var(--ease-out) both; }
.store-public .masonry .item-card:nth-child(1)  { animation-delay:   0ms; }
.store-public .masonry .item-card:nth-child(2)  { animation-delay:  60ms; }
.store-public .masonry .item-card:nth-child(3)  { animation-delay: 120ms; }
.store-public .masonry .item-card:nth-child(4)  { animation-delay: 180ms; }
.store-public .masonry .item-card:nth-child(5)  { animation-delay: 240ms; }
.store-public .masonry .item-card:nth-child(6)  { animation-delay: 300ms; }
.store-public .masonry .item-card:nth-child(7)  { animation-delay: 360ms; }
.store-public .masonry .item-card:nth-child(8)  { animation-delay: 420ms; }
.store-public .masonry .item-card:nth-child(9)  { animation-delay: 480ms; }
.store-public .masonry .item-card:nth-child(10) { animation-delay: 540ms; }
.store-public .masonry .item-card:nth-child(11) { animation-delay: 600ms; }
.store-public .masonry .item-card:nth-child(12) { animation-delay: 660ms; }


/* ══════════════════════════════════════════════════════════════
   ONBOARDING PAGE
   ══════════════════════════════════════════════════════════════ */
.onboarding-page {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-10) var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.onboarding-page__title {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-3);
}

.onboarding-page__subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
}

.onboarding-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  width: 100%;
}

@media (max-width: 600px) {
  .onboarding-cards { grid-template-columns: 1fr; }
}

.onboarding-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-7) var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  transition:
    border-color var(--dur-normal) ease,
    box-shadow var(--dur-normal) ease,
    transform var(--dur-slow) var(--ease-out);
  cursor: pointer;
}

.onboarding-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.onboarding-card__icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: var(--space-2);
}

.onboarding-card__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
}

.onboarding-card__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

.onboarding-card__features {
  list-style: none;
  padding: 0;
  margin: var(--space-3) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-align: left;
  width: 100%;
}

.onboarding-card__features li::before {
  content: "\2713\00a0";
  color: var(--color-accent);
  font-weight: var(--weight-bold);
}

.onboarding-card__btn {
  margin-top: auto;
  width: 100%;
}


/* ══════════════════════════════════════════════════════════════
   CART PAGE
   ══════════════════════════════════════════════════════════════ */
.cart-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cart-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: box-shadow var(--dur-normal) ease;
}

.cart-item:hover {
  box-shadow: var(--shadow-sm);
}

.cart-item__image-link {
  flex-shrink: 0;
}

.cart-item__image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.cart-item__details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.cart-item__title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
}

.cart-item__title a {
  color: var(--text-primary);
  text-decoration: none;
}

.cart-item__title a:hover {
  color: var(--color-accent);
}

.cart-item__meta {
  display: flex;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.cart-item__condition {
  font-weight: var(--weight-semibold);
}

.cart-item__seller {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.cart-item__seller a {
  color: var(--text-accent);
  text-decoration: none;
}

.cart-item__seller a:hover {
  text-decoration: underline;
}

.cart-item__price-col {
  flex-shrink: 0;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.cart-item__price {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
}

.cart-item__price--discounted {
  color: var(--color-accent);
}

.cart-item__price--original {
  font-size: var(--text-sm);
  font-weight: var(--weight-normal);
  text-decoration: line-through;
  opacity: 0.6;
}

.cart-item__price-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  justify-content: flex-end;
}

.cart-item__price-row--original {
  margin-top: 2px;
}

.cart-item__frozen-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.cart-item__saving {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-success);
}

.cart-item__remove {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--dur-normal) ease, border-color var(--dur-normal) ease;
}

.cart-item__remove:hover {
  color: var(--color-error);
  border-color: var(--color-error);
}

/* Cart summary / total */
.cart-summary {
  margin-top: var(--space-6);
  padding: var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.cart-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-summary__label {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
}

.cart-summary__total {
  font-size: var(--text-2xl);
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--tracking-tight);
}

@media (max-width: 600px) {
  .cart-item {
    flex-wrap: wrap;
    gap: var(--space-3);
  }
  .cart-item__image {
    width: 64px;
    height: 64px;
  }
  .cart-item__price-col {
    margin-left: auto;
  }
}
