/* ==========================================================================
   Heart to Kiss — site.css
   공통 UI: 검색 오버레이 / 카트 드로어 / 카카오 플로팅 / 상품 그리드 공통
   ========================================================================== */

/* --------------------------------------------------------------------------
   카트 뱃지
   -------------------------------------------------------------------------- */
.site-header__action--cart {
  position: relative;
}

.cart-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #1A1A1A;
  color: #fff;
  font-family: var(--font-numeric, 'Inter', monospace);
  font-size: 10px;
  font-weight: 700;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   검색 오버레이
   -------------------------------------------------------------------------- */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(255, 255, 255, 0.97);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 260ms var(--ease-out-soft, cubic-bezier(0.22,1,0.36,1));
  pointer-events: none;
  overflow-y: auto;
}

.search-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.search-overlay__header {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  z-index: 1;
}

.search-overlay__input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f5f5f5;
  border-radius: 12px;
  padding: 0 16px;
}

.search-overlay__input-wrap svg {
  flex-shrink: 0;
  color: #888;
}

.search-overlay__input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 16px;
  font-family: var(--font-body, 'Pretendard', sans-serif);
  padding: 14px 0;
  outline: none;
  color: #1A1A1A;
}

.search-overlay__input::placeholder {
  color: #aaa;
}

.search-overlay__close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: #1A1A1A;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 180ms;
}

.search-overlay__close:hover {
  background: #f5f5f5;
}

.search-overlay__body {
  flex: 1;
  padding: 24px;
  max-width: 960px;
  margin-inline: auto;
  width: 100%;
}

.search-hint {
  text-align: center;
  color: #aaa;
  font-size: 14px;
  margin-top: 48px;
}

/* 검색 결과 그리드 */
#searchGrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (min-width: 600px) {
  #searchGrid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  #searchGrid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.search-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #eee;
  transition: box-shadow 200ms, transform 200ms;
}

.search-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.search-card__thumb {
  aspect-ratio: 3/4;
  background: #f5f5f5;
}

.search-card__info {
  padding: 10px 12px 14px;
}

.search-card__cat {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.search-card__name {
  font-size: 13px;
  font-weight: 600;
  color: #1A1A1A;
  margin: 0 0 4px;
  line-height: 1.4;
}

.search-card__price {
  font-size: 13px;
  font-weight: 700;
  color: #1A1A1A;
  margin: 0;
}


/* --------------------------------------------------------------------------
   카트 드로어
   -------------------------------------------------------------------------- */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 350;
  opacity: 0;
  transition: opacity 300ms ease-out;
  pointer-events: none;
}

.cart-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  background: #fff;
  z-index: 400;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: -4px 0 32px rgba(0,0,0,0.12);
}

.cart-drawer.is-open {
  transform: translateX(0);
}

.cart-drawer__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}

.cart-drawer__title {
  font-family: var(--font-headline, 'Pretendard', sans-serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #1A1A1A;
  margin: 0;
}

.cart-drawer__count {
  font-size: 13px;
  color: #888;
  font-weight: 400;
  margin-left: 6px;
}

.cart-drawer__close {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #1A1A1A;
  transition: background 180ms;
  font-size: 20px;
  line-height: 1;
}

.cart-drawer__close:hover {
  background: #f5f5f5;
}

/* 카트 비어있을 때 */
.cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 48px 24px;
  text-align: center;
}

.cart-empty__icon {
  font-size: 48px;
  opacity: 0.3;
}

.cart-empty__title {
  font-size: 16px;
  font-weight: 600;
  color: #1A1A1A;
  margin: 0;
}

.cart-empty__desc {
  font-size: 13px;
  color: #aaa;
  margin: 0;
}

/* 카트 아이템 목록 */
.cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.cart-item-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.cart-item__thumb {
  width: 72px;
  height: 88px;
  border-radius: 6px;
  overflow: hidden;
  background: #f5f5f5;
  flex-shrink: 0;
}

.cart-item__info {
  min-width: 0;
}

.cart-item__name {
  font-size: 13px;
  font-weight: 600;
  color: #1A1A1A;
  margin: 0 0 4px;
  line-height: 1.4;
}

.cart-item__size {
  font-size: 12px;
  color: #aaa;
  margin: 0 0 10px;
}

.cart-item__qty-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.cart-qty-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #ddd;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #1A1A1A;
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
  line-height: 1;
  padding: 0;
}

.cart-qty-btn:hover {
  background: #f5f5f5;
  border-color: #bbb;
}

