/* =========================================================
   Certified-Pep Shop Grid — Flat, Figma-style
   v1.0.3 — cart button size + underline kill + alignment
========================================================= */

.cp-sg-wrap,
.cp-sg-wrap *{
  box-sizing:border-box;
}

.cp-sg-wrap{
  width:100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
  overflow-x: hidden;
}

.cp-sg-title{
  margin: 0 0 16px;
  font-family: "Plus Jakarta Sans","Inter",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  font-weight: 700;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #0F2746;
}

.cp-sg-sort{
  display:flex;
  gap: 18px;
  align-items:center;
  margin: 0 0 22px;
  font-family: "Plus Jakarta Sans","Inter",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
}

.cp-sg-sortBtn{
  appearance:none;
  background: transparent;
  border: 0;
  padding: 8px 0;
  margin: 0;
  cursor:pointer;
  font-weight: 700;
  font-size: 16px;
  color: #0F2746;
  opacity: .45;
  border-bottom: 2px solid transparent;
}

.cp-sg-sortBtn.is-active{
  opacity: 1;
  border-bottom-color: currentColor;
}

/* Grid */
.cp-sg-grid{
  display:grid;
  gap: 22px 22px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  max-width: 100%;
}

.cp-sg-item{ min-width:0; }

/* Ensure consistent vertical alignment across rows */
.cp-sg-item{
  display:flex;
  flex-direction:column;
}

.cp-sg-thumb{
  display:block;
  width: 100%;
  max-width: 100%;
  text-decoration:none !important;
  background-image:none !important;
  border: 0 !important;
}

.cp-sg-thumb img,
.cp-sg-img{
  display:block;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
}

/* Name / price */
.cp-sg-name{
  margin-top: 10px;
  font-family: "Plus Jakarta Sans","Inter",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.35;
  color: #0F2746;
  text-align:center;
}

.cp-sg-price{
  margin-top: 6px;
  font-family: "Plus Jakarta Sans","Inter",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #0F2746;
  opacity: .9;
  text-align:center;
}

/* Add to cart */
.cp-sg-cart{
  margin-top: auto;      /* align buttons across a row */
  padding-top: 10px;     /* keeps the same spacing from price */
  display:flex;          /* center buttons under product image */
  justify-content:center;
  align-items:center;
}

.cp-sg-cart .button,
.cp-sg-cart a.button,
.cp-sg-cart button.button,
.cp-sg-cart input.button{
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  width:auto !important;
  max-width: 210px;
  padding-left: 18px !important;
  padding-right: 18px !important;
  height: 42px !important;
  min-height: 42px !important;
  line-height: 42px !important;
  font-size: 14px !important;
  border-radius: 999px !important;
  text-decoration:none !important;
  background-image:none !important;
  border-bottom: 0 !important;
  white-space: nowrap;
}

