/* ============================================================
   Shop: catalogo, scheda prodotto e riepilogo della richiesta.
   Usa i colori e i caratteri di stile.css.
   ============================================================ */
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* intestazione: carrello accanto al menu */
.header-tools { display: flex; align-items: center; gap: 8px; order: 3; }
.site-header .nav { order: 2; margin-left: auto; }
.nav a[aria-current="page"] { color: var(--robbia); }
.cart-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 2px; background: var(--paper); color: var(--ink); font: 600 .74rem/1 var(--font-body); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; transition: border-color .2s var(--ease); }
.cart-btn:hover { border-color: var(--robbia); }
.cart-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--robbia); color: var(--on-robbia); display: inline-grid; place-items: center; font-size: .72rem; letter-spacing: 0; }
.cart-count.bump { animation: bump .35s var(--ease); }
@keyframes bump { 50% { transform: scale(1.25); } }
@media (max-width: 900px) {
  .site-header .nav { margin-left: 0; }
  .header-tools { margin-left: auto; }
}
@media (max-width: 520px) {
  .cart-label { display: none; }
  .header-tools { gap: 6px; }
  .cart-btn { padding: 0 10px; }
}

/* apertura */
.shop-head { padding-block: clamp(48px, 7vw, 88px) clamp(32px, 5vw, 56px); border-bottom: 1px solid var(--line); }
.shop-head h1 { font-size: clamp(2.6rem, 6vw, 5rem); font-weight: 400; margin-top: 18px; max-width: 16ch; }
.shop-head h1 em { color: var(--robbia); }
.shop-head .intro { color: var(--ink-soft); max-width: 60ch; margin-top: 22px; font-size: 1.05rem; }
.how { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.how li { display: flex; gap: 14px; align-items: baseline; padding: 20px 20px 0 0; font-size: .92rem; color: var(--ink-soft); }
.how li + li { padding-left: 20px; border-left: 1px solid var(--line); }
.how span { font-family: var(--font-display); font-style: italic; font-size: 1.6rem; color: var(--robbia); line-height: 1; }

/* barra filtri */
.shop { padding-block: 32px var(--space-section); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px 24px; flex-wrap: wrap; position: sticky; top: calc(72px + env(safe-area-inset-top, 0px)); z-index: 10; background: var(--bg); padding-block: 14px; border-bottom: 1px solid var(--line); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 20px; background: none; color: var(--ink-soft); font: 500 .8rem/1 var(--font-body); cursor: pointer; transition: border-color .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease); }
.chip:hover { border-color: var(--robbia); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip small { opacity: .65; margin-left: 4px; }
.tools { display: flex; gap: 10px; flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 2px; background: var(--paper); color: var(--ink-soft); }
.search:focus-within { border-color: var(--robbia); }
.search input { border: 0; background: none; color: var(--ink); font: 400 .9rem var(--font-body); width: 220px; outline: none; }
.sort select, .field select, .field input, .field textarea { min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 2px; background: var(--paper); color: var(--ink); font: 400 .9rem var(--font-body); }
.field textarea { padding: 10px 12px; resize: vertical; }
.sort select:focus-visible, .field select:focus-visible, .field input:focus-visible, .field textarea:focus-visible, .search input:focus-visible { outline: 2px solid var(--robbia); outline-offset: 2px; }
.result-count { font-size: .8rem; color: var(--ink-soft); margin: 18px 0 24px; }

/* griglia */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: clamp(28px, 3vw, 40px) clamp(16px, 2vw, 28px); }
.card { display: flex; flex-direction: column; text-align: left; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.card .photo { padding: 8px; transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.card:hover .photo { transform: translateY(-3px); box-shadow: 0 20px 34px -26px rgba(42, 26, 20, .55); }
.card img, .card .ph { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.card .cat { font-size: .66rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--oro); margin-top: 16px; }
.card h3 { font-size: 1.35rem; line-height: 1.15; margin-top: 6px; }
.card .price { margin-top: 8px; font-size: .92rem; font-weight: 500; }
.card .price small, .sheet .price small { font-weight: 400; color: var(--ink-soft); }
.card .flag { font-size: .72rem; color: var(--robbia); margin-top: 4px; }
.empty-results { grid-column: 1 / -1; color: var(--ink-soft); padding: 40px 0; }

/* segnaposto per gli articoli ancora senza foto: un piccolo tessuto */
.ph { position: relative; display: grid; place-items: center; text-align: center; padding: 16px; color: var(--ink-soft);
  background:
    repeating-linear-gradient(45deg, transparent 0 9px, color-mix(in srgb, var(--oro) 22%, transparent) 9px 10px),
    repeating-linear-gradient(-45deg, transparent 0 9px, color-mix(in srgb, var(--robbia) 16%, transparent) 9px 10px),
    var(--paper); }
.ph span { background: var(--paper); padding: 8px 12px; font-size: .68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; border: 1px solid var(--line); }

.shop-todo { margin-top: 56px; }

/* finestre: scheda prodotto e riepilogo */
.sheet { border: 0; padding: 0; background: var(--bg); color: var(--ink); max-width: none; max-height: none; }
.sheet::backdrop { background: rgba(20, 12, 9, .55); backdrop-filter: blur(2px); }
.close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--paper); color: var(--ink); font-size: 1.6rem; line-height: 1; cursor: pointer; z-index: 2; }
.close:hover { color: var(--robbia); }

