/* Apple Market - Apple-inspired design */

:root {
  --apple-bg: #000;
  --apple-bg-secondary: #1d1d1f;
  --apple-text: #f5f5f7;
  --apple-text-secondary: #a1a1a6;
  --apple-blue: #2997ff;
  --apple-blue-hover: #0077ed;
  --apple-border: #424245;
  --apple-card-bg: #161617;
  --apple-red: #ff3b30;
  --font-sf: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sf);
  background: var(--apple-bg);
  color: var(--apple-text);
  line-height: 1.47059;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--apple-blue);
  text-decoration: none;
}

a:hover {
  color: var(--apple-blue-hover);
  text-decoration: underline;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 48px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--apple-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
}

.nav-brand {
  font-size: 21px;
  font-weight: 600;
  color: var(--apple-text);
  text-decoration: none;
}

.nav-brand:hover {
  color: var(--apple-text);
  text-decoration: none;
}

.text-apple-red {
  color: var(--apple-red);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  color: var(--apple-text-secondary);
  font-size: 14px;
}

.nav-links a:hover {
  color: var(--apple-text);
  text-decoration: none;
}

.nav-message-link,
.nav-inquiry-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Hero / Landing */
.hero {
  text-align: center;
  padding: 80px 24px 120px;
  max-width: 980px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(40px, 8vw, 64px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0 0 16px;
}

.hero-subtitle {
  font-size: clamp(21px, 3vw, 28px);
  font-weight: 400;
  color: var(--apple-text-secondary);
  margin: 0 0 32px;
}

.hero-tagline {
  font-size: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--apple-blue);
  margin: 0 0 18px;
}

.hero-cta {
  display: inline-flex;
  gap: 16px;
  margin-top: 24px;
}

.guest-gate-banner {
  margin: 0 auto 24px;
  max-width: 760px;
  padding: 18px 20px;
  background: rgba(41, 151, 255, 0.08);
  border: 1px solid rgba(41, 151, 255, 0.28);
  border-radius: 18px;
  text-align: left;
}

.guest-gate-banner strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.guest-gate-banner p {
  margin: 0;
  color: var(--apple-text-secondary);
  font-size: 15px;
}

.guest-gate-banner-inline {
  max-width: none;
}

.guest-gate-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.home-guest-gate-actions {
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: 17px;
  font-weight: 400;
  border-radius: 980px;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s, background 0.2s;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--apple-blue);
  color: white;
}

.btn-primary:hover {
  background: var(--apple-blue-hover);
  color: white;
  text-decoration: none;
  opacity: 0.9;
}

.btn-secondary {
  background: transparent;
  color: var(--apple-blue);
  border: 1px solid var(--apple-blue);
}

.btn-secondary:hover {
  background: rgba(41, 151, 255, 0.1);
  color: var(--apple-blue);
  text-decoration: none;
}

.btn-remove {
  background: rgba(255, 69, 58, 0.2);
  color: #ff6961;
  border: 1px solid rgba(255, 69, 58, 0.5);
  padding: 8px;
}

.btn-remove:hover {
  background: rgba(255, 69, 58, 0.3);
  color: #ff6961;
}

/* Product grid */
.section {
  padding: 60px 24px 80px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-size: 32px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 48px;
}

.section-subtitle {
  text-align: center;
  color: var(--apple-text-secondary);
  margin: -28px 0 36px;
  font-size: 15px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--apple-card-bg);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--apple-border);
  transition: transform 0.2s, border-color 0.2s;
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: var(--apple-text-secondary);
  text-decoration: none;
  color: inherit;
}

.product-card-image {
  height: 180px;
  background: linear-gradient(135deg, var(--apple-bg-secondary) 0%, var(--apple-card-bg) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--apple-text-secondary);
  overflow: hidden;
}

.product-card-image .product-listing-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-card-image .product-card-icon-fallback {
  font-size: 48px;
  line-height: 1;
}

.product-card-body {
  padding: 20px;
}

.product-card-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
}

.product-card-meta {
  font-size: 14px;
  color: var(--apple-text-secondary);
  margin: 0 0 12px;
}

.product-card-price {
  font-size: 20px;
  font-weight: 600;
  color: var(--apple-blue);
}

