:root {
  --primary-color: #000;
  --bg-color: #f9f9f9;
  --card-bg: #fff;
  --text-color: #333;
  --gray-color: #888;
  --accent-color: #ff3f3f;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: var(--primary-color);
  color: #fff;
  padding: 60px 0;
  text-align: center;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 10px;
}

header p {
  opacity: 0.8;
  margin-bottom: 30px;
}

.search-container {
  max-width: 500px;
  margin: 0 auto;
}

#searchInput {
  width: 100%;
  padding: 15px 25px;
  border-radius: 30px;
  border: none;
  font-size: 1rem;
  outline: none;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Filter Tags */
.filter-tags {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 40px 0;
  flex-wrap: wrap;
}

.tag {
  padding: 8px 20px;
  border-radius: 20px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.tag.active, .tag:hover {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

/* Mall Grid */
.mall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  margin-bottom: 60px;
}

.mall-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.mall-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.mall-thumb {
  height: 180px;
  background-color: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  color: #ccc;
  background-size: cover;
  background-position: center;
}

.mall-info {
  padding: 20px;
}

.mall-info .category {
  font-size: 0.75rem;
  color: var(--accent-color);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 5px;
  display: block;
}

.mall-info h3 {
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.mall-info p {
  font-size: 0.9rem;
  color: var(--gray-color);
}

.user-status {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.1);
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 0.85rem;
  backdrop-filter: blur(5px);
}

.mall-card {
  position: relative;
}

.try-on-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--primary-color);
  color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 10;
  border: none;
}

.mall-card:hover .try-on-overlay {
  opacity: 1;
}

.share-container {
  margin-top: 30px;
  background: #f8f9fa;
  padding: 20px;
  border-radius: 12px;
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
}

.share-btn {
  padding: 8px 15px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
}

.share-btn.kakao { background: #fee500; border-color: #fee500; color: #3c1e1e; }
.share-btn.instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); color: #fff; border: none; }

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7);
  overflow-y: auto;
}

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 30px;
  border-radius: 20px;
  width: 90%;
  max-width: 800px;
  position: relative;
}

.close {
  position: absolute;
  right: 25px;
  top: 20px;
  font-size: 28px;
  cursor: pointer;
}

.modal h2 { margin-bottom: 10px; }
.modal-desc { color: var(--gray-color); margin-bottom: 30px; }

.vton-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 25px;
}

.upload-section label {
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.drop-zone {
  border: 2px dashed #ddd;
  border-radius: 12px;
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  overflow: hidden;
  position: relative;
}

.drop-zone:hover { border-color: var(--primary-color); background: #fcfcfc; }
.preview-img { width: 100%; height: 100%; object-fit: contain; }

.vton-options { margin-bottom: 25px; }
.vton-options label { display: block; font-weight: 600; margin-bottom: 10px; }
.vton-options select {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.btn-primary {
  width: 100%;
  padding: 15px;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 15px;
}

.btn-secondary {
  background: none;
  border: none;
  color: var(--gray-color);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

#replicateToken {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
}

.result-section {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid #eee;
  text-align: center;
}

.result-img {
  max-width: 100%;
  border-radius: 12px;
  margin-top: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.loading {
  padding: 40px;
  color: var(--primary-color);
  font-weight: 600;
}

.vton-btn {
  background: linear-gradient(135deg, #6e8efb, #a777e3) !important;
  color: #fff !important;
  border: none !important;
}

/* Footer */
footer {
  text-align: center;
  padding: 40px 0;
  border-top: 1px solid #eee;
  color: var(--gray-color);
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  header h1 { font-size: 2rem; }
  .mall-grid { grid-template-columns: 1fr; }
}
