/* ====================================================================
   CoreSpaceX Multi-Vendor Marketplace Components Styling
   ==================================================================== */

/* Grid Systems */
.grid-stores {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

.grid-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

/* Store Cards */
.store-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  display: flex;
  flex-direction: column;
}

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

.store-cover {
  height: 120px;
  width: 100%;
  object-fit: cover;
  background: #1e293b;
}

.store-card-body {
  padding: 16px;
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.store-logo-thumb {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid var(--bg-card-solid);
  object-fit: cover;
  position: absolute;
  top: -32px;
  left: 16px;
  box-shadow: var(--shadow-sm);
  background: #0f172a;
}

.store-card-header {
  margin-top: 36px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.store-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.store-category {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.store-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 14px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.store-card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  gap: 10px;
}

/* Product Cards */
.product-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast);
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-primary);
}

.product-img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  background: #0f172a;
}

.product-info {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-store-name {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.product-price-row {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-price {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent-secondary);
}

.product-old-price {
  font-size: 0.8rem;
  text-decoration: line-through;
  color: var(--text-dim);
  margin-left: 6px;
}

/* Variant Selector Pills */
.variant-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.variant-chip {
  padding: 6px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.variant-chip:hover {
  border-color: var(--text-muted);
}

.variant-chip.selected {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
  box-shadow: var(--accent-glow);
}

/* Store Profile Header */
.store-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}

.store-hero-cover {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.store-hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(0deg, rgba(11, 15, 25, 0.95) 0%, rgba(11, 15, 25, 0.4) 60%, transparent 100%);
  padding: 24px;
  display: flex;
  align-items: flex-end;
  gap: 20px;
}

.store-hero-logo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 4px solid var(--bg-main);
  object-fit: cover;
}

.store-hero-meta h1 {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

/* Chat System Window */
.chat-container {
  display: flex;
  height: calc(100vh - 140px);
  background: var(--bg-card-solid);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.chat-sidebar {
  width: 320px;
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
}

.convo-item {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.convo-item:hover, .convo-item.active {
  background: var(--bg-card-hover);
}

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

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
}

.chat-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass-bg);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-messages-area {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  line-height: 1.4;
  position: relative;
}

.msg-incoming {
  align-self: flex-start;
  background: var(--bg-card-solid);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  border-bottom-left-radius: 4px;
}

.msg-outgoing {
  align-self: flex-end;
  background: var(--accent-gradient);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.msg-system-card {
  align-self: center;
  max-width: 420px;
  width: 100%;
  background: var(--bg-card-solid);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.chat-input-bar {
  padding: 14px;
  border-top: 1px solid var(--glass-border);
  background: var(--glass-bg);
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-input-bar input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-card-solid);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  color: var(--text-main);
  outline: none;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: var(--bg-card-solid);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  max-width: 550px;
  width: 100%;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}
