/**
 * 고객 스토어 — 대시보드형 TDS + Pretendard
 */

.client-store-page,
.client-store-page * {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

.client-store-page {
  --ts-blue: var(--tds-blue500, #3182f6);
  --ts-text: var(--tds-grey900, #191f28);
  --ts-sub: var(--tds-grey600, #6b7684);
  --ts-muted: var(--tds-grey500, #8b95a1);
  --ts-line: var(--tds-grey200, #e5e8eb);
}

.client-store-page .client-store.client-dash {
  max-width: none;
  width: 100%;
  margin: 0;
  padding-bottom: 2.5rem;
}

.client-store-page .client-dash-panel__head {
  flex-wrap: wrap;
  gap: 0.75rem;
}

.client-store-page .client-dash-panel__title {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.client-store-page .client-dash-panel__head .ts-toolbar__hint {
  margin-top: 0.25rem;
}

.client-store-page.has-store-buybar .client-store.client-dash {
  padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
}

.client-store-page.has-store-drawer .ts-buybar,
.client-store-page.has-store-drawer .store-detail__sticky-cta {
  visibility: hidden;
  pointer-events: none;
}

/* ── Toolbar inside panel head ── */
.ts-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ts-toolbar__hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ts-muted);
  font-weight: 500;
}

.client-store__cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.4rem;
  padding: 0 0.9rem;
  border: 1px solid var(--ts-line);
  border-radius: var(--tds-radius-md, 0.75rem);
  background: #fff;
  color: var(--ts-text);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.client-store__cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--ts-blue);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
}

/* ── Category chips ── */
.ts-cats {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0 0 0.25rem;
  margin-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ts-cats::-webkit-scrollbar {
  display: none;
}

.ts-cat {
  flex-shrink: 0;
  border: 1px solid var(--ts-line);
  background: #fff;
  color: var(--ts-sub);
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.ts-cat.is-active {
  background: var(--ts-text);
  border-color: var(--ts-text);
  color: #fff;
}

/* ── Product grid (PC 5열) ── */
.ts-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--tds-space-md, 1rem) var(--tds-space-sm, 0.75rem);
}

.ts-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: transparent;
  border: none;
}

.ts-card__link {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.ts-card__media {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--tds-radius-lg, 1rem);
  overflow: hidden;
  background: var(--tds-grey50, #f9fafb);
  margin-bottom: 0.15rem;
}

.ts-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ts-card__badge {
  position: absolute;
  left: 0.45rem;
  top: 0.45rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.45rem;
  border-radius: var(--tds-radius-sm, 0.5rem);
  background: rgba(25, 31, 40, 0.78);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
}

.ts-card__badge--hot {
  background: var(--tds-red500, #f04452);
}

.ts-card__badge--best {
  background: var(--tds-blue500, #3182f6);
}

.ts-card__name {
  margin: 0;
  font-size: var(--tds-typo6-size, 0.9375rem);
  line-height: var(--tds-typo6-line, 1.4);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--tds-text-primary, #191f28);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
}

.ts-card__price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  min-height: var(--tds-typo6-line, 1.4rem);
}

.ts-card__discount {
  color: var(--tds-red500, #f04452);
  font-size: var(--tds-typo6-size, 0.9375rem);
  line-height: var(--tds-typo6-line, 1.4);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ts-card__price {
  font-size: var(--tds-typo6-size, 0.9375rem);
  line-height: var(--tds-typo6-line, 1.4);
  font-weight: 700;
  color: var(--tds-text-primary, #191f28);
  letter-spacing: -0.02em;
}

.ts-card__list {
  font-size: var(--tds-typo7-size, 0.8125rem);
  line-height: var(--tds-typo7-line, 1.25);
  font-weight: 500;
  color: var(--tds-text-tertiary, #8b95a1);
  text-decoration: line-through;
  letter-spacing: -0.01em;
}

.ts-card__actions {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.ts-card__actions .btn {
  min-height: 2.25rem;
  font-size: var(--tds-typo7-size, 0.8125rem);
  font-weight: 600;
  border-radius: var(--tds-radius-md, 0.75rem);
  font-family: inherit;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

/* ── Floating buy bar (담은 뒤에도 드로어는 닫힌 채 유지 가능) ── */
.ts-buybar {
  position: fixed;
  z-index: 900;
  left: 50%;
  bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(26rem, calc(100% - 1.5rem));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.75rem 0.7rem 1rem;
  background: rgba(25, 31, 40, 0.94);
  color: #fff;
  backdrop-filter: blur(12px);
  border-radius: 1.15rem;
  box-shadow: 0 12px 32px rgba(2, 9, 19, 0.22);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

.ts-buybar[hidden] {
  display: none !important;
}

.ts-buybar__meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.ts-buybar__meta span {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 600;
}

.ts-buybar__meta strong {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

.ts-buybar .btn {
  min-width: 7.5rem;
  min-height: 2.55rem;
  border-radius: 0.85rem;
  font-weight: 800;
  background: var(--ts-blue);
  border-color: var(--ts-blue);
  color: #fff;
  font-family: inherit;
}

@media (min-width: 1024px) {
  .ts-buybar {
    left: calc(var(--sidebar-width, 280px) + (100vw - var(--sidebar-width, 280px)) / 2);
  }
}

/* ── Detail (Toss-like compact) ── */
.client-store--detail {
  padding-bottom: 1rem;
}

.client-store-page.has-store-detail-cta .client-store--detail {
  padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
}

.store-detail__back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ts-sub);
  text-decoration: none;
  font-family: inherit;
}

.store-detail__back:hover {
  color: var(--ts-blue);
}

.store-detail {
  display: grid;
  grid-template-columns: 12.5rem minmax(0, 1fr);
  gap: 1.5rem 1.75rem;
  margin-bottom: 0;
  align-items: start;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--ts-line);
}

.store-detail__gallery {
  width: 12.5rem;
  max-width: 100%;
}

.store-detail__media {
  aspect-ratio: 1;
  width: 100%;
  border-radius: 1rem;
  overflow: hidden;
  background: var(--tds-grey50, #f9fafb);
  border: 1px solid var(--ts-line);
}

.store-detail__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.store-detail__info {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
  padding-top: 0.15rem;
}

.store-detail__cat {
  display: inline-flex;
  align-self: flex-start;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--tds-blue50, #e8f3ff);
  color: var(--tds-blue700, #1b64da);
  font-size: 0.7rem;
  font-weight: 800;
  font-family: inherit;
}

.store-detail__name {
  margin: 0;
  font-size: var(--tds-typo3-size, 1.375rem);
  line-height: var(--tds-typo3-line, 1.5);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tds-text-primary, #191f28);
}

.store-detail__summary {
  margin: 0;
  font-size: var(--tds-typo6-size, 0.9375rem);
  line-height: var(--tds-typo6-line, 1.5);
  color: var(--tds-text-secondary, #6b7684);
}

.store-detail__list-price {
  font-size: var(--tds-typo7-size, 0.8125rem);
  line-height: var(--tds-typo7-line, 1.25);
  font-weight: 500;
  color: var(--tds-text-tertiary, #8b95a1);
  text-decoration: line-through;
  letter-spacing: -0.01em;
}

.store-detail__price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.2rem 0.4rem;
}

.store-detail__discount {
  color: var(--tds-red500, #f04452);
  font-size: var(--tds-typo4-size, 1.25rem);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.store-detail__price strong {
  font-size: var(--tds-typo4-size, 1.25rem);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tds-text-primary, #191f28);
}

.store-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.15rem 0 0;
  padding: 0;
  list-style: none;
}

.store-detail__meta li {
  display: inline-flex;
  align-items: center;
  min-height: 1.85rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--tds-grey50, #f9fafb);
  color: var(--ts-sub);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
}

.store-detail__cta {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.5rem;
  margin-top: 0.35rem;
  max-width: 22rem;
}

.store-detail__cta .btn {
  min-height: 3rem;
  border-radius: 0.85rem;
  font-weight: 800;
  font-family: inherit;
}

.store-detail__sticky-cta {
  position: fixed;
  z-index: 900;
  left: 50%;
  bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(26rem, calc(100% - 1.5rem));
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 0.5rem;
  padding: 0.65rem;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid var(--ts-line);
  border-radius: 1.15rem;
  box-shadow: 0 12px 32px rgba(2, 9, 19, 0.14);
}

.store-detail__sticky-cta .btn {
  min-height: 2.75rem;
  border-radius: 0.85rem;
  font-weight: 800;
  font-family: inherit;
}

@media (min-width: 860px) {
  .store-detail__sticky-cta {
    display: none;
  }
}

@media (max-width: 859px) {
  .store-detail {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: left;
    gap: 1.1rem;
  }

  .store-detail__gallery {
    width: min(11rem, 48vw);
  }

  .store-detail__info {
    width: 100%;
  }

  .store-detail__cta {
    display: none;
  }
}

@media (min-width: 1024px) {
  .store-detail__sticky-cta {
    left: calc(var(--sidebar-width, 280px) + (100vw - var(--sidebar-width, 280px)) / 2);
  }
}

.store-detail__body-card {
  padding-top: 1.35rem;
}

.store-detail__body-title {
  margin: 0 0 0.9rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ts-text);
}

.store-detail__body,
.store-detail__body * {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

.store-detail__body .store-detail-lead {
  margin: 0 0 1.15rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--tds-grey700, #4e5968);
}

.store-detail__body h3 {
  margin: 1.25rem 0 0.6rem;
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--ts-text);
}

.store-detail-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.store-detail-list li {
  position: relative;
  padding: 0.7rem 0.85rem 0.7rem 2rem;
  border-radius: var(--tds-radius-md, 0.75rem);
  background: var(--tds-grey50, #f9fafb);
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--tds-grey800, #333d4b);
}

.store-detail-list li::before {
  content: '';
  position: absolute;
  left: 0.85rem;
  top: 1rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--ts-blue);
}

.store-detail-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.6rem;
}

.store-detail-steps li {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--tds-grey800, #333d4b);
}

.store-detail-step-num {
  flex-shrink: 0;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ts-blue);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.store-detail-note {
  margin-top: 1.25rem;
  padding: 0.95rem 1rem;
  border-radius: var(--tds-radius-md, 0.75rem);
  background: var(--tds-blue50, #e8f3ff);
}

.store-detail-note strong {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.8rem;
  color: var(--tds-blue700, #1b64da);
}

.store-detail-note p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--tds-grey700, #4e5968);
}

/* ── Drawer (기본 닫힘) ── */
.client-store-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(2, 9, 19, 0.4);
}

.client-store-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1410;
  width: min(100%, 400px);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: -12px 0 40px rgba(2, 9, 19, 0.12);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

.client-store-drawer[hidden],
.client-store-drawer-backdrop[hidden] {
  display: none !important;
}

.client-store-drawer__head,
.client-store-drawer__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--ts-line);
}

.client-store-drawer__foot {
  border-bottom: none;
  border-top: 1px solid var(--ts-line);
  flex-direction: column;
  align-items: stretch;
}

.client-store-drawer__head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.client-store-drawer__close {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.25rem;
}

.client-store-drawer__body {
  flex: 1;
  overflow: auto;
  padding: 0.75rem 1.1rem;
}

.client-store-drawer__empty {
  margin: 2rem 0;
  text-align: center;
  color: var(--ts-muted);
  font-size: 0.875rem;
}

.client-store-drawer__row {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--tds-grey100, #f2f4f6);
}

.client-store-drawer__thumb {
  width: 64px;
  height: 64px;
  border-radius: 0.65rem;
  overflow: hidden;
  background: var(--tds-grey50, #f9fafb);
  flex-shrink: 0;
}

.client-store-drawer__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.client-store-drawer__thumb-ph {
  width: 100%;
  height: 100%;
  background: var(--tds-grey100, #f2f4f6);
}

.client-store-drawer__meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.client-store-drawer__meta strong {
  font-size: 0.875rem;
  font-weight: 700;
}

.client-store-drawer__meta > span {
  font-size: 0.8125rem;
  color: var(--ts-sub);
}

.client-store-drawer__qty {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.client-store-drawer__qty button {
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--ts-line);
  border-radius: 0.45rem;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
}

.client-store-drawer__remove {
  width: auto !important;
  padding: 0 0.5rem !important;
  margin-left: 0.35rem;
  font-size: 0.75rem;
  color: #f04452;
  border-color: #fecdd3 !important;
}

.client-store-drawer__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9375rem;
}

.client-store-drawer__total strong {
  font-size: 1.125rem;
  font-weight: 800;
}

/* ── Buy choice modal ── */
.store-buy-modal {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

.store-buy-modal[hidden] {
  display: none !important;
}

.store-buy-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 9, 19, 0.45);
  backdrop-filter: blur(4px);
}

.store-buy-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 22.5rem);
  padding: 1.25rem 1.2rem 1.1rem;
  border-radius: 1.25rem;
  background: #fff;
  box-shadow: 0 16px 48px rgba(2, 9, 19, 0.16);
}

.store-buy-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.store-buy-modal__head h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ts-text, #191f28);
  line-height: 1.35;
}

.store-buy-modal__close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 0.65rem;
  background: transparent;
  color: var(--ts-muted, #8b95a1);
  cursor: pointer;
}

.store-buy-modal__close:hover {
  background: var(--tds-grey50, #f9fafb);
  color: var(--ts-text, #191f28);
}

.store-buy-modal__desc {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ts-sub, #6b7684);
}

.store-buy-modal__choices {
  display: grid;
  gap: 0.55rem;
}

.store-buy-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  width: 100%;
  padding: 0.95rem 1rem;
  border: 1px solid var(--ts-line, #e5e8eb);
  border-radius: 0.95rem;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.store-buy-choice:hover:not(:disabled) {
  border-color: #90c2ff;
  background: #f5f9ff;
}

.store-buy-choice:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.store-buy-choice strong {
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--ts-text, #191f28);
  letter-spacing: -0.02em;
}

.store-buy-choice span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ts-muted, #8b95a1);
  line-height: 1.4;
}

.store-buy-choice--primary {
  border-color: #c9e2ff;
  background: var(--tds-blue50, #e8f3ff);
}

.store-buy-choice--primary:hover:not(:disabled) {
  border-color: var(--ts-blue, #3182f6);
  background: #dbeafe;
}

.store-buy-choice--primary strong {
  color: var(--tds-blue700, #1b64da);
}

.store-buy-modal__cancel {
  width: 100%;
  margin-top: 0.75rem;
  min-height: 2.6rem;
  border-radius: 0.85rem;
  font-weight: 700;
  font-family: inherit;
}

.client-store__card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tds-grey400, #b0b8c1);
}

.client-store-panel__body {
  padding: var(--cd-padding, 1.25rem);
}

@media (max-width: 1280px) {
  .ts-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .ts-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .ts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .ts-grid {
    grid-template-columns: 1fr;
  }
}
