/* P-Clips Purchase Module — v1.0.1
   Clean, robust UI that stops the product page looking like a patchwork quilt.
*/

:root{
  --pclips-blue: #0B57D0;
  --pclips-blue-hover: #0A4EC0;
  --pclips-border: #E5E7EB;
  --pclips-text: #111827;
  --pclips-muted: #4B5563;

  --pclips-radius: 10px;
  --pclips-radius-lg: 14px;

  --pclips-control-h: 52px;
}

.pclips-purchase{
  font-family: 'Figtree', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  display: block;
  width: 100%;
}

/* ---------- Layout safety (prevents theme/Elementor overlay issues) ----------
   Some themes apply positioning/floats to Woo add-to-cart buttons/forms.
   This module must always occupy normal document flow so the next container
   cannot "shoot up" and overlap it.
*/

.pclips-purchase__form{
  position: static !important;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  float: none !important;
  clear: both !important;
  margin: 0 !important;
}

.pclips-purchase__form::after{
  content: "";
  display: block;
  clear: both;
}

.pclips-purchase__form .pclips-ctas{
  margin-top: 0;
  width: 100%;
}

.pclips-purchase__form button,
.pclips-purchase__form input,
.pclips-purchase__form .pclips-qty,
.pclips-purchase__form .pclips-ctas{
  position: static !important;
}

.pclips-fulfilment{
  clear: both;
}

/* ---------- Quantity stepper (Nike-style) ---------- */
.pclips-qty{
  display:flex;
  align-items: stretch;
  width: 160px;
  height: var(--pclips-control-h);
  border: 1px solid var(--pclips-border);
  border-radius: var(--pclips-radius);
  overflow: hidden;
  background: #fff;
  box-sizing: border-box;
}

.pclips-qty__btn{
  width: 52px;
  min-width: 52px;
  height: 100% !important;
  align-self: stretch !important;

  border: 0;
  background: #fff;
  cursor: pointer;
  font-size: 22px !important;
  line-height: 1;
  color: var(--pclips-text) !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  transition: background-color .15s ease;
}

.pclips-qty__btn:hover{ background: #F3F4F6; }
.pclips-qty__btn:active{ background: #E5E7EB; }

.pclips-qty__input{
  flex: 1 1 auto;
  border: 0 !important;
  border-left: 1px solid var(--pclips-border) !important;
  border-right: 1px solid var(--pclips-border) !important;
  background: transparent !important;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--pclips-text);
  outline: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  height: 100% !important;
  line-height: var(--pclips-control-h) !important;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

/* Kill any browser spinner controls */
.pclips-qty__input::-webkit-outer-spin-button,
.pclips-qty__input::-webkit-inner-spin-button{
  -webkit-appearance: none;
  margin: 0;
}

.pclips-qty__btn:focus-visible,
.pclips-qty__input:focus-visible{
  outline: 2px solid #111827;
  outline-offset: -2px;
}

.pclips-qty__real{
  display:none !important;
}

/* ---------- Buttons (side-by-side) ---------- */
.pclips-ctas{
  display: flex;
  flex-direction: row;
  gap: 12px;
  margin-top: 0;
  width: 100%;
  align-items: stretch;
}

/* Harden button box-model so theme rules cannot collapse them on mobile */
.pclips-cta{
  min-height: var(--pclips-control-h) !important;
  height: var(--pclips-control-h) !important;
  border-radius: 4px !important;

  font-family: 'Figtree', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  letter-spacing: .2px !important;

  line-height: 1.15 !important;
  padding: 0 18px !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;

  flex: 1 1 0;
  box-sizing: border-box !important;

  transition: background-color .50s ease, color .50s ease, border-color .50s ease, box-shadow .50s ease, transform .20s ease;
}

/* Theme defence */
.pclips-purchase .cart .single_add_to_cart_button,
.pclips-purchase .cart button.single_add_to_cart_button{
  float: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.pclips-cta--primary{
  background: var(--pclips-blue) !important;
  border: 1px solid var(--pclips-blue) !important;
  color: #fff !important;
}

.pclips-cta--primary:hover{
  background: var(--pclips-blue-hover) !important;
}

.pclips-cta--secondary{
  background: #051633 !important;
  color: #fff !important;
  border: 1px solid #051633 !important;
}

.pclips-cta--secondary:hover{
  background: #0c2550 !important;
  border-color: #0c2550 !important;
}

.pclips-cta:hover{
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
  transform: translateY(-1px);
}
.pclips-cta:active{
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(0,0,0,.06);
}

.pclips-cta:focus-visible{
  outline: 2px solid #111827;
  outline-offset: 2px;
}

/* ---------- Fulfilment / stock messaging (unified, not pill-ish) ---------- */
.pclips-fulfilment{
  margin-top: 14px;
}

.pclips-fulfilment__card{
  border-radius: 10px;
}

/* Container line */
.pclips-stock{
  display:flex;
  flex-wrap: wrap;
  align-items: baseline;          /* more natural text alignment */
  gap: 6px;                       /* tighter: feels like one sentence */
  margin: 0;

  font-size: 14px;                /* closer to typical theme body sizing */
  line-height: 1.35;
  color: #051633;
}

/* “Badge” becomes just a lead-in label */
.pclips-stock__badge{
  display:inline;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

/* Main text */
.pclips-stock__text{
  font-weight: 600;
  color: #051633;
}

/* IN STOCK */
.pclips-stock--in{
  background: #E7F6EC;
  border-radius: 10px;
  padding: 12px;
}

.pclips-stock--in .pclips-stock__badge{
  color: #166534;
}

/* BACKORDER / OUT */
.pclips-stock--out{
  background: #FFF3E6;
  border-radius: 10px;
  padding: 12px;
}

.pclips-stock--out .pclips-stock__badge{
  color: #92400E;
}

/* ---------- Responsive tightening ---------- */
@media (max-width: 480px){
  .pclips-qty{
    width: 100%;
  }
  .pclips-qty__btn{
    width: 56px;
    min-width: 56px;
  }
  .pclips-ctas{
    flex-direction: column;
    gap: 10px;
  }
  .pclips-ctas .pclips-cta{
    width: 100% !important; /* ensures full-width stacked buttons */
  }
}
