/* Thimbit store — shared by every shop. */
:root {
  --paper: #f7f3ec;
  --card: #fffdf9;
  --ink: #23201c;
  --muted: #6f675d;
  --line: #e2dacd;
  --thread: #b3402a;
  --thread-dark: #8f3020;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html.tb-locked { overflow: hidden; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
.tb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tb-error { padding: 4rem 1.5rem; text-align: center; }

/* header */
.tb-header { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: .75rem clamp(1rem, 4vw, 2.5rem); background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.tb-brand { display: inline-flex; align-items: center; gap: .5rem; font: 600 1.15rem var(--serif); text-decoration: none; letter-spacing: .01em; }
.tb-thimble { width: 18px; height: 20px; background: var(--thread);
  -webkit-mask: radial-gradient(circle at 50% 0, #000 0 55%, transparent 56%) top / 100% 70% no-repeat, linear-gradient(#000 0 0) bottom / 100% 62% no-repeat;
  mask: radial-gradient(circle at 50% 0, #000 0 55%, transparent 56%) top / 100% 70% no-repeat, linear-gradient(#000 0 0) bottom / 100% 62% no-repeat;
  border-radius: 9px 9px 3px 3px; }
.tb-cart-link { text-decoration: none; font-weight: 600; padding: .35rem .8rem; border: 1px solid var(--ink); border-radius: 999px; font-size: .9rem; }
.tb-cart-link:hover { background: var(--ink); color: var(--paper); }

.tb-main { max-width: 1240px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }
.tb-intro { padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(1.5rem, 4vw, 3rem); max-width: 40rem; }
.tb-intro h1 { font: 500 clamp(2.2rem, 6vw, 3.6rem)/1.05 var(--serif); margin: 0 0 .5rem; letter-spacing: -.01em; }
.tb-maker { margin: 0; font: italic 1.15rem var(--serif); color: var(--muted); }
.tb-tagline { margin: 1rem 0 0; font-size: 1.05rem; }
.tb-site { margin: .4rem 0 0; font-size: .9rem; color: var(--muted); }

/* grid of items */
.tb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: clamp(1rem, 2.5vw, 1.75rem); }
.tb-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; scroll-margin-top: 4.5rem; }
.tb-card-body { padding: 1rem 1.15rem 1.25rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.tb-group { margin: 0; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tb-card h2 { margin: 0; font: 500 1.4rem/1.2 var(--serif); }
.tb-desc { margin: 0; font-size: .93rem; color: #3d3831; }
.tb-note { margin: 0; font-size: .85rem; color: var(--thread-dark); }
.tb-credits { margin: .25rem 0 0; font-size: .72rem; color: var(--muted); }

/* gallery */
.tb-gallery { position: relative; background: #ece6dc; }
.tb-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; aspect-ratio: 4 / 3; outline: none; }
.tb-track::-webkit-scrollbar { display: none; }
.tb-track:focus-visible { box-shadow: inset 0 0 0 3px var(--thread); }
.tb-slide { flex: 0 0 100%; margin: 0; scroll-snap-align: center; scroll-snap-stop: always; position: relative; display: grid; place-items: center; cursor: zoom-in; }
.tb-slide img { position: absolute; inset: var(--pad, 1rem); width: calc(100% - 2 * var(--pad, 1rem)); height: calc(100% - 2 * var(--pad, 1rem)); object-fit: contain; filter: drop-shadow(0 2px 6px rgb(0 0 0 / .14)); user-select: none; }
.tb-slide:nth-child(n+2) { --pad: 0px; }
.tb-slide:nth-child(n+2) img { object-fit: cover; filter: none; }
.tb-slide figcaption { position: absolute; left: .6rem; top: .6rem; padding: .15rem .55rem; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  background: rgb(255 253 249 / .9); border-radius: 999px; }
.tb-arrow { position: absolute; top: 50%; translate: 0 -50%; width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 0; cursor: pointer;
  background: rgb(255 253 249 / .92); box-shadow: 0 1px 6px rgb(0 0 0 / .18); font-size: 1.6rem; line-height: 1; padding-bottom: .2rem; opacity: 0; transition: opacity .2s; }
.tb-prev { left: .6rem; } .tb-next { right: .6rem; }
.tb-gallery:hover .tb-arrow:not(:disabled), .tb-arrow:focus-visible { opacity: 1; }
.tb-arrow { color: var(--ink); }
.tb-arrow:disabled { pointer-events: none; opacity: 0 !important; }
@media (hover: none) { .tb-arrow { display: none; } }
.tb-dots { position: absolute; bottom: .6rem; left: 50%; translate: -50% 0; display: flex; gap: .4rem; padding: .3rem .5rem; background: rgb(255 253 249 / .85); border-radius: 999px; }
.tb-dot { width: .55rem; height: .55rem; padding: 0; border-radius: 50%; border: 1px solid var(--ink); background: transparent; cursor: pointer; }
.tb-dot[aria-current="true"] { background: var(--ink); }

/* options + add */
.tb-options { border: 0; padding: 0; margin: .35rem 0 0; display: grid; gap: .4rem; }
.tb-options legend { padding: 0; margin-bottom: .35rem; font-size: .78rem; font-weight: 600; color: var(--muted); }
.tb-option { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: .92rem; }
.tb-option:has(input:checked) { border-color: var(--ink); background: #f4efe6; }
.tb-option input { accent-color: var(--thread); margin: 0; }
.tb-option-label { flex: 1; }
.tb-option-price { font-weight: 600; font-variant-numeric: tabular-nums; }
.tb-add { margin-top: auto; padding: .75rem 1rem; border: 0; border-radius: 8px; background: var(--ink); color: var(--paper); font-weight: 600; cursor: pointer; transition: background .2s; }
.tb-card-body > .tb-options + .tb-add { margin-top: .5rem; }
.tb-add:hover { background: var(--thread-dark); }
.tb-add.tb-added { background: var(--thread); }

/* cart */
.tb-cart { margin: clamp(3rem, 8vw, 5rem) auto 3rem; max-width: 46rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.25rem, 4vw, 2.25rem); scroll-margin-top: 4.5rem; }
.tb-cart > h2 { margin: 0 0 1rem; font: 500 1.8rem var(--serif); outline: none; }
.tb-empty { color: var(--muted); margin: 0; }
.tb-line { display: grid; grid-template-columns: 64px 1fr auto; gap: .9rem; align-items: start; padding: .9rem 0; border-top: 1px solid var(--line); }
.tb-line img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.tb-line h3 { margin: 0 0 .35rem; font: 500 1.05rem var(--serif); }
.tb-line-controls { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center; font-size: .85rem; }
.tb-line-controls select, .tb-line-controls input { padding: .25rem .4rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.tb-line-controls input { width: 3.6rem; }
.tb-remove { border: 0; background: none; padding: 0; text-decoration: underline; color: var(--muted); cursor: pointer; font-size: .85rem; }
.tb-line-price { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-discount { display: flex; gap: .55rem; align-items: center; margin: .9rem 0 0; padding-top: .9rem; border-top: 1px solid var(--line); font-size: .9rem; cursor: pointer; }
.tb-discount input { accent-color: var(--thread); }
.tb-totals { display: grid; grid-template-columns: 1fr auto; gap: .3rem 1rem; margin: 1rem 0 0; padding-top: .9rem; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tb-totals dt, .tb-totals dd { margin: 0; }
.tb-totals dd { text-align: right; }
.tb-totals .tb-total { font-weight: 700; font-size: 1.15rem; }
.tb-checkout-area { margin-top: 1.4rem; display: grid; gap: .75rem; }
.tb-buyer { display: grid; gap: .7rem; }
.tb-field { display: grid; gap: .25rem; font-size: .82rem; font-weight: 600; color: var(--muted); }
.tb-field input, .tb-field textarea { padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 400; color: var(--ink); resize: vertical; }
.tb-checkout { display: block; text-align: center; padding: .9rem 1rem; border-radius: 8px; background: var(--thread); color: #fff; font-weight: 700; text-decoration: none; margin-top: .4rem; }
.tb-checkout:hover { background: var(--thread-dark); }
.tb-copy { justify-self: center; border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: .85rem; }
.tb-how { margin: 0; font-size: .82rem; color: var(--muted); text-align: center; }

/* lightbox */
.tb-lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #14120f; color: #f5f0e8; }
.tb-lightbox::backdrop { background: #14120f; }
.tb-lightbox[open] { display: flex; flex-direction: column; }
.tb-lightbox-bar { display: flex; justify-content: space-between; align-items: center; padding: .6rem 1rem; font: 1.05rem var(--serif); }
.tb-close { border: 0; background: none; color: inherit; font-size: 2rem; line-height: 1; cursor: pointer; padding: 0 .3rem; }
.tb-gallery-large { flex: 1; background: transparent; min-height: 0; }
.tb-gallery-large .tb-track { aspect-ratio: auto; height: 100%; }
.tb-gallery-large .tb-slide, .tb-gallery-large .tb-slide:nth-child(n+2) { cursor: default; --pad: 0px; }
.tb-gallery-large .tb-slide img { inset: 0 1rem 3.2rem; width: calc(100% - 2rem); height: calc(100% - 3.2rem); }
.tb-gallery-large .tb-slide img, .tb-gallery-large .tb-slide:nth-child(n+2) img { object-fit: contain; filter: none; }
.tb-gallery-large .tb-slide figcaption { color: var(--ink); top: 0; left: 1rem; }
.tb-gallery-large .tb-arrow { opacity: 1; }
.tb-gallery-large .tb-dots { bottom: 1rem; }

.tb-footer { text-align: center; padding: 2rem 1rem 3rem; font-size: .85rem; color: var(--muted); }
