/* ==========================================================================
   WHOSE CLOSET - MINI SHOP & BIO AFFILIATE
   Theme: Minimalist Korean Chic / Warm Linen Fashion Boutique
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;1,600&display=swap');

:root {
  /* Color Palette - Warm Oat & Rose Chic */
  --bg-primary: #FAF7F2;
  --bg-secondary: #F3ECE2;
  --bg-card: #FFFFFF;
  --bg-glass: rgba(255, 255, 255, 0.85);
  
  --text-main: #1C1917;
  --text-muted: #78716C;
  --text-light: #A8A29E;
  
  --brand-primary: #292524;
  --brand-accent: #E26D5C;
  --brand-accent-hover: #D45B4A;
  --shopee-orange: #EE4D2D;
  --shopee-orange-soft: #FFF2EE;
  
  --badge-bg: #F5EBE6;
  --badge-text: #B45309;
  --badge-hot: #DC2626;
  
  --border-subtle: rgba(220, 214, 204, 0.6);
  --border-focus: #1C1917;
  
  --shadow-sm: 0 2px 8px rgba(28, 25, 23, 0.04);
  --shadow-md: 0 8px 24px rgba(28, 25, 23, 0.06);
  --shadow-lg: 0 16px 40px rgba(28, 25, 23, 0.1);
  --shadow-glow: 0 0 20px rgba(226, 109, 92, 0.25);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Mode Support */
[data-theme="dark"] {
  --bg-primary: #121214;
  --bg-secondary: #1A1A1E;
  --bg-card: #1E1E24;
  --bg-glass: rgba(26, 26, 30, 0.88);
  
  --text-main: #F4F4F5;
  --text-muted: #A1A1AA;
  --text-light: #71717A;
  
  --brand-primary: #FFFFFF;
  --brand-accent: #FF7A66;
  --brand-accent-hover: #FF9280;
  
  --shopee-orange-soft: #2D1B18;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #FFFFFF;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
}

/* Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
  overflow-x: hidden;
}

/* Container */
.app-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 16px 80px;
  position: relative;
}

/* Floating Top Bar */
.top-notice-bar {
  background: linear-gradient(90deg, #1C1917 0%, #382F2D 100%);
  color: #FAF7F2;
  font-size: 0.82rem;
  font-weight: 500;
  text-align: center;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.2px;
}
.top-notice-bar span.fire {
  animation: pulseFire 1.5s infinite ease-in-out;
}
@keyframes pulseFire {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

/* Creator Profile Header */
.creator-header {
  text-align: center;
  padding: 32px 16px 20px;
  position: relative;
}

.btn-builder-header {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}
.btn-builder-header:hover {
  transform: translateY(-2px);
  border-color: var(--brand-accent);
  color: var(--brand-accent);
}

.theme-toggle-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}
.theme-toggle-btn:hover {
  transform: rotate(20deg) scale(1.05);
}

.avatar-wrapper {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 16px;
}
.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: #ffffff;
  border: 3px solid var(--bg-card);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-smooth);
}
.avatar-wrapper:hover .avatar-img {
  transform: scale(1.04);
}
.verified-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: #3B82F6;
  color: #FFFFFF;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  border: 2px solid var(--bg-card);
}

.creator-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}
.creator-handle {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-accent);
  background: var(--shopee-orange-soft);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}
.creator-bio {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 440px;
  margin: 0 auto 16px;
  line-height: 1.6;
}

/* Social Link Icons */
.social-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}
.social-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.1rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}
.social-icon-btn:hover {
  transform: translateY(-3px);
  color: var(--brand-accent);
  border-color: var(--brand-accent);
  box-shadow: var(--shadow-md);
}

/* Search & Filter Section */
.search-filter-section {
  position: sticky;
  top: 10px;
  z-index: 50;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.search-box-wrapper {
  position: relative;
  margin-bottom: 12px;
}
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 1rem;
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 14px 44px 14px 46px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  outline: none;
  transition: all var(--transition-fast);
}
.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(28, 25, 23, 0.08);
}
.clear-search-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 1rem;
  display: none;
  padding: 4px;
}
.clear-search-btn.active {
  display: block;
}