.product { width: min(960px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto; display: grid; grid-template-columns: 1fr 1fr; overflow: auto; border: 1px solid var(--line); }
.product-media { background: var(--paper); min-height: 320px; }
.product-media img, .product-media .ph { width: 100%; height: 100%; object-fit: cover; min-height: 320px; }
.product-body { padding: 40px 36px 32px; display: flex; flex-direction: column; gap: 14px; }
.product-body h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 500; padding-right: 32px; }
.product-body .price { font-size: 1.2rem; font-weight: 500; }
.product-body .desc { color: var(--ink-soft); font-size: .95rem; }
.field { display: grid; gap: 6px; }
.field label, .field-label { font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.qty { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 2px; width: max-content; background: var(--paper); }
.qty button { width: 44px; border: 0; background: none; color: var(--ink); font-size: 1.2rem; cursor: pointer; }
.qty button:hover { color: var(--robbia); }
.qty input { width: 52px; text-align: center; border: 0; border-inline: 1px solid var(--line); border-radius: 0; min-height: 44px; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button, .qty input::-webkit-outer-spin-button { -webkit-appearance: none; }
.stock { font-size: .85rem; color: var(--ink-soft); }
.add { align-self: flex-start; margin-top: 6px; }
.added, .sent { font-size: .88rem; color: var(--robbia); min-height: 1.2em; }
.added a { color: inherit; }

.drawer { width: min(480px, 100vw); height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.drawer[open] { animation: slide .3s var(--ease); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { position: relative; padding: 24px 24px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 2rem; font-weight: 500; }
.drawer-head .close { top: 16px; right: 14px; }
.drawer-body { flex: 1; overflow: auto; padding: 8px 24px max(32px, env(safe-area-inset-bottom, 0px)); }
.drawer .empty { color: var(--ink-soft); padding: 24px 0; }
.drawer .empty a { color: var(--robbia); }
.lines { list-style: none; margin: 0; padding: 0; }
.line { display: grid; grid-template-columns: 64px 1fr auto; gap: 4px 14px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: start; }
.line img, .line .ph { width: 64px; height: 80px; object-fit: cover; grid-row: span 3; padding: 0; }
.line .ph span { display: none; }
.line h3 { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.2; }
.line .var { font-size: .8rem; color: var(--ink-soft); }
.line .amount { font-size: .9rem; font-weight: 500; white-space: nowrap; }
.line .controls { grid-column: 2 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.line .qty button { width: 36px; }
.line .qty input { width: 40px; min-height: 36px; }
.remove { background: none; border: 0; color: var(--ink-soft); font: 500 .74rem/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 36px; }
.remove:hover { color: var(--robbia); }
.total { display: flex; justify-content: space-between; gap: 12px; padding: 18px 0 4px; font-size: 1rem; font-weight: 600; }
.total small { display: block; font-weight: 400; font-size: .78rem; color: var(--ink-soft); margin-top: 2px; }
.order { display: grid; gap: 16px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.order h3 { font-size: 1.5rem; font-weight: 500; }
.order .field input, .order .field textarea { width: 100%; }
.order [aria-invalid="true"] { border-color: var(--robbia); }
.hint { font-size: .78rem; color: var(--ink-soft); }
.error { font-size: .8rem; color: var(--robbia); min-height: 0; }
.error:empty { display: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .85rem; color: var(--ink-soft); cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--robbia); flex: none; }
.check a { color: var(--robbia); }
.send { display: flex; gap: 10px; flex-wrap: wrap; }
.send .btn { flex: 1 1 180px; }

@media (max-width: 760px) {
  .how { grid-template-columns: 1fr; }
  .how li, .how li + li { padding: 14px 0; border-left: 0; }
  .how li + li { border-top: 1px solid var(--line); }
  .toolbar { position: static; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -20px; padding-inline: 20px; width: calc(100% + 40px); }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .tools, .search { width: 100%; }
  .search input { width: 100%; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card h3 { font-size: 1.15rem; }
  .product { grid-template-columns: 1fr; width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border: 0; }
  .product-media, .product-media img, .product-media .ph { min-height: 0; aspect-ratio: 4 / 3; height: auto; }
  .product-body { padding: 24px 20px max(32px, env(safe-area-inset-bottom, 0px)); }
  .add { align-self: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .drawer[open], .cart-count.bump { animation: none; }
}
