/* Viet2Hand - Poshmark Aesthetic Styling */
:root {
  --primary: #9e1b32; /* Poshmark Burgundy */
  --primary-hover: #7f1427;
  --primary-light: #fdf2f4;
  --secondary: #2b2b2b;
  --accent: #2e7d32;
  --bg-main: #f8f9fa;
  --card-bg: #ffffff;
  --border-color: #e5e7eb;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Header & Navigation */
.header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-top {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.logo-badge {
  background: var(--primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.search-bar {
  flex: 1;
  max-width: 580px;
  position: relative;
}

.search-bar input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: #f3f4f6;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.search-bar input:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(158, 27, 50, 0.15);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: #f3f4f6;
}

.btn-sell {
  background: #111827;
  color: #fff;
  border-radius: 9999px;
  padding: 8px 20px;
}

.btn-sell:hover {
  background: #000;
}

/* Categories Bar (Poshmark Style) */
.categories-bar {
  border-top: 1px solid var(--border-color);
  background: #fff;
  overflow-x: auto;
  scrollbar-width: none;
}

.categories-list {
  max-width: 1240px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  gap: 20px;
  white-space: nowrap;
}

.cat-item {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.cat-item:hover, .cat-item.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #fff 0%, #fdf2f4 100%);
  border-bottom: 1px solid #fce7eb;
  padding: 32px 16px;
}

.hero-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.hero-text h1 {
  font-size: 28px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 8px;
}

.hero-text p {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 600px;
}

/* Main Layout */
.container {
  max-width: 1240px;
  margin: 24px auto;
  padding: 0 16px;
}

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

@media (max-width: 860px) {
  .layout-grid {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
}

/* Sidebar Filters */
.sidebar {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  height: fit-content;
}

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

.filter-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-main);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.filter-select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 14px;
  outline: none;
  background: #fff;
}

/* Product Grid (Poshmark Feed) */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
}

.card-image-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f3f4f6;
  position: relative;
  overflow: hidden;
}

.card-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.product-card:hover .card-image-box img {
  transform: scale(1.04);
}

.badge-discount {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.badge-condition {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.card-content {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-brand {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 2px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-prices {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
  margin-bottom: 10px;
}

.card-price {
  font-size: 17px;
  font-weight: 800;
  color: #111827;
}

.card-original-price {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.card-seller {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f3f4f6;
  padding-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.seller-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.seller-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  padding: 24px;
  position: relative;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
}

/* Chat Room Styles */
.chat-container {
  max-width: 800px;
  margin: 20px auto;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 78vh;
}

.chat-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafafa;
}

.chat-product-preview {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-product-img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fbfbfb;
}

.message-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  position: relative;
}

.message-mine {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 2px;
}

.message-other {
  align-self: flex-start;
  background: #e5e7eb;
  color: #111827;
  border-bottom-left-radius: 2px;
}

.offer-card {
  border: 2px dashed var(--primary);
  background: #fff5f6;
  padding: 12px;
  border-radius: 10px;
  text-align: center;
}

.chat-footer {
  padding: 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
  background: #fff;
}
