/* Art Wall shop — built on top of site-base.css (copied from the main
   GreenArtX site) so colors, type and spacing match exactly. Everything
   in this file is new UI the main site doesn't have: the artwork grid,
   filter bar, cart, and checkout components. */

.shop-main { padding-top: 32px; }

/* ---- Filter bar ---------------------------------------------------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 18px var(--gutter);
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}
.filter-bar select,
.filter-bar input[type="search"] {
  font-family: 'Work Sans', sans-serif;
  font-size: .85rem;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
}
.filter-bar input[type="search"] { flex: 1 1 220px; min-width: 160px; }
.filter-bar .filter-count { margin-left: auto; color: var(--stone); font-size: .82rem; }

/* ---- Artwork grid (bento/mosaic layout — tile shape driven by rarity) --
   Matches the original mockup's mosaic: mostly square tiles, with some
   wide and tall rectangles mixed in for visual rhythm. The source images
   are square (1:1); a non-square cell crops the image via object-fit:
   cover (same as every other tile) rather than stretching it — cropping a
   square photo into a rectangle is how every photo-grid mosaic works, it
   just shows less of the image, never a distorted one.
   Each card's exact grid-column/grid-row span is set inline by gallery.js
   (footprintFor()), picked deterministically per artwork so the mosaic is
   stable across reloads rather than reshuffling. grid-auto-rows is synced
   to the ACTUAL rendered column width in JS (gallery.js: syncTileUnit) so
   one grid unit is a true square at every screen size, which is what
   keeps square-footprint tiles square and gives rectangle tiles a clean
   2:1 ratio rather than an arbitrary one.
   grid-auto-flow: dense lets smaller tiles fill gaps left by bigger ones
   instead of leaving holes, so the layout stays packed as items of mixed
   size are added — the same technique behind the mockup's tight mosaic. */
.art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  grid-auto-rows: var(--tile-unit, 150px);
  grid-auto-flow: dense;
  gap: 20px;
  padding: 0 var(--gutter) 48px;
  max-width: var(--max);
  margin: 0 auto;
}
/* Full-bleed photo tile with a bottom scrim, matching the original
   mockup: the artwork image fills the whole tile, title and excerpt sit
   directly on the image over a dark gradient, no separate white info
   panel below it. */
.art-card {
  position: relative;
  display: block;
  height: 100%;
  text-decoration: none;
  color: #fff;
  background: var(--paper-dim);
  border-radius: 6px;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.art-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(27,27,24,.18); }
.art-card:hover .thumb { transform: scale(1.04); }

/* size-sm/md/lg/xl are now TEXT/weight tiers only (title size, rarity
   prominence) — the actual grid-column/grid-row span is set inline per
   card by gallery.js's footprintFor(), since within one tier a tile can
   be a square, a wide rectangle, or a tall one. A 1x1 fallback here is
   just a safety net in case a card is ever rendered without an inline
   span. */
.art-card { grid-column: span 1; grid-row: span 1; }

/* Short tiles (row-span 1 — a small square or a wide rectangle) don't
   have the vertical room for an excerpt line, so it's hidden rather than
   overflowing or getting clipped mid-sentence. Tall tiles (row-span 2+)
   keep it even at a narrow (1-column) width. */
.art-card.short-tile .art-excerpt { display: none; }

.art-card .thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--stone);
  transition: transform .4s ease;
}
.art-card.sold-out-tile .thumb { filter: grayscale(.6) brightness(.75); }

.art-card .scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(27,27,24,0) 35%, rgba(20,20,17,.78) 100%);
}

.art-card .rarity-tag {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 2;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.9);
}

.art-card .stock-pill {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  font-size: .68rem;
  letter-spacing: .04em;
  padding: 3px 9px;
  border-radius: 3px;
  background: rgba(255,255,255,.14);
  color: #fff;
  backdrop-filter: blur(3px);
}
.art-card.sold-out-tile .stock-pill { background: rgba(0,0,0,.55); }