/* Ultra-hard underline kill (some themes add underline via descendants/pseudo elements) */
.cp-sg-cart a,
.cp-sg-cart a *{
  text-decoration:none !important;
}
.cp-sg-cart a.button::before,
.cp-sg-cart a.button::after,
.cp-sg-cart .button::before,
.cp-sg-cart .button::after{
  content: none !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Kill underlines in all button states (themes get creative) */
.cp-sg-cart .button:hover,
.cp-sg-cart a.button:hover,
.cp-sg-cart .button:focus,
.cp-sg-cart a.button:focus,
.cp-sg-cart .button:active,
.cp-sg-cart a.button:active,
.cp-sg-cart .button:visited,
.cp-sg-cart a.button:visited,
.cp-sg-cart a.added_to_cart{
  text-decoration:none !important;
  background-image:none !important;
  border-bottom: 0 !important;
}


/* 🔒 Nuclear underline kill (some themes underline via background/box-shadow) */
.cp-sg-wrap .cp-sg-cart a,
.cp-sg-wrap .cp-sg-cart a:hover,
.cp-sg-wrap .cp-sg-cart a:focus,
.cp-sg-wrap .cp-sg-cart a:active,
.cp-sg-wrap .cp-sg-cart a:visited,
.cp-sg-wrap .cp-sg-cart .button,
.cp-sg-wrap .cp-sg-cart .button:hover,
.cp-sg-wrap .cp-sg-cart .button:focus,
.cp-sg-wrap .cp-sg-cart .button:active{
  text-decoration: none !important;
  text-decoration-line: none !important;
  text-decoration-thickness: 0 !important;
  text-decoration-color: transparent !important;
  background-image: none !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
}

/* Hide underline pseudo-elements if theme draws them */
.cp-sg-wrap .cp-sg-cart a::before,
.cp-sg-wrap .cp-sg-cart a::after,
.cp-sg-wrap .cp-sg-cart .button::before,
.cp-sg-wrap .cp-sg-cart .button::after{
  content: "" !important;
  display: none !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Make the "View cart" link match button and remove underline */
.cp-sg-wrap .cp-sg-cart a.added_to_cart{
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  height: 42px !important;
  min-height: 42px !important;
  line-height: 42px !important;
  padding: 0 18px !important;
  border-radius: 999px !important;
  text-decoration: none !important;
  background-image: none !important;
  border-bottom: 0 !important;
}

/* Pagination */
.cp-sg-pagination{ margin: 26px 0 0; }

.cp-sg-pageLinks{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items:center;
  font-family: "Plus Jakarta Sans","Inter",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
}

.cp-sg-pageLinks a,
.cp-sg-pageLinks span{
  display:inline-flex;
  min-width: 40px;
  height: 40px;
  align-items:center;
  justify-content:center;
  border-radius: 999px;
  padding: 0 14px;
  text-decoration:none !important;
}

.cp-sg-pageLinks .current{ font-weight: 800; }

/* Mobile */
@media (max-width: 820px){
  .cp-sg-wrap{ padding: 0 14px; }
  .cp-sg-title{ font-size: 26px; }
  .cp-sg-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 14px;
  }
  .cp-sg-sort{ gap: 14px; }
  .cp-sg-sortBtn{ font-size: 15px; }

  .cp-sg-cart .button,
  .cp-sg-cart a.button,
  .cp-sg-cart button.button,
  .cp-sg-cart input.button{
    max-width: 100%;
  }
}

/* =========================================================
   v1.0.6 — FINAL underline kill for Add to Cart
   Some themes simulate underlines with background-size/position
========================================================= */
.woocommerce .cp-sg-wrap .cp-sg-cart a.button,
.woocommerce-page .cp-sg-wrap .cp-sg-cart a.button,
.cp-sg-wrap .cp-sg-cart a.button,
.cp-sg-wrap .cp-sg-cart a.add_to_cart_button,
.cp-sg-wrap .cp-sg-cart a.ajax_add_to_cart,
.cp-sg-wrap .cp-sg-cart a.added_to_cart{
  text-decoration: none !important;
  text-decoration-line: none !important;
  text-decoration-thickness: 0 !important;
  text-decoration-color: transparent !important;
  border-bottom: 0 !important;
  box-shadow: none !important;

  /* kill underline-by-background tricks */
  background-image: none !important;
  background-size: 0 0 !important;
  background-position: 0 0 !important;
  background-repeat: no-repeat !important;
}

.woocommerce .cp-sg-wrap .cp-sg-cart a.button::before,
.woocommerce .cp-sg-wrap .cp-sg-cart a.button::after,
.woocommerce-page .cp-sg-wrap .cp-sg-cart a.button::before,
.woocommerce-page .cp-sg-wrap .cp-sg-cart a.button::after,
.cp-sg-wrap .cp-sg-cart a.button::before,
.cp-sg-wrap .cp-sg-cart a.button::after,
.cp-sg-wrap .cp-sg-cart a.add_to_cart_button::before,
.cp-sg-wrap .cp-sg-cart a.add_to_cart_button::after{
  content: none !important;
  display: none !important;
  border: 0 !important;
  box-shadow: none !important;
  background: none !important;
}

/* also ensure no underline on any inner spans/icons */
.cp-sg-wrap .cp-sg-cart a.button *,
.cp-sg-wrap .cp-sg-cart a.add_to_cart_button *,
.cp-sg-wrap .cp-sg-cart a.added_to_cart *{
  text-decoration: none !important;
  background-image: none !important;
  border-bottom: 0 !important;
}
