.commerce-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.commerce-panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
}

.commerce-section-heading,
.commerce-cart-title,
.commerce-cart-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.commerce-section-heading h2,
.commerce-cart-title h3 {
  margin: 0;
}

.commerce-section-heading p,
.commerce-cart-item p {
  margin: 5px 0 0;
  color: var(--muted);
}

.commerce-section-heading a,
.commerce-map a {
  color: var(--primary-strong);
  font-weight: 700;
}

.commerce-cart-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.commerce-cart-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.commerce-cart-item.is-unavailable {
  opacity: 0.72;
}

.commerce-cart-image {
  display: grid;
  width: 92px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft-pink);
}

.commerce-cart-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.commerce-image-fallback {
  color: var(--primary-strong);
  font-size: 1.6rem;
  font-weight: 800;
}

.commerce-cart-main {
  min-width: 0;
}

.commerce-cart-title h3 {
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.commerce-cart-title strong,
.commerce-cart-controls > strong {
  flex: 0 0 auto;
  font-size: 0.9rem;
}

.commerce-stock {
  font-size: 0.82rem;
}

.commerce-stock.is-unavailable,
.commerce-warning,
.commerce-error {
  color: #b42318;
}

.commerce-cart-controls {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 10px;
}

.commerce-quantity {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.commerce-quantity button {
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--primary-strong);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
}

.commerce-quantity button:disabled {
  color: #94a3b8;
  cursor: not-allowed;
}

.commerce-quantity output {
  min-width: 32px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.commerce-remove {
  border: 0;
  background: transparent;
  color: #b42318;
  font-weight: 700;
  cursor: pointer;
}

.commerce-summary-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 1.1rem;
  font-weight: 800;
}

.commerce-payment-options {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

.commerce-payment-options legend {
  margin-bottom: 8px;
  font-weight: 700;
}

.commerce-payment-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.commerce-payment-option:has(input:checked) {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 15%, transparent);
}

.commerce-payment-option:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.62;
}

.commerce-payment-option > span,
.commerce-payment-option small {
  display: block;
}

.commerce-payment-option small {
  margin-top: 3px;
  color: var(--muted);
}

.commerce-payment-option .commerce-payment-hint {
  color: #b42318;
  font-size: 0.78rem;
}

.commerce-map {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.commerce-map iframe {
  width: 100%;
  height: 170px;
  border: 0;
  border-radius: 12px;
}

.commerce-warning {
  margin-top: 10px;
  font-size: 0.88rem;
}

.commerce-error {
  min-height: 1.4em;
  margin: 10px 0;
  font-size: 0.9rem;
}

.commerce-empty {
  padding: 32px 12px;
  color: var(--muted);
  text-align: center;
}

.commerce-empty a {
  color: var(--primary-strong);
  font-weight: 700;
}

[data-cart-count] {
  min-width: 18px;
  margin-left: 3px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  line-height: 1.4;
  text-align: center;
  vertical-align: middle;
}

@media (max-width: 800px) {
  .commerce-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .commerce-panel {
    padding: 16px;
  }
}

@media (max-width: 520px) {
  .commerce-cart-item {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 10px;
  }

  .commerce-cart-image {
    width: 68px;
  }

  .commerce-cart-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

/* ===== Truncation deskripsi ===== */

/* Kartu produk di beli.html: maksimal 3 baris (2 baris di HP) */
.product-body .product-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-height: 4.8em; /* 3 baris x line-height 1.6 supaya tinggi kartu seragam */
  font-size: 0.92rem;
}

@media (max-width: 640px) {
  .product-body .product-desc {
    -webkit-line-clamp: 2;
    line-clamp: 2;
    min-height: 3.2em;
  }
}

/* Halaman product.html: terpotong + tombol "Baca selengkapnya" */
[data-detail-description] {
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.desc-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--desc-lines, 5);
  line-clamp: var(--desc-lines, 5);
  overflow: hidden;
}

.desc-clamp.is-expanded {
  display: block;
  -webkit-line-clamp: none;
  line-clamp: none;
  overflow: visible;
}

.desc-toggle {
  display: inline-block;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink, var(--primary-strong));
  font: 700 0.9rem var(--f-b, inherit);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

@media (max-width: 640px) {
  .desc-clamp { --desc-lines: 4; }
}

.mm-card-price.is-free{display:inline-block;align-self:flex-start;padding:2px 12px;border:2px solid #0b2342;border-radius:999px;background:#7ee2a8;color:#0b2342;font-size:.9rem;letter-spacing:.04em}