/* Halaman produk baru — hanya dimuat saat inc/produk.php aktif (body.almu-pb).
 *
 * Warna dan huruf dari tema (variabel --almu-*); yang diatur di sini adalah urutan
 * dan cara memilih. Satu-satunya elemen yang "bersuara" adalah pemilih warna —
 * sisanya sengaja tenang. HP dulu; desktop di blok @media paling bawah.
 *
 * Catatan spesifisitas: style.css tema mewarnai SEMUA <button> dengan hijau zaitun,
 * jadi tiap tombol kecil di sini (chip, tambah-kurang, tautan) me-reset latar,
 * warna, dan padding-nya sendiri.
 */

/* ── Kepala: judul kecil supaya harga terlihat di layar pertama HP ── */
.almu-pb .storefront-breadcrumb { display: none; }
.almu-pb.single-product div.product .product_title {
  font-size: 1.2rem; font-weight: 600; line-height: 1.3; letter-spacing: 0;
  margin: 0 0 .35em; color: var(--almu-text);
}
.almu-pb.single-product div.product p.price { font-size: 1.55rem; margin: 0 0 .6em; }
.almu-pb.single-product div.product p.price del { font-size: .7em; font-weight: 400; opacity: .6; }
.almu-pb.single-product div.product .woocommerce-product-gallery { margin-bottom: 1em; }
.almu-grosir-ringkas { margin: -.2em 0 1em; font-size: .92rem; font-weight: 600; color: var(--almu-brand-dark); }
.almu-grosir-ringkas .amount { font-weight: 700; }

/* Ringkasan jadi kolom flex supaya daftar tingkat grosir (dicetak plugin di bawah
   harga) bisa digeser ke bawah tombol beli tanpa mengubah plugin-nya. */
.almu-pb.single-product div.product .summary { display: flex; flex-direction: column; }
.almu-pb.single-product div.product .summary > * { order: 2; }
.almu-pb.single-product div.product .summary > .product_title,
.almu-pb.single-product div.product .summary > .price,
.almu-pb.single-product div.product .summary > .almu-grosir-ringkas,
.almu-pb.single-product div.product .summary > form.cart { order: 1; }
.almu-pb .almu-grosir { margin: 1.3em 0 0; max-width: none; }

/* ── Pemilih warna ── */
.almu-pb form.almu-picker-on table.variations,
.almu-pb form.almu-picker-on .reset_variations { display: none !important; }

.almu-warna { margin: 0 0 1.1em; }
.almu-warna-kepala { display: flex; align-items: baseline; gap: .5em; margin: 0 0 .5em; }
.almu-warna-judul { font-weight: 600; }
.almu-warna-pilih { font-weight: 600; color: var(--almu-brand-dark); }
.almu-warna-pilih.belum { font-weight: 400; color: var(--almu-muted); }
.almu-warna-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; }

.almu-pb button.almu-chip {
  display: flex; flex-direction: column; align-items: stretch; gap: 4px;
  margin: 0; padding: 4px 4px 6px; min-height: 0;
  background: var(--almu-surface); color: var(--almu-text);
  border: 1.5px solid rgba(62, 58, 53, .14); border-radius: 10px;
  font: inherit; font-size: .72rem; line-height: 1.2; text-align: center; text-transform: none;
  cursor: pointer; box-shadow: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.almu-pb button.almu-chip:hover { background: var(--almu-surface); color: var(--almu-text); border-color: var(--almu-brand); }
.almu-chip img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 6px; margin: 0; }
.almu-chip-nama { display: block; overflow-wrap: anywhere; }
.almu-chip-sisa { display: block; color: #A0522D; font-weight: 600; }
.almu-pb button.almu-chip.aktif {
  border-color: var(--almu-brand-dark);
  box-shadow: 0 0 0 1.5px var(--almu-brand-dark);
  font-weight: 600;
}
.almu-pb button.almu-chip:focus-visible { outline: 2px solid var(--almu-brand-dark); outline-offset: 2px; }
.almu-pb button.almu-chip:disabled { cursor: not-allowed; opacity: .5; }
.almu-pb button.almu-chip:disabled:hover { border-color: rgba(62, 58, 53, .14); }
.almu-chip:disabled img { filter: grayscale(1); }

.almu-warna-habis { margin-top: .8em; }
.almu-warna-habis summary { cursor: pointer; color: var(--almu-muted); font-size: .85rem; padding: .3em 0; }
.almu-warna-habis .almu-warna-grid { margin-top: .5em; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); }
.almu-warna-kosong { color: var(--almu-muted); margin: 0; }

