:root {
  --primary: #e91e63;
  --secondary: #ff6fa0;
  --ink: #222222;
  --muted: #7f6670;
  --line: #f3dce5;
  --surface: #ffffff;
  --soft: #fff7fa;
  --rose: #ffe8f0;
  --shadow: 0 22px 60px rgba(166, 67, 103, 0.14);
  --radius: 22px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Montserrat, Arial, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: linear-gradient(180deg, #fff 0%, #fff7fa 48%, #ffffff 100%);
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 25% 10%, rgba(255, 111, 160, 0.18), transparent 28%),
    radial-gradient(circle at 78% 88%, rgba(233, 30, 99, 0.12), transparent 30%),
    #fff;
}

.auth-panel {
  width: min(520px, 100%);
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: 0; }
h1 { font-size: 36px; line-height: 1.15; }
h2 { font-size: 30px; line-height: 1.2; }
h3 { font-size: 18px; line-height: 1.3; }

.auth-copy { margin: 16px 0 28px; color: var(--muted); line-height: 1.7; }
.auth-note { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.auth-message { min-height: 22px; margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.auth-message.error { color: #b42318; }
.auth-message.success { color: #177245; }
.field-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; }

.phone-input, .filters input, .filters select {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.phone-input:focus, .filters input:focus, .filters select:focus {
  border-color: rgba(233, 30, 99, 0.55);
  box-shadow: 0 0 0 4px rgba(233, 30, 99, 0.08);
}
.code-input { letter-spacing: 0; text-align: center; font-size: 20px; font-weight: 600; }

.primary-btn, .ghost-btn, .pill-btn, .pill-link, .card-action, .detail-button {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 500;
}

.primary-btn { width: 100%; margin-top: 18px; color: #fff; background: var(--primary); }
.ghost-btn { width: 100%; margin-top: 10px; color: var(--primary); background: var(--rose); }

.app-shell { width: min(1500px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 54px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--primary), var(--secondary)); box-shadow: 0 12px 30px rgba(233, 30, 99, 0.22); }
.top-actions { display: flex; gap: 10px; align-items: center; }
.pill-btn, .pill-link { color: var(--primary); background: #fff; border: 1px solid var(--line); }
#cart-count { min-width: 24px; min-height: 24px; display: grid; place-items: center; border-radius: 999px; color: #fff; background: var(--primary); font-size: 12px; }

.action-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 34px; }
.action-box { min-height: 142px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, #fff, #fff4f8); box-shadow: var(--shadow); text-align: left; transition: transform .2s ease, box-shadow .2s ease; }
.action-box:hover { transform: translateY(-3px); box-shadow: 0 28px 72px rgba(166, 67, 103, 0.18); }
.action-box span { display: block; margin-bottom: 12px; font-size: 23px; font-weight: 500; }
.action-box small { color: var(--muted); line-height: 1.5; }

.toolbar { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin: 0 0 22px; }
.filters { display: grid; grid-template-columns: 180px 260px; gap: 12px; }

.listing-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.listing-card { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 16px 46px rgba(166, 67, 103, 0.11); transition: transform .2s ease, box-shadow .2s ease; }
.listing-card:hover { transform: translateY(-4px); box-shadow: 0 26px 70px rgba(166, 67, 103, 0.16); }
.card-photo { width: 100%; height: 230px; flex: 0 0 230px; display: grid; place-items: center; overflow: hidden; background: linear-gradient(145deg, #ffe0eb, #fff7fa); color: var(--primary); font-weight: 500; text-align: center; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-note { font-size: 13px; color: var(--muted); }
.card-body { display: flex; flex: 1; flex-direction: column; padding: 18px; }
.card-top { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.price { margin-top: 12px; font-size: 22px; font-weight: 600; color: var(--primary); }
.meta { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.card-actions { display: grid; grid-template-columns: 42px 1fr; gap: 10px; margin-top: 16px; }
.like-btn { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--primary); }
.like-btn.active { color: #fff; background: var(--primary); }
.card-action { color: #fff; background: var(--primary); }
.detail-link { display: block; margin-top: 10px; color: var(--primary); font-size: 14px; }
.badge { position: absolute; top: 14px; left: 14px; z-index: 1; padding: 7px 10px; border-radius: 999px; background: rgba(255,255,255,.9); color: var(--primary); font-size: 12px; font-weight: 600; }
.empty-state { padding: 32px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }
.freshness-badge { display: inline-flex; align-items: center; min-height: 28px; margin-top: 12px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.freshness-badge.green { color: #126b2f; background: #dff7e7; }
.freshness-badge.yellow { color: #7a5a00; background: #fff3b8; }
.privacy-note { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr); gap: 34px; align-items: start; }
.detail-photo { height: 560px; border-radius: 28px; overflow: hidden; background: linear-gradient(145deg, #ffd8e6, #fff8fb); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--primary); text-align: center; }
.detail-photo img { width: 100%; height: 100%; object-fit: cover; }
.detail-panel { padding: 34px; border: 1px solid var(--line); border-radius: 28px; background: #fff; box-shadow: var(--shadow); }
.detail-price { margin: 18px 0; color: var(--primary); font-size: 34px; font-weight: 600; }
.detail-description { color: var(--muted); line-height: 1.8; }
.detail-meta { display: grid; gap: 10px; margin: 24px 0; color: var(--muted); }
.detail-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-button { color: #fff; background: var(--primary); }
.detail-button.secondary { color: var(--primary); background: var(--rose); }

.account-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 22px; }
.account-menu, .account-content { border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.account-menu { padding: 12px; display: grid; gap: 8px; align-content: start; }
.account-tab { min-height: 48px; border: 0; border-radius: 14px; text-align: left; padding: 0 16px; color: var(--muted); background: transparent; }
.account-tab.active, .account-tab:hover { color: var(--primary); background: var(--rose); }
.account-content { padding: 28px; min-height: 420px; }
.account-list { display: grid; gap: 12px; margin-top: 20px; }
.account-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--soft); }
.dashboard-columns { display: grid; gap: 18px; margin-top: 22px; }
.account-actions { display: grid; gap: 8px; align-content: start; min-width: 180px; }
.account-actions button { min-height: 34px; border: 1px solid var(--line); border-radius: 10px; color: var(--primary); background: #fff; font-size: 12px; }

@media (max-width: 1180px) {
  .listing-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .action-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-photo { height: 430px; }
}

@media (max-width: 820px) {
  .app-shell { width: min(100% - 28px, 720px); padding-top: 18px; }
  .topbar, .toolbar { align-items: stretch; flex-direction: column; }
  .top-actions, .filters { grid-template-columns: 1fr; display: grid; width: 100%; }
  .action-grid { grid-template-columns: 1fr; }
  .listing-grid { grid-template-columns: 1fr; }
  .account-item { grid-template-columns: 1fr; }
  .account-layout { grid-template-columns: 1fr; }
  h1 { font-size: 30px; }
  h2 { font-size: 25px; }
}

@media (max-width: 430px) {
  .auth-panel { padding: 28px; border-radius: 22px; }
  .detail-panel { padding: 24px; }
  .card-photo { height: 210px; flex-basis: 210px; }
  .detail-photo { height: 320px; }
  .detail-buttons { grid-template-columns: 1fr; }
  .card-actions { grid-template-columns: 42px 1fr; }
}

.seller-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, #fff, #fff7fa);
}

.seller-strip strong,
.seller-info h3 {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.seller-strip span,
.seller-info span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.seller-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(233, 30, 99, 0.2);
}

.seller-avatar.large {
  width: 66px;
  height: 66px;
  font-size: 20px;
}

.seller-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.seller-panel {
  display: grid;
  grid-template-columns: 66px 1fr auto;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, #fff, #fff5f9);
  box-shadow: 0 14px 40px rgba(166, 67, 103, 0.1);
}

.seller-info .eyebrow {
  margin-bottom: 4px;
}

.seller-contact {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 430px) {
  .seller-panel {
    grid-template-columns: 56px 1fr;
  }

  .seller-contact {
    grid-column: 1 / -1;
  }
}
