/* HG Store presentation layer. WooCommerce owns totals, checkout fields and gateway behavior. */

body.hg-store-checkout {
  --hg-checkout-primary: #1748a5;
  --hg-checkout-ink: #172d45;
  --hg-checkout-muted: #60758b;
  --hg-checkout-line: #dce5ef;
  --hg-checkout-soft: #f4f7fb;
  --hg-checkout-radius: 16px;
  background: #f6f8fb;
  color: var(--hg-checkout-ink);
}

body.hg-store-checkout :is(.woocommerce,.wp-block-woocommerce-cart,.wp-block-woocommerce-checkout) {
  font-family: inherit;
  line-height: 1.6;
  color: var(--hg-checkout-ink);
  max-width: 1280px;
  margin-inline: auto;
}

body.hg-store-checkout :is(.woocommerce,.wp-block-woocommerce-cart,.wp-block-woocommerce-checkout) * {
  box-sizing: border-box;
}

body.hg-store-checkout :is(h1,h2,h3) {
  color: var(--hg-checkout-ink);
  line-height: 1.25;
  letter-spacing: -.02em;
}

body.hg-store-checkout :is(.woocommerce-cart-form,.cart_totals,#customer_details,#order_review,.wc-block-cart__main,.wc-block-cart__sidebar,.wc-block-checkout__main,.wc-block-checkout__sidebar) {
  padding: clamp(16px,2.5vw,30px);
  border: 1px solid var(--hg-checkout-line);
  border-radius: var(--hg-checkout-radius);
  background: #fff;
  box-shadow: 0 4px 18px #172d4505;
}

body.hg-store-checkout :is(.woocommerce-cart-form,.cart-collaterals) {
  margin-bottom: 24px;
}

body.hg-store-checkout .woocommerce .cart-collaterals .cart_totals {
  float: none;
  width: 100%;
  max-width: 540px;
  margin-left: auto;
}

body.hg-store-checkout .woocommerce table.shop_table {
  border: 0;
  border-collapse: collapse;
  margin: 0 0 20px;
  line-height: 1.6;
}

body.hg-store-checkout .woocommerce table.shop_table :is(th,td) {
  padding: 18px 12px;
  border: 0;
  border-bottom: 1px solid var(--hg-checkout-line);
  vertical-align: middle;
  font-size: 14px;
}

body.hg-store-checkout .woocommerce table.shop_table thead th {
  background: var(--hg-checkout-soft);
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--hg-checkout-muted);
}

body.hg-store-checkout .woocommerce table.cart img {
  width: 76px;
  min-width: 54px;
  aspect-ratio: 1;
  object-fit: contain;
  border: 1px solid var(--hg-checkout-line);
  border-radius: 10px;
  background: var(--hg-checkout-soft);
}

body.hg-store-checkout .woocommerce a.remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #9c3945!important;
  background: #fff4f5;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
}

body.hg-store-checkout .woocommerce a.remove:hover {
  background: #9c3945;
  color: #fff!important;
}

body.hg-store-checkout :is(.woocommerce a,.wc-block-components-product-name,.wc-block-components-totals-coupon-link) {
  color: var(--hg-checkout-primary);
}

body.hg-store-checkout .woocommerce :is(a.button,button.button,input.button),
body.hg-store-checkout :is(.wc-block-components-button,.wc-block-cart__submit-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  height: auto;
  max-height: none;
  overflow: visible;
  padding: 12px 20px;
  margin-top: 0;
  border: 1px solid var(--hg-checkout-primary);
  border-radius: 9px;
  background: var(--hg-checkout-primary);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: normal;
  text-transform: none;
  text-decoration: none;
  white-space: normal;
  box-shadow: none;
  text-shadow: none;
  cursor: pointer;
}

body.hg-store-checkout :is(.woocommerce a.button,.woocommerce button.button,.wc-block-components-button):hover {
  filter: brightness(.94);
  background: var(--hg-checkout-primary);
  color: #fff;
}

body.hg-store-checkout :is(.woocommerce button.button:disabled,.wc-block-components-button:disabled) {
  opacity: .5;
  cursor: not-allowed;
}

