/* ============================================================
   TOKO ONLINE - STORE CSS
   Modern & Clean - Shopee/Tokopedia inspired
   ============================================================ */

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

:root {
  --orange:       #EE4D2D;
  --orange-2:     #FF6633;
  --orange-light: #FFF3F0;
  --orange-dark:  #C0392B;
  --red:          #E74C3C;
  --green:        #27AE60;
  --gray-50:      #F8F9FA;
  --gray-100:     #F1F3F4;
  --gray-200:     #E2E5E8;
  --gray-400:     #9AA3AF;
  --gray-500:     #6B7480;
  --gray-700:     #3D4450;
  --gray-900:     #1A1D23;
  --white:        #FFFFFF;
  --radius:       10px;
  --radius-sm:    6px;
  --radius-lg:    16px;
  --shadow-sm:    0 1px 4px rgba(0,0,0,0.08);
  --shadow:       0 2px 8px rgba(0,0,0,0.1);
  --shadow-lg:    0 8px 30px rgba(0,0,0,0.12);
  --transition:   .2s ease;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  min-height: 100vh;
}

/* ── HEADER ───────────────────────────────────────────────── */
.header {
  background: var(--orange);
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 2px 8px rgba(238,77,45,0.3);
}
.header-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0 20px; height: 64px;
  display: flex; align-items: center; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}