/* Products index: make listing cards more compact (~30%) */
.products-index-page .product-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.products-index-page .product-card-image {
  height: 130px;
}

.products-index-page .product-card-body {
  padding: 14px;
}

.products-index-page .product-card-title {
  font-size: 16px;
  margin: 0 0 6px;
}

.products-index-page .product-card-meta {
  font-size: 12px;
  margin: 0 0 8px;
}

.products-index-page .product-card-price {
  font-size: 18px;
}

.products-index-page .product-card-seller {
  margin: 0 0 2px;
  font-size: 12px;
  color: var(--apple-text-secondary);
}

.products-index-page .product-card-location {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--apple-text-secondary);
}

/* Home: tighter product strips — smaller tiles, more per row, less vertical scroll */
.home-compact-products {
  padding-top: 40px;
  padding-bottom: 44px;
}

.home-compact-products .section-title {
  font-size: clamp(22px, 3.5vw, 28px);
  margin-bottom: 8px;
}

.home-compact-products .section-subtitle {
  margin: -4px 0 16px;
  font-size: 13px;
}

.home-compact-products .product-grid {
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}

.home-compact-products .product-card {
  border-radius: 12px;
}

.home-compact-products .product-card-image {
    height: 64px;
    font-size: 26px;
  }

  .home-compact-products .product-card-image .product-card-icon-fallback {
    font-size: 26px;
  }

.home-compact-products .product-card-body {
  padding: 8px 10px 10px;
}

.home-compact-products .seller-badge,
.home-compact-products .verification-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 3px 6px;
  margin: 0 4px 4px 0;
  vertical-align: middle;
}

.home-compact-products .product-card-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-compact-products .product-card-meta {
  font-size: 10px;
  line-height: 1.35;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-compact-products .product-card-price {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.home-compact-products .home-featured-badges {
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.home-compact-products .home-featured-badges .seller-badge,
.home-compact-products .home-featured-badges .verification-badge {
  margin: 0;
}

@media (min-width: 768px) {
  .home-compact-products .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 12px;
  }

  .home-compact-products .product-card-image {
    height: 56px;
    font-size: 24px;
  }

  .home-compact-products .product-card-image .product-card-icon-fallback {
    font-size: 24px;
  }
}

@media (min-width: 1100px) {
  .home-compact-products .product-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.home-compact-products .home-compact-cta {
  text-align: center;
  margin-top: 16px;
}

/* Home: private + company side by side */
.home-dual-columns {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  box-sizing: border-box;
  align-items: start;
}

/* Vertical divider between private (left) and company (right) — desktop only */
.home-dual-columns::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  border-radius: 1px;
  background: var(--apple-red);
  /* From ~heading row to just above bottom CTAs (approx. like sketch) */
  top: 52px;
  bottom: 76px;
  pointer-events: none;
}

.home-dual-columns .home-compact-column {
  padding: 0;
  margin: 0;
  max-width: none;
}

.home-dual-columns .home-compact-column .section-title {
  font-size: clamp(18px, 2.5vw, 22px);
  margin-bottom: 6px;
}

.home-dual-columns .home-compact-column .section-subtitle {
  margin: -2px 0 12px;
  font-size: 12px;
}

.home-dual-columns .home-compact-column .product-grid {
  /* 3 cards per row × 2 rows (6 listings max per column) */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 900px) {
  .home-dual-columns {
    grid-template-columns: 1fr;
    padding-top: 32px;
    padding-bottom: 60px;
  }

  .home-dual-columns::after {
    display: none;
  }
}

/* Home: private | featured | company (three columns, two red dividers) */
.home-triple-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2px minmax(0, 1fr) 2px minmax(0, 1fr);
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  box-sizing: border-box;
  align-items: stretch;
  column-gap: 0;
}

.home-triple-grid-line {
  width: 2px;
  background: var(--apple-red);
  border-radius: 1px;
  justify-self: center;
  align-self: stretch;
  min-height: 120px;
  pointer-events: none;
}

.home-triple-grid .home-compact-column {
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  max-width: none;
  height: 100%;
}

.home-triple-grid .home-compact-column .section-title {
  font-size: clamp(15px, 1.8vw, 20px);
  margin-bottom: 6px;
}

.home-triple-grid .home-compact-column .section-subtitle {
  margin: -2px 0 12px;
  font-size: 11px;
}

.home-triple-grid .home-compact-column .product-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.home-triple-grid .home-compact-column .home-compact-cta {
  margin-top: auto;
  padding-top: 16px;
}

.home-triple-grid .home-compact-column:nth-child(1) {
  padding-right: 18px;
}

.home-triple-grid .home-compact-column:nth-child(3) {
  padding: 0 12px;
}

.home-triple-grid .home-compact-column:nth-child(5) {
  padding-left: 18px;
}

@media (max-width: 1024px) {
  .home-triple-grid {
    grid-template-columns: 1fr;
    padding-top: 32px;
    padding-bottom: 60px;
  }

  .home-triple-grid-line {
    display: none;
  }

  .home-triple-grid .home-compact-column:nth-child(1),
  .home-triple-grid .home-compact-column:nth-child(3),
  .home-triple-grid .home-compact-column:nth-child(5) {
    padding: 0;
  }
}

.seller-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}

