/* =========================================================
   PAGE-JUAL-EKSTRAK.CSS - Al Manar Herbafit
   Dimuat khusus di halaman Jual Ekstrak (page-jual-ekstrak.php).
   Variabel warna (--primary, --line, dll) & class .btn/.btn-primary
   sudah tersedia global lewat header-footer.css.
   ========================================================= */

/* ---------- HERO (banner promo, full-bleed image) ---------- */
.obral-hero {
  padding: 14px 0;
}
.obral-hero-inner {
  background: linear-gradient(135deg, var(--accent) 0%, #fdf6e3 100%);
  border-radius: 32px;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  min-height: 420px;
}
.obral-hero-text {
  flex: 1 1 380px;
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-btn{
  display: inline-flex;
  align-items: center;
  width: 39%;
  gap: 6px;
  background: #fff;
  color: var(--primary-dark);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
}
.obral-hero-badge {
  display: inline-block;
  background: #fff;
  color: #d9534f;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 999px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  width: fit-content;
}
.obral-hero-text h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--primary-dark);
  margin: 0 0 14px;
  line-height: 1.15;
}
.obral-hero-text p {
  color: var(--muted);
  font-size: var(--font-size, 1.1rem);
  margin: 0 0 24px;
  max-width: 50ch;
}
.obral-hero-image {
  flex: 1 1 420px;
  position: relative;
}
.obral-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- 3 KARTU PROMO (produk terbaru) ---------- */
.obral-promo-section {
  padding: 0;
}
.obral-promo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.obral-promo-card {
  position: relative;
  border-radius: 20px;
  padding: 28px;
  min-height: 180px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: flex;
  transition: 0.25s ease;
}
.obral-promo-card:hover {
  transform: translateY(-4px);
}
.obral-promo-text {
  position: relative;
  z-index: 2;
  max-width: 62%;
}
.obral-promo-label {
  display: inline-block;
  background: #fff;
  color: var(--primary-dark);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.obral-promo-text h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
}
.obral-promo-price {
  display: block;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 14px;
}
.obral-promo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: var(--primary-dark);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
}
.obral-promo-image {
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 140px;
  height: 140px;
  border-radius: 16px;
  overflow: hidden;
}
.obral-promo-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- SLIDER PRODUK PILIHAN ---------- */
.obral-slider-wrap {
  position: relative;
}
.obral-slider {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.obral-slider::-webkit-scrollbar {
  display: none;
}
.obral-slider .obral-card {
  flex: 0 0 220px;
  scroll-snap-align: start;
}
.obral-slider-btn {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  width: 42px !important;
  height: 42px !important;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  color: var(--primary-dark);
  padding: 0 !important;
  min-width: 0 !important;
}
.obral-slider-prev { left: -18px; }
.obral-slider-next { right: -18px; }

/* ---------- GRID SEMUA PRODUK ---------- */
.obral-grid-6 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 22px;
}

/* ---------- KARTU PRODUK (dipakai slider & grid) ---------- */
.section-title{
    padding: 20px 0;
}
.section-title h2{
    color: var(--primary-dark);
}
.obral-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  transition: 0.25s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.obral-card:hover {
  transform: translateY(-4px);
}
.obral-card-image {
  position: relative;
  aspect-ratio: 1 / 1;
}
.obral-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.obral-habis .obral-card-image img {
  filter: grayscale(60%);
  opacity: 0.75;
}
.obral-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  z-index: 2;
}
.obral-badge-diskon    { background: #d9534f; }
.obral-badge-terbatas  { background: #e0a832; }
.obral-badge-habis     { background: #a4a4a4; }

.obral-card-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.obral-card-body h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
}
.obral-card-body h3 a {
  color: var(--text);
  text-decoration: none;
}
.obral-card-body h3 a:hover {
  color: var(--primary);
}
.obral-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  flex-wrap: nowrap;
}
.obral-price-coret {
  color: var(--muted);
  text-decoration: line-through;
  font-size: 0.8rem;
  min-height: 1.2em;
  line-height: 1.2em;
  order: 2;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.obral-price-now {
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 1rem;
  order: 1;
  flex-shrink: 0;
}
.obral-btn-pesan {
  color: var(--primary-dark);
  width: 100%;
  font-weight: 600;
  font-size: 0.88rem;
  margin-top: auto;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .obral-grid-6 { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 768px) {
  .obral-grid-6 { grid-template-columns: repeat(3, 1fr); }
  .obral-header-brand { display: none; } /* hemat ruang di layar kecil */
  .obral-slider-prev, .obral-slider-next { display: none; } /* di mobile, scroll pakai swipe jari */
  .obral-hero-inner {
    flex-direction: column;
    min-height: 0;
  }
  .obral-hero-text {
    padding: 32px 24px;
  }
  .obral-hero-image {
    height: 220px;
  }
  .obral-promo-grid {
    grid-template-columns: 1fr;
  }
  .hero-btn{
    width: 50%;
  }
}
@media (max-width: 480px) {
  .obral-grid-6 { grid-template-columns: repeat(2, 1fr); }
}