@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

* {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ═══════════════════════════════════════════════════════
   TUNAS TOYOTA — MERCHANDISE & APPAREL DESIGN SYSTEM
   Modern Gazoo Racing & Toyota Lifestyle Aesthetic
   ═══════════════════════════════════════════════════════ */

/* --- HERO BANNER --- */
.merch-hero {
  position: relative;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #831843 100%);
  border-radius: 20px;
  padding: 28px 24px;
  color: #ffffff;
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.merch-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.35) 0%, rgba(239, 68, 68, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
  filter: blur(20px);
}

.merch-hero::after {
  content: 'GAZOO RACING';
  position: absolute;
  bottom: -15px;
  right: 15px;
  font-family: 'Sora', sans-serif;
  font-size: 3rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.04);
  letter-spacing: 4px;
  pointer-events: none;
  user-select: none;
}

.merch-badge-gr {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: #ffffff;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.merch-hero-title {
  font-family: 'Sora', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 60%, #f43f5e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.merch-hero-subtitle {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin-bottom: 18px;
  max-width: 520px;
}

/* Feature stats inside hero */
.merch-hero-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.merch-stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #e2e8f0;
  font-weight: 500;
}

.merch-stat-item i {
  color: #f87171;
  font-size: 0.9rem;
}

/* --- TOOLBAR & CONTROLS --- */
.merch-toolbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.merch-search-box {
  position: relative;
  width: 100%;
}

.merch-search-input {
  width: 100%;
  padding: 13px 44px 13px 44px;
  border-radius: 14px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-card, #ffffff);
  color: var(--text-dark, #0f172a);
  font-size: 0.9rem;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
  transition: all 0.25s ease;
}

.merch-search-input:focus {
  outline: none;
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

.merch-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted, #94a3b8);
  font-size: 0.95rem;
  pointer-events: none;
}

.merch-search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px;
  display: none;
  transition: color 0.2s ease;
}

.merch-search-clear:hover {
  color: #ef4444;
}

/* Filter Chips Slider */
.merch-categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.merch-categories::-webkit-scrollbar {
  display: none;
}

.merch-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 50px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-body, #475569);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.02);
}