.seller-badge-private {
  background: rgba(41, 151, 255, 0.12);
  color: var(--apple-blue);
  border: 1px solid rgba(41, 151, 255, 0.25);
}

.seller-badge-company {
  background: rgba(41, 151, 255, 0.12);
  color: var(--apple-blue);
  border: 1px solid rgba(41, 151, 255, 0.25);
}

.verification-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 10px 8px;
}

.verification-badge-verified {
  background: rgba(52, 199, 89, 0.16);
  color: #30d158;
  border: 1px solid rgba(52, 199, 89, 0.4);
}

.verification-badge-review {
  background: rgba(255, 159, 10, 0.12);
  color: #ffb340;
  border: 1px solid rgba(255, 159, 10, 0.25);
}

.verification-badge-rejected {
  background: rgba(255, 59, 48, 0.18);
  color: #ff453a;
  border: 1px solid rgba(255, 59, 48, 0.45);
}

.verification-badge-pending {
  background: rgba(255, 214, 10, 0.14);
  color: #ffe066;
  border: 1px solid rgba(255, 214, 10, 0.4);
}

/* Forms */
.form-container {
  max-width: 420px;
  margin: 60px auto;
  padding: 0 24px;
}

.form-container h1 {
  font-size: 32px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 32px;
}

/* Compact layout: add new listing (/products/new) */
.product-form-page--compact.form-container {
  margin-top: 24px;
  margin-bottom: 32px;
}

.product-form-page--compact.form-container h1 {
  font-size: clamp(22px, 4vw, 28px);
  text-align: left;
  margin-bottom: 8px;
}

.product-form-page--compact-intro.form-intro {
  color: var(--apple-text-secondary);
  font-size: 13px;
  line-height: 1.35;
  margin: 0 0 12px;
}

.product-form-page--compact .form-group {
  margin-bottom: 11px;
}

.product-form-page--compact .form-group label {
  font-size: 13px;
  margin-bottom: 4px;
}

.product-form-page--compact .form-group input,
.product-form-page--compact .form-group select,
.product-form-page--compact .form-group textarea {
  padding: 9px 12px;
  font-size: 16px;
  border-radius: 10px;
}

.product-form-page--compact .form-group textarea {
  min-height: 4.25rem;
}

.product-form-page--compact .form-compact-hint {
  font-size: 12px;
  color: var(--apple-text-secondary);
  margin: 3px 0 0;
  line-height: 1.32;
}

.product-form-page--compact .form-compact-hint--tight {
  margin-top: 2px;
}

.product-form-page--compact .serial-validation-row {
  gap: 8px;
}

.product-form-page--compact .serial-validation-message {
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.3;
}

.product-form-page--compact .form-actions {
  margin-top: 14px;
}

.product-form-page--compact .form-actions .btn {
  padding: 11px 14px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--apple-text-secondary);
}

.listing-images-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.listing-image-edit-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--apple-border);
  border-radius: 12px;
  background: var(--apple-card-bg);
}

.listing-image-edit-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}

.listing-image-edit-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: var(--apple-bg-secondary);
}

