#cardArea{
    display: grid;
    width: 90%;
    margin-left: 5%;
    margin-right: 5%;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;       /* space between cards */
    padding: 1rem;
}

.custom-card{
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  max-width: 30vw;
  transition: transform .12s ease, box-shadow .12s ease;
}
.custom-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.08);

}
.card-img{
  width: 100%;
  aspect-ratio: 9 / 16;        /* keeps rows even while loading */
  object-fit: cover;
  background: #f3f4f6;  
}
.card-img:hover{
    cursor: pointer;
}

.custom-card-body{
    padding: .75rem .9rem 1rem; 
    display: grid;
     gap: .5rem;
}

.custom-card-title{
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.custom-card-title:hover{
    cursor: pointer;
    text-decoration: underline;
}

#categories{
  height: 30vh;                 /* fixed strip height */
  display: flex;                /* lay cards in a row */
  align-items: stretch;         /* make cards fill 20vh */
  gap: 1rem;
  overflow-x: hidden;             /* scroll horizontally if needed */
  overflow-y: hidden;           /* keep everything inside the strip */
  padding: 0 1rem;
}

/* One card = vertical stack */
.feature-card{
  flex: 0 0 clamp(160px, 20vw, 220px);
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto; /* img grows, text auto */
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: transform .12s ease, box-shadow .12s ease;

}

.feature-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  cursor: pointer;
}

.feature-card img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature-card h3,
.feature-card p{
  margin: .4rem .6rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.loader {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  border: 10px solid;
  box-sizing: border-box;
  animation: animloader 1s linear infinite alternate;
}
@keyframes animloader {
  0% {
    border-color: white rgba(255, 255, 255, 0) rgba(255, 255, 255, 0) rgba(255, 255, 255, 0);
  }
  33% {
    border-color: white white rgba(255, 255, 255, 0) rgba(255, 255, 255, 0);
  }
  66% {
    border-color: white white white rgba(255, 255, 255, 0);
  }
  100% {
    border-color: white white white white;
  }
}

/* Mobile Responsive Styles for Shop */
@media (max-width: 768px) {
  #cardArea {
    width: 95%;
    margin-left: 2.5%;
    margin-right: 2.5%;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 0.75rem;
  }

  #categories {
    height: 22vh;
    gap: 0.75rem;
    padding: 0 0.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }

  .feature-card {
    flex: 0 0 clamp(140px, 35vw, 180px);
    scroll-snap-align: start;
  }

  .custom-card-body {
    padding: 0.5rem 0.6rem 0.75rem;
  }

  .custom-card-title {
    font-size: 0.9rem;
  }

  .card-img {
    aspect-ratio: 3 / 4;
  }
}

@media (max-width: 480px) {
  #cardArea {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0.5rem;
  }

  #categories {
    height: 18vh;
    gap: 0.5rem;
    padding: 0 0.5rem;
  }

  .feature-card {
    flex: 0 0 clamp(100px, 40vw, 140px);
  }

  .feature-card h3 {
    font-size: 0.85rem;
    margin: 0.3rem 0.4rem;
  }

  .feature-card p {
    font-size: 0.75rem;
    margin: 0.2rem 0.4rem;
  }

  .custom-card-title {
    font-size: 0.8rem;
  }

  .custom-card-body {
    padding: 0.4rem 0.5rem 0.6rem;
    gap: 0.3rem;
  }
} 