/* Porcelain and tile: catalogs (modul-porcelain-catalog, modul-tile-catalog)
   and product pages (single-porcelain-slab-post.php, single-tile.php).
   Loaded only there (inc/products.php). Tokens come from styles.css. */

[v-cloak] { display: none !important; }

/* ---------- Catalog ---------- */
.catalog-section { padding-top: clamp(2rem, 4vw, 3.5rem); }
.catalog__layout { display: grid; grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
.catalog__filters { position: sticky; top: calc(var(--header-h) + 1.5rem); }
.catalog__filter-toggle { display: none; width: 100%; align-items: center; justify-content: space-between; padding: 1rem 0; border-bottom: 1px solid var(--line); text-align: left; color: var(--ink); }
.catalog__filter-toggle strong { font-weight: 700; font-size: var(--fs-label); letter-spacing: var(--track-label); text-transform: uppercase; }
.catalog__filter-toggle small { margin-left: .5rem; color: var(--muted); font-size: .85rem; }
.catalog__chevron { width: 1.1rem; height: 1.1rem; transition: transform .25s var(--ease); }
.catalog__chevron.is-open { transform: rotate(180deg); }

.catalog__search { position: relative; display: flex; align-items: center; margin-bottom: 1.25rem; border-bottom: 1px solid var(--ink); }
.catalog__search svg { width: 1rem; height: 1rem; flex: none; color: var(--muted); }
.catalog__search input { flex: 1; min-width: 0; padding: .75rem .5rem; border: 0; background: transparent; font: inherit; font-size: .95rem; color: var(--ink); outline: none; }
.catalog__search input::placeholder { color: var(--muted); }
.catalog__search-clear { padding: 0 .25rem; font-size: 1.3rem; line-height: 1; color: var(--muted); }

.catalog__group { border-bottom: 1px solid var(--line); }
.catalog__group-head { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: .9rem 0; text-align: left; color: var(--ink); font-size: var(--fs-label); font-weight: 700; letter-spacing: var(--track-label); text-transform: uppercase; cursor: pointer; }
.catalog__plus { font-size: 1.1rem; font-weight: 400; transition: transform .25s var(--ease); }
.catalog__group-head[aria-expanded="true"] .catalog__plus { transform: rotate(45deg); }
.catalog__options { list-style: none; margin: 0; padding: 0 0 .9rem; display: grid; gap: .15rem; }
.catalog__options .mm-filter-row { display: flex; align-items: center; gap: .6rem; padding: .3rem 0; font-size: .95rem; color: var(--text); cursor: pointer; }
.catalog__options .mm-filter-row:hover { color: var(--ink); }
.mm-filter-check { flex: none; width: 1.05rem; height: 1.05rem; border: 1px solid var(--line-strong); position: relative; }
.mm-filter-check--checked { background: var(--ink); border-color: var(--ink); }
.mm-filter-check--checked::after { content: ""; position: absolute; left: .32rem; top: .1rem; width: .3rem; height: .55rem; border: solid var(--white); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.catalog__check { display: inline-grid; color: var(--line-strong); }
.catalog__check.is-on { color: var(--ink); }
.catalog__clear { margin-top: 1rem; font-size: .85rem; text-decoration: underline; text-underline-offset: .25em; color: var(--ink); }

.catalog__toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 1.5rem; min-height: 2.5rem; }
.catalog__count { margin: 0; font-size: .9rem; color: var(--muted); }
.catalog__active { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.catalog__active-label { font-size: var(--fs-label); font-weight: 700; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--gold); cursor: pointer; }
.catalog__active button { padding: .35rem .75rem; border: 1px solid var(--line); font-size: .85rem; color: var(--ink); }
.catalog__active button:hover { border-color: var(--ink); }
.catalog__active .catalog__clear-all { border: 0; text-decoration: underline; text-underline-offset: .25em; }
.catalog__sort { display: inline-flex; align-items: center; gap: .75rem; margin-left: auto; font-size: var(--fs-label); font-weight: 700; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink); }
.catalog__sort select { padding: .45rem 2rem .45rem .75rem; border: 1px solid var(--line); background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23333' stroke-width='1.3'/%3E%3C/svg%3E") right .7rem center / .65rem no-repeat; -webkit-appearance: none; appearance: none; font: inherit; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink); }

.catalog__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: clamp(1.5rem, 2.5vw, 2.5rem) clamp(1rem, 1.6vw, 1.75rem); }
.catalog__loading { padding: 4rem 0; text-align: center; color: var(--muted); }
.catalog__empty { padding: 3rem 0; }
.catalog__empty h2 { font-size: var(--fs-h3); font-weight: 400; margin-bottom: .75rem; }
.catalog__empty p { color: var(--text); margin-bottom: 1.25rem; }