.listing-image-remove {
  font-size: 12px;
  color: var(--apple-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 17px;
  font-family: inherit;
  background: var(--apple-card-bg);
  border: 1px solid var(--apple-border);
  border-radius: 12px;
  color: var(--apple-text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--apple-blue);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-actions {
  margin-top: 28px;
}

.form-actions .btn {
  width: 100%;
  padding: 14px;
}

.verification-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.verification-spinner-card {
  background: var(--apple-card-bg);
  border: 1px solid var(--apple-border);
  border-radius: 18px;
  padding: 28px 24px;
  text-align: center;
  min-width: 280px;
}

.serial-validation-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.serial-status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: 0 0 14px;
  border: 1px solid var(--apple-border);
  background: rgba(255, 255, 255, 0.12);
}

.serial-status-dot-idle,
.serial-status-dot-checking {
  background: rgba(255, 255, 255, 0.2);
}

.serial-status-dot-valid {
  background: #30d158;
  border-color: #30d158;
  box-shadow: 0 0 0 4px rgba(48, 209, 88, 0.12);
}

.serial-status-dot-invalid {
  background: #ff453a;
  border-color: #ff453a;
  box-shadow: 0 0 0 4px rgba(255, 69, 58, 0.12);
}

.serial-validation-message {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--apple-text-secondary);
}

.verification-spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--apple-blue);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.form-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--apple-text-secondary);
}

.form-footer a {
  color: var(--apple-blue);
}

/* Alerts */
.alert {
  padding: 14px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 15px;
}

.alert-notice {
  background: rgba(41, 151, 255, 0.2);
  border: 1px solid var(--apple-blue);
  color: var(--apple-blue);
}

.alert-alert {
  background: rgba(255, 69, 58, 0.2);
  border: 1px solid #ff453a;
  color: #ff6961;
}

/* Product detail */
.product-detail {
  max-width: 800px;
  margin: 60px auto;
  padding: 0 24px;
}

.product-detail-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

@media (max-width: 768px) {
  .product-detail-header {
    grid-template-columns: 1fr;
  }
}

.product-detail-media {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-detail-photo-main {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 18px;
  border: 1px solid var(--apple-border);
  background: var(--apple-card-bg);
}

.product-detail-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-detail-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--apple-border);
}

.product-detail-image {
  aspect-ratio: 1;
  background: var(--apple-card-bg);
  border-radius: 18px;
  border: 1px solid var(--apple-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  color: var(--apple-text-secondary);
}

.product-detail-image-fallback {
  aspect-ratio: 1;
}

.product-detail-info h1 {
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 12px;
}

.product-detail-price {
  font-size: 32px;
  font-weight: 600;
  color: var(--apple-blue);
  margin-bottom: 24px;
}

.product-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.deal-insight-card {
  margin: 8px 0 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--apple-border);
  border-radius: 14px;
}

.deal-insight-title {
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}

.deal-insight-meta {
  margin: 0;
  color: var(--apple-text-secondary);
  font-size: 12px;
}

.deal-insight-scale {
  position: relative;
  margin: 10px 0 8px;
  height: 10px;
}

.deal-insight-range {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2bc48a 0%, #8ddf79 50%, #ff9f0a 100%);
}

.deal-insight-marker {
  position: absolute;
  top: -2px;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #000;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.deal-insight-marker-great,
.deal-chip-great {
  background: #30d158;
  color: #30d158;
}

.deal-insight-marker-good,
.deal-chip-good {
  background: #64d56e;
  color: #64d56e;
}

.deal-insight-marker-fair,
.deal-chip-fair {
  background: #ffd60a;
  color: #ffd60a;
}

.deal-insight-marker-high,
.deal-chip-high {
  background: #ff453a;
  color: #ff453a;
}

.deal-chip {
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  border-radius: 999px;
  padding: 6px 9px;
  border: 1px solid currentColor;
}

.deal-chip-great {
  background: rgba(48, 209, 88, 0.12);
}

.deal-chip-good {
  background: rgba(100, 213, 110, 0.12);
}

.deal-chip-fair {
  background: rgba(255, 214, 10, 0.12);
}

.deal-chip-high {
  background: rgba(255, 69, 58, 0.12);
}

.badge {
  padding: 6px 12px;
  background: var(--apple-bg-secondary);
  border-radius: 8px;
  font-size: 14px;
  color: var(--apple-text-secondary);
}

.badge-muted {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  font-size: 12px;
  color: var(--apple-text-secondary);
}

.product-detail-description {
  color: var(--apple-text-secondary);
  line-height: 1.6;
}

.seller-info {
  margin-top: 24px;
  padding: 20px;
  background: var(--apple-card-bg);
  border-radius: 12px;
  border: 1px solid var(--apple-border);
}

.seller-info a {
  color: var(--apple-blue);
}

.messages-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}

