/* ==========================================================================
   HOCO REDESIGN — 99 cross-cutting integration fixes (loads last)
   ========================================================================== */

/* 1) Header is now SOLID (redesign) → stop content sitting behind it.
   Woodmart's "over-content" mode floats the header over the first section;
   put the header rows back in normal flow so content starts below them. */
.whb-header.whb-overcontent .whb-main-header{ position: relative !important; }
.whb-header.whb-overcontent .whb-general-header,
.whb-header.whb-overcontent .whb-top-bar{ position: relative !important; }
.main-page-wrapper{ margin-top: 0 !important; padding-top: 0 !important; }

/* 2) Header tool count bubbles (cart / wishlist / compare) → small neat badges */
.whb-header .wd-tools-count,
.whb-header .wd-cart-number,
.whb-header .wd-header-cart .wd-cart-number,
.whb-header [class*="-count"]:not(.count-title){
  min-width: 17px; height: 17px; line-height: 17px; padding: 0 4px;
  font-size: 10px; font-weight: 700; border-radius: 9px; text-align: center;
}

/* 3) Broaden the core card base to the real shop grid container
   (Woodmart shop grid is .products.wd-products-holder, not .wd-products) */
:is(.products, .wd-products) .product-grid-item{
  background:#fff; border:1px solid var(--hoco-line);
  border-radius:var(--hoco-radius);
}

/* 4) Product-search widget button was overlapping its input — pin it inside */
.widget_product_search form,
.woocommerce-product-search{ position: relative; display:flex; }
.widget_product_search input[type="search"],
.woocommerce-product-search input[type="search"]{ flex:1; padding-inline-end: 92px; }
.widget_product_search button,
.woocommerce-product-search button[type="submit"]{
  position:absolute; inset-inline-end:0; top:0; height:100%;
  border-radius: 0 10px 10px 0; padding:0 16px; white-space:nowrap;
}
html[dir="rtl"] .widget_product_search button,
html[dir="rtl"] .woocommerce-product-search button[type="submit"]{ border-radius: 10px 0 0 10px; }

/* 5) Product-card WhatsApp button (PHP-rendered) sits in Woodmart's hover-only
   .wd-bottom-actions — force it ALWAYS visible as a full-width green CTA. */
:is(.products,.wd-products) .product-grid-item .wd-bottom-actions{
  opacity:1 !important; visibility:visible !important; position:static !important;
  transform:none !important; height:auto !important; pointer-events:auto !important;
  display:flex; gap:8px; align-items:stretch; margin-top:10px;
  background:transparent !important; box-shadow:none !important; padding:0 !important;
}
:is(.products,.wd-products) .product-grid-item .wd-bottom-actions .wd-add-btn{ flex:1; margin:0; }
:is(.products,.wd-products) .product-grid-item .hoco-wa-order{
  display:flex !important; align-items:center; justify-content:center; gap:7px;
  width:100%; background:var(--hoco-wa) !important; color:#fff !important;
  border-radius:9px; padding:10px 12px; font-weight:700; font-size:14px; line-height:1;
  border:0; box-shadow:none;
}
:is(.products,.wd-products) .product-grid-item .hoco-wa-order:hover{ background:var(--hoco-wa-dark) !important; color:#fff !important; }
/* wishlist button in the actions row → compact square icon */
:is(.products,.wd-products) .product-grid-item .wrap-wishlist-button{ margin:0; flex:0 0 auto; }
:is(.products,.wd-products) .product-grid-item .wd-bottom-actions .wd-wishlist-btn{
  width:42px; height:100%; min-height:40px; display:flex; align-items:center; justify-content:center;
  background:#f4f1f6; border-radius:9px;
}
:is(.products,.wd-products) .product-grid-item .wd-bottom-actions .wd-wishlist-btn span{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }

/* 6) Order inside the price block: price first, then the WhatsApp button */
:is(.products,.wd-products) .product-grid-item .wrapp-product-price{ display:flex; flex-direction:column; }
:is(.products,.wd-products) .product-grid-item .wrapp-product-price > .price{ order:1; margin:0 2px 2px; }
:is(.products,.wd-products) .product-grid-item .wrapp-product-price .hoco-wa-order{ order:2; margin-top:10px; }