.art-card .content {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: 18px 20px;
}
.art-card .art-number {
  font-size: .68rem; letter-spacing: .08em; color: rgba(255,255,255,.72);
  text-transform: uppercase; margin-bottom: 4px;
}
.art-card .art-title {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.15;
  margin: 0 0 6px;
}
.art-card.size-xl .art-title,
.art-card.size-lg .art-title { font-size: 1.9rem; }
.art-card .art-excerpt {
  font-size: .85rem;
  color: rgba(255,255,255,.82);
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.art-card .bottom-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: .82rem;
}
.art-card .art-price { font-weight: 500; }
.art-card .explore-link { text-decoration: underline; text-underline-offset: 2px; color: #fff; }

.load-more-wrap { text-align: center; padding: 8px 0 56px; }

/* ---- Artwork detail --------------------------------------------------- */
.artwork-detail {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter) 64px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
}
@media (max-width: 760px) { .artwork-detail { grid-template-columns: 1fr; gap: 28px; } }
.artwork-detail img { width: 100%; border-radius: 6px; display: block; background: var(--line); }
.artwork-detail .meta-row { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 18px 0 26px; }
.artwork-detail .meta-row dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--stone); }
.artwork-detail .meta-row dd { margin: 2px 0 0; font-size: .95rem; }
.artwork-detail .price-row { font-size: 1.6rem; font-family: 'Instrument Serif', serif; margin: 6px 0 20px; }
.artwork-detail .stock-note { font-size: .85rem; color: var(--moss); margin-bottom: 18px; }
.artwork-detail .stock-note.sold-out { color: #a14b3a; }

/* ---- Cart --------------------------------------------------------------- */
.cart-wrap { max-width: 760px; margin: 0 auto; padding: 0 var(--gutter) 64px; }
.cart-item { display: flex; gap: 18px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 84px; height: 84px; object-fit: cover; border-radius: 4px; background: var(--line); }
.cart-item .cart-item-info { flex: 1; }
.cart-item .cart-item-title { font-family: 'Instrument Serif', serif; font-size: 1.1rem; }
.cart-item .remove-link { font-size: .8rem; color: var(--stone); text-decoration: underline; cursor: pointer; background: none; border: none; padding: 0; }
.cart-summary { display: flex; justify-content: space-between; padding: 18px 0; font-size: 1.1rem; }
.cart-empty { text-align: center; padding: 64px 0; color: var(--stone); }

/* ---- Checkout form -------------------------------------------------- */
.checkout-form { max-width: 520px; margin: 0 auto; padding: 0 var(--gutter) 64px; }
.checkout-form label { display: block; font-size: .8rem; margin: 16px 0 6px; color: var(--ink-soft); }
.checkout-form input {
  width: 100%; padding: 10px 12px; font-family: 'Work Sans', sans-serif;
  font-size: .95rem; border: 1px solid var(--line); border-radius: 4px; background: var(--paper);
}
.checkout-form .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkout-form .form-error { color: #a14b3a; font-size: .85rem; margin-top: 14px; }

/* ---- Misc --------------------------------------------------------------- */
.cart-link {
  font-size: .85rem;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.cart-link:hover { border-color: var(--moss); color: var(--moss); }

.mock-banner {
  background: #f2e4c0; color: #6b4d1f; text-align: center; font-size: .85rem;
  padding: 10px var(--gutter);
}
.page-title-row { max-width: var(--max); margin: 24px auto 8px; padding: 0 var(--gutter); }
.page-title-row h1 { font-family: 'Instrument Serif', serif; font-size: 2.2rem; margin: 0 0 6px; }
.page-title-row p { color: var(--ink-soft); max-width: 60ch; }

/* ---- Recent-purchase toast ----------------------------------------------
   Shows a REAL recent sale, bottom-left, then fades out and cycles to the
   next one. Hidden by default; only ever appears when there is genuine
   purchase data (see chrome.js initSocialProofWidget). */
.social-proof-toast {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 320px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(27,27,24,.28);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity .4s ease, transform .4s ease;
}
.social-proof-toast.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.social-proof-toast:hover { box-shadow: 0 20px 48px rgba(27,27,24,.36); }
.social-proof-thumb {
  width: 40px; height: 40px; border-radius: 6px; object-fit: cover;
  flex: 0 0 auto; background: var(--stone);
}
.social-proof-text { font-size: .8rem; line-height: 1.35; color: rgba(247,246,242,.9); }
.social-proof-text strong { color: #fff; }
.social-proof-text em { font-style: italic; color: #fff; }
.social-proof-time { display: block; font-size: .7rem; color: rgba(247,246,242,.55); margin-top: 2px; }

@media (max-width: 560px) {
  .social-proof-toast { left: 12px; right: 12px; max-width: none; bottom: 12px; }
}