.cart-qty-num {
  font-size: 14px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.cart-item__price {
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  color: #1A1A1A;
}

.cart-item__remove {
  color: #bbb;
  font-size: 20px;
  line-height: 1;
  padding: 0;
  transition: color 150ms;
  align-self: flex-start;
  margin-top: 2px;
}

.cart-item__remove:hover {
  color: #1A1A1A;
}

/* 카트 하단 합계 + 버튼 */
.cart-drawer__footer {
  flex-shrink: 0;
  padding: 20px 24px 28px;
  border-top: 1px solid rgba(0,0,0,0.07);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-total-label {
  font-size: 13px;
  color: #888;
}

.cart-total-price {
  font-family: var(--font-numeric, 'Inter', monospace);
  font-size: 18px;
  font-weight: 700;
  color: #1A1A1A;
}

.cart-free-ship {
  font-size: 12px;
  color: #A8E6CF;
  text-align: center;
}

.cart-checkout-btn {
  display: block;
  width: 100%;
  min-height: 52px;
  background: #1A1A1A;
  color: #fff;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: opacity 200ms;
  text-decoration: none;
  line-height: 52px;
}

.cart-checkout-btn:hover {
  opacity: 0.82;
  color: #fff;
}


/* --------------------------------------------------------------------------
   카카오톡 플로팅 버튼
   -------------------------------------------------------------------------- */
.kakao-float {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.kakao-float__btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #FEE500;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transition: transform 200ms var(--ease-out-soft, cubic-bezier(0.22,1,0.36,1)),
              box-shadow 200ms;
  text-decoration: none;
  cursor: pointer;
}

.kakao-float__btn:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.kakao-float__btn svg {
  display: block;
}

.kakao-float__label {
  background: #1A1A1A;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 6px 10px;
  border-radius: 20px;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 200ms, transform 200ms;
  pointer-events: none;
}

.kakao-float:hover .kakao-float__label {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 480px) {
  .kakao-float {
    bottom: 20px;
    right: 16px;
  }
  .kakao-float__btn {
    width: 48px;
    height: 48px;
  }
}


/* --------------------------------------------------------------------------
   공통 상품 그리드 (카테고리 페이지용)
   -------------------------------------------------------------------------- */
.prod-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 12px;
}

@media (min-width: 768px) {
  .prod-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px 20px;
  }
}

@media (min-width: 1024px) {
  .prod-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 28px 24px;
  }
}

/* 번들 그리드 — 큰 카드 PC 2열, 모바일 1열 */
.prod-grid--bundles {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .prod-grid--bundles {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (min-width: 1024px) {
  .prod-grid--bundles {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
}

.prod-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.prod-card__media {
  aspect-ratio: 3/4;
  border-radius: 6px;
  overflow: hidden;
  background: #f5f5f5;
  margin-bottom: 10px;
  position: relative;
  transition: transform 280ms var(--ease-out-soft, cubic-bezier(0.22,1,0.36,1));
}

.prod-card:hover .prod-card__media {
  transform: scale(1.02);
}

.prod-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.prod-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #1A1A1A;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 7px;
  border-radius: 3px;
}

.prod-card__badge--best {
  background: #A8E6CF;
  color: #1A1A1A;
}

/* 오른쪽 배지 (NEW / DISCOUNT) — 좌측 BEST 와 충돌 방지 */
.prod-card__badge--new,
.prod-card__badge--discount {
  top: 8px;
  left: auto;
  right: 8px;
}

/* BUNDLE 배지 — 하단 왼쪽 */
.prod-card__badge--bundle {
  top: auto;
  bottom: 8px;
  left: 8px;
}

.prod-card__badge--new {
  background: #A8E6CF;
  color: #1A1A1A;
}

.prod-card__badge--discount {
  background: #E53935;
  color: #FFFFFF;
}

.prod-card__badge--bundle {
  background: #1A1A1A;
  color: #FFFFFF;
}

/* 번들 카드 구성품 텍스트 */
.prod-card__bundle-info {
  font-size: 0.75rem;
  color: #6B6B6B;
  line-height: 1.4;
  margin-top: -4px;
}

.prod-card__price-original {
  font-size: 0.8rem;
  color: #aaa;
  text-decoration: line-through;
  margin: 0;
}

.prod-card__price--sale {
  color: #E53935;
}

.prod-card__cat {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.prod-card__name {
  font-size: 14px;
  font-weight: 600;
  color: #1A1A1A;
  margin: 0 0 6px;
  line-height: 1.4;
}

.prod-card__price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.prod-card__price {
  font-family: var(--font-numeric, 'Inter', monospace);
  font-size: 14px;
  font-weight: 700;
  color: #1A1A1A;
  margin: 0;
}

.prod-card__price--orig {
  font-size: 12px;
  color: #bbb;
  text-decoration: line-through;
  font-weight: 400;
}

.prod-card__price--sale {
  color: #E53935;
}

/* 필터/정렬 바 */
.cat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}

.cat-toolbar__count {
  font-size: 13px;
  color: #888;
}

.cat-toolbar__sort {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cat-sort-btn {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #aaa;
  padding: 6px 12px;
  border-radius: 100px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 160ms;
  background: transparent;
}

.cat-sort-btn.is-active,
.cat-sort-btn:hover {
  color: #1A1A1A;
  border-color: #1A1A1A;
}

/* ── 위시리스트 헤더 아이콘 + 뱃지 ──────────────────────────────────────── */
.site-header__action--wishlist {
  position: relative;
}

.wishlist-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #E53935;
  color: #fff;
  font-family: var(--font-numeric, 'Inter', monospace);
  font-size: 10px;
  font-weight: 700;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

/* ── 토스트 알림 ─────────────────────────────────────────────────────────── */
.htk-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(26, 26, 26, 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 100px;
  white-space: nowrap;
  z-index: 9999;
  opacity: 0;
  transition: opacity 220ms, transform 220ms var(--ease-out-soft, cubic-bezier(0.22,1,0.36,1));
  pointer-events: none;
}

.htk-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 로딩 스켈레톤 */
.prod-grid--loading .prod-card__media {
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 0.3; }
}