body.hg-store-checkout .woocommerce :is(input.input-text,textarea,select,input.qty),
body.hg-store-checkout .wc-block-components-text-input input,
body.hg-store-checkout .wc-block-components-combobox .wc-block-components-combobox-control input,
body.hg-store-checkout .wc-block-components-country-input select {
  min-height: 48px;
  height: auto;
  border: 1px solid #bccbdb;
  border-radius: 9px;
  padding: 11px 13px;
  background: #fff;
  color: var(--hg-checkout-ink);
  font: inherit;
  line-height: 1.5;
  box-shadow: none;
  max-width: 100%;
}

body.hg-store-checkout .woocommerce input.qty {
  width: 75px;
  padding-inline: 8px;
  text-align: center;
}

body.hg-store-checkout .woocommerce .coupon {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

body.hg-store-checkout .woocommerce .coupon #coupon_code {
  width: 180px;
  margin: 0;
}

body.hg-store-checkout .woocommerce .form-row {
  padding: 0;
  margin: 0 0 18px;
}

body.hg-store-checkout .woocommerce .form-row label {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
  margin-bottom: 7px;
  color: var(--hg-checkout-ink);
}

body.hg-store-checkout .woocommerce .form-row .required {
  color: #a33143;
}

body.hg-store-checkout .woocommerce :is(.woocommerce-message,.woocommerce-info,.woocommerce-error) {
  padding: 16px 20px 16px 48px;
  border: 1px solid #cfdeef;
  border-radius: 10px;
  background: #eef5fd;
  color: #254a72;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: none;
}

body.hg-store-checkout .woocommerce :is(.woocommerce-message,.woocommerce-info):before {
  color: var(--hg-checkout-primary);
  top: 18px;
  left: 18px;
}

body.hg-store-checkout .woocommerce .woocommerce-error {
  border-color: #e9bfc5;
  background: #fff5f5;
  color: #8a2c3b;
}

body.hg-store-checkout .woocommerce .woocommerce-error:before {
  color: #a33143;
}

body.hg-store-checkout .woocommerce #payment {
  background: var(--hg-checkout-soft);
  border: 1px solid var(--hg-checkout-line);
  border-radius: 12px;
  margin-top: 22px;
}

body.hg-store-checkout .woocommerce #payment ul.payment_methods {
  padding: 20px;
  border-bottom: 1px solid var(--hg-checkout-line);
}

body.hg-store-checkout .woocommerce #payment div.payment_box {
  background: #fff;
  border: 1px solid var(--hg-checkout-line);
  border-radius: 8px;
  color: var(--hg-checkout-muted);
  font-size: 13px;
  line-height: 1.6;
}

body.hg-store-checkout .woocommerce #payment div.payment_box:before {
  border-bottom-color: var(--hg-checkout-line);
}

body.hg-store-checkout .woocommerce #payment .place-order {
  padding: 20px;
}

body.hg-store-checkout .woocommerce #place_order {
  float: none;
  width: 100%;
  margin: 14px 0 0;
  min-height: 50px;
}

body.hg-store-checkout .woocommerce :is(.woocommerce-privacy-policy-text,.woocommerce-terms-and-conditions-wrapper) {
  font-size: 12px;
  color: var(--hg-checkout-muted);
}

body.hg-store-checkout .woocommerce .col2-set :is(.col-1,.col-2) {
  float: none;
  width: 100%;
  margin: 0;
}

body.hg-store-checkout .woocommerce #order_review_heading {
  margin: 0 0 18px;
}

body.hg-store-checkout .wc-block-components-order-summary-item__image img {
  border-radius: 9px;
  object-fit: contain;
}

body.hg-store-checkout .wc-block-components-totals-wrapper {
  padding-block: 18px;
  border-color: var(--hg-checkout-line);
}

body.hg-store-checkout .wc-block-components-totals-footer-item {
  font-size: 21px;
  font-weight: 750;
}

body.hg-store-checkout .wc-block-components-quantity-selector {
  border: 1px solid #bccbdb;
  border-radius: 8px;
  min-height: 40px;
}

body.hg-store-checkout .wc-block-components-panel__button {
  color: var(--hg-checkout-primary);
  line-height: 1.5;
  min-height: 44px;
}

body.hg-store-checkout :is(a,button,input,select,textarea):focus-visible {
  outline: 3px solid var(--hg-checkout-primary);
  outline-offset: 3px;
}

body.hg-store-checkout .select2-container .select2-selection--single {
  height: 48px;
  border: 1px solid #bccbdb;
  border-radius: 9px;
  background: #fff;
}

body.hg-store-checkout .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 46px;
  padding-left: 13px;
  color: var(--hg-checkout-ink);
}

