/* The existing JIANSU theme supplies the brand tokens and fonts. */
body.vh.jiansu-commerce-ui {
  --jiansu-flow-width: 1100px;
}

/* Storefront's alignwide negative margins otherwise undo the page's max-width. */
body.vh.jiansu-commerce-ui.woocommerce-cart .hentry,
body.vh.jiansu-commerce-ui.woocommerce-checkout .hentry {
  max-width: var(--jiansu-flow-width);
  margin-inline: auto;
  margin-bottom: 56px;
}

body.vh.jiansu-commerce-ui.woocommerce-cart .entry-content > .wp-block-woocommerce-cart.alignwide,
body.vh.jiansu-commerce-ui.woocommerce-checkout .entry-content > .wp-block-woocommerce-checkout.alignwide {
  box-sizing: border-box;
  width: 100% !important;
  max-width: 100% !important;
  margin-inline: 0 !important;
  padding-inline: 0 !important;
}

body.vh.jiansu-commerce-ui.woocommerce-cart .site-main,
body.vh.jiansu-commerce-ui.woocommerce-checkout .site-main {
  padding-top: 36px;
}

body.vh.jiansu-commerce-ui.woocommerce-cart .entry-header,
body.vh.jiansu-commerce-ui.woocommerce-checkout .entry-header {
  margin-bottom: 28px;
}

body.vh.jiansu-commerce-ui.woocommerce-cart .entry-title,
body.vh.jiansu-commerce-ui.woocommerce-checkout .entry-title {
  font-size: clamp(30px, 3.2vw, 42px);
  line-height: 1.15;
}

body.vh.jiansu-commerce-ui .wc-block-components-sidebar-layout .wc-block-components-main,
body.vh.jiansu-commerce-ui .wc-block-components-sidebar-layout .wc-block-components-sidebar {
  min-width: 0;
  padding-right: 0;
}

body.vh.jiansu-commerce-ui .wc-block-components-checkout-step__title,
body.vh.jiansu-commerce-ui .wc-block-components-title {
  font-size: 21px;
  line-height: 1.3;
}

body.vh.jiansu-commerce-ui .wc-block-components-checkout-step {
  margin-bottom: 28px;
}