.messages-sidebar,
.messages-main {
  background: var(--apple-card-bg);
  border: 1px solid var(--apple-border);
  border-radius: 18px;
}

.messages-sidebar {
  padding: 24px;
}

.messages-main {
  display: flex;
  flex-direction: column;
  min-height: 640px;
}

.messages-placeholder {
  align-items: center;
  justify-content: center;
  color: var(--apple-text-secondary);
}

.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.conversation-link {
  color: inherit;
}

.conversation-link:hover {
  text-decoration: none;
}

.conversation-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--apple-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.conversation-item-active {
  border-color: var(--apple-blue);
  background: rgba(41, 151, 255, 0.08);
}

.conversation-preview {
  margin: 6px 0 0;
  color: var(--apple-text-secondary);
  font-size: 14px;
}

.conversation-empty {
  color: var(--apple-text-secondary);
}

.messages-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--apple-border);
}

.messages-header h2 {
  margin: 0;
  font-size: 20px;
}

.messages-header-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.messages-header-actions {
  display: flex;
  gap: 8px;
}

.messages-thread {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.message-row {
  display: flex;
}

.message-row-incoming {
  justify-content: flex-start;
}

.message-row-outgoing {
  justify-content: flex-end;
}

.message-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--apple-bg-secondary);
}

.message-row-outgoing .message-bubble {
  background: rgba(41, 151, 255, 0.18);
}

.message-bubble p {
  margin: 0 0 8px;
}

.message-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.message-image {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--apple-border);
}

.message-time {
  font-size: 12px;
  color: var(--apple-text-secondary);
}

.message-form {
  padding: 20px 24px 24px;
  border-top: 1px solid var(--apple-border);
}

.message-dropzone {
  position: relative;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 8px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.message-dropzone textarea {
  margin: 0;
}

.message-dropzone-active {
  border-color: var(--apple-blue);
  background: rgba(41, 151, 255, 0.06);
}

.message-dropzone-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--apple-text-secondary);
}

.message-attachments-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.message-attachment-preview {
  position: relative;
  width: 72px;
  height: 72px;
}

.message-attachment-preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--apple-border);
}

.message-attachment-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 69, 58, 0.6);
  background: rgba(255, 69, 58, 0.95);
  color: white;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}

.message-form-actions {
  display: flex;
  justify-content: flex-end;
}

.message-form-actions .btn {
  width: auto;
}

.blocked-chat-notice p {
  margin: 0;
  color: var(--apple-text-secondary);
}

.message-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--apple-red);
  color: white;
  font-size: 12px;
  font-weight: 600;
}

.nav-message-badge {
  margin-left: 2px;
}

@media (max-width: 900px) {
  .messages-layout {
    grid-template-columns: 1fr;
  }
}

/* Dashboard */
.dashboard-header {
  margin-bottom: 40px;
}

.dashboard-header h1 {
  font-size: 32px;
  font-weight: 600;
  margin: 0 0 8px;
}

.dashboard-header p {
  color: var(--apple-text-secondary);
  margin: 0;
}

.dashboard-actions {
  margin-bottom: 32px;
}

/* Location filter */
.location-filter {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--apple-card-bg);
  border-radius: 12px;
  border: 1px solid var(--apple-border);
}

.location-filter-form .location-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.location-filter-label {
  display: block;
  font-size: 13px;
  color: var(--apple-text-secondary);
  margin-bottom: 6px;
}

.location-filter-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  background: var(--apple-bg);
  border: 1px solid var(--apple-border);
  border-radius: 8px;
  color: var(--apple-text);
}

