/*
  =============================================
  ✨ Compact 최종 CSS (shop-card.php 대응)
  =============================================
*/

/* 카드 컨테이너 */
.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

/* 카드 전체 */
.shop-card {
  display: flex;
  flex-direction: column;
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}
.shop-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* ================== 이미지 ================== */
.shop-card .shop-img {
  position: relative;
  width: 100%;
  height: 200px;   /* ⬅ 고정 높이 (flex 제거) */
  overflow: hidden;
  flex: none;      /* ⬅ flex 비율 삭제 */
}
.shop-card .shop-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease-in-out;
}
.shop-card:hover .shop-img img {
  transform: scale(1.05);
}

/* ================== 이미지 내부 요소 ================== */
.shop-card .shop-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
}
.shop-card .shop-badges span {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  color: #fff;
  text-shadow: 0 0 2px rgba(0,0,0,0.4);
}

/* 배지 색상 */
.shop-card .badge-BEST,
.shop-card .badge-베스트 { background: gold; color: #000; }
.shop-card .badge-강추 { background: crimson; }
.shop-card .badge-신규,
.shop-card .badge-신규이벤트 { background: dodgerblue; }
.shop-card .badge-인기 { background: seagreen; }
.shop-card .badge-추천 { background: purple; }
.shop-card .badge-할인이벤트 { background: darkorange; }

/* 리본 */
.shop-card .shop-ribbon {
  position: absolute;
  top: 24px;
  right: -28px;
  transform: rotate(45deg);
  width: 140px;
  background: #ff0000;
  color: #fff;
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  padding: 4px 0;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  text-shadow: 0 0 2px rgba(0,0,0,0.4);
  z-index: 2;
}

/* 영업 상태 */
.shop-card .shop-status {
  position: absolute;
  bottom: 0;
  left: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  background-color: rgba(0, 0, 0, 0.4);
  color: #fff;
  z-index: 2;
  backdrop-filter: blur(2px);
}
.shop-card .shop-status.open { color: #27ae60; }
.shop-card .shop-status.closed { color: #e74c3c; }

/* 거리 */
.shop-card .shop-distance {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  z-index: 2;
}

/* ================== 본문 ================== */
.shop-card .shop-body {
  flex: none;      /* ⬅ flex 비율 삭제 */
  padding: 12px;
  background: #fff;
  position: relative;
  z-index: 1;      /* ⬅ 불필요한 z-index는 삭제 가능 */
}
/* 제목 + 액션 버튼 */
.shop-card .shop-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 6px 0;
}
.shop-card .shop-card-title {
  font-size: 14px;
  font-weight: 700;
  margin: 8px 0 6px;  /* ⬅ 위쪽 여백 주고 밑으로 내림 */
  color: #333;
  display: block;
}

.shop-card .shop-card-actions {
  display: flex;
  gap: 6px;
}
.shop-card .shop-card-actions a {
  font-size: 13px;
  color: #666;
  transition: color 0.2s;
}
.shop-card .shop-card-actions a:hover {
  color: #e74c3c;
}

/* 주소 */
.shop-card .shop-addr {
  font-size: 12px;
  color: #777;
  margin-bottom: 4px;
}

/* 평점 + 리뷰 + 좋아요 */
.shop-card .shop-rating {
  display: flex;
  gap: 12px;
  font-size: 12px;
  margin-bottom: 6px;
}
.shop-card .shop-rating span {
  display: flex;
  align-items: center;
  gap: 3px;
}
.shop-card .shop-rating i.fa-star { color: #f39c12; }
.shop-card .shop-rating i.fa-comment-dots { color: #555; }
.shop-card .shop-rating i.fa-heart { color: #e74c3c; }

/* 가격 */
.shop-card .shop-price {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.shop-card .price-old {
  text-decoration: line-through;
  color: #b5b5b5;
  font-size: 12px;
}
.shop-card .price-new {
  font-weight: 800;
  color: #000;
  font-size: 14px;
}
.shop-card .price-discount {
  background: #d32f2f;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}

/* 구분선 */
.shop-card .shop-divider {
  border: none;
  border-top: 1px dashed rgba(0,0,0,0.08);
  margin: 6px 0;
}

/* 태그 */
.shop-card .shop-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.shop-card .shop-tags span {
  font-size: 11px;
  color: #333;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 2px 6px;
}

/* ================== 반응형 ================== */
@media (max-width: 768px) {
  .card-container {
    display: grid !important;
    grid-template-columns: 1fr !important; /* ✅ 무조건 1장 */
    gap: 12px;
    padding: 12px;
    overflow-x: unset !important; /* ✅ 가로 스크롤 막기 */
    white-space: normal !important;
  }

  .shop-card {
    width: 100% !important;   /* ✅ 카드 전체 폭 */
    max-width: 100% !important;
  }

  .shop-card .shop-img {
    height: 180px; /* 모바일에서 고정 높이 줄임 */
  }
}

