/* ==========================================================================
   AlphaBuds BC — Redesign 2026 : Product cards, grids, category pages
   ========================================================================== */

/* --------------------------------------------------------------------------
   Product card — restyles Flatsome's .product-small markup in place so every
   listing (shop, category, related, upsells, shortcodes) inherits it.
   -------------------------------------------------------------------------- */
.products .product-small.col,
.products li.product{
  padding-bottom:0;
}
.products .box-vertical .box-image,
.products .product-small .box{
  height:100%;
  display:flex;flex-direction:column;
  background:#fff;
  border:1px solid var(--os-line);
  border-radius:var(--os-r-lg);
  overflow:hidden;
  transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease;
  position:relative;
}
.products .product-small .box:hover{
  border-color:#cfdccf;
  box-shadow:var(--os-sh-2);
  transform:translateY(-3px);
}

/* Image well — fixed square, contained, never cropped or stretched.
   Flatsome sizes thumbnails with a padding-top aspect wrapper and an
   absolutely-positioned <img>. Putting aspect-ratio on the <img> collapsed that
   wrapper to height:0 and threw the image a full box-height below its clipped
   parent, so the wells rendered empty. Own the ratio on the container and let
   the image fill it instead. */
.products .product-small .box-image{
  width:100%;
  aspect-ratio:1/1;
  background:#fff;
  border-bottom:1px solid var(--os-line-2);
  position:relative;
  overflow:hidden;
}
.products .product-small .box-image > div,
.products .product-small .box-image > div > a,
.products .product-small .box-image > a{
  position:absolute;inset:0;
  display:block;width:100%;height:100%;
  padding-top:0!important;   /* neutralise Flatsome's inline aspect padding */
}
.products .product-small .box-image img{
  position:absolute;inset:0;
  width:100%;height:100%;
  aspect-ratio:auto;
  object-fit:contain;
  padding:10px;
  transition:transform .35s cubic-bezier(.2,.6,.3,1);
}
.products .product-small .box:hover .box-image img{transform:scale(1.045);}

/* Text block */
.products .product-small .box-text{
  flex:1;display:flex;flex-direction:column;
  padding:13px 14px 15px;
  text-align:left;
  background:#fff;
}
.products .product-small .box-text .product-cat,
.os-card__eyebrow{
  font-size:.68rem;font-weight:750;letter-spacing:.07em;text-transform:uppercase;
  color:var(--os-muted);margin:0 0 5px;line-height:1.2;
  opacity:1;
}
.products .product-small .box-text .name,
.products .product-small .box-text .product-title{
  font-size:.94rem;font-weight:660;line-height:1.35;letter-spacing:-.01em;
  margin:0 0 8px;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
  overflow:hidden;min-height:2.7em;
}
.products .product-small .box-text .name a,
.products .product-small .box-text .product-title a{
  color:var(--os-ink);text-decoration:none;
}
.products .product-small .box:hover .name a{color:var(--os-green);}

/* Rating row */
.products .product-small .star-rating{
  margin:0 0 8px;font-size:.8em;
}
.os-card__rate{
  display:flex;align-items:center;gap:6px;margin:0 0 8px;
  font-size:.78rem;color:var(--os-muted);font-weight:600;
}

/* Price — pushed to the bottom so cards align regardless of title length */
.products .product-small .box-text .price-wrapper,
.products .product-small .box-text .price{
  margin-top:auto;
}
.products .product-small .price{
  font-size:1.06rem;font-weight:750;color:var(--os-ink);letter-spacing:-.02em;
  display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;line-height:1.3;
}
.products .product-small .price del{
  font-size:.85rem;font-weight:600;color:var(--os-muted);opacity:1;
}
.products .product-small .price ins{
  text-decoration:none;color:var(--os-red);font-weight:780;
}
.products .product-small .price .amount{color:inherit;font-weight:inherit;}