/* Category Pills Carousel */
.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.category-pills::-webkit-scrollbar {
  display: none;
}
.cat-pill {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}
.cat-pill:hover {
  color: var(--text-main);
  background: var(--bg-secondary);
}
.cat-pill.active {
  background: var(--brand-primary);
  color: var(--bg-primary);
  border-color: var(--brand-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Section Header & Counters */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 4px;
}
.results-count {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}
.sort-select {
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}
@media (min-width: 800px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

/* Product Card */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all var(--transition-smooth);
  box-shadow: var(--shadow-sm);
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(226, 109, 92, 0.4);
}

/* Card Image & Badges */
.card-media-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--bg-secondary);
}
.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.product-card:hover .card-img {
  transform: scale(1.08);
}

.badge-code {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(28, 25, 23, 0.88);
  backdrop-filter: blur(8px);
  color: #FAF7F2;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.badge-discount {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--shopee-orange);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.76rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 6px rgba(238, 77, 45, 0.3);
}

.badge-highlight {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  color: #B45309;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
[data-theme="dark"] .badge-highlight {
  background: rgba(30, 30, 36, 0.95);
  color: #FBBF24;
}

.quickview-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1C1917;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  opacity: 0.9;
  transition: all var(--transition-fast);
}
.quickview-btn:hover {
  transform: scale(1.15);
  background: #FFFFFF;
}

/* Card Content */
.card-content {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-main);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8em;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.shop-type-tag {
  background: var(--shopee-orange-soft);
  color: var(--shopee-orange);
  font-weight: 700;
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
  margin-bottom: 12px;
}
.price-current {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--shopee-orange);
  letter-spacing: -0.3px;
}
.price-original {
  font-size: 0.78rem;
  color: var(--text-light);
  text-decoration: line-through;
}

/* Buy on Shopee Button */
.btn-shopee {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 14px;
  background: var(--shopee-orange);
  color: #FFFFFF;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(238, 77, 45, 0.25);
}
.btn-shopee:hover {
  background: #DC3E1F;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(238, 77, 45, 0.35);
}
.btn-shopee:active {
  transform: translateY(0);
}

/* Out of Stock (Hết hàng) Styles */
.product-card.is-sold-out {
  opacity: 0.85;
}
.badge-sold-out {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #475569;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  letter-spacing: 0.3px;
}
.btn-shopee.btn-sold-out {
  background: #64748B;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.9;
}
.btn-shopee.btn-sold-out:hover {
  background: #475569;
  transform: none;
}

/* Quick View Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  background: var(--bg-card);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-smooth);
}
.modal-overlay.open .modal-sheet {
  transform: translateY(0) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0, 0, 0, 0.5);
  color: #FFF;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
}

.modal-img-container {
  width: 100%;
  aspect-ratio: 4 / 4;
  overflow: hidden;
  background: var(--bg-secondary);
}
.modal-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-body {
  padding: 20px;
}
.modal-badge-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 10px;
}
.modal-style-tip {
  background: var(--bg-secondary);
  border-left: 3px solid var(--brand-accent);
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 0.88rem;
  margin: 14px 0;
  color: var(--text-main);
}
.modal-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}
.modal-action-row {
  display: flex;
  gap: 10px;
}
.btn-copy-code {
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-copy-code:hover {
  background: var(--border-subtle);
}

/* Toast Notification */
.toast-notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(28, 25, 23, 0.95);
  color: #FAF7F2;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  transition: transform var(--transition-smooth);
  pointer-events: none;
}
.toast-notice.show {
  transform: translateX(-50%) translateY(0);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}
.empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

/* Bottom Nav / Admin Access */
.bottom-admin-link {
  text-align: center;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px dashed var(--border-subtle);
}
.btn-to-admin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  transition: all var(--transition-fast);
}
.btn-to-admin:hover {
  color: var(--text-main);
  background: var(--border-subtle);
}
