/* Home page "shelves": one card per collection with its best products as tappable tiles. Colours come from the theme variables,
   so every theme (and a store's custom colours) restyles the cards automatically. */

.shelves { --shelf-radius: 1.35rem; margin-bottom: 2.5rem; }

.shelves-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: .25rem 0 1rem; }
.shelves-head h2 { margin: 0; font-size: clamp(1.45rem, 2.2vw, 2rem); }
.shelves-head .all { font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; }
.shelves-head .all:hover { gap: .55rem; }

.shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); gap: 1.15rem; }

/* ----- a collection card ----- */
.shelf {
  position: relative; display: flex; flex-direction: column; overflow: hidden; isolation: isolate;
  padding: 1.05rem 1.05rem .95rem; border-radius: var(--shelf-radius);
  color: #fff; background: linear-gradient(150deg, var(--maroon) 0%, var(--maroon-dark) 100%);
  box-shadow: 0 2px 6px rgba(var(--maroon-rgb), .12), 0 10px 26px rgba(var(--maroon-rgb), .10);
  transition: transform .22s ease, box-shadow .22s ease;
}
.shelf::before, .shelf::after { content: ""; position: absolute; border-radius: 50%; z-index: -1; pointer-events: none; }
.shelf::before { width: 190px; height: 190px; right: -70px; top: -80px; background: rgba(255, 255, 255, .13); }
.shelf::after { width: 120px; height: 120px; left: -50px; bottom: 30px; background: rgba(255, 255, 255, .07); }
.shelf:hover { transform: translateY(-3px); box-shadow: 0 4px 10px rgba(var(--maroon-rgb), .16), 0 18px 38px rgba(var(--maroon-rgb), .20); }

