@charset "UTF-8";
/* ==========================================================================
   상품 목록/상세 (product) — /products, /products/{id}
   site.css 의 토큰과 .card/.btn/.badge 를 재사용하고 여기서 확장만 한다.
   모바일 퍼스트, 브레이크포인트 640px / 1024px
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 카테고리 탭
   -------------------------------------------------------------------------- */
.product-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-2);
    overflow-x: auto;               /* 모바일에서 가로 스크롤 */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.product-tabs__link {
    flex: 0 0 auto;
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-size: var(--font-size-base);
    font-weight: 700;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.product-tabs__link:hover,
.product-tabs__link:focus-visible {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.product-tabs__link--active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.product-tabs__link--active:hover,
.product-tabs__link--active:focus-visible {
    background: var(--color-primary-dark);
    color: #fff;
}

@media (min-width: 640px) {
    .product-tabs {
        flex-wrap: wrap;
        overflow-x: visible;
    }
}

/* --------------------------------------------------------------------------
   2. 목록 그리드 / 상품 카드
   -------------------------------------------------------------------------- */
.product-list__count {
    margin-bottom: var(--space-3);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.product-list__count strong {
    color: var(--color-primary);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-4);
}

@media (min-width: 640px) {
    .product-grid {
        gap: var(--space-5);
    }
}

.product-card {
    color: inherit;
    text-decoration: none;
}

/* 품절 뱃지 기준점 */
.product-card__media {
    position: relative;
}

.product-card__soldout {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(35, 36, 31, .45);
    color: #fff;
    font-size: var(--font-size-md);
    font-weight: 700;
    letter-spacing: .05em;
}

.product-card__name {
    display: block;
    line-height: var(--line-height-tight);
}

.product-card__summary {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    line-height: 1.5;
}

.product-card__price {
    display: block;
    margin-top: auto;
    padding-top: var(--space-2);
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-accent);
}

.product-list__notice {
    margin-top: var(--space-8);
}

/* --------------------------------------------------------------------------
   3. 상세 - 레이아웃
   -------------------------------------------------------------------------- */
.product-detail {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    margin-bottom: var(--space-10);
}

.product-detail > * {
    min-width: 0;
}

@media (min-width: 640px) {
    .product-detail {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: var(--space-8);
    }
}

/* 좌: 이미지 */
.product-detail__media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--color-cream);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

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

.product-detail__soldout {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(35, 36, 31, .45);
    color: #fff;
    font-size: var(--font-size-xl);
    font-weight: 700;
    letter-spacing: .08em;
}

/* 우: 정보 */
.product-detail__category {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--space-1);
}

.product-detail__name {
    font-size: var(--font-size-xl);
    line-height: var(--line-height-tight);
    margin-bottom: var(--space-2);
}

.product-detail__summary {
    font-size: var(--font-size-base);
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
}

.product-detail__price {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-accent);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

@media (min-width: 1024px) {
    .product-detail__name {
        font-size: var(--font-size-2xl);
    }
}

/* --------------------------------------------------------------------------
   4. 상세 - 스펙 목록
   -------------------------------------------------------------------------- */
.product-spec {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: var(--space-2) var(--space-3);
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--color-border);
    font-size: var(--font-size-base);
}

.product-spec dt {
    color: var(--color-text-muted);
    font-weight: 700;
}

.product-spec dd {
    color: var(--color-text);
}

.product-spec__note {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   5. 상세 - 구매 폼 (수량 + 장바구니)
   -------------------------------------------------------------------------- */
.product-buy {
    padding-top: var(--space-5);
}

.product-qty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.product-qty__label {
    font-size: var(--font-size-base);
    font-weight: 700;
}

.product-qty__control {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    overflow: hidden;
}

.product-qty__btn {
    width: 44px;
    min-height: 44px;
    border: 0;
    background: var(--color-cream);
    color: var(--color-text);
    font-size: var(--font-size-lg);
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition);
}

.product-qty__btn:hover:not([disabled]) {
    background: var(--color-primary-light);
}

.product-qty__btn[disabled] {
    opacity: .5;
    cursor: not-allowed;
}

.product-qty__input {
    width: 64px;
    min-height: 44px;
    padding: 0 var(--space-2);
    border: 0;
    border-inline: 1px solid var(--color-border);
    text-align: center;
    font-size: var(--font-size-base);
    font-weight: 700;
    background: var(--color-surface);
    color: var(--color-text);
}

.product-buy__total {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
    background: var(--color-cream);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
}

.product-buy__total strong {
    font-size: var(--font-size-lg);
    color: var(--color-accent);
}

.product-buy__total .text-muted {
    font-size: var(--font-size-xs);
}

.product-buy__submit {
    min-height: 52px;
    font-size: var(--font-size-md);
}

.product-buy__help {
    margin-top: var(--space-3);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.product-buy__help a {
    color: var(--color-primary);
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   6. 상세 - 하단 영역
   -------------------------------------------------------------------------- */
.product-description .content-body {
    padding: var(--space-2) 0;
}

.product-related .product-card__price {
    font-size: var(--font-size-base);
}
