/**
 * Negozio / archivi prodotto v2. Riferimento: demo Bricksify "Product filter grid".
 */
.cm-shop { --sh-bg:#f6f5f3; --sh-card:#fff; --sh-line:#e7e4df; --sh-ink:#111; --sh-muted:#6b6b6b; --sh-r:16px; --sh-ease:cubic-bezier(.4,.15,0,1); background:var(--sh-bg); color:var(--sh-ink); }
body:has(.cm-shop) { background:var(--sh-bg,#f6f5f3); }
.cm-shop__inner, .brxe-container.cm-shop__inner { max-width:none !important; align-items:stretch !important; width:min(1440px, 100% - 3.2rem) !important; margin:0 auto; padding:1.6rem 0 6.4rem; display:flex; flex-direction:column; gap:2rem; }

/* Intestazione + barra */
.cm-shop-head { width:100%; }
.cm-shop-title { font-size:clamp(2.8rem, 2.2rem + 1.6vw, 4.4rem); line-height:1.1; letter-spacing:-.015em; font-weight:500; margin:0; text-transform:none; }
.cm-shop-bar { width:100%; display:flex; flex-direction:row; justify-content:space-between; align-items:center; gap:1.2rem; flex-wrap:wrap; }
.cm-shop-count { font-size:1.4rem; color:var(--sh-muted); }
.cm-shop-actions, .brxe-block.cm-shop-actions { width:auto; display:flex; flex-direction:row; align-items:center; gap:.8rem; flex-wrap:wrap; }
\nselect.cm-sort, .cm-shop select.cm-sort { appearance:none; -webkit-appearance:none; height:4.2rem; padding:0 3.6rem 0 1.8rem; border:1px solid var(--sh-line); border-radius:999px; background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23111' d='m12 15-5-5h10z'/%3E%3C/svg%3E") no-repeat right 1.4rem center; font-size:1.4rem; color:var(--sh-ink); cursor:pointer; min-width:18rem; }
select.cm-sort:focus-visible, .cm-ftoggle:focus-visible, .cm-fgroup__title:focus-visible, .cm-fapply:focus-visible, .cm-fclose:focus-visible { outline:2px solid var(--sh-ink); outline-offset:2px; }
.cm-ftoggle { display:inline-flex; align-items:center; gap:.8rem; height:4.2rem; padding:0 1.8rem; border:1px solid var(--sh-line); border-radius:999px; background:#fff; color:var(--sh-ink); font-size:1.4rem; cursor:pointer; transition:border-color .2s; }
.cm-ftoggle:hover { border-color:var(--sh-ink); }
.cm-ftoggle__count { display:inline-grid; place-items:center; min-width:2rem; height:2rem; padding:0 .5rem; border-radius:999px; background:var(--sh-ink); color:#fff; font-size:1.1rem; }
.cm-ftoggle__count[hidden] { display:none; }

/* Layout */
.cm-shop-layout { width:100%; display:grid; grid-template-columns:28rem minmax(0,1fr); gap:2.4rem; align-items:start; }
.cm-shop-layout.is-collapsed { grid-template-columns:minmax(0,1fr); }
.cm-shop-layout.is-collapsed .cm-shop-side { display:none; }
.cm-shop-main { min-width:0; display:flex; flex-direction:column; gap:3.2rem; width:100%; }

/* Sidebar filtri */
.cm-shop-side { position:sticky; top:calc(var(--cm-hh, 120px) + 1.6rem); max-height:calc(100vh - var(--cm-hh, 120px) - 3.2rem); overflow:auto; overscroll-behavior:contain; display:flex; flex-direction:column; gap:.8rem; scrollbar-width:thin; width:100%; }
.cm-side-head, .cm-side-apply { display:none; }
.cm-active-filters:empty, .cm-active-filters:not(:has(*)) { display:none; }
.cm-active-filters { display:flex; flex-wrap:wrap; gap:.6rem; }
.cm-active-filters li, .cm-active-filters > * { list-style:none; }
.cm-active-filters button, .cm-active-filters .brx-option-text { font-size:1.2rem; }
.cm-active-filters button { display:inline-flex; align-items:center; gap:.6rem; padding:.5rem 1.1rem; border-radius:999px; background:var(--sh-ink); color:#fff; border:0; cursor:pointer; }
.cm-fgroup { background:var(--sh-card); border:1px solid var(--sh-line); border-radius:12px; width:100%; }
.cm-fgroup__title { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1.4rem 1.6rem; font-size:1.4rem; font-weight:600; cursor:pointer; user-select:none; width:100%; }
.cm-fgroup__title::after { content:''; width:.8rem; height:.8rem; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(45deg) translateY(-25%); transition:transform .25s var(--sh-ease); flex:none; }
.cm-fgroup.is-open .cm-fgroup__title::after { transform:rotate(-135deg) translateY(-25%); }
.cm-fgroup__body { display:none; padding:0 1.6rem 1.6rem; width:100%; }
.cm-fgroup.is-open .cm-fgroup__body { display:block; }
.cm-fgroup__body ul { margin:0; padding:0; list-style:none; display:flex; flex-direction:column; gap:.2rem; }
.cm-fgroup__body li { margin:0; }
.cm-fgroup__body label { display:flex; align-items:center; gap:1rem; padding:.5rem 0; font-size:1.4rem; cursor:pointer; line-height:1.3; }
.cm-fgroup__body input[type=checkbox] { width:1.7rem; height:1.7rem; margin:0; accent-color:var(--sh-ink); flex:none; }
.cm-fgroup__body .brx-option-count, .cm-fgroup__body [class*=count] { margin-left:auto; color:var(--sh-muted); font-size:1.2rem; }
.cm-fgroup__body .brx-option-text { flex:1; }
.cm-fgroup__body .brx-option-disabled, .cm-fgroup__body li.brx-option-disabled label { opacity:.4; }
.cm-fgroup__body select { width:100%; height:4.2rem; border:1px solid var(--sh-line); border-radius:8px; padding:0 1.2rem; font-size:1.4rem; background:#fff; }
.cm-fgroup__body button[class*=show-more], .cm-fgroup__body .brx-show-more, .cm-fgroup__body [class*=show-more] button { margin-top:.6rem; background:none; border:0; padding:0; font-size:1.3rem; font-weight:600; text-decoration:underline; cursor:pointer; color:var(--sh-ink); }

/* Griglia + card */
.cm-pgrid { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:1.6rem; width:100%; }
.cm-shop-layout.is-collapsed .cm-pgrid { grid-template-columns:repeat(4, minmax(0,1fr)); }
.cm-pcard { position:relative; display:flex; flex-direction:column; background:var(--sh-card); border:1px solid var(--sh-line); border-radius:var(--sh-r); overflow:hidden; min-width:0; transition:box-shadow .4s var(--sh-ease), transform .4s var(--sh-ease); }
@media (hover:hover) { .cm-pcard:hover { box-shadow:0 12px 32px -18px rgba(17,17,17,.28); } }
.cm-pc-mediawrap { width:100%; }
.cm-pc-media { position:relative; display:block; aspect-ratio:1/1; overflow:hidden; background:#fff; }
.cm-pc-img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; transition:opacity .75s var(--sh-ease), scale .75s var(--sh-ease); }
.cm-pc-img2 { opacity:0; scale:1.05; }
@media (hover:hover) {
  .cm-pcard:hover .cm-pc-img2 { opacity:1; scale:1; }
  .cm-pcard:hover .cm-pc-media:has(.cm-pc-img2) .cm-pc-img1 { opacity:0; }
  .cm-pcard:hover .cm-pc-media:not(:has(.cm-pc-img2)) .cm-pc-img1 { scale:1.04; }
}
@media (prefers-reduced-motion: reduce) { .cm-pc-img, .cm-pcard { transition:none; } }
.cm-pc-badges { position:absolute; top:1rem; left:1rem; z-index:3; pointer-events:none; }
.cm-pc-body { display:flex; flex-direction:column; gap:.4rem; padding:1.4rem 1.6rem 1.8rem; flex:1; width:100%; }
.cm-pc-brand { display:block; font-size:1.1rem; font-weight:500; letter-spacing:.12em; text-transform:uppercase; color:var(--sh-muted); }
.cm-pc-brandwrap:empty { display:none; }
.cm-pc-title { margin:0; font-size:1.5rem; font-weight:500; line-height:1.35; text-transform:none; letter-spacing:0; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.cm-pc-title a { color:inherit; }
.cm-pc-title a::after { content:''; position:absolute; inset:0; z-index:2; }
.cm-pc-price { margin-top:auto; padding-top:.4rem; font-size:1.5rem; font-weight:600; display:flex; flex-wrap:wrap; align-items:baseline; gap:.2rem .6rem; }
.cm-pc-price del { color:var(--sh-muted); font-weight:400; font-size:1.3rem; order:2; }
.cm-pc-price ins { text-decoration:none; }
.cm-pc-contact { font-weight:500; font-size:1.4rem; color:var(--sh-muted); }
.cm-pgrid > .brx-query-trail { display:none; }
.cm-pgrid:not(:has(.cm-pcard))::before { content:'Nessun prodotto corrisponde ai filtri selezionati.'; grid-column:1 / -1; padding:4.8rem 2.4rem; text-align:center; background:#fff; border:1px solid var(--sh-line); border-radius:var(--sh-r); font-size:1.5rem; color:var(--sh-muted); }

/* Paginazione */
.cm-pagination { width:100%; display:flex; justify-content:center; }
.cm-pagination ul.page-numbers { display:flex; flex-direction:row; flex-wrap:wrap; justify-content:center; gap:.6rem; margin:0; padding:0; list-style:none; }
.cm-pagination li > .page-numbers { display:inline-grid; place-items:center; min-width:4.2rem; height:4.2rem; padding:0 1.2rem; border-radius:999px; background:#fff; border:1px solid var(--sh-line); color:var(--sh-ink); font-size:1.4rem; font-weight:500; transition:border-color .2s, background .2s; }
.cm-pagination a.page-numbers:hover { border-color:var(--sh-ink); }
.cm-pagination li > .page-numbers.current { background:var(--sh-ink); border-color:var(--sh-ink); color:#fff; }
.cm-pagination li > .page-numbers.dots { background:none; border:0; }

/* Descrizione categoria */
.cm-catdesc-wrap { width:100%; }
.cm-catdesc { margin-top:3.2rem; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,2fr); gap:2.4rem 6.4rem; padding:5.6rem; background:#fff; border:1px solid var(--sh-line); border-radius:24px; }
.cm-catdesc__eyebrow { display:block; font-size:1.2rem; letter-spacing:.16em; text-transform:uppercase; color:var(--sh-muted); margin-bottom:1.2rem; }
.cm-catdesc__title { margin:0; font-size:clamp(2.6rem, 2rem + 1.2vw, 3.6rem); line-height:1.15; font-weight:500; letter-spacing:-.01em; text-transform:none; }
.cm-catdesc__head::after { content:''; display:block; width:4.8rem; height:1px; background:var(--sh-ink); margin-top:2.4rem; }
.cm-catdesc__text { position:relative; font-size:1.55rem; line-height:1.85; color:#3a3a3a; max-height:22rem; overflow:hidden; transition:max-height .5s var(--sh-ease); }
.cm-catdesc__text p { margin:0 0 1.2rem; }
.cm-catdesc__text p:last-child { margin-bottom:0; }
.cm-catdesc__text h2, .cm-catdesc__text h3 { font-size:1.8rem; margin:2rem 0 .8rem; text-transform:none; }
.cm-catdesc__text a { text-decoration:underline; }
.cm-catdesc.is-clamped .cm-catdesc__text::after { content:''; position:absolute; left:0; right:0; bottom:0; height:8rem; background:linear-gradient(rgba(255,255,255,0), #fff); pointer-events:none; }
.cm-catdesc.is-expanded .cm-catdesc__text { max-height:none; }
.cm-catdesc.is-expanded .cm-catdesc__text::after { display:none; }
.cm-catdesc__more { margin-top:1.6rem; display:inline-flex; align-items:center; gap:.6rem; background:none; border:0; border-bottom:1px solid var(--sh-ink); padding:0 0 .2rem; font-size:1.3rem; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--sh-ink); cursor:pointer; }

/* Tablet e mobile: filtri in pannello laterale */
@media (max-width: 991px) {
  .cm-shop-layout, .cm-shop-layout.is-collapsed { grid-template-columns:minmax(0,1fr); }
  .cm-shop-layout.is-collapsed .cm-shop-side { display:flex; }
  .cm-pgrid, .cm-shop-layout.is-collapsed .cm-pgrid { grid-template-columns:repeat(2, minmax(0,1fr)); }
  .cm-shop-side { position:fixed; top:0; bottom:0; left:0; z-index:100001; width:min(92vw, 40rem); max-height:none; height:100%; padding:0 1.6rem 1.6rem; background:var(--sh-bg); transform:translateX(-102%); transition:transform .4s var(--sh-ease); box-shadow:12px 0 40px rgba(0,0,0,.14); visibility:hidden; }
  .cm-shop-side.is-open { transform:none; visibility:visible; }
  .cm-side-head { display:flex; flex-direction:row; align-items:center; justify-content:space-between; position:sticky; top:0; z-index:2; background:var(--sh-bg); padding:1.6rem 0 1.2rem; width:100%; }
  .cm-side-title { font-size:1.8rem; font-weight:600; }
  .cm-fclose { display:inline-grid; place-items:center; width:4rem; height:4rem; border-radius:50%; border:1px solid var(--sh-line); background:#fff; color:var(--sh-ink); cursor:pointer; }
  .cm-side-apply { display:block; position:sticky; bottom:0; margin-top:auto; padding-top:1.2rem; background:linear-gradient(rgba(246,245,243,0), var(--sh-bg) 30%); width:100%; }
  .cm-fapply { width:100%; height:5.2rem; border-radius:999px; border:0; background:var(--sh-ink); color:#fff; font-size:1.4rem; font-weight:600; letter-spacing:.06em; text-transform:uppercase; cursor:pointer; }
  .cm-shop-backdrop { position:fixed; inset:0; z-index:100000; background:rgba(17,17,17,.45); opacity:0; transition:opacity .3s; }
  .cm-shop-backdrop.is-open { opacity:1; }
  html.cm-flock, html.cm-flock body { overflow:hidden; }
  .cm-catdesc { grid-template-columns:minmax(0,1fr); padding:3.2rem 2.4rem; }
}
@media (max-width: 600px) {
  .cm-shop__inner { width:calc(100% - 2.4rem); gap:1.6rem; }
  .cm-pgrid { gap:1rem; }
  .cm-pcard { border-radius:12px; }
  .cm-pc-body { padding:1rem 1.1rem 1.3rem; }
  .cm-pc-title { font-size:1.35rem; }
  .cm-pc-price { font-size:1.4rem; }
  .cm-pc-brand { font-size:1rem; }
  .cm-shop-bar { flex-wrap:nowrap; }
  .cm-shop-count { display:none; }
  .cm-shop-actions { width:100%; display:grid; grid-template-columns:1fr auto; }
  select.cm-sort { min-width:0; width:100% !important; }
}
.cm-shop-actions > * { width:auto !important; flex:none; }
.cm-shop-bar > .cm-shop-count { width:auto; }
.cm-shop-actions { flex-wrap:nowrap !important; justify-content:flex-end; }
.cm-shop-actions > .brxe-shortcode { width:auto !important; }
.cm-shop .screen-reader-text { position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@media (max-width: 600px) {
  .cm-shop-bar > .brxe-block.cm-shop-actions { width:100%; display:grid; grid-template-columns:minmax(0,1fr) auto; }
  .cm-shop-actions > select.cm-sort { width:100% !important; min-width:0; }
}
@media (max-width: 991px) {
  .brxe-block.cm-side-head { flex-direction:row; align-items:center; justify-content:space-between; }
  .cm-fapply { display:flex; align-items:center; justify-content:center; text-align:center; padding:0 2rem; }
}
.cm-side-head > .brxe-shortcode { width:auto; flex:none; }
.brxe-block.cm-side-head { flex-wrap:nowrap; }
/* i riquadri filtro non devono restringersi dentro la colonna a scorrimento */
.cm-shop-side > * { flex-shrink:0 !important; }
.cm-shop-side { overflow-x:hidden; overflow-y:auto; }
.cm-fgroup__body > * { max-width:100%; }
.brxe-block.cm-shop-side { flex-wrap:nowrap !important; flex-direction:column !important; }
