/* VEILVÖR — fogli di stile oltre theme.json */

:root {
  --ink: var(--wp--preset--color--inchiostro, #000);
  --paper: var(--wp--preset--color--carta, #fff);
  --stone: var(--wp--preset--color--pietra, #8a8783);
  --serif: var(--wp--preset--font-family--serif, "Cormorant Garamond", serif);
  --sans: var(--wp--preset--font-family--sans, "Instrument Sans", sans-serif);
  --gutter: var(--wp--custom--gutter, clamp(16px, 4vw, 56px));
  --sezione: var(--wp--custom--sezione, clamp(96px, 14vw, 180px));
}
html { scroll-behavior: smooth; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

/* testata fissa: si inverte da sola sopra le sezioni nere */
.testata {
  position: fixed; inset: 0 0 auto; z-index: 20;
  padding: 18px var(--gutter);
  color: #fff; mix-blend-mode: difference;
}
.admin-bar .testata { top: 32px; }
@media (max-width: 782px) { .admin-bar .testata { top: 46px; } }
.testata .marchio { margin: 0; }
.testata .marchio img { height: 56px; width: auto; filter: invert(1); }
.testata .wp-block-navigation a { text-decoration: none; }
.testata .wp-block-navigation a:hover { text-decoration: underline; text-underline-offset: 5px; }
.testata .wc-block-mini-cart { color: inherit; }
.testata .wc-block-mini-cart__button { padding: 0; color: inherit; font: inherit; }
.testata .wc-block-mini-cart__button:hover { opacity: 1; }
.testata .wc-block-mini-cart__badge { color: #000; background: #fff; }
.testata .lingua { opacity: .45; font-size: 14px; }
@media (max-width: 760px) { .testata .facoltativo { display: none; } }

/* sezioni: intere, bianche o nere, con la crepa come confine */
.sezione { position: relative; padding: var(--sezione) var(--gutter); }
.sezione > * { max-width: none; }
.nero { background: var(--ink); color: var(--paper); }
.nero .wp-element-button:hover, .nero .wp-block-button__link:hover { background: var(--paper); color: var(--ink); }
.nero .wc-block-components-product-sku, .nero .has-pietra-color { color: #b9b6b1 !important; }
.crepa { position: absolute; left: 0; right: 0; top: -1px; height: 46px; width: 100%; transform: translateY(-100%); display: block; pointer-events: none; }
.wp-block-html:has(> .crepa) { margin: 0; }
.sotto-testata { padding-top: 0; }
.sotto-testata .sezione:first-child, .sotto-testata > .wp-block-woocommerce-store-notices + .sezione { padding-top: calc(92px + var(--gutter)); }

/* 1 · apertura: l'emblema 3D */
.apertura { height: 100svh; min-height: 560px; padding: 0; overflow: hidden; }
.apertura canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.apertura .motto { position: absolute; left: 0; right: 0; bottom: 6vh; text-align: center; }
.apertura .motto .titolo { font: 300 clamp(26px, 3.2vw, 40px)/1.1 var(--serif); letter-spacing: .02em; }
.apertura .motto .sotto { margin-top: 8px; color: var(--stone); font-size: 14px; }

/* 2 · manifesto */
.manifesto p { margin: 0 auto; max-width: 17ch; text-align: center; font-family: var(--serif); font-weight: 300; line-height: 1.02; }

/* 3 · capitolo: l'archivio dei disegni, come schede di sartoria */
.capitolo .testa { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; flex-wrap: wrap;
  border-bottom: 1px solid currentColor; padding-bottom: 18px; margin-bottom: clamp(40px, 6vw, 72px); }
.capitolo .testa h1, .capitolo .testa h2 { margin: 0; font-size: var(--wp--preset--font-size--capitolo); line-height: 1; }
.capitolo .testa p { margin: 0; max-width: 42ch; color: var(--stone); }
.archivio .wc-block-product-template, .archivio ul.wc-block-product-template {
  display: grid !important; grid-template-columns: repeat(6, 1fr) !important;
  gap: clamp(40px, 5vw, 72px) clamp(20px, 3vw, 40px) !important; list-style: none; margin: 0; padding: 0;
}
.archivio .wc-block-product-template > li { grid-column: span 2; width: auto !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
.archivio .wc-block-product-template > li:nth-child(5n+4) { grid-column: 2 / span 2; }
.archivio .wc-block-product-template > li:nth-child(5n+5) { grid-column: 4 / span 2; }
.archivio .wc-block-components-product-image { margin: 0; aspect-ratio: 2 / 3; display: grid; place-items: center; }
.archivio .wc-block-components-product-image a { display: contents; }
.archivio .wc-block-components-product-image img { height: 100%; width: auto; max-height: 100%; object-fit: contain;
  transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.archivio li:hover .wc-block-components-product-image img { transform: scale(1.03); }
.scheda { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 14px; row-gap: 0; margin-top: 18px; border-top: 1px solid currentColor; padding-top: 12px; }
.scheda > * { margin: 0 !important; }
.scheda .wp-block-woocommerce-product-summary, .scheda .info { grid-column: 2; color: var(--stone); font-size: 13px; }
.scheda .wc-block-components-product-summary { margin: 0; }
.scheda .info p { margin: 0; font-size: inherit; line-height: 1.5; }
.scheda .nome { font: 400 20px/1.2 var(--serif); }
.scheda .nome a { text-decoration: none; }

/* il numero d'archivio: «N° 04», ricavato dal codice del prodotto */
.wc-block-components-product-sku { font-size: 0; line-height: 1.2; color: inherit; white-space: nowrap; width: max-content; }
.wc-block-components-product-sku .wp-block-post-terms__prefix { display: none; }
.wc-block-components-product-sku strong, .wc-block-components-product-sku .sku { font: italic 300 20px/1.2 var(--serif); }
.wc-block-components-product-sku strong::before, .wc-block-components-product-sku .sku::before { content: "N° "; }

/* 4 · un pezzo da vicino, in negativo */
.vicino .wc-block-product-template { display: block; margin: 0; padding: 0; list-style: none; }
.vicino .wc-block-product-template > li { width: auto !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
.vicino .da-vicino { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.vicino .wc-block-components-product-image { margin: 0; }
.vicino .wc-block-components-product-image img { width: 100%; max-height: 82vh; object-fit: contain; filter: invert(1); }
.vicino .wc-block-components-product-sku strong, .vicino .wc-block-components-product-sku .sku { font-size: 28px; color: var(--stone); }
.vicino .nome-vicino { font: 300 clamp(56px, 8vw, 120px)/.95 var(--serif); margin: 10px 0 24px; }
.vicino .nome-vicino a { text-decoration: none; }
.vicino .righe { max-width: 34ch; margin: 0 0 36px; color: #cfcdc9; }
.vicino .wc-block-components-product-button { margin: 0; }
.vicino .wc-block-components-product-button .wp-block-button__link { border: 1px solid currentColor; background: transparent; color: inherit; padding: 14px 26px; font-size: 14px; border-radius: 0; }
.vicino .wc-block-components-product-button .wp-block-button__link:hover { background: var(--paper); color: var(--ink); }
.vicino .wc-block-components-product-button .added_to_cart { display: none; }

/* 5 · piede */
.piede { position: relative; padding: clamp(80px, 10vw, 120px) var(--gutter) 32px; text-align: center; }
.piede .logo { width: min(320px, 70vw); margin: 0 auto 56px; }
.piede .colonne { display: flex; justify-content: center; gap: clamp(20px, 4vw, 56px); flex-wrap: wrap; font-size: 14px; }
.piede .colonne a { text-decoration: none; }
.piede .colonne a:hover { text-decoration: underline; text-underline-offset: 5px; }
.piede small { display: block; margin-top: 56px; color: var(--stone); font-size: 12px; }

/* pagina prodotto: la scheda di sartoria */
.prodotto .prodotto-colonne { gap: clamp(32px, 5vw, 80px); }
.prodotto .woocommerce-product-gallery { margin: 0; opacity: 1 !important; }
.prodotto .woocommerce-product-gallery img { width: 100%; height: auto; }
.prodotto .flex-control-thumbs { display: flex; gap: 12px; margin: 14px 0 0; padding: 0; list-style: none; }
.prodotto .flex-control-thumbs li { width: 72px; }
.prodotto .flex-control-thumbs img { opacity: .45; cursor: pointer; }
.prodotto .flex-control-thumbs img.flex-active, .prodotto .flex-control-thumbs img:hover { opacity: 1; }
.prodotto .woocommerce-product-gallery__trigger { display: none; }
.prodotto .nome-prodotto { font-size: clamp(44px, 6vw, 88px); line-height: .98; margin: 6px 0 18px; }
.prodotto .prezzo { font-size: 15px; margin: 0 0 22px; }
.prodotto .breve { color: var(--stone); max-width: 38ch; margin: 0 0 28px; }
.prodotto .breve p { margin: 0; }
.prodotto .wc-block-add-to-cart-form, .prodotto form.cart { margin: 0 0 40px; }
.prodotto table.variations { width: 100%; border-collapse: collapse; margin: 0 0 18px; }
.prodotto table.variations th, .prodotto table.variations td { padding: 10px 0; border-bottom: 1px solid currentColor; text-align: left; font-weight: 400; }
.prodotto table.variations th.label { width: 7em; font-size: 13px; color: var(--stone); }
.prodotto table.variations select { width: 100%; font: inherit; color: inherit; background: transparent; border: 0; height: auto !important; min-height: 0; line-height: 1.4 !important; padding: 8px 36px 8px 0 !important; border-radius: 0; }
.prodotto table.variations td.value { position: relative; }
.prodotto .reset_variations { font-size: 12px; color: var(--stone); }
.prodotto .woocommerce-variation-price { margin: 0 0 16px; font-size: 15px; }
.prodotto .woocommerce-variation-availability { display: none; }
.prodotto .woocommerce-variation-add-to-cart { display: flex; gap: 12px; align-items: stretch; }
.prodotto .quantity input { width: 64px; font: inherit; color: inherit; background: transparent; border: 1px solid currentColor; text-align: center; }
.prodotto .single_add_to_cart_button { border: 1px solid currentColor; background: var(--ink); color: var(--paper); padding: 14px 26px; font: 400 14px/1.2 var(--sans); cursor: pointer; border-radius: 0; }
.prodotto .single_add_to_cart_button:hover { background: var(--paper); color: var(--ink); }
.prodotto .single_add_to_cart_button.disabled { opacity: .4; cursor: not-allowed; }
.prodotto .dettagli { border-top: 1px solid currentColor; padding-top: 22px; max-width: 42ch; color: var(--stone); font-size: 14px; }
.prodotto .dettagli p { margin: 0 0 10px; }

/* pagine semplici, carrello e cassa */
.pagina h1 { margin: 0 0 32px; }
.wc-block-components-button, .wc-block-components-checkout-place-order-button { border-radius: 0 !important; }
.wc-block-components-notice-banner { border-radius: 0; }
.woocommerce-store-notice { background: var(--ink); color: var(--paper); }

@media (max-width: 760px) {
  .archivio .wc-block-product-template, .archivio ul.wc-block-product-template { grid-template-columns: 1fr 1fr !important; }
  .archivio .wc-block-product-template > li, .archivio .wc-block-product-template > li:nth-child(5n+4) { grid-column: span 1; }
  .archivio .wc-block-product-template > li:nth-child(5n+5) { grid-column: 1 / span 2; width: 60% !important; justify-self: center; }
  .vicino .da-vicino { grid-template-columns: 1fr; }
  .prodotto .prodotto-colonne { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .archivio .wc-block-components-product-image img { transition: none; }
}

/* WooCommerce aggiunge da solo l'icona «account» al menu: per ora resta nascosta, il carrello basta */
.testata .wc-block-customer-account, .testata .wp-block-woocommerce-customer-account { display: none; }
