/**
 * Appily Fortyseven — Seed Atlas shop
 * Dark command deck + aisle constellation tiles + spine index + dossier grid
 * Distinct from shared Appily mast/rail/sidebar shop layouts.
 */

.page-shop-atlas {
  --ax-ink: #1a121c;
  --ax-plum: #3d2b3f;
  --ax-deep: #140e16;
  --ax-gold: #c9a86c;
  --ax-gold-soft: #e4d0a8;
  --ax-cream: #f6f1eb;
  --ax-sand: #ebe3d8;
  --ax-muted: #877780;
  --ax-accent: #c9a86c;
  --ax-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ax-serif: 'Playfair Display', Georgia, serif;
  --ax-sans: 'Jost', system-ui, sans-serif;
  background: var(--ax-cream);
  color: var(--ax-ink);
}

.page-shop-atlas .page-main { padding-top: 0; }

.a47-atlas { padding-bottom: 3.5rem; }

.a47-atlas-reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.75s var(--ax-ease) calc(var(--a47-delay, 0) * 80ms),
    transform 0.75s var(--ax-ease) calc(var(--a47-delay, 0) * 80ms);
}
.a47-atlas-reveal.is-visible {
  opacity: 1;
  transform: none;
}

.a47-atlas-card-reveal {
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition:
    opacity 0.55s var(--ax-ease) calc(var(--card-i, 0) * 40ms),
    transform 0.55s var(--ax-ease) calc(var(--card-i, 0) * 40ms);
}
.a47-atlas-card-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ════════════ COMMAND DECK ════════════ */
.a47-atlas-deck {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 3.25rem) 0 clamp(2.25rem, 4vw, 3rem);
  background:
    radial-gradient(ellipse 60% 55% at 8% 30%, rgba(201, 168, 108, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 45% 40% at 95% 80%, rgba(92, 122, 74, 0.14) 0%, transparent 50%),
    linear-gradient(155deg, #21161f 0%, #2c2030 48%, #160f1a 100%);
  color: #fff;
}

.a47-atlas-deck-mesh {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 85% 70% at 40% 40%, #000 15%, transparent 72%);
  pointer-events: none;
  z-index: 0;
}

.a47-atlas-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.38;
  pointer-events: none;
  z-index: 0;
  animation: axOrb 15s ease-in-out infinite alternate;
}
.a47-atlas-orb--a {
  width: min(36vw, 320px);
  aspect-ratio: 1;
  background: var(--ax-gold);
  top: -12%;
  right: 8%;
}
.a47-atlas-orb--b {
  width: min(30vw, 260px);
  aspect-ratio: 1;
  background: #5c7a4a;
  bottom: -18%;
  left: -4%;
  animation-delay: -6s;
}
@keyframes axOrb {
  to { transform: translate(16px, -12px) scale(1.08); }
}

.a47-atlas-deck-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: end;
}

.a47-atlas-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.7rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ax-gold-soft);
}
.a47-atlas-kicker--dark { color: var(--ax-accent); }

.a47-atlas-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5dce7a;
  box-shadow: 0 0 0 0 rgba(93, 206, 122, 0.5);
  animation: axPulse 2s ease-in-out infinite;
}
@keyframes axPulse {
  50% { box-shadow: 0 0 0 7px rgba(93, 206, 122, 0); }
}

.a47-atlas-deck-copy h1 {
  margin: 0 0 0.75rem;
  font-family: var(--ax-serif);
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  font-weight: 600;
  line-height: 1.1;
}

.a47-atlas-lede {
  margin: 0 0 1.25rem;
  max-width: 46ch;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(255,255,255,0.68);
}

.a47-atlas-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}
.a47-atlas-stats div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 72px;
}
.a47-atlas-stats strong {
  font-family: var(--ax-serif);
  font-size: 1.35rem;
  color: var(--ax-gold-soft);
}
.a47-atlas-stats span {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.42);
}

.a47-atlas-search {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(12px);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
  overflow: hidden;
}
.a47-atlas-search-prefix {
  padding: 0 0.15rem 0 1rem;
  font-family: var(--ax-serif);
  font-size: 1.35rem;
  color: var(--ax-gold);
}
.a47-atlas-search input {
  appearance: none;
  border: 0;
  background: transparent;
  color: #fff;
  padding: 1rem 0.65rem;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  min-width: 0;
}
.a47-atlas-search input::placeholder { color: rgba(255,255,255,0.38); }
.a47-atlas-search button {
  appearance: none;
  border: 0;
  background: var(--ax-gold);
  color: var(--ax-deep);
  padding: 0 1.25rem;
  align-self: stretch;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.2s;
}
.a47-atlas-search button:hover { filter: brightness(1.06); }

