/* Color selection pages: hub + per-category gallery (assets/js/color-gallery.js). */

/* ---------------------------------------------------------------- hero */
.cg-hero { padding: 72px 0 68px; overflow: hidden; }
.cg-hero .container { position: relative; }
.cg-hero p { max-width: 600px; margin: 16px 0 0; color: #f3d9da; font-size: 17px; }
.cg-crumbs { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.cg-crumbs a { color: #f3d9da; }
.cg-crumbs a:hover { color: var(--white); }
.cg-crumbs span { color: var(--white); }
.cg-hero .hero-photo { width: 100%; height: 100%; object-fit: cover; }

/* ------------------------------------------------------ hub: categories */
.cg-cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.cg-cat { position: relative; display: flex; flex-direction: column; background: var(--white); box-shadow: 0 12px 34px rgba(0,0,0,.08); color: var(--body-on-white); min-width: 0; }
a.cg-cat { transition: transform .18s ease, box-shadow .18s ease; }
a.cg-cat:hover { transform: translateY(-3px); box-shadow: 0 18px 44px rgba(0,0,0,.14); }
.cg-cat-photo { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--off-white); }
.cg-cat-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cg-cat-body { padding: 24px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.cg-cat h2 { font-family: var(--font-sans); font-weight: 700; font-size: 24px; color: var(--ink); }
.cg-cat .cg-go { margin-top: auto; padding-top: 8px; color: var(--red); font-weight: 700; }
.cg-cat--soon .cg-cat-photo img { filter: grayscale(1) brightness(.9); }
.cg-soon { position: absolute; top: 14px; left: 14px; padding: 6px 10px; background: rgba(18,18,18,.78); color: var(--white); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

/* ----------------------------------------------------- gallery: grid */
.cg-section { padding-top: 64px; }
.cg-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; flex-wrap: wrap; }
.cg-intro p { max-width: 620px; }
.cg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.cg-tile { display: flex; flex-direction: column; background: var(--white); box-shadow: 0 8px 24px rgba(0,0,0,.08); color: var(--ink); min-width: 0; transition: transform .18s ease, box-shadow .18s ease; }
.cg-tile:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0,0,0,.14); }
.cg-tile:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.cg-tile-photo { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--off-white); }
.cg-tile-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cg-tile-foot { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 14px 16px 16px; min-height: 64px; }
.cg-tile-foot .cg-swatch { grid-row: 1 / span 2; }
.cg-tile-name { font-weight: 700; font-size: 17px; line-height: 1.25; }
.cg-tile-count { font-size: 13px; color: #777; }
.cg-swatch { display: inline-block; width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.55), 0 0 0 1px rgba(0,0,0,.18); flex: none; }
.cg-swatch--lg { width: 38px; height: 38px; }
.cg-limited { position: absolute; top: 12px; left: 12px; padding: 5px 9px; background: rgba(18,18,18,.78); color: var(--white); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.cg-tile--skeleton .cg-tile-photo, .cg-tile--skeleton .cg-tile-foot { background: linear-gradient(90deg, #eee 25%, #f6f6f6 50%, #eee 75%); background-size: 200% 100%; animation: cg-shimmer 1.2s infinite linear; }
.cg-tile--skeleton .cg-tile-foot { height: 64px; }
@keyframes cg-shimmer { to { background-position: -200% 0; } }
.cg-error { padding: 40px; background: var(--off-white); text-align: center; }
.cg-error p { max-width: 520px; margin: 0 auto 20px; }

/* --------------------------------------------------- gallery: viewer */
.cg-back { background: none; border: 0; padding: 0; margin-bottom: 20px; color: var(--red); font: inherit; font-weight: 700; cursor: pointer; }
.cg-back:hover { text-decoration: underline; }
.cg-viewer-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 44px; align-items: start; }
.cg-stage { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #111; cursor: zoom-in; touch-action: pan-y; user-select: none; outline: none; }
.cg-stage:focus-visible { box-shadow: 0 0 0 3px var(--red); }
.cg-track { display: flex; height: 100%; transition: transform .38s cubic-bezier(.22, .7, .2, 1); will-change: transform; }
.cg-slide { flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.cg-slide img { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; }
.cg-nav { position: absolute; top: 50%; width: 46px; height: 46px; margin-top: -23px; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--ink); font-size: 30px; line-height: 1; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.3); display: flex; align-items: center; justify-content: center; padding-bottom: 4px; }
.cg-nav:disabled { opacity: .35; cursor: default; }
.cg-nav--prev { left: 14px; }
.cg-nav--next { right: 14px; }
.cg-counter, .cg-zoom-hint { position: absolute; bottom: 12px; padding: 5px 10px; background: rgba(18,18,18,.72); color: var(--white); font-size: 12px; font-weight: 700; letter-spacing: .06em; pointer-events: none; }
.cg-counter { right: 12px; font-variant-numeric: tabular-nums; }
.cg-zoom-hint { left: 12px; }
.cg-rail { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.cg-thumb { flex: 0 0 96px; aspect-ratio: 4 / 3; padding: 0; border: 3px solid transparent; background: var(--off-white); cursor: pointer; scroll-snap-align: center; }
.cg-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: .7; }
.cg-thumb.is-on { border-color: var(--red); }
.cg-thumb.is-on img, .cg-thumb:hover img { opacity: 1; }
.cg-info { display: flex; flex-direction: column; gap: 14px; }
.cg-product { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
.cg-name { display: flex; align-items: center; gap: 14px; font-family: var(--font-sans); font-weight: 700; font-size: 36px; line-height: 1.1; color: var(--ink); }
.cg-desc { font-size: 17px; }
.cg-limited-note { padding: 12px 14px; background: var(--off-white); font-size: 15px; }
.cg-info .btn { text-align: center; }
.cg-fine { font-size: 14px; color: #777; }

/* ---------------------------------------------------------- lightbox */
.cg-lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(10,10,10,.94); display: flex; align-items: center; justify-content: center; }
.cg-lightbox[hidden] { display: none; }
.cg-lb-frame { max-width: calc(100vw - 140px); max-height: calc(100vh - 80px); overflow: hidden; cursor: zoom-in; }
.cg-lb-frame img { display: block; max-width: calc(100vw - 140px); max-height: calc(100vh - 80px); transition: transform .25s ease; }
.cg-lb-frame.is-zoom { cursor: zoom-out; }
.cg-lb-frame.is-zoom img { transform: scale(2.2); }
.cg-lb-close { position: absolute; top: 14px; right: 18px; width: 48px; height: 48px; border: 0; background: none; color: var(--white); font-size: 40px; line-height: 1; cursor: pointer; }
.cg-lb-nav { position: absolute; top: 50%; width: 52px; height: 52px; margin-top: -26px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: var(--white); font-size: 34px; cursor: pointer; padding-bottom: 4px; }
.cg-lb-prev { left: 16px; }
.cg-lb-next { right: 16px; }
.cg-lb-hint { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: #bbb; font-size: 13px; }

@media (max-width: 1100px) { .cg-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) {
  .cg-cats { grid-template-columns: 1fr; }
  .cg-viewer-grid { grid-template-columns: 1fr; gap: 24px; }
  .cg-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .cg-name { font-size: 30px; }
}
@media (max-width: 600px) {
  .cg-hero { padding: 54px 0 50px; }
  .cg-tile-foot { padding: 12px; column-gap: 10px; }
  .cg-tile-name { font-size: 15px; }
  .cg-swatch { width: 24px; height: 24px; }
  .cg-nav { width: 38px; height: 38px; margin-top: -19px; font-size: 24px; }
  .cg-zoom-hint { display: none; }
  .cg-lb-frame, .cg-lb-frame img { max-width: 100vw; }
  .cg-lb-nav { width: 42px; height: 42px; margin-top: -21px; background: rgba(0,0,0,.5); }
  .cg-lb-prev { left: 6px; }
  .cg-lb-next { right: 6px; }
}
@media (prefers-reduced-motion: reduce) { .cg-track, .cg-tile, a.cg-cat, .cg-lb-frame img { transition: none; } }