/* Product card (catalog grids) */
.catalog-card { display: grid; gap: .9rem; align-content: start; }
.catalog-card__img { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-2); }
.catalog-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.catalog-card__img:hover img { transform: scale(1.04); }
.catalog-card__badge { position: absolute; z-index: 1; top: .75rem; left: .75rem; padding: .3rem .6rem; background: var(--white); font-size: .72rem; font-weight: 700; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink); }
.catalog-card__overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(9, 4, 2, .7); color: var(--white); font-size: var(--fs-label); letter-spacing: var(--track-label); text-transform: uppercase; opacity: 0; transition: opacity .3s var(--ease); }
.catalog-card__img:hover .catalog-card__overlay { opacity: 1; }
.catalog-card__row { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.catalog-card__name { font-size: 1.1rem; line-height: 1.3; color: var(--ink); text-decoration: none; }
.catalog-card__name:hover { text-decoration: underline; text-underline-offset: .25em; }
.catalog-card__stock { margin: 0; font-size: .75rem; font-weight: 700; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--gold-dark); }
.catalog-card__meta { display: flex; flex-wrap: wrap; gap: .2rem .5rem; margin: 0; font-size: .88rem; color: var(--muted); }
.catalog-card__meta span + span::before { content: "\00b7"; margin-right: .5rem; }
.catalog-card__meta:empty { display: none; }
.catalog-card__note { margin: 0; font-size: .85rem; color: var(--text); }
.catalog-card .site-fav-heart, .product-detail .site-fav-heart { width: 2.1rem; height: 2.1rem; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--ink); }
.catalog-card .site-fav-heart[data-status="in-cart"], .product-detail .site-fav-heart[data-status="in-cart"] { background: transparent; color: var(--gold-dark); }
.infinity-sps-link { display: inline-block; margin-top: .25rem; font-size: .78rem; font-weight: 700; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--gold-dark); }

@media (max-width: 900px) {
	.catalog__layout { grid-template-columns: 1fr; gap: 1rem; }
	.catalog__filters { position: static; }
	.catalog__filter-toggle { display: flex; }
	/* Porcelain: Vue toggles .is-open; tile: viewer toggles .hidden. */
	.infinity-porcelain-viewer .catalog__filter-body:not(.is-open) { display: none; }
	.tile .catalog__filter-body.hidden { display: none; }
	.catalog__filter-body { padding-top: 1rem; }
	.catalog__sort { margin-left: 0; }
}
@media (min-width: 901px) { .tile .catalog__filter-body.hidden { display: block; } }

/* ---------- Product page ---------- */
.product-detail { padding-block: clamp(1.5rem, 3vw, 2.5rem) 0; }
.product-detail__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2rem, 5vw, 6rem); align-items: start; padding-bottom: var(--section); }
.product-detail__summary { position: sticky; top: calc(var(--header-h) + 2rem); }
.product-detail__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.product-detail__title { font-family: var(--serif); font-weight: 400; font-size: clamp(2.4rem, 4vw, 4rem); line-height: 1.02; letter-spacing: -.01em; }
.product-detail__finish { font-family: var(--sans); font-size: .5em; color: var(--muted); white-space: nowrap; }
.product-detail__code { margin-top: 1rem; color: var(--muted); }
.product-detail__code strong { color: var(--ink); font-weight: 600; }
.product-detail__stock { margin-top: .75rem; font-size: var(--fs-label); font-weight: 700; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--gold-dark); }
.product-detail__desc { margin-top: 1.5rem; color: var(--text); }
.product-detail__desc p + p { margin-top: 1em; }
.product-detail__actions { display: grid; justify-items: start; gap: 1.25rem; margin-top: 2rem; }
.product-detail__actions .asgmodul-multi-inquire-tip { margin: 0; color: var(--muted); }
.product-detail__actions .asgmodul-multi-inquire-tip a { color: var(--ink); }
.product-detail__tools { display: flex; flex-wrap: wrap; gap: 1rem 2rem; }
.product-detail__tools [data-copied]::after { content: " — link copied"; text-transform: none; letter-spacing: 0; }
.product-detail .notice { margin-top: 1.25rem; }
.product-detail--tile .entry-text h2 { font-size: var(--fs-h3); font-weight: 400; margin-top: 2.2rem; }

/* Spec list */
.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; margin: 2rem 0 0; border-top: 1px solid var(--line); }
.specs > div { padding: .85rem 0; border-bottom: 1px solid var(--line); }
.specs > .specs__wide { grid-column: 1 / -1; }
.specs dt { margin-bottom: .2rem; font-size: .72rem; font-weight: 700; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--muted); }
.specs dd { margin: 0; color: var(--ink); }
.specs dd.is-available { color: var(--gold-dark); }

