/* Catalog storefront: product list, product card and product page (built on shop-base.css; every rule under .cw-shop). */

/* ---------------------------------------------------------------- listing */
.cw-shop .cws-listing-head { margin-bottom: 1.5rem; }
.cw-shop .cws-listing-image { width: 100%; max-height: 16rem; object-fit: cover; border-radius: var(--cws-radius); margin-bottom: 1.25rem; }
.cw-shop .cws-listing-head h1 { margin-bottom: .5rem; }
.cw-shop .cws-listing-intro { color: var(--cws-muted); max-width: 52rem; }

.cw-shop .cws-toolbar { background: var(--cws-soft); border: 1px solid var(--cws-line); border-radius: var(--cws-radius); padding: .75rem; margin-bottom: 1rem; }
.cw-shop .cws-toolbar-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; align-items: center; }
@media (min-width: 768px) { .cw-shop .cws-toolbar-main { grid-template-columns: minmax(0, 1fr) 14rem auto; } }
.cw-shop .cws-toolbar-submit { white-space: nowrap; }

/* the search box with live suggestions (Catalog search-box partial) */
.cw-shop .cat-search-box input[type=search] { padding-left: 2.5rem; background: var(--cws-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat .85rem center; }
.cw-shop .cat-search-box [data-cw-suggest-list] { margin-top: .35rem !important; border: 1px solid var(--cws-line); border-radius: var(--cws-radius-sm); background: var(--cws-surface); overflow: hidden; box-shadow: var(--cws-shadow-hover) !important; }
.cw-shop .cat-search-box .list-group-item { border: 0; border-bottom: 1px solid var(--cws-line); padding: .6rem .85rem; color: var(--cws-ink); }
.cw-shop .cat-search-box .list-group-item:last-child { border-bottom: 0; }
.cw-shop .cat-search-box .list-group-item img { object-fit: cover; border-radius: 6px; }
.cw-shop .cat-search-box .list-group-item.active, .cw-shop .cat-search-box .list-group-item:hover { background: var(--cws-soft); color: var(--cws-ink); border-color: var(--cws-line); }

/* the filter panel */
.cw-shop .cws-filters { margin-top: .75rem; }
.cw-shop .cws-filters > summary { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; font-weight: 600; padding: .35rem .25rem; list-style: none; border-radius: 6px; }
.cw-shop .cws-filters > summary::-webkit-details-marker { display: none; }
.cw-shop .cws-filters > summary::after { content: ""; width: .5rem; height: .5rem; border-right: 2px solid var(--cws-muted); border-bottom: 2px solid var(--cws-muted); transform: rotate(45deg); margin: -.2rem 0 0 .15rem; transition: transform var(--cws-ease); }
.cw-shop .cws-filters[open] > summary::after { transform: rotate(-135deg); margin-top: .2rem; }
.cw-shop .cws-count { display: inline-flex; align-items: center; justify-content: center; min-width: 1.4rem; height: 1.4rem; padding: 0 .35rem; border-radius: 999px; background: var(--cws-accent); color: var(--cws-accent-ink); font-size: .75rem; font-weight: 700; }
.cw-shop .cws-filters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1rem 1.25rem; padding: 1rem .25rem .5rem; }
.cw-shop .cws-filter { min-width: 0; border: 0; padding: 0; margin: 0; }
.cw-shop .cws-filter > label, .cw-shop .cws-filter > legend { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; float: none; width: auto; padding: 0; }
.cw-shop .cws-range { display: flex; align-items: center; gap: .4rem; }
.cw-shop .cws-range .form-control { min-width: 0; }
.cw-shop .cws-checks { display: grid; gap: .3rem; max-height: 11rem; overflow-y: auto; padding-right: .25rem; }
.cw-shop .cws-checks .form-check { margin: 0; display: flex; align-items: center; gap: .5rem; padding-left: 0; font-weight: 400; }
.cw-shop .cws-checks .form-check-input { float: none; margin: 0; }
.cw-shop .cws-filters-actions { display: flex; gap: .5rem; padding: .75rem .25rem 0; border-top: 1px solid var(--cws-line); margin-top: .75rem; }

.cw-shop .cws-result-count { color: var(--cws-muted); font-size: .9rem; margin: 0 0 1rem; }