/* ── Jumlah: tombol tambah-kurang sebesar ibu jari ── */
.almu-pb.single-product div.product form.cart .quantity.almu-jumlah {
  display: flex; align-items: center; gap: 0; margin: 0 0 .4em; float: none;
}
.almu-jumlah-label { font-weight: 600; margin-right: auto; }
.almu-pb button.almu-jumlah-btn {
  width: 44px; height: 44px; margin: 0; padding: 0; min-height: 0;
  background: var(--almu-surface); color: var(--almu-text);
  border: 1px solid rgba(62, 58, 53, .25); border-radius: 8px;
  font-size: 1.3rem; line-height: 1; font-weight: 400; box-shadow: none;
}
.almu-pb button.almu-jumlah-btn:hover { background: var(--almu-surface); color: var(--almu-brand-dark); border-color: var(--almu-brand-dark); }
.almu-pb.single-product div.product form.cart .quantity.almu-jumlah .qty {
  width: 3.2em; height: 44px; margin: 0 6px; padding: 0; text-align: center;
  font-size: 1.05rem; font-weight: 600; background: transparent; border: 0; box-shadow: none;
  -moz-appearance: textfield; appearance: textfield;
}
.almu-jumlah .qty::-webkit-outer-spin-button,
.almu-jumlah .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.almu-ajak { min-height: 1.5em; margin: 0 0 .9em; font-size: .88rem; font-weight: 600; color: var(--almu-brand-dark); text-align: right; }
.almu-pb .almu-grosir-hitung { display: none; }   /* hitungannya pindah ke bilah beli & ajakan */

