/* ============================================
   Sekarmart - Detail Produk
   ============================================ */

.skm-detail-topbar {
  position: absolute;
  top: 60px;
  left: 0; right: 0;
  padding: 8px 16px;
  display: flex;
  z-index: 10;
}

.skm-detail-img {
  position: relative;
  width: 100%;
  background: #f8f9fa;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  max-height: 480px;
}
.skm-detail-img img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.skm-badge-diskon-lg {
  position: absolute;
  top: 12px; left: 12px;
  background: #dc3545;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
}
.skm-badge-habis-lg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  font-weight: 700;
}

.skm-detail-body {
  background: #fff;
  padding: 16px;
  margin-bottom: 8px;
}
.skm-detail-nama {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: #212529;
  margin-bottom: 12px;
}
.skm-detail-harga {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.skm-harga-asli-lg {
  color: #adb5bd;
  text-decoration: line-through;
  font-size: 14px;
}
.skm-harga-final-lg {
  font-size: 24px;
  font-weight: 700;
}
.skm-detail-meta {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: #6c757d;
  padding-top: 12px;
  border-top: 1px solid #f1f3f5;
  flex-wrap: wrap;
}
.skm-detail-meta i { margin-right: 4px; }

.skm-detail-section {
  background: #fff;
  padding: 16px;
  margin-bottom: 8px;
}
.skm-detail-section h6 {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 10px;
  color: #212529;
}
.skm-detail-deskripsi {
  font-size: 14px;
  line-height: 1.7;
  color: #495057;
}

/* Produk terkait */
.skm-terkait-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (min-width: 576px) {
  .skm-terkait-grid { grid-template-columns: repeat(4, 1fr); }
}
.skm-terkait-card {
  text-decoration: none;
  color: inherit;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #f1f3f5;
}
.skm-terkait-img {
  position: relative;
  width: 100%;
  padding-top: 100%;
  background: #f8f9fa;
}
.skm-terkait-img img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.skm-terkait-body { padding: 6px 8px 8px; }
.skm-terkait-nama {
  font-size: 12px;
  line-height: 1.3;
  height: 32px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.skm-badge-diskon {
  position: absolute;
  top: 4px; left: 4px;
  background: #dc3545;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
}

/* ============================================
   STICKY BOTTOM ACTION (PENTING!)
   ============================================ */
.skm-detail-sticky {
  position: fixed;
  bottom: 56px;              /* ⬅️ di atas bottom nav */
  left: 0; right: 0;
  background: #fff;
  padding: 12px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  border-top: 1px solid #e9ecef;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
  z-index: 1040;             /* ⬅️ lebih tinggi dari bottom nav (1030) */
}

/* Desktop/tablet: tidak perlu di atas bottom nav */
@media (min-width: 768px) {
  .skm-detail-sticky {
    position: sticky;
    bottom: 0;
    max-width: 1100px;
    margin: 0 auto;
    border-radius: 12px 12px 0 0;
  }
}

.skm-qty-control {
  display: flex;
  align-items: center;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.skm-qty-control .btn-qty {
  width: 36px; height: 40px;
  border: none;
  background: #f8f9fa;
  font-size: 18px;
  font-weight: 600;
  color: #198754;
  cursor: pointer;
}
.skm-qty-control .btn-qty:active { background: #e9ecef; }
.skm-qty-control input {
  width: 44px;
  text-align: center;
  border: none;
  font-weight: 600;
  -moz-appearance: textfield;
}
.skm-qty-control input::-webkit-outer-spin-button,
.skm-qty-control input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ============================================
   TABEL LEVEL HARGA
   ============================================ */
.skm-price-level-table {
  border: 1px solid #e9ecef;
  border-radius: 10px;
  overflow: hidden;
}
.skm-pl-header {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
  padding: 10px 14px;
  background: #f8f9fa;
  font-size: 12px;
  font-weight: 700;
  color: #495057;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.skm-pl-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
  padding: 12px 14px;
  font-size: 13.5px;
  border-top: 1px solid #f1f3f5;
  align-items: center;
  transition: background 0.15s;
}
.skm-pl-row:hover {
  background: #f0fdf4;
}
.skm-pl-row.termurah {
  background: #ecfdf5;
  border-left: 3px solid #10b981;
  font-weight: 600;
}
.skm-pl-qty {
  color: #495057;
}
.skm-pl-qty i {
  color: #94a3b8;
  margin-right: 4px;
}
.skm-pl-harga {
  text-align: right;
  font-weight: 700;
  color: #198754;
  font-size: 14px;
}
/* ============================================
   TOTAL DI STICKY BOTTOM
   ============================================ */
.skm-total-sticky {
  flex-shrink: 0;
  text-align: right;
  padding: 0 6px;
  line-height: 1.2;
}
.skm-total-sticky strong {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

/* Efek pulse saat harga berubah */
#hargaAktif {
  transition: color 0.3s;
}
#hargaAktif.harga-berubah {
  animation: skm-harga-pulse 0.6s ease;
  color: #f59e0b;
}
@keyframes skm-harga-pulse {
  0%   { transform: scale(1);   color: #198754; }
  30%  { transform: scale(1.12); color: #f59e0b; }
  100% { transform: scale(1);   color: #198754; }
}

/* Row tabel level yang aktif */
.skm-pl-row.aktif {
  background: #ecfdf5 !important;
  border-left: 3px solid #10b981;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(16,185,129,0.3);
}

/* Badge harga member */
#labelMember {
  font-size: 11px;
  padding: 4px 8px;
  font-weight: 600;
}