/* ----------------------------------------------------------- product card */
.cw-shop .cws-product-card { position: relative; display: flex; flex-direction: column; height: 100%; background: var(--cws-surface); border: 1px solid var(--cws-line); border-radius: var(--cws-radius); overflow: hidden; transition: box-shadow var(--cws-ease), transform var(--cws-ease), border-color var(--cws-ease); }
.cw-shop .cws-product-card:hover, .cw-shop .cws-product-card:focus-within { box-shadow: var(--cws-shadow-hover); border-color: color-mix(in srgb, var(--cws-line) 55%, var(--cws-ink)); }
.cw-shop .cws-product-media { position: relative; aspect-ratio: 1 / 1; background: var(--cws-soft); overflow: hidden; }
.cw-shop .cws-product-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 400ms ease; }
.cw-shop .cws-product-card:hover .cws-product-media img { transform: scale(1.04); }
.cw-shop .cws-product-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: color-mix(in srgb, var(--cws-muted) 60%, transparent); }
.cw-shop .cws-product-body { display: flex; flex-direction: column; flex: 1; gap: .4rem; padding: .9rem 1rem 1rem; }
.cw-shop .cws-product-name { font-size: 1rem; font-weight: 600; line-height: 1.35; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cw-shop .cws-product-name a { color: var(--cws-ink); text-decoration: none; }
.cw-shop .cws-product-name a:hover { color: var(--cws-accent); }
.cw-shop .cws-product-text { margin: 0; font-size: .875rem; color: var(--cws-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cw-shop .cws-product-foot { margin-top: auto; display: flex; flex-direction: column; gap: .35rem; padding-top: .35rem; }
.cw-shop .cws-product-price { display: flex; flex-direction: column; gap: .15rem; }
.cw-shop .cws-product-price .cws-price { font-size: 1.15rem; }
.cw-shop .cws-price-ref { display: block; color: var(--cws-muted); font-size: .72rem; line-height: 1.35; }
.cw-shop .cws-price-ref s { text-decoration: line-through; }
.cw-shop .cws-product-card .cat-badges { z-index: 1; }

/* the carousel block uses the card as a slide */
.cw-shop.cat-carousel__slide { padding: 0; }

/* ------------------------------------------------------------ product page */
.cw-shop .cws-product { --cws-gap: clamp(1.25rem, 3vw, 3rem); }
.cw-shop .cws-crumbs { font-size: .85rem; color: var(--cws-muted); margin-bottom: 1.25rem; }
.cw-shop .cws-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; }
.cw-shop .cws-crumbs li + li::before { content: "/"; margin-right: .35rem; opacity: .6; }
.cw-shop .cws-crumbs a { color: var(--cws-muted); text-decoration: none; }
.cw-shop .cws-crumbs a:hover { color: var(--cws-accent); text-decoration: underline; }
.cw-shop .cws-product-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--cws-gap); align-items: start; }
@media (min-width: 992px) { .cw-shop .cws-product-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } .cw-shop .cws-product-gallery { position: sticky; top: 1.5rem; } }

.cw-shop .cws-gallery-main { position: relative; aspect-ratio: 1 / 1; border-radius: var(--cws-radius); overflow: hidden; background: var(--cws-soft); border: 1px solid var(--cws-line); }
.cw-shop .cws-gallery-main img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cw-shop .cws-gallery-thumbs { display: flex; gap: .6rem; margin-top: .75rem; overflow-x: auto; padding-bottom: .25rem; }
.cw-shop .cws-gallery-thumb { flex: 0 0 4.5rem; width: 4.5rem; height: 4.5rem; padding: 0; border: 2px solid transparent; border-radius: var(--cws-radius-sm); overflow: hidden; background: var(--cws-soft); cursor: pointer; transition: border-color var(--cws-ease), opacity var(--cws-ease); opacity: .8; }
.cw-shop .cws-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cw-shop .cws-gallery-thumb:hover { opacity: 1; }
.cw-shop .cws-gallery-thumb[aria-current="true"] { border-color: var(--cws-accent); opacity: 1; }