/* Add-to-cart — compact, appears as a real action not a slab */
.products .product-small .add-to-cart-button,
.products .product-small .button.primary{
  margin:11px 0 0;
}
.products .product-small .add-to-cart-button a,
.products .product-small a.button{
  display:flex;align-items:center;justify-content:center;gap:7px;
  width:100%;margin:0;
  min-height:42px;padding:11px 14px;
  border-radius:var(--os-r-pill);
  background:var(--os-green-050);
  color:var(--os-green-700);
  border:1.5px solid transparent;
  font-size:.86rem;font-weight:700;letter-spacing:0;text-transform:none;
  box-shadow:none;
  transition:background .16s ease,color .16s ease,border-color .16s ease;
}
.products .product-small .add-to-cart-button a:hover,
.products .product-small a.button:hover{
  background:var(--os-green);color:#fff;
}
.products .product-small a.button.loading{opacity:.7;}
.products .product-small a.added{background:var(--os-green);color:#fff;}

/* Quantity box inside a grid card is clutter — hide it, keep it on the PDP */
.products .product-small .quantity,
.products .product-small form.cart .quantity{display:none!important;}

/* Variation dropdown in grid: make it a real, tappable control */
.products .product-small select,
.products .product-small .variations select{
  width:100%;height:42px;margin:11px 0 0;
  border:1.5px solid var(--os-line);border-radius:var(--os-r-pill);
  background:#fff;padding:0 34px 0 15px;
  font-size:.85rem;font-weight:640;color:var(--os-ink);
  font-family:var(--os-font);
  box-shadow:none;
  appearance:none;-webkit-appearance:none;
  background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235c6a60' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 14px center;
}
.products .product-small select:focus{border-color:var(--os-green);}

/* Badges — replace the round orange blob */
.products .product-small .badge-container{
  position:absolute;top:10px;left:10px;z-index:3;margin:0;
  display:flex;flex-direction:column;gap:5px;align-items:flex-start;
}
.products .product-small .badge{
  width:auto;height:auto;margin:0;
}
.products .product-small .badge .badge-inner{
  display:inline-flex;align-items:center;
  width:auto;height:auto;min-height:0;
  padding:5px 9px;border-radius:6px;
  background:var(--os-red);color:#fff;
  font-size:.7rem;font-weight:750;letter-spacing:.03em;line-height:1;
  border:0;box-shadow:none;
}
.products .product-small .badge.on-sale .badge-inner{background:var(--os-red);}
.products .product-small .badge.new-bubble .badge-inner{background:var(--os-green);}
.products .product-small .out-of-stock-label{
  background:rgba(16,23,16,.82);color:#fff;border-radius:var(--os-r-sm);
  font-weight:700;letter-spacing:.03em;
}

/* Quick view — quieter */
.products .product-small .quick-view,
.products .product-small .quick-view-added{
  border-radius:var(--os-r-pill);font-size:.78rem;font-weight:700;
  text-transform:none;letter-spacing:0;
}

/* --------------------------------------------------------------------------
   Grid density — 4 up on desktop reads far better than 6 cramped columns
   -------------------------------------------------------------------------- */
@media (min-width:850px){
  .shop-container .products.row:not(.slider) > .product-small,
  .products.row-small:not(.slider) > .product-small{
    flex-basis:25%;max-width:25%;
  }
}
@media (min-width:1400px){
  .shop-container .products.row:not(.slider) > .product-small{
    flex-basis:20%;max-width:20%;
  }
}
@media (max-width:849px) and (min-width:550px){
  .products.row:not(.slider) > .product-small{flex-basis:33.33%;max-width:33.33%;}
}
@media (max-width:549px){
  .products.row:not(.slider) > .product-small{flex-basis:50%;max-width:50%;}
  .products .product-small .box-text{padding:11px 11px 13px;}
  .products .product-small .box-text .name{font-size:.87rem;min-height:2.6em;}
  .products .product-small .price{font-size:.98rem;}
  .products .product-small a.button{font-size:.8rem;min-height:40px;}
}

/* --------------------------------------------------------------------------
   Category / shop page header
   -------------------------------------------------------------------------- */
.shop-page-title.page-title,
.category-page-title{
  background:transparent!important;border:0;padding:0;margin:0;
}
.shop-page-title .page-title-inner{display:none;}

.os-cathero{
  background:linear-gradient(180deg,var(--os-surface-2) 0%,#fff 100%);
  border-bottom:1px solid var(--os-line);
  padding:26px 0 0;
  margin-bottom:22px;
}
.os-cathero__in{max-width:var(--os-max);margin:0 auto;padding:0 20px;}
.os-crumbs{
  display:flex;align-items:center;gap:7px;flex-wrap:wrap;
  font-size:.79rem;color:var(--os-muted);margin-bottom:12px;
}
.os-crumbs a{color:var(--os-muted);text-decoration:none;font-weight:600;}
.os-crumbs a:hover{color:var(--os-green);text-decoration:underline;}
.os-crumbs span[aria-current]{color:var(--os-ink);font-weight:680;}
.os-crumbs svg{opacity:.5;flex:none;}

.os-cathero__top{
  display:flex;align-items:flex-start;justify-content:space-between;
  gap:24px;flex-wrap:wrap;
}
.os-cathero__t{
  margin:0;font-size:clamp(1.6rem,3vw,2.3rem);font-weight:780;letter-spacing:-.03em;
}
.os-cathero__count{
  display:inline-flex;align-items:center;gap:6px;margin-top:8px;
  font-size:.87rem;color:var(--os-muted);font-weight:600;
}
.os-cathero__desc{
  margin:12px 0 0;max-width:70ch;color:var(--os-ink-2);
  font-size:.95rem;line-height:1.62;
}
.os-cathero__desc.is-clamped{
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.os-cathero__more{
  background:none;border:0;padding:6px 0;margin-top:2px;cursor:pointer;
  color:var(--os-green);font-weight:700;font-size:.85rem;font-family:var(--os-font);
}
.os-cathero__more:hover{text-decoration:underline;}
.os-cathero__chips{margin-top:16px;padding-bottom:14px;}

/* Sticky sort/filter toolbar */
.os-toolbar{
  position:sticky;top:0;z-index:40;
  background:rgba(255,255,255,.96);backdrop-filter:blur(8px);
  border-bottom:1px solid var(--os-line);
  margin-bottom:22px;
}
.os-toolbar__in{
  max-width:var(--os-max);margin:0 auto;padding:11px 20px;
  display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;
}
.os-toolbar__l{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.os-toolbar__n{font-size:.86rem;color:var(--os-muted);font-weight:640;}
.os-toolbar .woocommerce-ordering{margin:0;}
.os-toolbar select,
.woocommerce-ordering select{
  height:42px;border:1.5px solid var(--os-line);border-radius:var(--os-r-pill);
  background-color:#fff;padding:0 38px 0 16px;font-size:.87rem;font-weight:650;
  color:var(--os-ink);font-family:var(--os-font);box-shadow:none;
  appearance:none;-webkit-appearance:none;
  background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235c6a60' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 15px center;
}
@media (max-width:549px){
  .os-toolbar__in{padding:9px 14px;}
  .os-toolbar__n{display:none;}
  .woocommerce-ordering select{width:100%;}
}

/* Pagination */
.woocommerce-pagination ul.page-numbers{border:0;display:flex;gap:6px;justify-content:center;}
.woocommerce-pagination li{border:0;}
.woocommerce-pagination .page-numbers{
  min-width:42px;height:42px;display:flex;align-items:center;justify-content:center;
  border:1.5px solid var(--os-line);border-radius:var(--os-r-pill);
  color:var(--os-ink-2);font-weight:680;font-size:.9rem;padding:0 12px;
  transition:border-color .16s ease,background .16s ease,color .16s ease;
}
.woocommerce-pagination .page-numbers:hover{border-color:var(--os-green);color:var(--os-green);}
.woocommerce-pagination .page-numbers.current{
  background:var(--os-green);border-color:var(--os-green);color:#fff;
}

/* SEO copy block at the foot of category pages — collapsed by default */
.os-seoblock{
  margin-top:40px;padding-top:26px;border-top:1px solid var(--os-line);
  color:var(--os-ink-2);
}
.os-seoblock__inner{
  position:relative;overflow:hidden;max-height:190px;
  transition:max-height .35s ease;
}
.os-seoblock__inner.is-open{max-height:none;}
.os-seoblock__inner:not(.is-open)::after{
  content:"";position:absolute;left:0;right:0;bottom:0;height:90px;
  background:linear-gradient(180deg,rgba(255,255,255,0),#fff 85%);
}
.os-seoblock h2{font-size:1.2rem;margin-top:1.4em;}
.os-seoblock h3{font-size:1.03rem;margin-top:1.2em;}
.os-seoblock p,.os-seoblock li{font-size:.93rem;line-height:1.68;color:var(--os-muted);}

/* Legacy category banner from the older mu-plugin layer. Our .os-cathero
   replaces it and repeats its chips, so it is pure duplication. */
.os-cat-header,
.os-cat-inner{display:none!important;}

/* Circular "callout" badges (used by related-products and some loops) get the
   same rectangular treatment as the main grid, instead of an orange blob. */
.products .badge.badge-circle,
.related .badge.badge-circle,
.products .badge-circle{
  width:auto!important;height:auto!important;min-width:0;
}
.products .badge-inner,
.related .badge-inner,
.badge-circle .badge-inner{
  width:auto!important;height:auto!important;min-height:0!important;
  border-radius:6px!important;
  padding:5px 9px!important;
  background:var(--os-red);color:#fff;
  font-size:.7rem;font-weight:750;letter-spacing:.03em;line-height:1;
  display:inline-flex;align-items:center;justify-content:center;
  border:0;box-shadow:none;
}
.products .badge.new-bubble .badge-inner,
.related .badge.new-bubble .badge-inner{background:var(--os-green);}
