/* ============ BASE LAYOUT ============ */
body {
  -webkit-font-smoothing: antialiased;
  background-color: #f8f9fa;
}

/* ============ PRODUCT CARD WRAPPER (POSISI & SHADOW GLOBAL) ============ */
.product-card {
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transition: transform .15s ease;
  position: relative;
}
.product-card:active {
  transform: scale(0.985);
}

/* ============ IMAGE SQUARE COMMON (dipakai di banyak tempat) ============ */
.product-thumb,
.detail-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 16px;
}

/* ============ SKELETON LOADING SHIMMER ============ */
.skeleton {
  position: relative;
  background: #e6e6e6;
  overflow: hidden;
  border-radius: 16px;
}
.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150px;
  height: 100%;
  width: 150px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer {
  100% {
    transform: translateX(300px);
  }
}

/* Skeleton for square images */
.thumb-loading {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
}

/* ============ TEXT SECTION ============ */
.product-info {
  padding: 14px 16px 18px 16px;
}

/* ============ LIST MODE (index lama / toko list) ============ */
#productList {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Scroll horizontal snap for preview gallery */
.scroll-snap-x {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
}
.scroll-snap-x > * {
  scroll-snap-align: center;
  flex: 0 0 auto;
}

/* Thumbnail kecil (list mode) */
.product-thumb-list {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.thumb-loading-list {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  flex-shrink: 0;
}

/* ============ FRAME TIPIS (dipakai lama — MASIH DIPAKAI DI BEBERAPA HALAMAN) ============ */
.img-frame {
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  overflow: hidden;
}


.img-frame-premium {
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  box-shadow: 0px 2px 6px rgba(0,0,0,0.08);
  background: #fff;
  overflow: hidden;
}


.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.product-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  padding: 8px;
  text-align: center;
  transition: transform .15s ease;
}

.product-grid-item:hover {
  transform: translateY(-2px);
}


/* Product image inside grid (square) */
.product-grid-item img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
}
.discount-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: #ff3b30;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  padding: 5px 7px;
  border-radius: 6px;
  z-index: 3;
}

/* Badge diskon versi detail (lebih mencolok) */
.discount-badge-detail {
  background: #ff3b30;
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  padding: 6px 10px;
  border-radius: 6px;
  display: inline-block;
}

.grid-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* maksimal 2 baris */
  -webkit-box-orient: vertical;
  max-width: 100%;
  text-overflow: ellipsis;
}

input.form-control {
  height: 44px;
  border-radius: 10px;
}
.btn-primary {
  background: #fe5722;
  border-color: #fe5722;
}
.btn-primary:hover {
  background: #e64a19;
}