body.hg-store-checkout .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 46px;
}

@media(min-width:1000px) {
  body.hg-store-checkout .woocommerce form.checkout {
    display: grid;
    grid-template-columns: minmax(0,1.15fr) minmax(0,1fr);
    gap: 24px;
    align-items: start;
  }

  body.hg-store-checkout #customer_details {
    grid-column: 1;
    grid-row: 1/3;
  }

  body.hg-store-checkout #order_review_heading {
    grid-column: 2;
    grid-row: 1;
    margin: 0 0 -8px!important;
  }

  body.hg-store-checkout #order_review {
    grid-column: 2;
    grid-row: 2;
  }

  body.hg-store-checkout .wc-block-components-sidebar {
    position: sticky;
    top: 32px;
  }
}

@media(max-width:999px) {
  body.hg-store-checkout #order_review_heading {
    margin: 28px 0 16px!important;
  }

  body.hg-store-checkout :is(.wc-block-cart__main,.wc-block-checkout__main) {
    margin-bottom: 20px;
  }
}

@media(max-width:600px) {
  body.hg-store-checkout :is(.woocommerce,.wp-block-woocommerce-cart,.wp-block-woocommerce-checkout) {
    width: calc(100% - 19px);
    max-width: none;
    margin-inline: auto;
  }

  body.hg-store-checkout :is(.woocommerce-cart-form,.cart_totals,#customer_details,#order_review,.wc-block-cart__main,.wc-block-cart__sidebar,.wc-block-checkout__main,.wc-block-checkout__sidebar) {
    padding: 14px;
    border-radius: 12px;
  }

  body.hg-store-checkout .woocommerce table.shop_table :is(th,td) {
    padding: 12px 6px;
    font-size: 13px;
  }

  body.hg-store-checkout .woocommerce table.shop_table_responsive tr td {
    border-bottom: 1px solid #e4ebf3;
  }

  body.hg-store-checkout .woocommerce table.shop_table_responsive tr td::before {
    color: var(--hg-checkout-muted);
    font-weight: 600;
  }

  body.hg-store-checkout .woocommerce .coupon {
    width: 100%;
    margin-bottom: 12px;
  }

  body.hg-store-checkout .woocommerce .coupon #coupon_code {
    flex: 1;
    min-width: 100px;
    width: auto;
  }

  body.hg-store-checkout .woocommerce .actions>button {
    width: 100%;
  }

  body.hg-store-checkout .woocommerce .form-row-first,
  body.hg-store-checkout .woocommerce .form-row-last {
    float: none;
    width: 100%;
  }
}

/* Desktop order review must fill its grid cell, including when a theme sets a percentage width. */

@media(min-width:1000px) {
  body.hg-store-checkout .woocommerce form.checkout {
    grid-template-rows: min-content minmax(0,1fr);
    row-gap: 16px;
  }

  body.hg-store-checkout .woocommerce form.checkout #order_review_heading {
    padding: 0!important;
    border: 0!important;
    margin: 0!important;
  }

  body.hg-store-checkout .woocommerce form.checkout :is(#customer_details,#order_review,#order_review_heading) {
    float: none;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin-inline: 0;
    box-sizing: border-box;
  }

  body.hg-store-checkout .woocommerce form.checkout #order_review {
    justify-self: stretch;
  }

  body.hg-store-checkout .woocommerce #order_review table.shop_table {
    width: 100%;
    max-width: 100%;
    table-layout: auto;
  }

  body.hg-store-checkout .woocommerce #order_review :is(th,td) {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  body.hg-store-checkout .woocommerce #order_review :is(th.product-total,td.product-total,.woocommerce-Price-amount) {
    white-space: nowrap;
  }

  body.hg-store-checkout .woocommerce #order_review #payment {
    width: 100%;
    min-width: 0;
    float: none;
  }
}

/* Center the privacy copy inside the order/payment box; WooCommerce owns its text and link. */

body.hg-store-checkout .woocommerce #payment .woocommerce-privacy-policy-text {
  width: 100%;
  max-width: none;
  margin: 20px auto;
  text-align: center;
}

body.hg-store-checkout .woocommerce #payment .woocommerce-privacy-policy-text p {
  margin: 0;
  text-align: inherit;
}

body.hg-store-checkout .wc-block-checkout__terms {
  width: 100%;
  text-align: center;
}