.location-filter-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.location-filter-hint {
  margin: 0 0 12px;
  max-width: 52rem;
  font-size: 13px;
  line-height: 1.45;
  color: var(--apple-text-secondary);
}

.location-filter-current {
  margin: 0 0 24px;
  color: var(--apple-text-secondary);
  font-size: 14px;
}

.seller-type-filter {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

/* Product browse filters: make chips smaller and tighter */
.seller-type-filter .btn {
  padding: 8px 14px;
  font-size: 15px;
  border-radius: 999px;
}

/* Selected filter: keep blue fill + thin red outline */
.seller-type-filter .btn-primary {
  border: 1px solid var(--apple-red);
}

.inline-year-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inline-year-input {
  width: 110px;
  padding: 8px 10px;
  font-size: 14px;
  background: var(--apple-card-bg);
  border: 1px solid var(--apple-border);
  border-radius: 999px;
  color: var(--apple-text);
}

.inline-year-input:focus {
  outline: none;
  border-color: var(--apple-blue);
}

.inline-year-submit {
  padding: 8px 12px;
  font-size: 14px;
}

.created-by {
  margin: 48px 0 0;
  text-align: center;
  color: var(--apple-text-secondary);
  font-size: 14px;
}

/* Home: full-bleed gray “Why Imarket?” strip, compact height */
.home-why-strip {
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
  background: var(--apple-bg-secondary);
  padding: 22px 20px 14px;
}

.home-why-strip-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.home-why-title {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 600;
  text-align: center;
  margin: 0 0 14px;
  line-height: 1.2;
}

.home-why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px 20px;
  max-width: 960px;
  margin: 0 auto;
}

.home-why-item {
  text-align: center;
}

.home-why-icon {
  font-size: 26px;
  line-height: 1;
  margin: 0 0 8px;
}

.home-why-item-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
  line-height: 1.25;
}

.home-why-item-desc {
  color: var(--apple-text-secondary);
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.home-why-created-by {
  margin: 14px 0 0;
  text-align: center;
  color: var(--apple-text-secondary);
  font-size: 12px;
  line-height: 1.3;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.admin-stat-card,
.admin-panel {
  background: var(--apple-card-bg);
  border: 1px solid var(--apple-border);
  border-radius: 18px;
}

.admin-stat-card {
  padding: 20px;
}

.admin-stat-card span {
  display: block;
  color: var(--apple-text-secondary);
  font-size: 14px;
  margin-bottom: 8px;
}

.admin-stat-card strong {
  font-size: 28px;
}

.admin-panels-grid,
.admin-review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.admin-panel {
  padding: 24px;
}

.admin-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.admin-panel-header h2,
.admin-panel h2 {
  margin: 0;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-list-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--apple-border);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  color: inherit;
}

.admin-list-item:hover {
  text-decoration: none;
  border-color: var(--apple-blue);
}

.admin-list-item-static {
  align-items: flex-start;
}

.admin-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  align-items: end;
}

/* Region Picker */
body.region-picker-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.region-picker {
  text-align: center;
  padding: 48px 24px;
  max-width: 420px;
}

.region-picker-title {
  font-size: 48px;
  font-weight: 600;
  margin: 0 0 16px;
}

.region-picker-subtitle {
  color: var(--apple-text-secondary);
  font-size: 21px;
  margin: 0 0 40px;
}

.region-picker-form .form-group {
  margin-bottom: 24px;
}

.region-picker-select {
  width: 100%;
  padding: 14px 18px;
  font-size: 17px;
  background: var(--apple-card-bg);
  border: 1px solid var(--apple-border);
  border-radius: 12px;
  color: var(--apple-text);
  cursor: pointer;
}

.region-picker-select:focus {
  outline: none;
  border-color: var(--apple-blue);
}

.btn-lg {
  padding: 14px 32px;
  font-size: 17px;
  width: 100%;
}

/* Region & language switcher in nav */
.nav-locale-link {
  font-size: 14px;
}

.nav-locale {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-locale select,
.nav-locale .locale-select {
  padding: 6px 10px;
  font-size: 14px;
  background: var(--apple-card-bg);
  border: 1px solid var(--apple-border);
  border-radius: 8px;
  color: var(--apple-text);
  cursor: pointer;
}

.nav-locale form {
  margin: 0;
}