.brand-icon { font-size: 24px; }
.brand-name {
  font-family: 'Poppins', sans-serif;
  font-size: 20px; font-weight: 700; color: var(--white);
  letter-spacing: -0.3px;
}
.search-wrap {
  flex: 1; max-width: 500px;
  position: relative;
}
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 15px; pointer-events: none;
}
.search-input {
  width: 100%; padding: 10px 14px 10px 36px;
  border: none; border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif; font-size: 14px;
  outline: none; background: var(--white);
}
.header-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.btn-header-ghost {
  color: rgba(255,255,255,0.9); text-decoration: none;
  font-size: 13px; font-weight: 600; padding: 7px 14px;
  border: 1.5px solid rgba(255,255,255,0.5); border-radius: var(--radius-sm);
  transition: var(--transition);
}
.btn-header-ghost:hover { background: rgba(255,255,255,0.15); color: var(--white); }
.btn-cart {
  display: flex; align-items: center; gap: 6px;
  background: var(--white); color: var(--orange);
  border: none; border-radius: var(--radius-sm);
  padding: 8px 16px; font-family: 'Nunito', sans-serif;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: var(--transition); white-space: nowrap;
}
.btn-cart:hover { background: var(--orange-light); }
.cart-badge {
  background: var(--orange); color: var(--white);
  font-size: 11px; font-weight: 800;
  min-width: 18px; height: 18px; border-radius: 100px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ── HERO ─────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-2) 100%);
  padding: 48px 20px; position: relative; overflow: hidden;
  min-height: 180px; display: flex; align-items: center;
}
.hero-content {
  max-width: 1280px; margin: 0 auto; width: 100%;
  position: relative; z-index: 2;
}
.hero-sub {
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.85);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px;
}
.hero-title {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(28px, 5vw, 48px); font-weight: 700;
  color: var(--white); margin-bottom: 8px; line-height: 1.1;
}
.hero-desc { font-size: 15px; color: rgba(255,255,255,0.8); }
.hero-shapes { position: absolute; inset: 0; pointer-events: none; }
.shape {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.s1 { width: 300px; height: 300px; right: -80px; top: -80px; }
.s2 { width: 200px; height: 200px; right: 150px; bottom: -60px; }
.s3 { width: 120px; height: 120px; right: 60px; top: 20px; background: rgba(255,255,255,0.04); }

/* ── MAIN ─────────────────────────────────────────────────── */
.main { max-width: 1280px; margin: 0 auto; padding: 28px 20px; }
.section-header {
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.section-title {
  font-family: 'Poppins', sans-serif;
  font-size: 18px; font-weight: 700; flex-shrink: 0;
}
.cat-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-btn {
  padding: 6px 16px; border-radius: 100px;
  border: 1.5px solid var(--gray-200); background: var(--white);
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 600;
  color: var(--gray-500); cursor: pointer; transition: var(--transition);
}
.cat-btn:hover { border-color: var(--orange); color: var(--orange); }
.cat-btn.active {
  background: var(--orange); border-color: var(--orange);
  color: var(--white);
}

/* ── PRODUCT GRID ─────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.product-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer; display: flex; flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px); box-shadow: var(--shadow);
}
.product-img {
  aspect-ratio: 1; overflow: hidden; background: var(--gray-100);
  position: relative;
}
.product-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s;
}
.product-card:hover .product-img img { transform: scale(1.06); }
.disc-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--red); color: var(--white);
  font-size: 11px; font-weight: 800;
  padding: 2px 7px; border-radius: 100px;
}
.product-body { padding: 12px 12px 14px; flex: 1; display: flex; flex-direction: column; }
.product-cat {
  font-size: 11px; font-weight: 700; color: var(--orange);
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px;
}
.product-name {
  font-size: 13px; font-weight: 600; color: var(--gray-900);
  line-height: 1.4; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.price-row { display: flex; align-items: baseline; gap: 5px; margin-bottom: 10px; }
.price-final { font-size: 15px; font-weight: 800; color: var(--orange-dark); }
.price-original { font-size: 11px; color: var(--gray-400); text-decoration: line-through; }
.card-actions { display: flex; gap: 6px; margin-top: auto; }
.btn-detail {
  flex: 1; padding: 8px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--orange); background: transparent;
  font-family: 'Nunito', sans-serif; font-size: 12px; font-weight: 700;
  color: var(--orange); cursor: pointer; transition: var(--transition);
}
.btn-detail:hover { background: var(--orange-light); }
.btn-wa {
  padding: 8px 10px; border-radius: var(--radius-sm);
  border: none; background: #25D366; color: var(--white);
  font-size: 15px; cursor: pointer; transition: var(--transition);
}
.btn-wa:hover { background: #1da851; }
.btn-addcart {
  flex: 1; padding: 8px; border-radius: var(--radius-sm);
  border: none; background: var(--orange); color: var(--white);
  font-family: 'Nunito', sans-serif; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: var(--transition);
}
.btn-addcart:hover { background: var(--orange-dark); }

/* ── SKELETON ─────────────────────────────────────────────── */
.skeleton-card {
  background: var(--white); border-radius: var(--radius);
  aspect-ratio: .75; animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}
.no-product {
  grid-column: 1/-1; text-align: center;
  padding: 60px 20px; color: var(--gray-400);
}

/* ── CART DRAWER ──────────────────────────────────────────── */
.drawer-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.35); z-index: 300;
}
.drawer-overlay.show { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 100%; max-width: 420px;
  background: var(--white); z-index: 301;
  transform: translateX(100%); transition: transform .3s ease;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.drawer.open { transform: translateX(0); }
.drawer-header {
  padding: 20px 20px 16px; border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.drawer-header h3 { font-size: 17px; font-weight: 800; }
.drawer-close {
  background: var(--gray-100); border: none; cursor: pointer;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 14px; display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.drawer-close:hover { background: var(--gray-200); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.cart-item {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--gray-100);
}
.cart-item:last-of-type { border-bottom: none; }
.cart-thumb {
  width: 64px; height: 64px; border-radius: var(--radius-sm);
  object-fit: cover; background: var(--gray-100); flex-shrink: 0;
}
.cart-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: 13px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 4px;
}
.cart-item-price { font-size: 13px; font-weight: 800; color: var(--orange-dark); }
.qty-ctrl { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--gray-200); background: var(--white);
  font-size: 15px; font-weight: 700; color: var(--gray-700);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.qty-btn:hover { border-color: var(--orange); color: var(--orange); }
.qty-num { font-size: 14px; font-weight: 700; min-width: 20px; text-align: center; }
.btn-remove { background: none; border: none; cursor: pointer; font-size: 16px; padding: 4px; opacity: .6; }
.btn-remove:hover { opacity: 1; }
.cart-empty {
  text-align: center; padding: 60px 20px;
  color: var(--gray-400); font-size: 15px;
}
.cart-footer {
  padding: 16px 20px; border-top: 1px solid var(--gray-100);
  background: var(--gray-50); flex-shrink: 0;
}
.cart-total-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.cart-total-label { font-size: 14px; color: var(--gray-500); font-weight: 600; }
.cart-total-val { font-size: 22px; font-weight: 800; color: var(--orange-dark); }
.cart-note { font-size: 12px; color: var(--gray-400); text-align: center; margin-top: 8px; }

/* ── PRODUCT DETAIL MODAL ─────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 400;
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: var(--white); border-radius: var(--radius-lg);
  width: 100%; max-width: 640px; max-height: 90vh;
  overflow-y: auto; box-shadow: var(--shadow-lg);
}
.detail-img {
  width: 100%; aspect-ratio: 1.6; object-fit: cover;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--gray-100);
}
.detail-body { padding: 24px; }
.detail-cat {
  font-size: 12px; font-weight: 700; color: var(--orange);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px;
}
.detail-name { font-size: 20px; font-weight: 800; margin-bottom: 12px; line-height: 1.3; }
.detail-prices { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.detail-price-final { font-size: 26px; font-weight: 800; color: var(--orange-dark); }
.detail-price-orig { font-size: 15px; color: var(--gray-400); text-decoration: line-through; }
.detail-disc-badge {
  background: var(--red); color: var(--white);
  font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 100px;
}
.detail-desc { font-size: 14px; line-height: 1.7; color: var(--gray-500); margin-bottom: 20px; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-detail-cart {
  flex: 2; padding: 13px; background: var(--orange); color: var(--white);
  border: none; border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 800;
  cursor: pointer; transition: var(--transition);
}
.btn-detail-cart:hover { background: var(--orange-dark); }
.btn-detail-wa {
  flex: 1; padding: 13px; background: #25D366; color: var(--white);
  border: none; border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: var(--transition); min-width: 140px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-detail-wa:hover { background: #1da851; }

/* ── TOAST ────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--gray-900); color: var(--white);
  padding: 12px 24px; border-radius: 100px;
  font-size: 14px; font-weight: 600; z-index: 999;
  opacity: 0; transition: all .3s; white-space: nowrap;
  pointer-events: none; box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.ok { background: #166534; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .search-wrap { max-width: 100%; }
  .btn-header-ghost { display: none; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
@media (max-width: 400px) {
  .brand-name { font-size: 16px; }
  .product-grid { gap: 8px; }
}

/* ── BRAND LOGO ───────────────────────────────────────────── */
.brand-logo {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-icon-default { font-size: 24px; }
.brand-logo img {
  width: 36px; height: 36px; object-fit: contain; border-radius: 6px;
}

/* ── HERO LOGO ────────────────────────────────────────────── */
.hero-logo-wrap { margin-bottom: 12px; }
.hero-logo-img {
  height: 72px; max-width: 200px; object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.2));
}

@media (max-width: 768px) {
  .hero-logo-img { height: 52px; max-width: 140px; }
  .brand-logo img { width: 28px; height: 28px; }
}