/* the colourways repeat down the page, so neighbouring cards are never the same */
.shelf:nth-child(4n+2) { color: #2a1a22; background: linear-gradient(150deg, var(--gold-light) 0%, var(--gold) 100%); box-shadow: 0 2px 6px rgba(var(--gold-rgb), .18), 0 10px 26px rgba(var(--gold-rgb), .16); }
.shelf:nth-child(4n+3) { color: #2a1a22; background: linear-gradient(150deg, var(--maroon-tint-2) 0%, var(--maroon-line) 100%); }
.shelf:nth-child(4n+4) { color: #2a1a22; background: linear-gradient(150deg, var(--ivory-deep) 0%, var(--gold-light) 140%); }
.shelf:nth-child(4n+3)::before, .shelf:nth-child(4n+4)::before { background: rgba(255, 255, 255, .45); }
.shelf:nth-child(4n+2)::before { background: rgba(255, 255, 255, .28); }

.shelf-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; margin-bottom: .85rem; }
.shelf-top h3 { margin: 0; font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; line-height: 1.2; }
.shelf-top h3 a { color: inherit; text-decoration: none; }
.shelf-top h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.shelf-count { display: block; margin-top: .15rem; font-size: .74rem; font-weight: 600; opacity: .8; font-family: var(--font-body); }
.shelf-star { font-size: 1.2rem; opacity: .9; }
/* admins only: marks a collection customers cannot see */
.shelf-private { display: inline-flex; align-items: center; gap: .25rem; margin-top: .3rem; padding: .08rem .55rem; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-family: var(--font-body); font-size: .68rem; font-weight: 800; letter-spacing: .02em; }
.shelf-private + .shelf-count { margin-top: .25rem; }

/* ----- the four products ----- */
.shelf-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; align-content: start; }
/* fewer than four products: one gets a big tile, and an odd third spans the row, so there are never empty slots */
.shelf-tiles.n1 { grid-template-columns: 1fr; }
.shelf-tiles.n1 .tile-img { aspect-ratio: 4 / 3; }
.shelf-tiles.n3 .tile:nth-child(3) { grid-column: 1 / -1; }
.shelf-tiles.n3 .tile:nth-child(3) .tile-img { aspect-ratio: 16 / 9; }
.tile {
  display: flex; flex-direction: column; gap: .35rem; min-width: 0; padding: .45rem .45rem .55rem;
  background: #fff; color: #2a1a22; text-decoration: none; border-radius: .95rem;
  transition: transform .16s ease, box-shadow .16s ease;
}
.tile:hover, .tile:focus-visible { color: #2a1a22; transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0, 0, 0, .22); }
.tile:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.tile-img { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; border-radius: .7rem; background: #f3ece6; }
.tile-img::before { content: ""; position: absolute; inset: -12%; background: var(--bg, none) center / cover no-repeat; filter: blur(14px) saturate(1.1); }
.tile-img img { position: relative; width: 100%; height: 100%; object-fit: contain; display: block; transition: transform .4s ease; }
.tile:hover .tile-img img { transform: scale(1.07); }
.tile-off { position: absolute; left: .35rem; top: .35rem; padding: .1rem .45rem; border-radius: 999px; background: #d6334a; color: #fff; font-size: .68rem; font-weight: 800; line-height: 1.35; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.tile-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; font-size: .8rem; font-weight: 600; line-height: 1.25; padding: 0 .1rem; }
.tile-price { padding: 0 .1rem; font-size: .98rem; font-weight: 800; line-height: 1.15; }
.tile-price sup { font-size: .58em; font-weight: 700; margin-left: .05rem; }
.tile-price s { margin-left: .3rem; color: #8a7b72; font-size: .72rem; font-weight: 500; }
.tile-gst { display: block; padding: 0 .1rem; margin-top: -.2rem; color: #8a7b72; font-size: .66rem; font-weight: 600; }

.shelf-foot { display: inline-flex; align-items: center; gap: .35rem; align-self: flex-start; margin-top: auto; padding-top: .85rem; font-size: .86rem; font-weight: 700; color: inherit; text-decoration: none; }
.shelf-foot:hover { gap: .6rem; color: inherit; }

/* a collection with nothing to show yet */
.shelf-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; min-height: 11rem; text-align: center; padding: 1rem; border-radius: .95rem; background: rgba(255, 255, 255, .55); color: #2a1a22; }
.shelf-empty i { font-size: 2rem; color: var(--maroon); }
.shelf-empty .t { font-weight: 800; }
.shelf-empty .d { font-size: .8rem; color: #6c5f58; }

@media (max-width: 575.98px) {
  .shelf-grid { gap: .9rem; }
  .shelf { padding: .9rem .8rem .85rem; }
  .shelf-top h3 { font-size: 1.1rem; }
  .tile-name { font-size: .78rem; }
}
@media (prefers-reduced-motion: reduce) {
  .shelf, .tile, .tile-img img { transition: none; }
  .shelf:hover, .tile:hover, .tile:hover .tile-img img { transform: none; }
}

/* ----- the banner is a link: hover lifts it, and the arrow nudges ----- */
.hero-link { overflow: hidden; transition: box-shadow .25s ease, transform .25s ease; }
.hero-link:hover { box-shadow: 0 14px 34px rgba(var(--maroon-rgb), .22); transform: translateY(-2px); }
.hero-link:has(.stretched-link:focus-visible) { outline: 3px solid var(--gold); outline-offset: 3px; }
.hero-link .stretched-link .bi { display: inline-block; transition: transform .2s ease; }
.hero-link:hover .stretched-link .bi { transform: translateX(4px); }

/* ----- home page showing every product under the banner ----- */
.home-all .shelves-head h2 { margin-bottom: .1rem; }
.home-count { margin: 0; font-size: .82rem; font-weight: 600; color: var(--maroon); opacity: .8; letter-spacing: .02em; }
.home-sort { display: inline-flex; align-items: center; gap: .55rem; margin: 0; }
.home-sort label { font-size: .8rem; font-weight: 700; color: #6c5f58; white-space: nowrap; }
.home-sort .form-select { width: auto; min-width: 11.5rem; border-radius: 999px; }

.home-grid { margin-bottom: .5rem; }
@media (max-width: 575.98px) {
  .home-sort { width: 100%; }
  .home-sort .form-select { flex: 1; }
}
