/* ============================================================
   Custom Woo · Most Hired Furniture (namespaced .cww-mh)

   Defaults match the category page card. Everything here can be
   changed in the widget's Style tab:
   - typography (font, size, weight, line height...) is written WITHOUT
     !important at two-class specificity, so Elementor's
     "{{WRAPPER}} .cww-mh .x" (three classes) always wins;
   - sizes, spacing and colours go through CSS variables or
     Elementor selectors that carry !important themselves.
   ============================================================ */
.cww-mh{
  --mh-accent:var(--cww-magenta); --mh-text:var(--cww-ink); --mh-panel:var(--cww-panel);
  --mh-btn-bg:var(--cww-gold); --mh-btn-color:var(--cww-ink); --mh-dot:var(--cww-teal);
  --mh-gap:30px; --mh-pv:var(--mh-pv-m,2);
  --mh-panel-r:28px; --mh-panel-top:clamp(22px,3.4vw,40px);
  --mh-card-r:35px; --mh-bar-h:40px;
  --mh-dot-size:14px; --mh-dot-active:48px; --mh-dot-gap:10px;
  position:relative; padding:0 0 30px; margin:0; color:var(--mh-text) !important;
}
@media (min-width:768px){.cww-mh{--mh-pv:var(--mh-pv-t,2)}}
@media (min-width:1100px){.cww-mh{--mh-pv:var(--mh-pv-d,4)}}
/* Orientation: phones turned sideways and tablets in landscape get their own cards-per-view */
@media (orientation:landscape) and (max-height:500px) and (max-width:1000px){.cww-mh{--mh-pv:var(--mh-pv-ml,3)}}
@media (orientation:landscape) and (min-width:900px) and (max-width:1366px) and (min-height:501px) and (pointer:coarse){.cww-mh{--mh-pv:var(--mh-pv-tl,3)}}

/* Panel starts partway down the heading, as in the reference design */
.cww-mh::before{content:"";position:absolute;inset:var(--mh-panel-top) 0 0;background:var(--mh-panel);border-radius:var(--mh-panel-r);z-index:0}
.cww-mh > *{position:relative;z-index:1}

/* ---------- Heading ---------- */
.cww-mh .cww-mh__head{text-align:center;padding:0 16px;margin:0 0 28px}
.cww-mh .cww-mh__title{
  font-family:"Plus Jakarta Sans", system-ui, sans-serif;font-weight:700;font-size:clamp(2rem,5.6vw,3.6rem);
  line-height:1.1;letter-spacing:-.01em;margin:0 0 10px !important;padding:0 !important;
  color:var(--mh-text) !important;text-align:inherit;
}
.cww-mh .cww-mh__hl{color:var(--mh-accent) !important}
.cww-mh .cww-mh__sub{max-width:900px;margin:0 var(--mh-sub-mr,auto) 0 var(--mh-sub-ml,auto) !important;font-size:clamp(1rem,2.1vw,1.2rem);line-height:1.5;color:var(--mh-text) !important;text-align:inherit}

/* ---------- Slider ---------- */
.cww-mh .cww-mh__wrap{position:relative;padding:0 14px}
.cww-mh__track{display:flex;gap:var(--mh-gap);overflow-x:auto !important;overflow-y:hidden !important;scroll-snap-type:x mandatory;scroll-behavior:smooth;-webkit-overflow-scrolling:touch;scrollbar-width:none;list-style:none !important;margin:-6px 0 -18px !important;padding:6px var(--mh-track-px,6px) 24px !important;scroll-padding-inline:var(--mh-track-px,6px);touch-action:pan-x pan-y;overscroll-behavior-x:contain;cursor:grab}
.cww-mh__track::-webkit-scrollbar{display:none}
.cww-mh__slide{flex:0 0 calc((100% - var(--mh-gap) * (var(--mh-pv) - 1)) / var(--mh-pv));min-width:0;scroll-snap-align:start;display:flex;margin:0 !important;padding:0 !important;list-style:none !important}
.cww-mh__slide::before,.cww-mh__slide::marker{content:none !important}

/* ---------- Card: same as the category page card (.wccp-product-card) ---------- */
.cww-mh .cww-mh__card{
  display:flex;flex-direction:column;position:relative;width:100%;height:100%;min-width:0;
  background:#fff;border:0;border-radius:var(--mh-card-r) !important;overflow:hidden;
  box-shadow:0 0 3px rgba(0,0,0,.08),0 3px 16px rgba(0,0,0,.06);
  color:#111827;font-family:"Plus Jakarta Sans", system-ui, sans-serif;
  font-size:16px;font-weight:500;line-height:1.4;
}