/* Gallery */
.product-gallery + .product-gallery { margin-top: clamp(2.5rem, 5vw, 4rem); }
.product-gallery__label { margin-bottom: 1rem; }
.product-gallery__stage { position: relative; background: var(--surface); }
.product-gallery__main { display: block; width: 100%; padding: 0; cursor: zoom-in; }
.product-gallery__main img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.product-gallery__stage--contain .product-gallery__main img { object-fit: contain; aspect-ratio: 4 / 3; }
.product-gallery__count { position: absolute; left: 1rem; bottom: .75rem; margin: 0; padding: .2rem .55rem; background: rgba(255, 255, 255, .85); font-size: .8rem; color: var(--ink); }
.product-gallery__arrows { position: absolute; right: .75rem; bottom: .5rem; background: rgba(255, 255, 255, .85); }
.product-gallery__caption { margin: .9rem 0 0; color: var(--muted); }
.product-gallery__caption strong { font-weight: 600; color: var(--ink); margin-right: .5rem; }
.product-gallery__thumbs { display: flex; gap: .75rem; margin-top: 1rem; overflow-x: auto; scrollbar-width: thin; padding-bottom: .25rem; }
.product-gallery__thumbs button { flex: none; display: grid; gap: .3rem; justify-items: start; width: 6.5rem; padding: 0; text-align: left; opacity: .7; transition: opacity .2s; }
.product-gallery__thumbs button.is-active, .product-gallery__thumbs button:hover { opacity: 1; }
.product-gallery__thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid transparent; }
.product-gallery__thumbs button.is-active img { border-color: var(--ink); }
.product-gallery__thumb-meta { font-size: .68rem; font-weight: 700; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--muted); }
.product-gallery__thumb-name { font-size: .85rem; color: var(--ink); }
.product-gallery__lightbox { max-width: min(92vw, 1600px); max-height: 92vh; padding: 0; border: 0; background: transparent; }
.product-gallery__lightbox::backdrop { background: rgba(9, 4, 2, .85); }
.product-gallery__lightbox img { max-width: 100%; max-height: 92vh; object-fit: contain; }
.product-gallery__close { position: fixed; top: 1rem; right: 1.25rem; font-size: 2.2rem; line-height: 1; color: var(--white); }

/* Inspiration images */
.media-mosaic { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: clamp(.75rem, 1.5vw, 1.25rem); }
.media-mosaic img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.media-mosaic img:first-child { grid-column: span 2; grid-row: span 2; height: 100%; }

@media (max-width: 900px) {
	.product-detail__grid { grid-template-columns: 1fr; }
	.product-detail__summary { position: static; }
	.media-mosaic img:first-child { grid-column: auto; grid-row: auto; }
}

/* WordPress/core .gallery rules must not reach the product gallery. */
.product-detail .product-gallery { display: block; margin: 0; }
.product-detail .section-head .eyebrow { color: var(--gold); margin: 0 0 .75rem; }

/* Tile: labelled favorite, share dialog, closing band */
.product-detail__tools { align-items: center; }
.product-detail__tools .site-fav-heart--label { gap: .5rem; font-size: var(--fs-label); font-weight: 700; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink); }
.share-dialog { width: min(92vw, 32rem); padding: clamp(1.5rem, 4vw, 2.5rem); border: 0; background: var(--white); color: var(--ink); }
.share-dialog::backdrop { background: rgba(9, 4, 2, .6); }
.share-dialog p { color: var(--text); margin: .75rem 0 0; }
.share-dialog .title { color: var(--ink); margin: 0; }
.share-dialog__close { position: absolute; top: .75rem; right: 1rem; font-size: 1.8rem; line-height: 1; color: var(--ink); }
.share-dialog__row { display: flex; gap: .75rem; margin-top: 1.5rem; }
.share-dialog__row input { flex: 1; min-width: 0; padding: .7rem .8rem; border: 1px solid var(--line); font: inherit; font-size: .9rem; color: var(--ink); }
.product-detail .content-split__head .eyebrow { margin: 0; }

/* Grid children may shrink (thumb rows scroll inside instead of widening the page). */
.product-detail__grid > *, .catalog__layout > * { min-width: 0; }
.product-detail__tools .site-fav-heart--label { white-space: nowrap; }
/* Card body: even spacing under the name. */
.catalog-card__body > * { margin: 0; }
.catalog-card__body > * + * { margin-top: .35rem; }
/* Tile tools: the labelled heart gets its own line. */
.product-detail__tools { row-gap: .75rem; }
.product-detail__tools .site-fav-heart--label { flex-basis: 100%; justify-content: flex-start; }

/* MaterialMatrix controls rendered inside theme pages: use the design-system palette, not the plugin's navy. */
.mm-slab-show-more, .mm-slab-show-more:focus { color: var(--ink); border-color: var(--ink); background: transparent; letter-spacing: .08em; }
.mm-slab-show-more:hover { color: var(--white); background: var(--ink); border-color: var(--ink); }
.mm-filter-clear-btn { color: var(--muted); background: transparent; }
.mm-filter-clear-btn:hover { color: var(--ink); }