/* ════════════ CONSTELLATION ════════════ */
.a47-atlas-constellation {
  padding: clamp(1.5rem, 3vw, 2.25rem) 0;
  background: #fff;
  border-bottom: 1px solid rgba(61, 43, 63, 0.08);
}

.a47-atlas-constellation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.a47-atlas-reset {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ax-plum);
  text-decoration: none;
}
.a47-atlas-reset.is-muted { opacity: 0.35; pointer-events: none; }
.a47-atlas-reset:hover { color: var(--ax-accent); }

.a47-atlas-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.a47-atlas-tile {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 118px;
  padding: 0.95rem 1rem;
  text-decoration: none;
  color: var(--ax-ink);
  background: var(--ax-cream);
  border: 1px solid rgba(61, 43, 63, 0.08);
  overflow: hidden;
  transition: transform 0.3s var(--ax-ease), border-color 0.3s, background 0.3s, color 0.3s;
}
.a47-atlas-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(61, 43, 63, 0.2);
}
.a47-atlas-tile.is-active {
  background: var(--ax-plum);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 16px 36px rgba(26, 18, 28, 0.18);
}
.a47-atlas-tile-index {
  font-family: var(--ax-serif);
  font-size: 1.1rem;
  color: var(--ax-accent);
}
.a47-atlas-tile.is-active .a47-atlas-tile-index { color: var(--ax-gold-soft); }
.a47-atlas-tile strong {
  align-self: end;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}
.a47-atlas-tile em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ax-muted);
}
.a47-atlas-tile.is-active em { color: rgba(255,255,255,0.55); }
.a47-atlas-tile-glyph {
  position: absolute;
  right: 0.55rem;
  bottom: 0.35rem;
  font-size: 1.6rem;
  opacity: 0.18;
  pointer-events: none;
}
.a47-atlas-tile--all { background: linear-gradient(145deg, #fff, var(--ax-sand)); }

.a47-atlas-tile.tone-peony { --ax-accent: #5c7a4a; }
.a47-atlas-tile.tone-hydrangea { --ax-accent: #8b6b8e; }
.a47-atlas-tile.tone-rose { --ax-accent: #6b8f71; }
.a47-atlas-tile.tone-tulip { --ax-accent: #c47a3a; }
.a47-atlas-tile.tone-lily { --ax-accent: #3d6b5c; }
.a47-atlas-tile.tone-daisy { --ax-accent: #a67c52; }
.a47-atlas-tile.tone-bouquet { --ax-accent: #c9a86c; }

/* ════════════ BOARD ════════════ */
.a47-atlas-board {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  padding-top: clamp(1.5rem, 3vw, 2.25rem);
  align-items: start;
}

.a47-atlas-spine-toggle {
  display: none;
  width: 100%;
  margin-bottom: 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(61, 43, 63, 0.14);
  background: #fff;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.a47-atlas-spine-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(20, 14, 22, 0.45);
}

.a47-atlas-spine {
  position: sticky;
  top: 5.5rem;
  background: var(--ax-ink);
  color: #fff;
  padding: 1rem 0.75rem 1.1rem;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);
}

.a47-atlas-spine-head {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
  padding: 0 0.35rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.a47-atlas-spine-head span {
  font-family: var(--ax-serif);
  font-size: 1.6rem;
  color: var(--ax-gold);
}
.a47-atlas-spine-head p {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}

.a47-atlas-spine-nav {
  display: grid;
  gap: 0.2rem;
}
.a47-atlas-spine-nav a {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 0.35rem;
  align-items: center;
  padding: 0.55rem 0.4rem;
  text-decoration: none;
  color: rgba(255,255,255,0.62);
  border-left: 2px solid transparent;
  transition: 0.2s ease;
}
.a47-atlas-spine-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}
.a47-atlas-spine-nav a.is-active {
  color: #fff;
  border-left-color: var(--ax-gold);
  background: rgba(201, 168, 108, 0.12);
}
.a47-atlas-spine-nav a span {
  font-family: var(--ax-serif);
  font-size: 0.85rem;
  color: var(--ax-gold);
}
.a47-atlas-spine-nav a strong {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.a47-atlas-spine-nav a em {
  font-style: normal;
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(255,255,255,0.35);
}

.a47-atlas-spine-note {
  margin-top: 0.9rem;
  padding: 0.75rem 0.45rem 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.72rem;
  line-height: 1.45;
  color: rgba(255,255,255,0.45);
}
.a47-atlas-spine-note a { color: var(--ax-gold-soft); }

/* Canvas */
.a47-atlas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.a47-atlas-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ax-muted);
}
.a47-atlas-meta strong { color: var(--ax-ink); }
.a47-atlas-clear {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ax-plum);
  text-decoration: none;
}
.a47-atlas-clear:hover { color: var(--ax-accent); }

.a47-atlas-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.a47-atlas-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(61, 43, 63, 0.08);
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
  transition: transform 0.35s var(--ax-ease), box-shadow 0.35s;
}
.a47-atlas-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 48px rgba(26, 18, 28, 0.1);
}
.a47-atlas-card.is-feature {
  grid-column: span 2;
  grid-row: span 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  clip-path: none;
}
.a47-atlas-card.is-feature .a47-atlas-card-media { aspect-ratio: auto; min-height: 100%; }
.a47-atlas-card.is-feature .a47-atlas-card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.35rem 1.25rem;
}

.a47-atlas-card-media {
  position: relative;
  display: block;
  aspect-ratio: 1;
  background: var(--ax-sand);
  overflow: hidden;
}
.a47-atlas-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s var(--ax-ease);
}
.a47-atlas-card:hover .a47-atlas-card-media img { transform: scale(1.06); }

.a47-atlas-card-flag {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  z-index: 2;
  padding: 0.3rem 0.55rem;
  background: var(--ax-plum);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.a47-atlas-card-sku {
  position: absolute;
  right: 0.55rem;
  bottom: 0.45rem;
  z-index: 1;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.35);
  text-shadow: 0 1px 8px rgba(0,0,0,0.35);
  pointer-events: none;
}
.a47-atlas-card-hover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(22, 15, 26, 0.55);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.3s var(--ax-ease);
}
.a47-atlas-card:hover .a47-atlas-card-hover { opacity: 1; }

.a47-atlas-card-body { padding: 0.9rem 0.95rem 1.05rem; }
.a47-atlas-card-aisle {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ax-muted);
}
.a47-atlas-card-body h3 {
  margin: 0 0 0.3rem;
  font-family: var(--ax-sans);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
}
.a47-atlas-card-body h3 a {
  color: var(--ax-ink);
  text-decoration: none;
}
.a47-atlas-card-variant {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  color: var(--ax-muted);
}
.a47-atlas-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
}
.a47-atlas-card-price {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.a47-atlas-card-price s {
  font-size: 0.78rem;
  color: var(--ax-muted);
}
.a47-atlas-card-price strong {
  font-size: 1.05rem;
  color: var(--ax-accent);
}
.a47-atlas-card-cta {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--ax-ink);
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  transition: background 0.2s;
}
.a47-atlas-card-cta:hover { background: var(--ax-accent); }

