/* store.mifa.my.id — Neubrutalism Theme */
:root {
  --red: #e11d48;
  --red-soft: #fde8ec;
  --red-dark: #be123c;
  --black: #1a1a1a;
  --white: #ffffff;
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-300: #d4d4d4;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-800: #262626;
  --shadow: 4px 4px 0px #1a1a1a;
  --shadow-sm: 2px 2px 0px #1a1a1a;
  --shadow-hover: 6px 6px 0px #1a1a1a;
  --border: 3px solid #1a1a1a;
  --border-thin: 2px solid #1a1a1a;
  --radius: 0px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

/* ====== Neubrutalism Components ====== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px; border: var(--border-thin);
  box-shadow: var(--shadow-sm);
  font-weight: 700; font-size: 0.875rem; text-transform: uppercase;
  cursor: pointer; transition: all 0.1s ease;
  text-decoration: none; gap: 8px;
  background: var(--white); color: var(--black);
  font-family: var(--font);
}
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn-primary { background: var(--red); color: white; border-color: var(--black); }
.btn-primary:hover { background: var(--red-dark); }
.btn-sm { padding: 8px 16px; font-size: 0.75rem; }
.btn-block { display: flex; width: 100%; }
.btn-success { background: #16a34a; color: white; border-color: var(--black); }
.btn-warning { background: #f59e0b; color: var(--black); border-color: var(--black); }
.btn-danger { background: #dc2626; color: white; border-color: var(--black); }
.btn-ghost { background: transparent; border-color: var(--gray-300); box-shadow: none; }
.btn-ghost:hover { border-color: var(--black); box-shadow: var(--shadow-sm); }

.card {
  background: var(--white); border: var(--border);
  box-shadow: var(--shadow);
  padding: 16px;
}
.card-sm { padding: 12px; }
.card-header { font-weight: 800; font-size: 1.25rem; margin-bottom: 12px; text-transform: uppercase; }

.badge {
  display: inline-block; padding: 4px 10px;
  border: 2px solid var(--black); font-weight: 700; font-size: 0.7rem;
  text-transform: uppercase;
}
.badge-red { background: var(--red); color: white; }
.badge-green { background: #16a34a; color: white; }
.badge-gray { background: var(--gray-200); }

.input {
  width: 100%; padding: 12px 14px;
  border: var(--border-thin); box-shadow: var(--shadow-sm);
  font-size: 1rem; font-family: var(--font);
  background: var(--white); outline: none;
  transition: box-shadow 0.1s;
}
.input:focus { box-shadow: var(--shadow); }
.textarea { min-height: 80px; resize: vertical; }

/* ====== Layout ====== */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--white); border-bottom: var(--border);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.app-header h1 { font-size: 1.1rem; font-weight: 800; text-transform: uppercase; }
.app-header h1 a { color: var(--black); text-decoration: none; }
.app-header h1 span { color: var(--red); }
.header-actions { display: flex; gap: 8px; align-items: center; }
.header-actions .btn { padding: 8px 14px; font-size: 0.7rem; }

.container { max-width: 1024px; margin: 0 auto; padding: 16px; }

/* ====== Product Grid ====== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 16px;
}
.product-card {
  background: var(--white); border: var(--border);
  box-shadow: var(--shadow);
  cursor: pointer; transition: all 0.15s;
  overflow: hidden;
}
.product-card:active { transform: translate(2px, 2px); box-shadow: none; }
.product-card .img-wrap {
  aspect-ratio: 1; overflow: hidden;
  background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
}
.product-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.product-card .info { padding: 10px 12px 12px; }
.product-card .info h3 { font-size: 0.8rem; font-weight: 700; margin-bottom: 4px; line-height: 1.3; }
.product-card .info .price { font-size: 1rem; font-weight: 800; color: var(--red); }
.product-card .info .stok-badge { font-size: 0.65rem; margin-top: 4px; }

/* ====== Product Detail ====== */
#detail-page { padding-bottom: 100px; }
.detail-gallery { position: relative; }
.detail-image-main {
  width: 100%; max-height: 400px; object-fit: contain;
  background: var(--gray-100); border: var(--border);
  box-shadow: var(--shadow);
  display: block;
}
.gallery-thumbs {
  display: flex; gap: 8px; margin-top: 8px; overflow-x: auto;
  padding-bottom: 4px;
}
.gallery-thumbs img {
  width: 60px; height: 60px; object-fit: cover;
  border: 2px solid var(--gray-300); cursor: pointer;
  flex-shrink: 0; transition: border-color 0.15s;
}
.gallery-thumbs img.active { border-color: var(--red); border-width: 3px; }
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: var(--white); border: 2px solid var(--black);
  width: 36px; height: 36px; display: flex; align-items: center;
  justify-content: center; font-weight: 800; cursor: pointer;
  box-shadow: var(--shadow-sm); z-index: 2;
}
.gallery-nav:active { transform: translateY(-50%) translate(2px, 2px); box-shadow: none; }
.gallery-nav.prev { left: 8px; }
.gallery-nav.next { right: 8px; }

