:root {
  --bg-dark: #0b0f19;
  --bg-card: #151c2c;
  --bg-card-hover: #1e293b;
  --primary: #ee4d2d; /* Shopee Orange */
  --primary-hover: #ff5722;
  --primary-glow: rgba(238, 77, 45, 0.35);
  --secondary: #3b82f6;
  --accent: #10b981;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #26334d;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* TOP PROMO BAR */
.top-promo-bar {
  background: linear-gradient(90deg, #ee4d2d, #f97316);
  color: #fff;
  text-align: center;
  padding: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* HEADER */
.shop-header {
  background: #0f1626;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.shop-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}

.shop-logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), #f97316);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  box-shadow: 0 0 15px var(--primary-glow);
}

.shop-brand-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
}

.shop-brand-text span {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 700;
}

/* SEARCH BAR */
.shop-search-bar {
  flex: 1;
  max-width: 580px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.shop-search-bar input {
  width: 100%;
  padding: 12px 46px 12px 48px;
  background: #090d16;
  border: 1px solid var(--border-color);
  border-radius: 30px;
  color: #fff;
  font-size: 0.95rem;
  font-family: var(--font);
  transition: all 0.25s ease;
}

.shop-search-bar input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.btn-clear {
  position: absolute;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
}

/* CART BUTTON */
.cart-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.cart-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0f1626;
}

/* CATEGORY BAR */
.category-bar {
  background: #090d16;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 0;
}

.category-container {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.cat-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 10px 18px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.cat-pill:hover {
  background: var(--bg-card-hover);
  color: #fff;
}

.cat-pill.active {
  background: linear-gradient(135deg, var(--primary), #f97316);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 15px var(--primary-glow);
}

/* MAIN SHOWCASE */
.shop-main {
  padding: 2rem 1.25rem 4rem;
}

.fallback-alert {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
  color: #93c5fd;
}

.fallback-alert i {
  font-size: 1.5rem;
  color: var(--secondary);
  margin-top: 2px;
}

.btn-close-alert {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #93c5fd;
  font-size: 1.1rem;
  cursor: pointer;
}

.section-title-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
}

.section-title-box h2 {
  font-size: 1.35rem;
  font-weight: 800;
}

.product-count-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 700;
}

/* PRODUCT GRID */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  position: relative;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--primary-glow);
  border-color: rgba(238, 77, 45, 0.4);
}

.product-img-wrapper {
  position: relative;
  width: 100%;
  height: 220px;
  background: #090d16;
  overflow: hidden;
}

.product-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.discount-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.shopee-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  color: #fbbf24;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
}

.product-info {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-cat {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.product-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.7rem;
}

.price-box {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.current-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
}

.original-price {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.product-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
}

.btn-buy-shopee {
  flex: 1;
  background: linear-gradient(135deg, var(--primary), #f97316);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px var(--primary-glow);
  transition: all 0.2s ease;
}

.btn-buy-shopee:hover {
  background: linear-gradient(135deg, #ff5722, #ea580c);
}

.btn-add-cart {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add-cart:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
}

.empty-state i {
  font-size: 4rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* CART DRAWER */
.cart-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 9998;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 100%;
  height: 100vh;
  background: #0f1626;
  border-left: 1px solid var(--border-color);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-close-cart {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
}

.cart-body {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  gap: 12px;
  background: var(--bg-card);
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
}

.cart-item-info {
  flex: 1;
}

.cart-item-title {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
}

.cart-item-price {
  color: var(--primary);
  font-weight: 800;
  font-size: 0.88rem;
}

.cart-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: #090d16;
}

.cart-total-box {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.cart-total-box strong {
  color: #fff;
}

/* FOOTER */
.shop-footer {
  background: #060a12;
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.hidden { display: none !important; }

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--accent);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 100000;
  transition: all 0.3s ease;
}

.toast.hidden {
  transform: translateY(100px);
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 768px) {
  .header-container {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .shop-search-bar {
    order: 3;
    max-width: 100%;
    width: 100%;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }

  .product-img-wrapper {
    height: 150px;
  }

  .product-info {
    padding: 0.88rem;
  }

  .product-title {
    font-size: 0.85rem;
    height: 2.4rem;
  }

  .current-price {
    font-size: 1.05rem;
  }
}
