/*
Theme Name: Blocksy Child
Template: blocksy
Version: 1.0
*/

/* =========================
   PRICE + VAT
========================= */
.woocommerce .price {
  line-height: 1.4;
}

.woocommerce .price > .woocommerce-Price-amount {
  font-size: 1.4rem;
  font-weight: 600;
  color: #e4572e;
  line-height: 1.2;
}

.cck-inc-vat {
  display: block;
  margin-top: 2px;
  font-size: .7em;
  opacity: .75;
  line-height: 1.2;
  font-weight: 400;
}

/* =========================
   SINGLE PRODUCT – VARIATION PRICE
========================= */
.single-product .woocommerce-variation-price .price {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
}

.single-product .woocommerce-variation-price .woocommerce-price-suffix {
  display: block !important;
  margin-top: 2px !important;
}

/* Hide duplicate parent stock line */
.single-product .product.product-type-variable .summary > p.stock,
.single-product .product.product-type-variable .summary > .stock {
  display: none !important;
}

/* =========================
   SINGLE PRODUCT – VARIATION ROW
========================= */
.single-product .single_variation_wrap .woocommerce-variation.single_variation {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  flex-wrap: nowrap !important;
  margin-bottom: 20px !important;
  min-height: 114px;
}

.single-product .single_variation_wrap .woocommerce-variation-price {
  flex: 0 0 auto !important;
  margin: 0 !important;
  width: auto !important;
  float: none !important;
}

.single-product .single_variation_wrap .woocommerce-variation-availability {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  margin-left: 30px !important;
  text-align: left !important;
  white-space: normal !important;
}

.single-product .single_variation_wrap .woocommerce-variation-availability p {
  margin: 0 !important;
}


/* =========================
   VARIATION BUTTONS (SINGLE PRODUCT)
========================= */
form.variations_form.cck-has-var-buttons table.variations select {
  position: absolute !important;
  left: -9999px !important;
}

form.variations_form .cck-var-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 8px 0 10px;
}

form.variations_form .cck-var-btn {
  background: #fff;
  border: 1px solid rgba(0,0,0,.25);
  padding: 10px;
  font-size: 16px;
  cursor: pointer;
}

form.variations_form .cck-var-btn.is-active {
  border-color: #000;
  box-shadow: 0 0 0 2px #000 inset;
}

/* =========================
   SAFE CHECKOUT
========================= */
.cck-safe-checkout {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 8px;
  background: #fff;
  min-height: 110px;
}

.cck-safe-checkout__icons {
  display: flex;
  gap: 14px;
  justify-content: center;
}

/* =========================
   LOOP VARIATION BADGES (NO LAYOUT)
========================= */
.cck-loop-variation-badges {
  margin-top: 10px;
}

.cck-var-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cck-var-badges .cck-badge {
  padding: 6px 12px;
  border: 1px solid #111;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: #111;
}
/* =========================
   SAFE CHECKOUT (stable)
========================= */
.cck-safe-checkout{
  margin-top:16px;
  padding:14px 16px;
  border:1px solid rgba(0,0,0,.12);
  border-radius:8px;
  background:#fff;
  min-height:110px;
}
.cck-safe-checkout__title{ text-align:center; font-weight:600; margin-bottom:10px; }
.cck-safe-checkout__icons{
  display:flex;
  gap:14px;
  justify-content:center;
  align-items:center;
  flex-wrap:wrap;
  min-height:54px;
}
.cck-safe-checkout__icons img{
  height:50px !important;
  width:72px; /* reserve width */
  object-fit:contain;
  display:block;
}
/* Elementor adds margin-inline-start to button:not(:first-child)
   which breaks wrapped rows (8TB looks indented). Kill it. */
form.variations_form .cck-var-buttons .cck-var-btn{
  margin: 0 !important;
  margin-inline-start: 0 !important;
  margin-left: 0 !important;
  margin-block-start: 0 !important;
}

/* (optional) belt + braces: remove Elementor button spacing var inside this area */
form.variations_form .cck-var-buttons{
  --button-spacing: 0px;
}
/* =========================
   STOCK CHIP (SIMPLE + VARIATION) — CLEAN
========================= */

/* Chip container (both simple + variation) */
.woocommerce-variation-availability .cck-delivery-msg,
.single-product .product p.stock .cck-delivery-msg{
  display:flex !important;
  width:100% !important;
  gap:5px;
  padding:8px 10px;
  border-radius:10px;
  background:rgba(0,0,0,.03);
  border:1px solid rgba(0,0,0,.08);
  color:rgba(0,0,0,.78);
  flex-wrap:wrap;
  align-items:flex-start;
  font-size:14px;
  line-height:1.25;
  min-height:52px;
}

.woocommerce-variation-availability p.stock,
.single-product .product p.stock{
  margin:0;
}

/* Left row: qty + icon */
.cck-delivery-msg .msg-qty{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-weight:600;
  white-space:nowrap;
}

/* Second line */
.cck-delivery-msg .msg-delivery{
  flex:0 0 100%;
  margin-top:2px;

}

/* CTA pill on the right */
.cck-delivery-msg .msg-time-limit{
  margin-left:auto;
  padding:3px 8px;
  border-radius:999px;
  background:rgba(228,87,46,.10);
  border:1px solid rgba(228,87,46,.22);
  color:#b5482e;
  font-weight:600;
}

/* =========================
   ICON (single source of truth)
========================= */