.detail-info { margin-top: 16px; }
.detail-info h2 { font-size: 1.25rem; font-weight: 800; margin-bottom: 8px; }
.detail-info .price { font-size: 1.5rem; font-weight: 800; color: var(--red); margin-bottom: 8px; }
.detail-info .stok { margin-bottom: 12px; }
.detail-info .deskripsi { font-size: 0.9rem; color: var(--gray-600); line-height: 1.6; margin-bottom: 16px; }

/* Variant selector */
.variant-section { margin-bottom: 16px; }
.variant-label { font-weight: 700; font-size: 0.8rem; text-transform: uppercase; margin-bottom: 6px; }
.variant-options { display: flex; flex-wrap: wrap; gap: 6px; }
.variant-chip {
  padding: 8px 16px; border: 2px solid var(--gray-300);
  font-weight: 600; font-size: 0.8rem; cursor: pointer;
  background: var(--white); transition: all 0.1s;
}
.variant-chip:hover { border-color: var(--black); }
.variant-chip.selected { border-color: var(--red); background: var(--red-soft); color: var(--red); font-weight: 800; }
.variant-chip.out { opacity: 0.4; text-decoration: line-through; cursor: not-allowed; }
.variant-info { font-size: 0.75rem; color: var(--gray-500); margin-top: 4px; }

/* ====== Order Form ====== */
.order-form { margin-top: 16px; }
.order-form .form-group { margin-bottom: 12px; }
.order-form .form-group label { display: block; font-weight: 700; font-size: 0.8rem; margin-bottom: 4px; text-transform: uppercase; }
.order-item { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 8px; border: var(--border-thin); }
.order-item .qty-input { width: 60px; text-align: center; padding: 8px; }
.order-item .item-name { flex: 1; font-size: 0.85rem; font-weight: 600; }
.order-item .item-price { font-weight: 700; font-size: 0.85rem; white-space: nowrap; }
.order-summary { background: var(--gray-100); padding: 12px; border: 2px solid var(--black); margin-top: 12px; }
.order-summary .row { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 0.9rem; }
.order-summary .row.total { font-weight: 800; font-size: 1.1rem; border-top: 2px solid var(--black); padding-top: 8px; margin-top: 8px; }

/* ====== Admin Dashboard ====== */
.admin-layout { display: flex; flex-direction: column; min-height: 100dvh; }
.admin-header { background: var(--black); color: white; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; }
.admin-header h2 { font-size: 1rem; font-weight: 800; text-transform: uppercase; }
.admin-header h2 span { color: var(--red); }
.admin-body { flex: 1; padding: 16px; }

.order-card {
  background: var(--white); border: var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px; padding: 12px;
}
.order-card .order-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 8px; }
.order-card .order-no { font-weight: 800; font-size: 0.85rem; }
.order-card .order-info { font-size: 0.8rem; color: var(--gray-600); margin-bottom: 8px; }
.order-card .order-items { font-size: 0.8rem; margin-bottom: 8px; }
.order-card .order-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.order-card .order-actions .btn { font-size: 0.65rem; padding: 6px 12px; }

.status-bar { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.status-bar .badge { cursor: pointer; }
.status-bar .badge.active { background: var(--red); color: white; }

.login-form { max-width: 360px; margin: 80px auto; }
.login-form h2 { text-align: center; margin-bottom: 24px; font-size: 1.5rem; text-transform: uppercase; }
.login-form h2 span { color: var(--red); }

/* ====== Loading & Empty ====== */
.loading { text-align: center; padding: 48px; font-weight: 700; font-size: 1.2rem; }
.empty { text-align: center; padding: 48px; color: var(--gray-400); }
.page-title { font-size: 1.25rem; font-weight: 800; text-transform: uppercase; margin-bottom: 4px; }
.page-subtitle { font-size: 0.85rem; color: var(--gray-500); margin-bottom: 16px; }

/* ====== Modal ====== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-card { background: white; border: var(--border); box-shadow: var(--shadow); max-width: 480px; width: 100%; padding: 20px; }
.modal-card h3 { font-weight: 800; margin-bottom: 12px; font-size: 1.1rem; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; justify-content: flex-end; }

/* ====== Success page ====== */
.success-page { text-align: center; padding: 48px 16px; }
.success-page .icon { font-size: 4rem; margin-bottom: 16px; }
.success-page h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.success-page .order-no { font-size: 1.5rem; font-weight: 800; color: var(--red); margin-bottom: 16px; }

/* ====== Toast ====== */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  z-index: 300;
  padding: 12px 24px; border: var(--border-thin); box-shadow: var(--shadow);
  font-weight: 700; font-size: 0.85rem;
  background: var(--black); color: white;
  animation: toastIn 0.3s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ====== Responsive ====== */
@media (min-width: 640px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
  #detail-page { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
  .detail-info { margin-top: 0; }
}

/* Cart badge */
.cart-count {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: white;
  font-size: 0.6rem; font-weight: 800;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--black);
}
.cart-btn { position: relative; }

/* Search */
.search-bar { margin-bottom: 16px; }
.search-bar input { border: var(--border); box-shadow: var(--shadow); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-400); border: 2px solid var(--black); }