/* PATCH033: WooCommerce thank-you / order received is part of HG Store commerce UI. */
body.hg-store-checkout .woocommerce-order{
  width:min(100%,980px);margin:0 auto 28px;color:var(--hg-checkout-ink);overflow-wrap:anywhere;
}
body.hg-store-checkout .woocommerce-order .woocommerce-notice--success,
body.hg-store-checkout .woocommerce-order .woocommerce-thankyou-order-received{
  padding:18px 22px;border:1px solid #b7dbc7;border-radius:14px;background:#edf9f1;
  color:#21613b;font-size:16px;font-weight:700;line-height:1.55;margin:0 0 20px;
}
body.hg-store-checkout .woocommerce-order .woocommerce-order-overview{
  list-style:none;display:grid;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:12px;
  padding:0!important;margin:0 0 26px!important;
}
body.hg-store-checkout .woocommerce-order .woocommerce-order-overview li{
  float:none!important;width:auto;min-width:0;margin:0!important;min-height:78px;padding:15px!important;
  border:1px solid var(--hg-checkout-line)!important;border-radius:12px;background:#fff;
  color:var(--hg-checkout-muted);font-size:12px!important;line-height:1.6;
}
body.hg-store-checkout .woocommerce-order .woocommerce-order-overview li strong{
  display:block;font-size:15px;color:var(--hg-checkout-ink);font-weight:750;
}
body.hg-store-checkout .woocommerce-order :is(.woocommerce-order-details,.woocommerce-customer-details){
  background:#fff;border:1px solid var(--hg-checkout-line);border-radius:14px;padding:clamp(15px,3vw,26px);
  margin:0 0 22px;max-width:100%;
}
body.hg-store-checkout .woocommerce-order :is(.woocommerce-order-details,.woocommerce-customer-details) h2{font-size:20px;margin:0 0 15px}
body.hg-store-checkout .woocommerce-order .woocommerce-customer-details address{
  border:0;background:var(--hg-checkout-soft);border-radius:10px;padding:16px;line-height:1.7;word-break:break-word;
}
body.hg-store-checkout .woocommerce-order table.shop_table{width:100%;max-width:100%;border:0}
body.hg-store-checkout .woocommerce-order :is(td,th){overflow-wrap:anywhere}
body.hg-store-checkout .woocommerce-order .woocommerce-table__product-name a{font-weight:650;text-decoration:none}
/* Woo login form at checkout and account sign-in consistently match HG Store. */
body.hg-store-checkout .woocommerce form.login,
body.hg-store-checkout .woocommerce form.woocommerce-form-login,
body.hg-store-checkout .woocommerce form.register{
  max-width:650px;width:100%;border:1px solid var(--hg-checkout-line);background:#fff;
  padding:clamp(18px,3vw,28px);border-radius:14px;margin:18px 0 24px;
}
body.hg-store-checkout .woocommerce form.login :is(input,button){max-width:100%}
body.hg-store-checkout .woocommerce form.login button.button{margin:10px 0 0}
body.hg-store-checkout .woocommerce form.login .woocommerce-form-login__rememberme{display:flex;align-items:center;gap:8px}
body.hg-store-checkout .woocommerce form.login .woocommerce-LostPassword{margin:10px 0 0}
/* Blocks order confirmation + checkout responsive */
body.hg-store-checkout :is(.wp-block-woocommerce-order-confirmation-status,.wp-block-woocommerce-order-confirmation-summary,.wp-block-woocommerce-order-confirmation-totals,.wp-block-woocommerce-order-confirmation-billing-address,.wp-block-woocommerce-order-confirmation-shipping-address){
  background:#fff;border:1px solid var(--hg-checkout-line);border-radius:14px;padding:clamp(16px,3vw,26px);margin-bottom:16px;
  overflow-wrap:anywhere;
}
@media(max-width:600px){
  body.hg-store-checkout .woocommerce-order .woocommerce-order-overview{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  body.hg-store-checkout .woocommerce-order .woocommerce-order-overview li{min-height:75px;padding:11px!important}
  body.hg-store-checkout .woocommerce-order :is(.woocommerce-order-details,.woocommerce-customer-details){padding:14px}
  body.hg-store-checkout .woocommerce-order .woocommerce-table{display:block;overflow-x:auto}
}
@media(max-width:350px){body.hg-store-checkout .woocommerce-order .woocommerce-order-overview{grid-template-columns:1fr}}