.cck-delivery-msg .msg-icon{
  width:18px;
  height:18px;
  border-radius:999px;
  position:relative;
  flex:0 0 18px;

  /* icon image defaults */
  background-repeat:no-repeat;
  background-position:center;
  background-size:12px 12px;
}

/* IN (default): green tick */
.cck-delivery-msg .msg-qty{ color:#0f6b2f; font-size:15px;}
.cck-delivery-msg .msg-icon{
  background-color:rgba(20,160,75,.14);
  border:1px solid rgba(20,160,75,.30);
}
.cck-delivery-msg .msg-icon:before{
  content:"✓";
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:800;
  color:#14a04b;
  line-height:1;
}

/* =========================
   STATES
========================= */

/* OUT: red + white X */
.cck-delivery-msg.cck-state-out{
  background:rgba(185,28,28,.06);
  border-color:rgba(185,28,28,.22);
}
.cck-delivery-msg.cck-state-out .msg-qty{ color:#b91c1c; }

.cck-delivery-msg.cck-state-out .msg-icon{
  background-color:#ef4444;
  border:1px solid rgba(239,68,68,.45);
}
.cck-delivery-msg.cck-state-out .msg-icon:before{
  content:"✕";
  color:#fff;
  font-weight:900;
}

/* INFO: blue + SVG clock (no mask) */
.cck-delivery-msg.cck-state-info{
  background:rgba(2,132,199,.06);
  border-color:rgba(2,132,199,.20);
}
.cck-delivery-msg.cck-state-info .msg-qty{ color:#0369a1; }

.cck-delivery-msg.cck-state-info .msg-icon{
  background-color:rgba(2,132,199,.12);
  border:1px solid rgba(2,132,199,.30);
  /* remove tick glyph */
}
.cck-delivery-msg.cck-state-info .msg-icon:before{
  content:"";
}

/* clock image (stroke uses currentColor so it matches) */
.cck-delivery-msg.cck-state-info{
  color:#0369a1;
}
.cck-delivery-msg.cck-state-info .msg-icon{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/g%3E%3C/svg%3E");
}

/* Force Woo Cart/Checkout blocks to obey the site container */
/* =========================================================
   CCK / Blocksy + WooCommerce
   Fix horizontal overflow caused by Woo notices + full-width templates
   - Stops .woocommerce-notices-wrapper going 2000px wide
   - Forces container width vars back to your 1290px setting on Woo pages
   - Adds safe overflow clipping (without breaking layouts)
========================================================= */

/* 1) Force Blocksy container variable back to your chosen width
      (Elementor full-width templates can override this) */
body.woocommerce-cart,
body.woocommerce-checkout,
body.single-product,
body.woocommerce-page {
  --theme-container-width: 1290px;
}

/* 2) Prevent tiny horizontal scrollbars in general */
html { overflow-x: clip; }

/* 3) Clamp the Woo notices wrapper to viewport + container */
.woocommerce-notices-wrapper{
  width: min(100%, var(--theme-container-width, 1290px)) !important;
  max-width: min(100%, var(--theme-container-width, 1290px)) !important;
  margin-left: auto !important;
  margin-right: auto !important;

  /* Match your site edge spacing feel */
  padding-left: 24px !important;
  padding-right: 24px !important;

  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* 4) Clamp notice boxes inside the wrapper */
.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-info,
.woocommerce-notices-wrapper .woocommerce-error{
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* 5) Make sure the notice action button can’t force overflow */
.woocommerce-notices-wrapper .button,
.woocommerce-notices-wrapper a.button{
  max-width: 100% !important;
}

/* 6) Extra guards: common Woo containers that sometimes go full-bleed */
body.woocommerce-cart .woocommerce,
body.woocommerce-checkout .woocommerce,
body.single-product .woocommerce{
  max-width: min(100%, var(--theme-container-width, 1290px)) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}

/* 7) If you’re using a mega-menu rule with 100vw anywhere, it can create
      a 1–15px overflow due to scrollbar width. This neutralises it safely. */
header [data-id="menu"] .menu > li > .sub-menu{
  width: min(1400px, calc(100% - 64px)) !important; /* DO NOT use 100vw */
}
.woocommerce-notices-wrapper {
  margin-top:20px !important;
}
/* Remove the ugly Woo notice border (and soften the whole thing) */
.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-info,
.woocommerce-notices-wrapper .woocommerce-error{
  border: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
}

.cck-cart-affiliate-promo{
  max-width: var(--theme-container-width, 1290px);
  margin: 0 auto 18px;
  padding: 0 24px;
  box-sizing: border-box;
}

.cck-cart-affiliate-promo__inner{
  display:flex;
  gap:16px;
  align-items:center;
  justify-content:space-between;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
}

.cck-cart-affiliate-promo__title{
  font-weight: 700;
  font-size: 1.05rem;
}

.cck-cart-affiliate-promo__text{
  flex: 1;
  opacity: .85;
}

.cck-cart-affiliate-promo__btn{
  display:inline-block;
  padding: 10px 14px;
  border-radius: 8px;
  background:#000;
  color:#fff !important;
  text-decoration:none !important;
  white-space:nowrap;
}

.cck-cart-affiliate-promo__btn:hover{ opacity:.9; }

@media (max-width: 768px){
  .cck-cart-affiliate-promo__inner{
    flex-direction:column;
    align-items:flex-start;
  }
}