.cw-shop .cws-product-panel h1 { margin-bottom: .75rem; }
.cw-shop .cws-product-panel .cat-badges { margin-bottom: .75rem !important; }
.cw-shop .cws-buy-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; margin: .75rem 0 .25rem; }
.cw-shop .cws-buy-price .cws-price { font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem); margin: 0; }
.cw-shop .cws-buy-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.25rem; margin: .5rem 0 1rem; font-size: .875rem; color: var(--cws-muted); }
.cw-shop .cws-lead { color: var(--cws-muted); margin-bottom: 1.25rem; }
.cw-shop .cws-buy { display: grid; gap: 1rem; padding: 1.25rem; background: var(--cws-soft); border: 1px solid var(--cws-line); border-radius: var(--cws-radius); margin: 1.25rem 0; }
.cw-shop .cws-buy-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: stretch; }
.cw-shop .cws-buy-actions .btn { flex: 1 1 12rem; min-height: 3rem; font-size: 1.02rem; }
.cw-shop .cws-buy label { font-size: .85rem; font-weight: 600; }
.cw-shop [data-cw-axes] { display: grid; gap: .9rem; }
.cw-shop [data-cw-axes] select, .cw-shop [data-cw-fallback] { width: 100%; }
.cw-shop [data-cw-axes] button:not(.cw-swatch) { border: 1px solid var(--cws-line); background: var(--cws-surface); color: var(--cws-ink); border-radius: var(--cws-radius-sm); padding: .45rem .9rem; font-weight: 550; transition: border-color var(--cws-ease), background-color var(--cws-ease); }
.cw-shop [data-cw-axes] button:not(.cw-swatch):hover:not(:disabled) { border-color: var(--cws-ink); }
.cw-shop [data-cw-axes] button[aria-pressed="true"]:not(.cw-swatch), .cw-shop [data-cw-axes] button.is-selected:not(.cw-swatch) { border-color: var(--cws-accent); box-shadow: inset 0 0 0 1px var(--cws-accent); color: var(--cws-accent); }
.cw-shop [data-cw-axes] button:disabled { opacity: .45; text-decoration: line-through; cursor: not-allowed; }

.cw-shop .cws-sections { margin-top: 1.5rem; border-top: 1px solid var(--cws-line); }
.cw-shop .cws-section { border-bottom: 1px solid var(--cws-line); }
.cw-shop .cws-section > summary { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; font-weight: 650; cursor: pointer; list-style: none; }
.cw-shop .cws-section > summary::-webkit-details-marker { display: none; }
.cw-shop .cws-section > summary::after { content: ""; width: .55rem; height: .55rem; border-right: 2px solid var(--cws-muted); border-bottom: 2px solid var(--cws-muted); transform: rotate(45deg); transition: transform var(--cws-ease); margin-right: .25rem; }
.cw-shop .cws-section[open] > summary::after { transform: rotate(-135deg); }
.cw-shop .cws-section-body { padding: 0 0 1.25rem; }
.cw-shop .cws-section-body img { max-width: 100%; height: auto; border-radius: var(--cws-radius-sm); }
.cw-shop .cws-specs { display: grid; grid-template-columns: minmax(8rem, 1fr) 2fr; margin: 0; border: 1px solid var(--cws-line); border-radius: var(--cws-radius-sm); overflow: hidden; }
.cw-shop .cws-specs dt, .cw-shop .cws-specs dd { margin: 0; padding: .65rem .9rem; border-bottom: 1px solid var(--cws-line); }
.cw-shop .cws-specs dt { background: var(--cws-soft); font-weight: 600; font-size: .9rem; }
.cw-shop .cws-specs dt:last-of-type, .cw-shop .cws-specs dd:last-of-type { border-bottom: 0; }
.cw-shop .cws-options { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .25rem; font-size: .95rem; }

.cw-shop .cat-related { margin-top: 3.5rem !important; }
.cw-shop .cat-related h2 { font-size: 1.4rem; margin-bottom: 1.25rem; }

.cw-shop p[data-cw-reference] { margin: 0 0 .5rem; font-size: .8rem; color: var(--cws-muted); line-height: 1.4; }
.cw-shop p[data-cw-reference][hidden] { display: none; }
.cw-shop [data-cw-reference-value] { text-decoration: line-through; }
.cw-shop .cws-gallery-empty { display: flex; align-items: center; justify-content: center; color: color-mix(in srgb, var(--cws-muted) 60%, transparent); }
.cw-shop .cws-buy-meta [data-cw-sku]:not([hidden])::before { content: "#"; margin-right: .15rem; opacity: .6; }