/* Image: fixed-height box, whole photo shown (never cropped); background matched to the photo by JS */
.cww-mh .cww-mh__img{
  display:flex;align-items:center;justify-content:center;position:relative;width:100%;
  height:min(var(--mh-img-h,280px),90cqw);padding:20px;box-sizing:border-box;overflow:hidden;
  background:#f8f8f8;transition:background-color .3s ease;
  border-radius:var(--mh-card-r) var(--mh-card-r) 0 0;
}
.cww-mh .cww-mh__img img{
  display:block;width:100% !important;height:100% !important;max-width:100% !important;max-height:100% !important;min-width:0;
  object-fit:contain;object-position:center;margin:0 !important;padding:0 !important;border-radius:0 !important;
  transform:scale(1);transition:transform .4s cubic-bezier(.4,0,.2,1);-webkit-user-drag:none;user-select:none;
}
.cww-mh .cww-mh__card:hover .cww-mh__img img{transform:scale(1.05)}

/* Title, price and the quantity / button row */
.cww-mh .cww-mh__body{display:flex;flex-direction:column;gap:12px;flex:1 1 auto;padding:10px 20px}
.cww-mh .cww-mh__body > a{color:inherit !important;text-decoration:none !important}
.cww-mh .cww-mh__name{
  margin:0 !important;padding:0 !important;font-family:"Plus Jakarta Sans", system-ui, sans-serif;
  font-size:16px;font-weight:600;line-height:1.4;color:#111827 !important;min-height:44px;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.cww-mh .cww-mh__price{display:block;margin:0 !important;font-size:16px;font-weight:600;line-height:1.2;color:#c2185b !important}
.cww-mh .cww-mh__prefix{color:#666 !important;font-weight:400;margin-right:4px}
.cww-mh .cww-mh__amount{font-weight:600}
.cww-mh .cww-mh__amount,.cww-mh .cww-mh__amount *{color:#c2185b !important}
.cww-mh .cww-mh__amount *{font-weight:inherit !important;font-size:inherit !important;font-family:inherit !important;line-height:inherit !important}

/* Bottom row: "Quantity" box | amber button */
.cww-mh .cww-mh__bar{
  display:flex;align-items:stretch;gap:10px;margin-top:auto;padding:8px 0 10px;
  background:transparent !important;border:0;cursor:default;
}
.cww-mh .cww-mh__qty{
  flex:1 1 0;width:100% !important;min-width:0 !important;height:var(--mh-bar-h) !important;min-height:0 !important;
  margin:0 !important;padding:0 14px 1px;box-sizing:border-box;
  border:2px solid #e0e0e0 !important;border-radius:0 0 0 20px !important;
  background:#fff !important;box-shadow:none !important;outline:0 !important;text-align:left !important;
  font-family:"Plus Jakarta Sans", system-ui, sans-serif;font-size:15px;font-weight:500;
  color:#243638 !important;line-height:1;-moz-appearance:textfield;appearance:textfield;transition:border-color .2s;
}
.cww-mh .cww-mh__qty::placeholder{color:#8c8c8c;opacity:1;font-weight:500}
.cww-mh .cww-mh__qty::-webkit-outer-spin-button,.cww-mh .cww-mh__qty::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.cww-mh .cww-mh__qty:focus{border-color:#00838f !important}
.cww-mh .cww-mh__qty:disabled{opacity:.55}
.cww-mh .cww-mh__btn{
  position:relative;flex:1 1 0;min-width:0;display:flex;align-items:center;justify-content:center;
  height:var(--mh-bar-h) !important;min-height:0;margin:0 !important;padding:0 14px;box-sizing:border-box;
  border:0 !important;border-radius:0 0 20px 0 !important;
  background:#ffc107 !important;color:#1a1a1a !important;box-shadow:0 2px 4px rgba(255,193,7,.3) !important;
  font-family:"Plus Jakarta Sans", system-ui, sans-serif;font-size:13px;font-weight:600;line-height:1;
  white-space:nowrap;text-align:center;text-decoration:none !important;cursor:pointer;overflow:hidden;
  transition:background-color .2s ease,box-shadow .2s ease,transform .2s ease,color .2s ease;
}
.cww-mh .cww-mh__btn:hover:not(:disabled),.cww-mh .cww-mh__btn:focus-visible{background:#ffb300 !important;color:#1a1a1a !important;box-shadow:0 4px 12px rgba(255,193,7,.4) !important;transform:translateY(-1px)}
.cww-mh .cww-mh__btn--out,.cww-mh .cww-mh__btn--out:hover{opacity:.55;cursor:not-allowed;transform:none !important}
.cww-mh .cww-mh__btn--full{border-radius:0 0 20px 20px !important;background:#e0e7ff !important;color:#3730a3 !important;box-shadow:none !important}
.cww-mh .cww-mh__btn--full:hover,.cww-mh .cww-mh__btn--full:focus-visible{background:#c7d2fe !important;color:#3730a3 !important;box-shadow:none !important}
.cww-mh .cww-mh__icon{flex-shrink:0;pointer-events:none}

/* Button states: the label keeps its place (so the width never changes) and the state text sits on top */
.cww-mh .cww-mh__btn-label{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-width:0}
.cww-mh .cww-mh__btn-state{position:absolute;inset:0;display:none;align-items:center;justify-content:center;gap:6px;padding:0 6px;overflow:hidden;white-space:nowrap;pointer-events:none}
.cww-mh .cww-mh__btn.is-loading .cww-mh__btn-label,
.cww-mh .cww-mh__btn.is-success .cww-mh__btn-label,
.cww-mh .cww-mh__btn.is-error .cww-mh__btn-label{visibility:hidden}
.cww-mh .cww-mh__btn.is-loading .cww-mh__btn-state,
.cww-mh .cww-mh__btn.is-success .cww-mh__btn-state,
.cww-mh .cww-mh__btn.is-error .cww-mh__btn-state{display:flex}
.cww-mh .cww-mh__btn:disabled{cursor:default;transform:none !important}
.cww-mh .cww-mh__btn.is-loading{opacity:.75}
.cww-mh .cww-mh__btn.is-loading .cww-mh__btn-state::after{content:"";flex:0 0 auto;width:10px;height:10px;border:2px solid rgba(0,0,0,.3);border-top-color:#000;border-radius:50%;animation:cww-mh-spin .6s linear infinite}
.cww-mh .cww-mh__btn.is-success,.cww-mh[style] .cww-mh__btn.is-success{background:#22c55e !important;color:#fff !important;box-shadow:0 4px 12px rgba(34,197,94,.35) !important}
.cww-mh .cww-mh__btn.is-error,.cww-mh[style] .cww-mh__btn.is-error{background:#ef4444 !important;color:#fff !important}
@keyframes cww-mh-spin{to{transform:rotate(360deg)}}

/* Colour overrides from the widget (inline variables) */
.cww-mh[style*="--mh-accent"] .cww-mh__amount,.cww-mh[style*="--mh-accent"] .cww-mh__amount *{color:var(--mh-accent) !important}
.cww-mh[style*="--mh-btn-bg"] .cww-mh__btn:not(.cww-mh__btn--full):not(.is-success):not(.is-error){background:var(--mh-btn-bg) !important}
.cww-mh[style*="--mh-btn-color"] .cww-mh__btn:not(.cww-mh__btn--full):not(.is-success):not(.is-error){color:var(--mh-btn-color) !important}

/* ---------- Dots & arrows ---------- */
.cww-mh .cww-mh__dots{display:flex;justify-content:center;align-items:center;gap:var(--mh-dot-gap);margin-top:24px}
.cww-mh .cww-mh__dot{width:var(--mh-dot-size);height:var(--mh-dot-size);padding:0 !important;margin:0 !important;border:2px solid var(--mh-dot) !important;border-radius:999px !important;background:transparent !important;cursor:pointer;transition:width .3s cubic-bezier(.22,.61,.36,1),background .3s ease}
.cww-mh .cww-mh__dot[aria-current="true"]{width:var(--mh-dot-active);background:var(--mh-dot) !important}

.cww-mh .cww-mh__arrow{position:absolute;top:35%;z-index:2;width:44px;height:44px;padding:0 !important;border:0 !important;border-radius:50% !important;background:#fff !important;color:var(--mh-dot) !important;box-shadow:var(--cww-shadow) !important;display:flex;align-items:center;justify-content:center;cursor:pointer}
.cww-mh .cww-mh__arrow:disabled{opacity:.35;cursor:default}
.cww-mh .cww-mh__arrow--prev{left:0}
.cww-mh .cww-mh__arrow--next{right:0}
.cww-mh .cww-mh__arrow svg{width:45%;height:45%}

.cww-mh__empty{text-align:center;padding:20px;color:var(--cww-ink-soft)}
.cww-mh .screen-reader-text{position:absolute !important;width:1px;height:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);white-space:nowrap}

/* ---------- Hide links injected after "Add to quote" (WooCommerce "View cart", quote plugins) ---------- */
.cww-mh .cww-mh__bar > :not(.cww-mh__qty):not(.cww-mh__btn):not(label),
.cww-mh a.added_to_cart, .cww-mh .wc-forward,
.cww-mh [class*='wpcft'], .cww-mh .wpc-fly-cart-btn,
.cww-mh .yith-ywraq-add-button, .cww-mh [class*='ywraq'], .cww-mh [class*='view-quote']{display:none !important}

/* ---------- Drag ---------- */
.cww-mh.is-dragging .cww-mh__track{scroll-snap-type:none !important;scroll-behavior:auto !important;cursor:grabbing;user-select:none}
.cww-mh.is-dragging .cww-mh__track a{pointer-events:none}

/* ---------- Fit to the card's own width (iPad & other in-between sizes) ----------
   The card is a size container, so the button row adapts to how wide each card
   actually is (depends on screen width AND cards per view), not just the screen. */
.cww-mh .cww-mh__card{container-type:inline-size;container-name:cwwmhcard}
.cww-mh .cww-mh__btn-label{max-width:100%}
@container cwwmhcard (max-width:300px){
  .cww-mh .cww-mh__body{padding:10px 14px;gap:10px}
  .cww-mh .cww-mh__btn{padding:0 8px;font-size:12px}
  .cww-mh .cww-mh__btn-label{gap:4px}
  .cww-mh .cww-mh__icon{width:12px;height:12px}
  .cww-mh .cww-mh__qty{padding:0 10px 1px;font-size:14px}
}
@container cwwmhcard (max-width:270px){
  /* Not enough room side by side: stack quantity above the button, both full width */
  .cww-mh .cww-mh__bar{flex-direction:column;gap:6px;padding:4px 0 12px}
  .cww-mh .cww-mh__qty,.cww-mh .cww-mh__btn{flex:0 0 auto;width:100% !important;border-radius:8px !important}
  .cww-mh .cww-mh__btn{font-size:13px}
  .cww-mh .cww-mh__img{height:min(var(--mh-img-h,280px),220px);padding:14px}
  .cww-mh .cww-mh__name{font-size:14px;min-height:40px}
  .cww-mh .cww-mh__price{font-size:15px}
}
@container cwwmhcard (max-width:200px){
  .cww-mh .cww-mh__body{padding:10px;gap:8px}
  .cww-mh .cww-mh__img{height:min(var(--mh-img-h,280px),160px);padding:10px}
  .cww-mh .cww-mh__name{font-size:13px;min-height:36px}
  .cww-mh .cww-mh__price{font-size:14px}
  .cww-mh .cww-mh__btn{padding:0 6px;font-size:12px}
}
@container cwwmhcard (max-width:150px){
  .cww-mh .cww-mh__icon{display:none}
  .cww-mh .cww-mh__btn{font-size:11px;white-space:normal;line-height:1.15}
}

/* ---------- Phones in landscape: short screen, so keep the whole card in view ---------- */
@media (orientation:landscape) and (max-height:500px) and (max-width:1000px){
  .cww-mh{--mh-gap:14px;--mh-card-r:20px;--mh-bar-h:35px}
  .cww-mh .cww-mh__card .cww-mh__img{height:min(var(--mh-img-h,280px),90cqw,40vh);padding:10px}
  .cww-mh .cww-mh__head{margin-bottom:18px}
  .cww-mh .cww-mh__title{font-size:clamp(1.6rem,4vw,2.4rem)}
}

/* ---------- Tablets & phones (same as the category card; Style-tab values override these) ---------- */
@media (max-width:992px){.cww-mh{--mh-gap:24px}}
@media (max-width:768px){
  .cww-mh .cww-mh__btn{font-size:12px}
  .cww-mh .cww-mh__icon{width:12px;height:12px}
}
@media (max-width:600px){
  .cww-mh{--mh-gap:14px;--mh-card-r:16px;--mh-bar-h:35px;--mh-img-h:160px}
  .cww-mh .cww-mh__wrap{padding:0 8px}
  .cww-mh .cww-mh__img{padding:10px}
  .cww-mh .cww-mh__body{padding:12px;gap:8px}
  .cww-mh .cww-mh__name{font-size:13px;min-height:36px}
  .cww-mh .cww-mh__price{font-size:14px}
  .cww-mh .cww-mh__bar{flex-direction:column;gap:6px;padding:4px 0 0}
  .cww-mh .cww-mh__qty,.cww-mh .cww-mh__btn{flex:0 0 auto;width:100% !important;border-radius:8px !important}
  .cww-mh .cww-mh__btn{padding:0 10px;font-size:12px}
  .cww-mh .cww-mh__qty{font-size:16px;padding:0 10px 1px} /* 16px stops iPhone zooming in */
  .cww-mh .cww-mh__qty::placeholder{font-size:13px}
}
@media (max-width:400px){
  .cww-mh{--mh-gap:10px}
  .cww-mh .cww-mh__body{padding:10px}
  .cww-mh .cww-mh__btn{padding:0 6px;font-size:11px}
  .cww-mh .cww-mh__btn-label{gap:4px}
}
@media (max-width:340px){
  .cww-mh .cww-mh__btn{white-space:normal;line-height:1.15}
}
@media (prefers-reduced-motion:reduce){.cww-mh__track{scroll-behavior:auto}}
