/* ============================================================
   Shop by Category — hub tiles + collection landing pages
   Loaded only on pages using the collection templates.
   ============================================================ */

.a1p-page-lede {
  max-width: 620px;
  margin: 14px 0 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--a1p-muted);
}

.a1p-crumb {
  color: var(--a1p-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.a1p-crumb:hover { color: var(--a1p-accent); border-bottom-color: var(--a1p-accent); }

/* ---------- Tile grid ---------- */
.a1p-collections { padding-top: 48px; }
.a1p-collections--more { padding-top: 8px; }

.a1p-tile-grid {
  display: grid;
  gap: 20px;
}
.a1p-tile-grid--4 { grid-template-columns: repeat(4, 1fr); }
.a1p-tile-grid--3 { grid-template-columns: repeat(3, 1fr); }
.a1p-tile-grid--2 { grid-template-columns: repeat(2, 1fr); }

.a1p-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 208px;
  padding: 22px 22px 18px;
  background: var(--a1p-bg);
  border: 1px solid var(--a1p-border);
  border-radius: var(--a1p-radius);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.a1p-tile:hover {
  border-color: var(--a1p-border-strong);
  box-shadow: 0 8px 24px rgba(10, 34, 64, .09);
  transform: translateY(-2px);
}

/* Accent tiles (Offers / BOGO) carry the flag red so live deals read first. */
.a1p-tile.is-accent {
  background: var(--a1p-navy);
  border-color: var(--a1p-navy);
  color: #fff;
}
.a1p-tile.is-accent::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--a1p-accent);
}
.a1p-tile.is-accent:hover {
  border-color: var(--a1p-accent);
  box-shadow: 0 8px 24px rgba(178, 34, 52, .28);
}

.a1p-tile-eyebrow {
  font-family: var(--a1p-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--a1p-muted);
}
.a1p-tile.is-accent .a1p-tile-eyebrow { color: var(--a1p-accent-soft); }

.a1p-tile-label {
  display: block;
  margin: 10px 0 8px;
  font-family: var(--a1p-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--a1p-navy);
}
.a1p-tile.is-accent .a1p-tile-label { color: #fff; }

.a1p-tile-tagline {
  font-size: 14px;
  line-height: 1.6;
  color: var(--a1p-muted);
}
.a1p-tile.is-accent .a1p-tile-tagline { color: rgba(255, 255, 255, .8); }

.a1p-tile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
}
.a1p-tile-count {
  font-family: var(--a1p-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--a1p-muted);
}
.a1p-tile.is-accent .a1p-tile-count { color: rgba(255, 255, 255, .72); }
.a1p-tile-arrow {
  font-size: 17px;
  color: var(--a1p-accent);
  transition: transform .18s ease;
}
.a1p-tile:hover .a1p-tile-arrow { transform: translateX(4px); }
.a1p-tile.is-accent .a1p-tile-arrow { color: var(--a1p-accent-soft); }

/* Secondary row sits a little quieter than the featured row. */
.a1p-tile.is-compact { min-height: 168px; }
.a1p-tile.is-compact .a1p-tile-label { font-size: 21px; }
.a1p-tile.is-compact { background: var(--a1p-bg-alt); }

/* ---------- Shop by goal ---------- */
.a1p-goals { padding-top: 8px; }
.a1p-goal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.a1p-goal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  background: var(--a1p-bg);
  border: 1px solid var(--a1p-border);
  border-left: 3px solid var(--a1p-navy-soft);
  border-radius: var(--a1p-radius);
  text-decoration: none;
  color: var(--a1p-navy);
  transition: border-left-color .18s ease, background .18s ease, transform .18s ease;
}
.a1p-goal:hover {
  border-left-color: var(--a1p-accent);
  background: var(--a1p-bg-alt);
  transform: translateX(2px);
}
.a1p-goal-name {
  font-family: var(--a1p-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}
.a1p-goal-count {
  flex: none;
  font-family: var(--a1p-mono);
  font-size: 12px;
  color: var(--a1p-muted);
  background: var(--a1p-bg-dim);
  border-radius: 999px;
  padding: 3px 10px;
}

/* ---------- Collection landing pages ---------- */
.a1p-collection-body { padding-top: 40px; }
.a1p-collection-intro { margin-bottom: 32px; }

.a1p-offer-terms {
  background: var(--a1p-cream);
  border-bottom: 1px solid var(--a1p-border);
  padding: 18px 0;
}
.a1p-offer-terms-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.a1p-offer-terms-list li {
  position: relative;
  padding-left: 20px;
  font-size: 14px;
  color: var(--a1p-text);
}
.a1p-offer-terms-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--a1p-accent);
  font-weight: 700;
}

/* Rank chip for Top Sellers */
.a1p-product-imgwrap { position: relative; }
.a1p-rank-chip {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-family: var(--a1p-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #fff;
  background: var(--a1p-navy);
  border-radius: 999px;
  padding: 3px 9px;
}

.a1p-collection-empty {
  max-width: 520px;
  padding: 48px 0 8px;
}
.a1p-collection-empty h2 {
  font-family: var(--a1p-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  color: var(--a1p-navy);
}
.a1p-collection-empty p {
  margin: 0 0 22px;
  color: var(--a1p-muted);
  line-height: 1.7;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .a1p-tile-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .a1p-goal-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .a1p-tile-grid--4,
  .a1p-tile-grid--3,
  .a1p-tile-grid--2 { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .a1p-tile { min-height: 178px; padding: 18px; }
  .a1p-tile-label { font-size: 21px; }
  .a1p-offer-terms-list { flex-direction: column; gap: 8px; }
}
@media (max-width: 560px) {
  .a1p-tile-grid--4,
  .a1p-tile-grid--3,
  .a1p-tile-grid--2 { grid-template-columns: 1fr; }
  .a1p-goal-grid { grid-template-columns: 1fr; }
  .a1p-tile { min-height: 0; }
}
