/* APP STYLES — overlay on top of theme.css variables for app pages */

/* NAV */
.app-nav {
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
}
.app-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  gap: 2rem;
}
.app-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.app-nav-links {
  display: flex;
  gap: 1.5rem;
}
.app-nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.app-nav-links a:hover { color: var(--accent); }

/* LAYOUT */
.app-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}
.app-container.narrow { max-width: 640px; }

/* BROWSE HEADER */
.browse-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}
.browse-header h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
}

/* CATEGORY FILTER */
.category-filter {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
}
.filter-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: all 0.15s;
}
.filter-link:hover { color: var(--accent); border-color: var(--border); }
.filter-link.active {
  background: var(--surface);
  border-color: var(--border);
  color: var(--accent);
}

/* LISTING GRID */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}
.listing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
  display: block;
  transition: border-color 0.2s, transform 0.15s;
}
.listing-card:hover {
  border-color: rgba(212,146,42,0.4);
  transform: translateY(-2px);
}
.listing-photo {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}
.listing-photo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
}
.listing-info {
  padding: 1rem;
}
.listing-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
  display: block;
  margin-bottom: 0.35rem;
}
.listing-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.listing-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.listing-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.listing-condition {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
}

/* BUTTONS */
.btn-primary {
  background: var(--accent);
  color: #0e1a0e;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.65rem 1.4rem;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-dim); color: #0e1a0e; }
.btn-full { width: 100%; text-align: center; }
.btn-secondary {
  display: block;
  text-align: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  margin-top: 0.75rem;
}
.btn-secondary:hover { color: var(--text); }

/* FORMS */
.listing-form { display: flex; flex-direction: column; gap: 1.5rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }
.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.7rem 0.9rem;
  font-family: var(--font-body);
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group input[type="file"] { color: var(--text-muted); font-size: 0.85rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row.delivery-options { grid-template-columns: 1fr 1fr; }
.form-group.inline { flex-direction: row; align-items: center; }
.form-group.inline label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--text);
  font-size: 0.9rem;
}
.form-group.inline input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }

/* ERROR BANNER */
.error-banner {
  background: rgba(212,80,80,0.1);
  border: 1px solid rgba(212,80,80,0.3);
  border-radius: 3px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.error-banner p { color: #e87070; font-size: 0.9rem; margin: 0; }
.error-msg { color: #e87070; }

/* DETAIL PAGE */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 3rem;
  margin-top: 2rem;
}
.main-photo {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.main-photo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
}
.photo-thumbs {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.thumb {
  width: 72px;
  height: 56px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--border);
  cursor: pointer;
}
.detail-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  display: block;
  margin-bottom: 0.5rem;
}
.detail-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}
.detail-price {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1rem;
}
.detail-meta-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.detail-badge {
  font-size: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.25rem 0.65rem;
  border-radius: 2px;
  color: var(--text-muted);
}
.detail-description {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1rem;
  white-space: pre-wrap;
}
.detail-location {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.seller-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}
.seller-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.seller-avatar span { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: #0e1a0e; }
.seller-avatar img { width: 100%; height: 100%; object-fit: cover; }
.seller-details { display: flex; flex-direction: column; gap: 0.2rem; }
.seller-name { font-weight: 600; color: var(--text); text-decoration: none; font-size: 0.9rem; }
.seller-name:hover { color: var(--accent); }
.seller-location { font-size: 0.8rem; color: var(--text-muted); }
.cta-group { display: flex; flex-direction: column; gap: 0.25rem; }

/* SELLER PROFILE */
.profile-header {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.profile-avatar span { font-family: var(--font-display); font-weight: 700; font-size: 2rem; color: #0e1a0e; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-info { display: flex; flex-direction: column; gap: 0.5rem; }
.profile-username { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; color: var(--text); }
.profile-location, .profile-bio { font-size: 0.9rem; color: var(--text-muted); }
.profile-bio { max-width: 50ch; line-height: 1.6; }
.profile-rating { display: flex; align-items: center; gap: 0.5rem; }
.stars { color: var(--accent); letter-spacing: 0.05em; }
.rating-num { font-weight: 700; color: var(--text); font-size: 0.9rem; }
.rating-count { font-size: 0.8rem; color: var(--text-muted); }
.no-rating { font-size: 0.85rem; color: var(--text-muted); }
.profile-since { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }
.section-label {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.5rem;
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-state p { font-size: 1rem; margin-bottom: 0.5rem; }
.empty-state a { color: var(--accent); }

/* BACK LINK */
.back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  display: inline-block;
  margin-bottom: 1.5rem;
  transition: color 0.15s;
}
.back-link:hover { color: var(--accent); }

/* PAGE HEADER */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}
.page-header h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .detail-layout { grid-template-columns: 1fr; gap: 2rem; }
  .form-row { grid-template-columns: 1fr; }
  .profile-header { flex-direction: column; }
  .listing-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .browse-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
}
@media (max-width: 480px) {
  .listing-grid { grid-template-columns: 1fr; }
}