/* /css/shop-ui.css — tribeLy • Shop UI (v2 CORE-STRICT)
   ✅ Layout only
   ✅ No button overrides
   ✅ No radius overrides
   ✅ Uses ui-core as single source of truth
*/

/* =========================================================
   CONTAINER
========================================================= */

#view-shop{
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  background: var(--ui-bg);
  color: var(--ui-text);
}

#view-shop img{
  max-width: 100%;
  height: auto;
  display:block;
}

/* =========================================================
   SECTION SPACING
========================================================= */

#view-shop .tl-card{
  margin-bottom: 12px;
}

#view-shop .tl-stack{
  display:flex;
  flex-direction:column;
  gap:12px;
}

#view-shop .tl-stack-tight{
  gap:10px;
}

/* =========================================================
   REWARDS GRID
========================================================= */

#view-shop .tl-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:12px;
}

@media (min-width: 820px){
  #view-shop .tl-grid{
    grid-template-columns: repeat(3, minmax(0,1fr));
  }
}

@media (max-width:420px){
  #view-shop .tl-grid{
    gap:10px;
  }
}

/* Product card (layout only) */
#view-shop .tl-cardItem{
  display:flex;
  flex-direction:column;
  gap:10px;
}

/* Media */
#view-shop .tl-media{
  width:100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--ui-r-inner);
  overflow:hidden;
  background: var(--ui-bg);
  display:flex;
  align-items:center;
  justify-content:center;
}

#view-shop .tl-mediaImg{
  width:100%;
  height:100%;
  object-fit:cover;
}

#view-shop .tl-mediaFallback{
  font-size:26px;
  color: var(--ui-muted);
}

/* =========================================================
   GOALS
========================================================= */

#view-shop .tl-progress{
  margin-top:6px;
  display:flex;
  align-items:center;
  gap:10px;
}

#view-shop .tl-progressTrack{
  flex:1 1 auto;
  height:8px;
  border-radius:999px;
  background: rgba(17,24,39,.08);
  overflow:hidden;
}

#view-shop .tl-progressFill{
  height:100%;
  background: var(--ui-accent);
  border-radius:999px;
}

#view-shop .tl-itemActionsRow{
  justify-content:flex-end;
}

/* =========================================================
   PENDING APPROVALS
========================================================= */

#view-shop .tl-itemRow{
  align-items:center;
}

#view-shop .tl-itemActions{
  display:flex;
  gap:8px;
}

/* =========================================================
   BALANCE CARDS
========================================================= */

#view-shop .tl-cardItem .tl-title{
  font-size:20px;
}

/* =========================================================
   EMPTY STATES
========================================================= */

#view-shop .tl-muted{
  font-size:14px;
}

/* =========================================================
   MOBILE TWEAKS
========================================================= */

@media (max-width:420px){

  #view-shop{
    padding:14px;
  }

  #view-shop .tl-card{
    margin-bottom:10px;
  }

  #view-shop .tl-media{
    aspect-ratio: 16 / 11;
  }

}

/* =========================================================
   FAMILY GOAL IMAGE FIX
========================================================= */

#view-shop .tl-cardItem[data-goal] .tl-media,
#view-shop .tl-cardItem[data-goal] .tl-mediaSm{
  width: 72px;
  height: 72px;
  min-width: 72px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--ui-bg);
  display:flex;
  align-items:center;
  justify-content:center;
}

#view-shop .tl-cardItem[data-goal] .tl-media img,
#view-shop .tl-cardItem[data-goal] .tl-mediaSm img{
  width:100%;
  height:100%;
  object-fit: cover;
  object-position: center;
}

/* Zorg dat tekst netjes uitlijnt */
#view-shop .tl-cardItem[data-goal] .tl-itemRow{
  align-items: center;
  gap: 16px;
}

/* Iets minder dominantie op mobiel */
@media (max-width:420px){
  #view-shop .tl-cardItem[data-goal] .tl-media,
  #view-shop .tl-cardItem[data-goal] .tl-mediaSm{
    width: 64px;
    height: 64px;
    min-width: 64px;
    border-radius: 12px;
  }
}
/* =========================================================
   SHOP — Make Rewards/Goals feel like Balances (tiles inside a big card)
========================================================= */

/* Outer card on the host (Safari/iOS supports :has) */
#view-shop #rewardsHost:has(#shopRewardsGrid),
#view-shop #goalsHost:has(#goalsListStack){
  background: var(--ui-card);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-r-card);
  box-shadow: var(--ui-shadow-card);
  padding: var(--ui-pad-card);
}

/* Make the internal header card "flat" so it becomes part of the outer card */
#view-shop #rewardsHost:has(#shopRewardsGrid) > .tl-card:first-child,
#view-shop #goalsHost:has(#goalsListStack)   > .tl-card:first-child{
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin: 0 0 12px 0;
}

/* Content sits on the white background (no extra top margin) */
#view-shop #shopRewardsGrid,
#view-shop #goalsListStack{
  margin: 0;
}

/* Nice separation between the two big blocks */
#view-shop #rewardsHost{ margin-bottom: 12px; }
#view-shop #goalsHost{ margin-bottom: 12px; }