/* ================================
   SB Trade Cards — FULL STYLESHEET
   ================================ */

/* ---------- Grid (flex so last row centers) ---------- */
.sb-trade-grid{
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: center;   /* center leftover items on the last row */
}

/* Card widths per breakpoint (columns) */
.sb-trade-card{ width: 100%; }                               /* <500px: 1 col */

@media (min-width: 500px){                                    /* 500–769: 2 cols */
  .sb-trade-card{ width: calc((100% - 28px*1) / 2); }
}

@media (min-width: 770px){                                    /* 770–1279: 3 cols */
  .sb-trade-card{ width: calc((100% - 28px*2) / 3); }
}

@media (min-width: 1280px){                                   /* 1280+: 5 cols */
  .sb-trade-card{ width: calc((100% - 28px*4) / 5); }
}

/* ---------- Card ---------- */
.sb-trade-card{
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #E3EAF2;
  box-shadow: 0 10px 18px rgba(9,14,28,.12);
  padding: 40px;
  text-align: center;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

/* Photo anchors to the full card (starts as a circle at the top) */
.sb-trade-card__photo{
  position: absolute;
  left: 50%;
  top: 24px;
  translate: -50% 0;
  width: 210px;
  height: 210px;
  border-radius: 999px;
  background-size: cover;
  background-position: center;
  filter: grayscale(100%);
  z-index: 0;  /* bottom-most layer */
  transition:
    left .40s ease-in-out,
    top .40s ease-in-out,
    width .40s ease-in-out,
    height .40s ease-in-out,
    border-radius .40s ease-in-out,
    filter .45s ease-in-out,
    opacity .45s ease-in-out;
}

/* Top stack just for orange + icon */
.sb-trade-card__top{
  position: relative;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Orange circle (middle layer) */
.sb-trade-card__orange{
  --size: 152px;
  position: absolute;
  left: 50%;
  top: 15px;
  translate: -50% 0;
  width: var(--size);
  height: var(--size);
  border-radius: 999px;
  background: rgba(211,137,69,1); /* #D38945 */
  z-index: 1;
  transition:
    transform .40s ease-in-out,
    top .40s ease-in-out,
    background .45s ease-in-out,
    opacity .45s ease-in-out;
}

/* Icon (front of the stack) */
.sb-trade-card__iconwrap{
  position: absolute;
  left: 50%;
  top: 90px;
  translate: -50% -50%;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  z-index: 2;
}
.sb-icon--dark{
  display: block;
  width: 64px;
  height: auto;
  opacity: 1;
  transition: opacity .18s ease;
}
.sb-icon--lightwrap{
  position: absolute;
  inset: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #0F172B;
  opacity: 0;
  transition: opacity .18s ease;
}
.sb-icon--lightwrap img{
  width: 64px;
  height: auto;
  display: block;
}

/* Content (always above) */
.sb-trade-card__content{
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.sb-trade-card h3{
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 800;
  color: #0F172B;
  transition: color .18s ease;
}
.sb-trade-card p{
  margin: 0 0 20px 0;
  color: #0F172B;
  font-size: 20px;
  transition: color .18s ease;
}

/* Explore button */
.sb-trade-card .sb-btn{
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 10px;
  background: #0F172B;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 6px 12px rgba(15,23,43,.18);
  transition: transform .15s ease, box-shadow .15s ease;
}
.sb-trade-card .sb-btn:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 16px rgba(15, 23, 43, .25);
  cursor: pointer;
}

/* ---------- Hover state ---------- */
/* Photo morphs to cover the entire card */
.sb-trade-card:hover .sb-trade-card__photo{
  left:50%; top:50%; translate:-50% -50%;
  width: 100%;
  height: 100%;
  border-radius: 16px;            /* match card radius */
  filter: grayscale(100%) brightness(.75);
  opacity: 1;
}

/* Orange expands + fades to .5 */
.sb-trade-card:hover .sb-trade-card__orange{
  transform: scale(9);
  top: 50%;
  background: rgba(211,137,69,.5);
  opacity: 1;
}

/* Icon swap + white text */
.sb-trade-card:hover .sb-icon--dark{ opacity: 0; }
.sb-trade-card:hover .sb-icon--lightwrap{ opacity: 1; }
.sb-trade-card:hover h3,
.sb-trade-card:hover p{ color: #fff; }

/* ---------- Optional: small-screen tuning for circle sizes ---------- */
@media (max-width: 769px){
  .sb-trade-card__top{ height: 220px; }
  .sb-trade-card__photo{ top: 20px; width: 180px; height: 180px; }
  .sb-trade-card__orange{ --size: 140px; top: 0px; }
  .sb-trade-card__iconwrap{ top: 70px; width: 100px; height: 100px; }
}

@media (max-width: 499px){
  .sb-trade-card{ padding: 28px 18px; }
  .sb-trade-card__top{ height: 200px; }
  .sb-trade-card__photo{ top: 18px; width: 160px; height: 160px; }
  .sb-trade-card__orange{ --size: 126px; top: 5px; }
  .sb-trade-card__iconwrap{ top: 70px; width: 92px; height: 92px; }
  .sb-trade-card h3{ font-size: 24px; }
  .sb-trade-card p{ font-size: 18px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce){
  .sb-trade-card__photo,
  .sb-trade-card__orange,
  .sb-icon--dark,
  .sb-icon--lightwrap,
  .sb-trade-card h3,
  .sb-trade-card p{
    transition: none !important;
  }
}
