/*
 * familia-catalog – functional CSS only.
 *
 * The LOOK (colours, type, spacing, hover states, breakpoints) belongs to the Storefront child theme
 * (stream E). Everything here is layout/behaviour that would otherwise leave the markup unusable:
 * badge stacking, the swatch/facet click targets, the tooltip, the alternate-image cross-fade.
 * All of it is easily overridden – single class selectors, no !important.
 */

/* ------------------------------------------------------------------ badges */
.familia-badges { display: flex; flex-wrap: wrap; gap: .25rem; }
.familia-badges--loop { position: absolute; z-index: 2; top: .5rem; left: .5rem; pointer-events: none; }
.woocommerce ul.products li.product { position: relative; }
.familia-badge { display: inline-block; padding: .15em .5em; font-size: .75rem; line-height: 1.4; white-space: nowrap; }

/* ------------------------------------------------------------------ swatches */
.familia-swatches__list { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.familia-swatch { margin: 0; }
.familia-swatch__button {
  display: block; width: 2rem; height: 2rem; padding: 0; border: 1px solid transparent; border-radius: 50%;
  background-color: transparent; background-position: center; background-size: cover; background-repeat: no-repeat;
  cursor: pointer;
}
.familia-swatch--light .familia-swatch__button { border-color: currentColor; }
.familia-swatch--out-of-stock .familia-swatch__button { opacity: .45; }
.familia-swatch__button[aria-pressed="true"] { outline: 2px solid currentColor; outline-offset: 2px; }
.familia-swatch__label { display: block; font-size: .75rem; }
.familia-swatches--compact .familia-swatch__button { width: 1.1rem; height: 1.1rem; }
.familia-swatches--compact .familia-swatch__label { display: none; }
.familia-swatches--compact { display: flex; align-items: center; gap: .4rem; }

/* second-colour image cross-fade in listings */
.woocommerce ul.products li.product a img { position: relative; }
.familia-card__alt-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .2s; }
.woocommerce ul.products li.product:hover .familia-card__alt-image { opacity: 1; }

/* ------------------------------------------------------------------ attributes table */
.familia-attributes { width: 100%; }
.familia-attributes th { text-align: left; font-weight: 600; white-space: nowrap; }
.familia-attr-icon { vertical-align: middle; margin-right: .3em; }
.familia-attr-tip { cursor: help; border-bottom: 1px dotted currentColor; }
.familia-size-guide summary { cursor: pointer; }
.familia-size-guide dt { font-weight: 500; }

/* tooltip bubble, injected by catalog.js */
.familia-tip-bubble {
  position: absolute; z-index: 1000; max-width: 22rem; padding: .5rem .65rem;
  font-size: .8125rem; line-height: 1.45; background: #fff; color: #140e06;
  border: 1px solid rgba(20, 14, 6, .18); box-shadow: 0 4px 16px rgba(20, 14, 6, .14);
}

/* ------------------------------------------------------------------ filters */
.familia-filters__active { display: flex; flex-wrap: wrap; gap: .35rem; }
.familia-facet__list { margin: 0; padding: 0; list-style: none; }
.familia-facet__option { display: flex; align-items: center; gap: .4rem; cursor: pointer; }
.familia-facet__count { margin-left: auto; font-size: .8125rem; opacity: .7; }
.familia-facet__color { display: inline-block; width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); }
.familia-facet--icon .familia-facet__list,
.familia-facet--imageOnly .familia-facet__list { display: flex; flex-wrap: wrap; gap: .5rem; }
.familia-facet--icon .familia-facet__count,
.familia-facet--imageOnly .familia-facet__count { margin-left: .25rem; }
.familia-facet--imageOnly .familia-facet__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.familia-facet__item.is-hidden { display: none; }
.familia-facet--price label { display: inline-flex; align-items: center; gap: .3rem; }
.familia-facet--price input { width: 6rem; }

/* ------------------------------------------------------------------ CTA, stock, brands */
.familia-cta-secondary { display: inline-block; }
.familia-delivery { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.familia-brands__letters { display: flex; flex-wrap: wrap; gap: .4rem; }
.familia-brands__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .75rem; margin: 0; padding: 0; list-style: none; }
.familia-brands__link { display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.familia-brands__count { font-size: .75rem; opacity: .7; }