/* ── Dua tombol: keranjang (garis) dan beli (penuh) ── */
.almu-pb.single-product div.product form.cart .woocommerce-variation-add-to-cart,
.almu-pb.single-product div.product form.cart:not(.variations_form) {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start;
}
.almu-pb.single-product div.product form.cart .almu-jumlah,
.almu-pb.single-product div.product form.cart .almu-ajak { grid-column: 1 / -1; }
.almu-pb.single-product div.product form.cart .single_add_to_cart_button,
.almu-pb.single-product div.product form.cart .almu-beli {
  width: 100%; margin: 0; padding: 14px 8px; min-height: 50px; clear: none; float: none;
  font-size: 1rem; font-weight: 600; border-radius: 8px;
}
.almu-pb.single-product div.product form.cart .single_add_to_cart_button {
  background: transparent; color: var(--almu-brand-dark); border: 1.5px solid var(--almu-brand-dark);
}
.almu-pb.single-product div.product form.cart .single_add_to_cart_button:hover { background: rgba(95, 107, 84, .08); color: var(--almu-brand-dark); }
.almu-pb.single-product div.product form.cart .almu-beli { background: var(--almu-brand-dark); color: #fff; border: 1.5px solid var(--almu-brand-dark); }
.almu-pb.single-product div.product form.cart .almu-beli:hover { background: var(--almu-brand); border-color: var(--almu-brand); }
.almu-pb.single-product div.product form.cart .single_add_to_cart_button.disabled,
.almu-pb.single-product div.product form.cart .almu-beli.disabled { opacity: .45; cursor: not-allowed; }

.almu-tanya { margin: .9em 0 0; text-align: center; font-size: .9rem; }
.almu-tanya a { color: var(--almu-brand-dark); text-decoration: underline; text-underline-offset: 3px; }

.almu-jaminan { list-style: none; margin: 1.2em 0 0; padding: 1em 0 0; border-top: 1px solid rgba(62, 58, 53, .12); font-size: .9rem; }
.almu-jaminan li { position: relative; margin: 0 0 .45em; padding-left: 1.5em; line-height: 1.45; }
.almu-jaminan li::before { content: "✓"; position: absolute; left: 0; color: var(--almu-brand-dark); font-weight: 700; }

/* ── Deskripsi: satu bagian, diringkas ── */
.almu-pb .woocommerce-tabs ul.tabs:has(li:only-child) { display: none; }
.almu-pb .woocommerce-tabs:has(ul.tabs li:only-child) .panel { width: 100%; float: none; margin: 0; }
.almu-pb .woocommerce-tabs { padding-top: 1.5em; }
.almu-pb .woocommerce-Tabs-panel--description > h2:first-child { font-size: 1.15rem; font-weight: 600; }
.almu-ringkas { position: relative; max-height: 20em; overflow: hidden; }
.almu-ringkas::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5em;
  background: linear-gradient(to bottom, rgba(250, 247, 242, 0), var(--almu-bg)); pointer-events: none;
}
.almu-ringkas.almu-ringkas-buka { max-height: none; }
.almu-ringkas.almu-ringkas-buka::after { display: none; }
.almu-pb button.almu-ringkas-btn {
  display: block; margin: .4em 0 1.5em; padding: .5em 0; min-height: 44px;
  background: none; color: var(--almu-brand-dark); border: 0; box-shadow: none;
  font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.almu-pb button.almu-ringkas-btn:hover { background: none; color: var(--almu-brand); }

/* ── Bilah beli yang menempel di bawah layar (HP) ── */
.almu-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 998;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: var(--almu-surface); border-top: 1px solid rgba(62, 58, 53, .14);
  box-shadow: 0 -4px 16px rgba(62, 58, 53, .08);
  transition: transform .2s ease;
}
.almu-bar[hidden] { display: none; }
.almu-bar.almu-bar-sembunyi { transform: translateY(110%); }
.almu-bar-info { display: flex; flex-direction: column; min-width: 0; margin-right: auto; line-height: 1.25; }
.almu-bar-warna { font-size: .75rem; color: var(--almu-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.almu-bar-total { font-size: 1.1rem; color: var(--almu-brand-dark); font-variant-numeric: tabular-nums; }
.almu-pb .almu-bar button {
  margin: 0; padding: 0 14px; height: 46px; min-height: 0; border-radius: 8px;
  font-size: .95rem; font-weight: 600; white-space: nowrap; box-shadow: none;
}
.almu-pb .almu-bar .almu-bar-keranjang { background: transparent; color: var(--almu-brand-dark); border: 1.5px solid var(--almu-brand-dark); }
.almu-pb .almu-bar .almu-bar-beli,
.almu-pb .almu-bar .almu-bar-pilih { background: var(--almu-brand-dark); color: #fff; border: 1.5px solid var(--almu-brand-dark); }
.almu-bar .almu-bar-keranjang, .almu-bar .almu-bar-beli { display: none; }
.almu-bar.almu-bar-siap .almu-bar-keranjang, .almu-bar.almu-bar-siap .almu-bar-beli { display: block; }
.almu-bar.almu-bar-siap .almu-bar-pilih { display: none; }

@media (max-width: 767px) {
  body.almu-bar-on { padding-bottom: 72px; }
  /* Bilah sudah memuat jalan ke keranjang & WA ada sebagai tautan di halaman: dua
     tombol melayang hanya menutupi isi. Keranjang dinaikkan, WA disembunyikan. */
  body.almu-bar-on .almu-wa-float { display: none; }
  body.almu-bar-on .almu-cart-float { bottom: 84px; width: 46px; height: 46px; right: 12px; }
  /* Keranjang kosong: tombol melayangnya hanya menutupi harga di tepi kanan. */
  body.almu-bar-on .almu-cart-float:not(:has(.has-items)) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .almu-bar, .almu-pb button.almu-chip { transition: none; }
}

/* ── Desktop: dua kolom, ringkasan ikut menggulir; bilah tidak dipakai ── */
@media (min-width: 768px) {
  .almu-bar { display: none !important; }
  .almu-pb .storefront-breadcrumb { display: block; }
  .almu-pb.single-product div.product .product_title { font-size: 1.6rem; }
  .almu-pb.single-product div.product .summary { position: sticky; top: 24px; }
  .almu-warna-grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
  .almu-ajak { text-align: left; }
  .almu-jumlah-label { margin-right: 1em; }
  .almu-pb.single-product div.product form.cart .quantity.almu-jumlah { justify-content: flex-start; }
}
