/**
 * Product detail page — action bar and the size / quantity sheet.
 *
 * Loaded on single product pages only (see inc/woocommerce.php), after the
 * main stylesheet. The stock WooCommerce form stays in the page as the no-JS
 * fallback; `html.moya-buy-js` (set inline by the template) hides it once the
 * sheet-driven bar can take over.
 */

/* ---------------------------------------------------------- action bar */
html.moya-buy-js .moya-cart-block { display: none; }

.single-product .sheet-bar { gap: 8px; }
.sheet-bar .bar-ico svg { width: 19px; height: 19px; }
.sheet-bar .bar-ico span { white-space: nowrap; }

.bar-cta {
  flex: 1 1 0;
  min-width: 0;
  height: 46px;
  padding: 0 8px;
  border: 1px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: transform .16s, box-shadow .16s, background .16s;
}
.bar-cta svg { width: 16px; height: 16px; flex: 0 0 auto; }
.bar-cta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-cta:active { transform: scale(.98); }

.bar-cta.is-cart:hover { background: #F7F7F8; }

.bar-cta.is-buy {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
  box-shadow: 0 10px 22px -14px rgba(226, 58, 46, .9);
}
.bar-cta.is-buy:hover { background: var(--red-dark); border-color: var(--red-dark); }

.bar-cta[disabled] { opacity: .45; pointer-events: none; }

/* WhatsApp shares the exact same footprint as the two CTAs (equal thirds). */
.sheet-bar .bar-ico--wa {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  height: 46px;
  padding: 0 8px;
  border: 1px solid #D6EFE0;
  border-radius: 14px;
  background: #F2FCF6;
  color: var(--green);
  flex-direction: row;
  gap: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.sheet-bar .bar-ico--wa svg { width: 16px; height: 16px; flex: 0 0 auto; }
.sheet-bar .bar-ico--wa span {
  font-size: 12px;
  letter-spacing: -.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-ico--wa {
  color: var(--green);
  border-color: #D6EFE0;
  background: #F2FCF6;
}
.bar-ico--wa[data-moya-wa] { color: var(--green); }

/* ---------------------------------------------------------- buy sheet */
#moyaSheetBuy .sheet-body { padding-bottom: 22px; }

.buy-card {
  background: #fff;
  border-radius: 14px;
  padding: 13px 14px;
  margin-bottom: 10px;
}
.buy-card--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.buy-attr + .buy-attr { margin-top: 13px; }
.buy-attr-t {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
  font-size: 12px;
  color: var(--ink2);
}
.buy-attr-t b { color: var(--ink); font-size: 12px; font-weight: 600; }
.buy-attr.is-empty .buy-attr-t b { color: var(--ink3); font-weight: 500; }
.buy-attr.is-missing .buy-opt { border-color: #F0B7B1; }

.buy-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.buy-opt {
  min-width: 46px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: .16s;
}
.buy-opt:hover { border-color: #C9CBD1; }
.buy-opt.is-on {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.buy-row-t { font-size: 12.5px; color: var(--ink2); }

.qty-step {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.qty-step button {
  width: 36px;
  height: 34px;
  border: 0;
  background: #fff;
  color: var(--ink2);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.qty-step button:active { background: #F2F3F5; }
.qty-step input {
  width: 46px;
  height: 34px;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  -moz-appearance: textfield;
}
.qty-step input::-webkit-outer-spin-button,
.qty-step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.buy-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 12px;
  font-size: 12.5px;
  color: var(--ink2);
}
.buy-total b { font-size: 16px; font-weight: 700; color: var(--red); }
.buy-total b .woocommerce-Price-currencySymbol { font-size: 13px; }

.buy-confirm {
  width: 100%;
  height: 49px;
  border: 0;
  border-radius: 14px;
  background: var(--red);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 12px 26px -16px rgba(226, 58, 46, .95);
  transition: .16s;
}
.buy-confirm:active { transform: scale(.99); }
.buy-confirm[disabled] { opacity: .55; pointer-events: none; }
.buy-confirm .buy-ico { display: none; align-items: center; }
.buy-confirm .buy-ico svg { width: 18px; height: 18px; }
.buy-confirm .buy-ico.is-cart { display: inline-flex; }
.buy-confirm.is-buy .buy-ico.is-cart { display: none; }
.buy-confirm.is-buy .buy-ico.is-buy { display: inline-flex; }
.buy-confirm.is-busy { opacity: .7; pointer-events: none; }

@media (max-width: 360px) {
  .bar-cta { font-size: 11px; gap: 4px; padding: 0 6px; }
  .bar-cta svg { width: 14px; height: 14px; }
  .sheet-bar .bar-ico--wa { font-size: 11px; gap: 4px; padding: 0 6px; }
  .sheet-bar .bar-ico--wa svg { width: 14px; height: 14px; }
  .sheet-bar .bar-ico--wa span { font-size: 11px; }
}
