/* TP Pricebox & Total for WooCommerce
 * - Product price yellow box (no flip) + Omnibus
 * - "Yhteensä" total box next to Add to Cart
 */

/* Default: if not init/ready, show Woo normally and hide our price box */
html:not(.tp-pricebox-init):not(.tp-pricebox-ready) .single-product .summary.entry-summary .tp-price-box{
  display:none !important;
}

/* Init/ready: our price box is used */
html.tp-pricebox-init .single-product .summary.entry-summary .tp-price-box,
html.tp-pricebox-ready .single-product .summary.entry-summary .tp-price-box{
  display:inline-block !important;
  width:auto;
  max-width:100%;
  margin:6px 0 10px;

  background:#f7c244 !important;
  color:#111 !important;
  padding:15px 25px 10px 10px;
  border-radius:5px;
  box-shadow:0 8px 24px rgba(0,0,0,.12);
}

/* In init phase: don't show an empty yellow box */
html.tp-pricebox-init .single-product .summary.entry-summary .tp-price-box[data-ready="0"]{
  opacity:0;
}
html.tp-pricebox-ready .single-product .summary.entry-summary .tp-price-box{
  opacity:1;
}

/* Hide original Woo prices only while init/ready is active */
html.tp-pricebox-init .single-product .summary.entry-summary > p.price,
html.tp-pricebox-init .single-product .summary.entry-summary > .price,
html.tp-pricebox-init .single-product .summary.entry-summary .woocommerce-variation-price,
html.tp-pricebox-init .single-product .summary.entry-summary .single_variation .price,
html.tp-pricebox-init .single-product .summary.entry-summary .omnibus-lowest-price,
html.tp-pricebox-init .single-product .summary.entry-summary #omnibus-lowest-price-container,
html.tp-pricebox-ready .single-product .summary.entry-summary > p.price,
html.tp-pricebox-ready .single-product .summary.entry-summary > .price,
html.tp-pricebox-ready .single-product .summary.entry-summary .woocommerce-variation-price,
html.tp-pricebox-ready .single-product .summary.entry-summary .single_variation .price,
html.tp-pricebox-ready .single-product .summary.entry-summary .omnibus-lowest-price,
html.tp-pricebox-ready .single-product .summary.entry-summary #omnibus-lowest-price-container{
  display:none !important;
}

/* But show Omnibus inside our box */
html.tp-pricebox-init .single-product .summary.entry-summary .tp-price-box .omnibus-lowest-price,
html.tp-pricebox-ready .single-product .summary.entry-summary .tp-price-box .omnibus-lowest-price{
  display:block !important;
}

/* Typography: prevent "discount tiny" look */
.single-product .summary.entry-summary .tp-price-box .price{
  display:block !important;
  margin:0 !important;
  line-height:1.15 !important;
}
.single-product .summary.entry-summary .tp-price-box del,
.single-product .summary.entry-summary .tp-price-box ins{
  display:inline-flex;
  align-items:baseline;
  vertical-align:baseline;
}
.single-product .summary.entry-summary .tp-price-box del{
  opacity:.75;
  margin-right:.35em;
}
.single-product .summary.entry-summary .tp-price-box ins{
  text-decoration:none !important;
}
.single-product .summary.entry-summary .tp-price-box del .amount{
  font-size:.85em;
}
.single-product .summary.entry-summary .tp-price-box ins .amount{
  font-size:1em;
}

.single-product .summary.entry-summary .tp-price-box .tax-rate{
  font-size:12px;
  margin-left:.35em;
  white-space:nowrap;
}

.single-product .summary.entry-summary .tp-price-box .omnibus-lowest-price{
  margin-top:8px !important;
  margin-bottom:0 !important;
  font-size:14px !important;
  line-height:1.35;
  color:#111 !important;
}

.single-product .summary.entry-summary .tp-price-box *,
.single-product .summary.entry-summary .tp-price-box .woocommerce-Price-amount,
.single-product .summary.entry-summary .tp-price-box .woocommerce-Price-currencySymbol{
  color:#111 !important;
}

/* --- "Yhteensä" (Total) box placement and styling --- */
.single-product .summary.entry-summary form.cart{
  display:flex;
  align-items:flex-start;
  flex-wrap:wrap;
  column-gap:20px;
  row-gap:12px;
}

/* Keep typical order: qty (default), add to cart, total box */
.single-product .summary.entry-summary .single_add_to_cart_button{ order:2; }
.single-product .summary.entry-summary .vat-total-box{ order:3; }

.single-product .summary.entry-summary .vat-total-box{
  background:#f7c244;
  color:#111;
  padding:6px 18px;
  border-radius:5px;
  margin-left:10px;
  box-shadow:0 8px 24px rgba(0,0,0,.12);
}


.cuw-total-price-section {
    display:none !important;
}


.vat-total-title{ font-size:16px; }
.vat-total-row{ font-size:22px; line-height:1.2; display:none; }
.vat-total-row .woocommerce-Price-amount{ font-weight:700; }

.vat-total-box.vat-mode-inc .vat-row-inc{ display:block; }
.vat-total-box.vat-mode-ex  .vat-row-ex{  display:block; }

@media (max-width:600px){
  .single-product .summary.entry-summary .vat-total-box{ margin-left:0; }
}