body.vh.jiansu-commerce-ui .wc-block-components-product-metadata {
  color: var(--muted, #625b66);
  font-size: 14px;
  line-height: 1.5;
}

body.vh.jiansu-commerce-ui .wc-block-cart-items__row .wc-block-components-product-name {
  font-size: 17px;
  line-height: 1.4;
  font-weight: 600;
}

body.vh.jiansu-commerce-ui .wc-block-components-sidebar .wp-block-woocommerce-checkout-order-summary-block,
body.vh.jiansu-commerce-ui .wc-block-cart__sidebar .wp-block-woocommerce-cart-order-summary-block {
  overflow: visible;
  border-color: var(--line, #e6e0e5) !important;
  border-radius: 14px;
  background: var(--surface, #fdfcfd);
}

/* Give the ordinary checkout path the same brand treatment as Place Order. */
body.vh.jiansu-commerce-ui .wc-block-cart__submit-button,
body.vh.jiansu-commerce-ui .wc-block-components-checkout-place-order-button {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  padding: 14px 20px !important;
  border: 1px solid transparent;
  background: var(--accent, #b23a68) !important;
  color: #fff !important;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none !important;
  white-space: normal;
  text-align: center;
}

body.vh.jiansu-commerce-ui .wc-block-cart__submit-button:hover,
body.vh.jiansu-commerce-ui .wc-block-components-checkout-place-order-button:hover {
  background: var(--accent-hover, #992f58) !important;
}

body.vh.jiansu-commerce-ui .wc-block-cart__submit-button .wc-block-components-button__text {
  text-decoration: none;
}

/* Stripe owns the contents and height of its frames; only their host spacing changes. */
body.vh.jiansu-commerce-ui .wc-block-components-express-payment,
body.vh.jiansu-commerce-ui #wc-stripe-express-checkout-element {
  max-width: 100%;
}

body.vh.jiansu-commerce-ui .wc-block-components-express-payment--cart {
  margin-top: 20px;
}

body.vh.jiansu-commerce-ui .wc-block-cart__submit-container {
  margin-top: 16px;
}

/* Keep the short purchase panel aligned with its product image. */
body.vh.jiansu-commerce-ui.single-product div.product .summary.entry-summary {
  position: static;
  top: auto;
}

body.vh.jiansu-commerce-ui.single-product form.cart {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding-block: 18px;
}

body.vh.jiansu-commerce-ui.single-product form.cart::before,
body.vh.jiansu-commerce-ui.single-product form.cart::after {
  display: none;
}

body.vh.jiansu-commerce-ui.single-product form.cart .quantity {
  margin: 0;
}

body.vh.jiansu-commerce-ui.single-product form.cart .quantity .qty {
  box-sizing: border-box;
  width: 72px;
  height: 48px;
  padding: 10px;
}

body.vh.jiansu-commerce-ui.single-product .single_add_to_cart_button {
  width: 100%;
  min-height: 48px;
  margin: 0;
  white-space: normal;
}

body.vh.jiansu-commerce-ui.single-product .summary #wc-stripe-express-checkout-element {
  margin-top: 14px;
}

/* Match Woo Blocks' own container breakpoint and order-summary behavior. */
@container (min-width: 920px) {
  body.vh.jiansu-commerce-ui .wc-block-components-sidebar-layout.wc-block-cart,
  body.vh.jiansu-commerce-ui .wc-block-components-sidebar-layout.wc-block-checkout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 32px;
    align-items: start;
  }

  body.vh.jiansu-commerce-ui .wc-block-components-sidebar-layout .wc-block-components-main,
  body.vh.jiansu-commerce-ui .wc-block-components-sidebar-layout .wc-block-components-sidebar {
    width: auto;
    margin: 0;
  }
}

@container (max-width: 919px) {
  body.vh.jiansu-commerce-ui .wc-block-components-sidebar-layout.wc-block-cart,
  body.vh.jiansu-commerce-ui .wc-block-components-sidebar-layout.wc-block-checkout {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  body.vh.jiansu-commerce-ui .wc-block-components-sidebar-layout .wc-block-components-main,
  body.vh.jiansu-commerce-ui .wc-block-components-sidebar-layout .wc-block-components-sidebar {
    width: 100%;
    margin: 0;
  }
}

@media (max-width: 767px) {
  body.vh.jiansu-commerce-ui #content > .col-full {
    box-sizing: border-box;
    width: 100%;
    margin-inline: auto;
    padding-inline: 16px;
  }

  body.vh.jiansu-commerce-ui .site-header {
    padding-inline: 16px;
  }

  body.vh.jiansu-commerce-ui.woocommerce-cart .site-main,
  body.vh.jiansu-commerce-ui.woocommerce-checkout .site-main {
    padding-top: 28px;
  }

  body.vh.jiansu-commerce-ui.woocommerce-cart .entry-header,
  body.vh.jiansu-commerce-ui.woocommerce-checkout .entry-header {
    margin-bottom: 24px;
  }

  body.vh.jiansu-commerce-ui .wc-block-components-checkout-step__title,
  body.vh.jiansu-commerce-ui .wc-block-components-title {
    font-size: 20px;
  }

  body.vh.jiansu-commerce-ui .jiansu-language-switcher {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    padding: 3px 8px;
    font-size: 12px;
  }

  body.vh.jiansu-commerce-ui .jiansu-language-switcher summary {
    min-height: 38px;
    gap: 6px;
  }

  body.vh.jiansu-commerce-ui .jiansu-language-switcher summary > span {
    font-size: 11px;
  }
}

/* ===== Checkout redesign (v0.2) — scoped to checkout only ===== */
body.vh.jiansu-commerce-ui.woocommerce-checkout {
  --jc-card: #fff;
  --jc-radius: 16px;
  --jc-field-h: 54px;
}
body.vh.woocommerce-checkout .entry-title { text-align: left; }
body.vh.woocommerce-checkout .entry-header::after {
  content: ""; display: block; width: 44px; height: 3px; margin-top: 14px;
  border-radius: 3px; background: var(--accent);
}

/* steps become cards */
body.vh.woocommerce-checkout .wc-block-components-checkout-step {
  box-sizing: border-box; padding: 26px 28px 22px; margin-bottom: 20px;
  background: var(--jc-card); border: 1px solid var(--line);
  border-radius: var(--jc-radius); box-shadow: var(--shadow);
}
body.vh.woocommerce-checkout .wc-block-components-checkout-step__heading { margin-bottom: 18px; }
body.vh.woocommerce-checkout .wc-block-components-checkout-step__title {
  font-family: var(--display); font-size: 19px; letter-spacing: -.01em;
}
body.vh.woocommerce-checkout .wc-block-components-checkout-step__description { color: var(--muted); font-size: 13.5px; }

/* inputs */
body.vh.woocommerce-checkout .wc-block-components-text-input input,
body.vh.woocommerce-checkout .wc-blocks-components-select__select {
  border: 1px solid var(--line) !important;
  border-radius: 12px !important; background: var(--bg) !important; color: var(--ink);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s;
}
body.vh.woocommerce-checkout .wc-block-components-text-input input:focus,
body.vh.woocommerce-checkout .wc-blocks-components-select__select:focus {
  background: #fff !important; border-color: var(--accent) !important;
  box-shadow: 0 0 0 4px var(--accent-soft); outline: none;
}
body.vh.woocommerce-checkout .wc-block-components-text-input label,
body.vh.woocommerce-checkout .wc-blocks-components-select__label { color: var(--muted); }

/* payment methods as selectable cards */
body.vh.woocommerce-checkout .wc-block-components-radio-control { gap: 12px; display: grid; }
body.vh.woocommerce-checkout .wc-block-components-radio-control-accordion-option {
  box-sizing: border-box; border: 1px solid var(--line) !important; border-radius: 14px !important;
  background: #fff; transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s;
  overflow: hidden;
}
body.vh.woocommerce-checkout .wc-block-components-radio-control-accordion-option--checked-option-highlighted,
body.vh.woocommerce-checkout .wc-block-components-radio-control-accordion-option:has(input:checked) {
  border-color: var(--accent) !important; background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(178,58,104,.12);
}
body.vh.woocommerce-checkout .wc-block-components-radio-control__option { border: 0 !important; background: transparent !important; box-shadow: none !important; }
body.vh.woocommerce-checkout .wc-block-components-radio-control__label { font-weight: 600; }
body.vh.woocommerce-checkout .wc-block-components-radio-control__input:checked { border-color: var(--accent) !important; }
body.vh.woocommerce-checkout .wc-block-components-radio-control__input:checked::before { background: var(--accent) !important; }
body.vh.woocommerce-checkout .wc-block-components-radio-control-accordion-content { background: #fff; border-top: 1px solid var(--line); }

/* order summary */
@container (min-width: 920px) {
  body.vh.woocommerce-checkout .wc-block-components-sidebar { position: sticky; top: 96px; align-self: start; }
}
body.vh.woocommerce-checkout .wc-block-components-sidebar .wp-block-woocommerce-checkout-order-summary-block {
  border: 1px solid var(--line) !important; border-radius: var(--jc-radius);
  background: var(--tint) !important; box-shadow: var(--shadow); padding: 4px 0;
}
body.vh.woocommerce-checkout .wc-block-components-order-summary__button-text { font-family: var(--display); font-weight: 600; }
body.vh.woocommerce-checkout .wc-block-components-order-summary-item__image img { border-radius: 10px; }
body.vh.woocommerce-checkout .wc-block-components-totals-footer-item {
  border-top: 1px dashed rgba(178,58,104,.35); padding-top: 16px;
}
body.vh.woocommerce-checkout .wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
  font-family: var(--display); font-size: 26px; font-weight: 600; color: var(--accent);
}

/* terms + place order */
body.vh.woocommerce-checkout .wc-block-checkout__terms { color: var(--muted); font-size: 13px; }
body.vh.woocommerce-checkout .wc-block-components-checkout-place-order-button {
  min-height: 56px; border-radius: var(--pill) !important; font-size: 16px; letter-spacing: .02em;
  box-shadow: 0 14px 28px -14px rgba(178,58,104,.7);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s;
}
body.vh.woocommerce-checkout .wc-block-components-checkout-place-order-button:hover {
  transform: translateY(-1px); box-shadow: 0 18px 32px -14px rgba(178,58,104,.85);
}
body.vh.woocommerce-checkout .wc-block-checkout__actions { padding-top: 8px; }

@media (max-width: 767px) {
  body.vh.woocommerce-checkout .wc-block-components-checkout-step { padding: 20px 16px 16px; border-radius: 14px; }
  body.vh.woocommerce-checkout .wc-block-components-checkout-place-order-button { min-height: 54px; }
}

/* ===== Sitewide polish (v0.3) ===== */
body.vh .button:not(.alt),
body.vh button.button:not(.alt),
body.vh ul.products li.product .button {
  background: var(--accent) !important; color: #fff !important;
}
body.vh .button:not(.alt):hover,
body.vh button.button:not(.alt):hover,
body.vh ul.products li.product .button:hover {
  background: var(--accent-hover) !important; color: #fff !important;
  box-shadow: 0 10px 24px -12px rgba(178,58,104,.7);
}

/* accent underline under every page title (matches checkout) */
body.vh:not(.home) .entry-title::after,
body.vh .woocommerce-products-header__title::after {
  content: ""; display: block; width: 44px; height: 3px; margin-top: 14px;
  border-radius: 3px; background: var(--accent);
}
body.vh.woocommerce-checkout .entry-header::after { display: none; } /* avoid double bar */
body.vh.woocommerce-checkout .entry-title::after { display: block; }

/* sort dropdown */
body.vh .woocommerce-ordering select {
  border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 10px 14px; min-height: 44px;
}

/* About / policy pages as a card */
body.vh.page:not(.home):not(.woocommerce-cart):not(.woocommerce-checkout) .hentry .entry-content {
  box-sizing: border-box; max-width: 820px; padding: 32px 36px; background: #fff;
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
}
body.vh.page:not(.home):not(.woocommerce-cart):not(.woocommerce-checkout) .entry-content > :last-child { margin-bottom: 0; }

/* product trust bullets are links now */
body.vh .vh-trust a { color: inherit; text-decoration: none; }
body.vh .vh-trust a:hover { color: var(--accent); }
body.vh .vh-trust a:hover i { color: var(--accent); }

/* keep the floating language button off the footer text */
body.vh .site-footer { padding-bottom: 88px; }
@media (max-width: 767px) {
  body.vh.page .hentry { margin-bottom: 24px; }
  body.vh.page:not(.home):not(.woocommerce-cart):not(.woocommerce-checkout) .hentry .entry-content { padding: 22px 18px; }
}