/* Empty */
.a47-atlas-empty {
  position: relative;
  text-align: center;
  padding: 4rem 1.25rem;
  background: #fff;
  border: 1px dashed rgba(61, 43, 63, 0.18);
}
.a47-atlas-empty-ring {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  border: 1px dashed var(--ax-accent);
  border-radius: 50%;
  animation: axSpin 18s linear infinite;
}
@keyframes axSpin { to { transform: rotate(360deg); } }
.a47-atlas-empty h2 {
  margin: 0 0 0.4rem;
  font-family: var(--ax-serif);
  color: var(--ax-plum);
}
.a47-atlas-empty p { color: var(--ax-muted); }
.a47-atlas-empty-btn {
  display: inline-flex;
  margin-top: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--ax-plum);
  color: #fff;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Pagination inherits site styles; tighten spacing */
.page-shop-atlas .pagination,
.page-shop-atlas .pager,
.page-shop-atlas nav[aria-label*="agination"] {
  margin-top: 1.75rem;
}

/* Responsive */
@media (max-width: 1100px) {
  .a47-atlas-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .a47-atlas-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .a47-atlas-card.is-feature { grid-column: span 2; }
}

@media (max-width: 900px) {
  .a47-atlas-deck-grid { grid-template-columns: 1fr; }
  .a47-atlas-board { grid-template-columns: 1fr; }
  .a47-atlas-spine-toggle { display: block; grid-column: 1; }
  .a47-atlas-spine {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    width: min(280px, 86vw);
    transform: translateX(-105%);
    transition: transform 0.35s var(--ax-ease);
    clip-path: none;
    overflow-y: auto;
  }
  .a47-atlas-spine.is-open { transform: none; }
  .a47-atlas-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .a47-atlas-tiles { grid-template-columns: 1fr 1fr; }
  .a47-atlas-grid { grid-template-columns: 1fr; }
  .a47-atlas-card.is-feature {
    grid-column: span 1;
    grid-template-columns: 1fr;
  }
  .a47-atlas-card.is-feature .a47-atlas-card-media {
    aspect-ratio: 1;
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .a47-atlas-reveal,
  .a47-atlas-card-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .a47-atlas-orb,
  .a47-atlas-live-dot,
  .a47-atlas-empty-ring {
    animation: none !important;
  }
}