.merch-cat-chip:hover {
  background: var(--bg-surface, #f8fafc);
  color: var(--text-dark, #0f172a);
  border-color: #cbd5e1;
}

.merch-cat-chip.active {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.merch-cat-chip .chip-count {
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 0.7rem;
  background: rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

.merch-cat-chip.active .chip-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Meta Bar (Result count & Sorting) */
.merch-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
}

.merch-result-count {
  font-weight: 600;
  color: var(--text-dark, #0f172a);
}

.merch-sort-select {
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-card, #ffffff);
  color: var(--text-dark, #0f172a);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

/* --- PRODUCT GRID & CARDS --- */
.merch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

@media (max-width: 640px) {
  .merch-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 380px) {
  .merch-grid {
    grid-template-columns: 1fr;
  }
}

/* Product Card Component */
.merch-card {
  position: relative;
  background: var(--bg-card, #ffffff);
  border-radius: 18px;
  border: 1px solid var(--border-color, #e2e8f0);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.merch-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Card Header Image Area */
.merch-card-img-wrap {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 Aspect Ratio */
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  overflow: hidden;
  cursor: pointer;
}

.merch-card-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  transition: transform 0.4s ease;
}

.merch-card:hover .merch-card-img {
  transform: scale(1.08);
}

/* Card Badges */
.merch-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  z-index: 2;
}

.badge-gr {
  background: linear-gradient(135deg, #dc2626 0%, #000000 100%);
  color: #ffffff;
}

.badge-bestseller {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
}

.badge-new {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
}

/* Wishlist Button */
.merch-card-wishlist {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 2;
}

.merch-card-wishlist:hover,
.merch-card-wishlist.active {
  background: #ffffff;
  color: #ef4444;
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.25);
}

/* Card Body */
.merch-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.merch-card-category {
  font-size: 0.72rem;
  font-weight: 700;
  color: #ef4444;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.merch-card-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dark, #0f172a);
  line-height: 1.35;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.7em;
}

.merch-card-part {
  font-size: 0.73rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 10px;
  font-family: monospace;
}

.merch-card-part span {
  font-weight: 600;
  color: var(--text-dark, #334155);
}

/* Variant Selector inside card */
.merch-card-select-wrap {
  margin-bottom: 12px;
}

.merch-card-select {
  width: 100%;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-surface, #f8fafc);
  color: var(--text-dark, #0f172a);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease;
}

.merch-card-select:focus {
  border-color: #ef4444;
}

/* Stock Badges Row */
.merch-stock-row {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.merch-stock-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
}

.stock-cabang {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.stock-tam {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.stock-empty {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* Price & Indent Tag */
.merch-card-price-wrap {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color, #e2e8f0);
  margin-bottom: 12px;
}

.merch-card-price {
  font-family: 'Sora', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ef4444;
  line-height: 1.2;
}

.merch-card-indent {
  font-size: 0.72rem;
  color: #d97706;
  font-weight: 600;
  margin-top: 2px;
}

/* Card Actions */
.merch-card-actions {
  display: flex;
  gap: 8px;
}

.btn-merch-wa {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
  text-decoration: none;
}

.btn-merch-wa:hover {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.35);
  color: #ffffff;
}

.btn-merch-preview {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--bg-surface, #f1f5f9);
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-dark, #334155);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-merch-preview:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

/* --- QUICK VIEW LIGHTBOX MODAL --- */
.merch-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.merch-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.merch-modal-card {
  position: relative;
  width: 100%;
  max-width: 680px;
  background: var(--bg-card, #ffffff);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.2));
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.merch-modal-overlay.active .merch-modal-card {
  transform: scale(1);
}

.merch-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.1);
  border: none;
  color: var(--text-dark, #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}

.merch-modal-close:hover {
  background: #ef4444;
  color: #ffffff;
}

.merch-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow-y: auto;
}

@media (max-width: 600px) {
  .merch-modal-grid {
    grid-template-columns: 1fr;
  }
}

.merch-modal-img-wrap {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

.merch-modal-img {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.15));
}

.merch-modal-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.merch-modal-title {
  font-family: 'Sora', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-dark, #0f172a);
  margin-bottom: 8px;
  line-height: 1.3;
}

.merch-modal-price {
  font-family: 'Sora', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: #ef4444;
  margin-bottom: 14px;
}

.merch-modal-desc {
  font-size: 0.85rem;
  color: var(--text-body, #475569);
  line-height: 1.6;
  margin-bottom: 16px;
}

.merch-spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-bottom: 18px;
}

.merch-spec-table td {
  padding: 6px 0;
  border-bottom: 1px solid var(--border-color, #f1f5f9);
}

.merch-spec-table td:first-child {
  color: var(--text-muted, #64748b);
  width: 40%;
}

.merch-spec-table td:last-child {
  font-weight: 600;
  color: var(--text-dark, #0f172a);
}

/* --- EMPTY & ERROR STATES --- */
.merch-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  background: var(--bg-card, #ffffff);
  border-radius: 20px;
  border: 1px dashed var(--border-color, #cbd5e1);
  color: var(--text-muted, #64748b);
}

.merch-empty-icon {
  font-size: 2.8rem;
  color: #cbd5e1;
  margin-bottom: 12px;
}

.merch-empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark, #0f172a);
  margin-bottom: 6px;
}

/* --- DARK MODE ADJUSTMENTS --- */
[data-theme="dark"] .merch-search-input {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .merch-cat-chip {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .merch-cat-chip:hover {
  background: #334155;
  color: #ffffff;
}

[data-theme="dark"] .merch-sort-select {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .merch-card {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .merch-card-img-wrap {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

[data-theme="dark"] .merch-card-title {
  color: #f8fafc;
}

[data-theme="dark"] .merch-card-select {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .stock-cabang {
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
  border-color: rgba(37, 99, 235, 0.4);
}

[data-theme="dark"] .stock-tam {
  background: rgba(22, 163, 74, 0.2);
  color: #4ade80;
  border-color: rgba(22, 163, 74, 0.4);
}

[data-theme="dark"] .btn-merch-preview {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .merch-modal-card {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .merch-modal-img-wrap {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

[data-theme="dark"] .merch-modal-title {
  color: #f8fafc;
}

[data-theme="dark"] .merch-modal-desc {
  color: #94a3b8;
}

[data-theme="dark"] .merch-spec-table td:last-child {
  color: #f8fafc;
}

[data-theme="dark"] .merch-modal-close {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}
