.catalogShell,
.catalogShell *,
.catalogShell *::before,
.catalogShell *::after {
    box-sizing: border-box;
}

.catalogShell {
    width: var(--catalog-shell-width, 1000px);
    max-width: var(--catalog-shell-max-width, 100%);
    margin: var(--catalog-shell-margin, 0 auto);
    padding: var(--catalog-shell-padding, 0);
}

.catalogShell--mobile.catalogShell--without-identity {
    margin-top: 10px;
    padding-top: 0;
}

.catalogShell__identity,
.catalogShell__category,
.catalogShell__toolbar,
.catalogShell__results,
.catalogShell__section,
.catalogShell__grid,
[data-catalog-card] {
    min-width: 0;
}

.catalogShell__grid {
    display: grid;
    grid-template-columns: repeat(var(--catalog-shell-grid-columns, 4), minmax(0, 1fr));
    gap: var(--catalog-shell-grid-gap, 42px 20px);
}

.catalogShell--factory > [data-catalog-sticky-owner="category"] {
    position: sticky;
    z-index: 25;
    top: var(--catalog-shell-sticky-offset, 0px);
}

[data-catalog-card] {
    display: flex;
    min-height: 100%;
    flex-direction: column;
}

[data-catalog-media],
[data-catalog-card-action] {
    text-decoration: none;
}

/* 목록 페이지가 함께 사용하는 소개, 카테고리, 상태 전환 규칙 */
.catalogListIdentity {
    padding: 48px 0 32px;
}

.catalogListIdentity__title {
    margin: 0;
    color: var(--bj-text, #303c45);
    font-family: var(--bj-font-family, "Pretendard", sans-serif);
    font-size: var(--bj-type-page, 28px);
    line-height: var(--bj-type-page-line, 38px);
}

.catalogListIdentity__description {
    margin: 8px 0 0;
    color: var(--bj-muted, #66635e);
    font-family: var(--bj-font-family, "Pretendard", sans-serif);
    font-size: var(--bj-type-body, 16px);
    line-height: var(--bj-type-body-line, 26px);
}

.catalogCategoryNav {
    display: flex;
    min-width: max-content;
    align-items: flex-end;
    justify-content: center;
    gap: var(--catalog-category-group-gap, 44px);
}

.catalogCategoryNav__group {
    display: flex;
    min-width: max-content;
    align-items: flex-end;
    margin: 0;
    gap: var(--catalog-category-gap, 44px);
}

.catalogCategoryNav__group--related {
    position: relative;
}

.catalogCategoryNav__group--related::before {
    content: '';
    position: absolute;
    top: 20px;
    left: calc(var(--catalog-category-group-gap, 44px) / -2);
    width: 1px;
    height: 28px;
    background: var(--catalog-nav-group-line, #cfd6d9);
}

.catalogCategoryNav__item {
    display: flex;
    position: relative;
    width: var(--catalog-category-item-width, 72px);
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    padding: 0 0 18px;
    gap: 8px;
    color: var(--bj-muted, #66635e);
    text-decoration: none;
}

.catalogCategoryNav__item::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    width: 32px;
    height: 2px;
    background: transparent;
    transform: translateX(-50%);
}

.catalogCategoryNav__item:is(.is-current, [aria-current="page"]) {
    color: var(--bj-text, #303c45);
    font-weight: var(--bj-type-nav-weight, 600);
}

.catalogCategoryNav__item:is(.is-current, [aria-current="page"])::after {
    background: var(--bj-brand-navy, #1b2631);
}

.catalogCategoryNav__icon {
    display: flex;
    width: var(--bj-catalog-category-tile, 36px);
    height: var(--bj-catalog-category-tile, 36px);
    align-items: center;
    justify-content: center;
    border-radius: var(--bj-catalog-category-radius, 8px);
    background: transparent;
    transition: background-color 160ms ease;
}

.catalogCategoryNav__icon img {
    display: block;
    width: var(--bj-catalog-category-icon, 24px);
    height: var(--bj-catalog-category-icon, 24px);
    object-fit: contain;
}

.catalogCategoryNav__label {
    font-size: var(--bj-catalog-category-label-pc, 15px);
    line-height: 20px;
    white-space: nowrap;
}

.catalogOutlineSwitch {
    display: flex;
    margin: 0;
    gap: 8px;
}

.catalogOutlineSwitch a {
    display: inline-flex;
    height: var(--catalog-outline-control-height, 40px);
    min-width: var(--catalog-outline-control-width, 112px);
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 1px solid var(--catalog-outline-control-border, #b8c0c3);
    border-radius: var(--bj-catalog-cta-radius, 8px);
    color: var(--bj-muted, #66635e);
    background: #fff;
    font-size: var(--bj-catalog-quantity-size, 13px);
    font-weight: var(--bj-type-control-weight, 500);
    text-decoration: none;
}

.catalogOutlineSwitch a:is(.is-current, [aria-current="page"]) {
    color: var(--bj-brand-navy, #1b2631);
    font-weight: var(--bj-type-nav-weight, 600);
}

@media (hover: hover) and (pointer: fine) {
    .catalogCategoryNav__item:hover,
    .catalogOutlineSwitch a:hover {
        color: var(--bj-text, #303c45);
    }

    .catalogCategoryNav__item:hover .catalogCategoryNav__icon {
        background: var(--catalog-nav-icon-tile-hover-bg, #f5f6f6);
    }

    .catalogOutlineSwitch a:hover {
        border-color: var(--catalog-outline-control-hover-border, #88949a);
        background: var(--catalog-outline-control-hover-background, #fafafa);
    }
}

/* 모든 카탈로그 카드 제목은 이 한 규칙과 전역 토큰만 수정합니다. */
[data-catalog-card] [data-catalog-card-title] {
    color: var(--bj-catalog-title-color, var(--bj-text, #303c45));
    font-family: var(--bj-font-family, "Pretendard", sans-serif);
    font-size: var(--bj-catalog-title-size, 14px);
    font-weight: var(--bj-catalog-title-weight, 500);
    line-height: var(--bj-catalog-title-line, 20px);
}

/* 상품 구매 정보가 없는 일반 콘텐츠 카드의 공통 골격 */
[data-catalog-card-layout="content"] [data-catalog-card-body] {
    width: 100%;
    margin: 0;
    gap: 8px;
    padding-top: 12px;
}

[data-catalog-card-layout="content"] [data-catalog-card-title-row] {
    display: flex;
    width: 100%;
    min-width: 0;
    margin: 0;
    align-items: center;
    gap: 8px;
}

[data-catalog-card-layout="content"] [data-catalog-card-title] {
    overflow: hidden;
    min-width: 0;
    flex: 0 1 auto;
    margin: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-catalog-card-layout="content"] [data-catalog-card-title] a {
    color: inherit;
    font: inherit;
    text-decoration: none;
}

[data-catalog-media] {
    overflow: hidden;
    aspect-ratio: var(--catalog-media-aspect-ratio, auto);
    border-radius: var(--catalog-media-radius, var(--bj-catalog-media-radius, 8px));
}

.catalogBadge {
    box-sizing: border-box;
    display: inline-flex;
    width: auto;
    height: 17px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 0;
    border-radius: 999px;
    color: #5f6670;
    background: #f1f3f5;
    font-family: var(--bj-font-family, inherit);
    font-size: var(--bj-catalog-meta-size, 11px);
    font-weight: var(--bj-type-control-weight, 500);
    line-height: 17px;
    white-space: nowrap;
}

.catalogBadge--active {
    color: var(--bj-accent, #a9495b);
    background: #fcecef;
}

[data-catalog-card-body] {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

/*
 * Invitation-list card anatomy.
 *
 * Renewed catalogs opt into the same information rhythm as the invitation
 * list instead of inventing per-page stacks:
 * media -> one-line title/status -> 24px commerce row -> CTA.
 */
[data-catalog-card-layout="invitation"] [data-catalog-card-body] {
    width: 100%;
    padding-top: 12px;
}

[data-catalog-card-layout="invitation"] [data-catalog-card-title-row] {
    display: flex;
    width: 100%;
    height: var(--bj-catalog-title-line, 20px);
    min-height: var(--bj-catalog-title-line, 20px);
    align-items: center;
    gap: 8px;
}

[data-catalog-card-layout="invitation"] [data-catalog-card-title] {
    display: block;
    overflow: hidden;
    width: auto;
    min-width: 0;
    height: var(--bj-catalog-title-line, 20px);
    min-height: 0;
    flex: 1 1 auto;
    margin: 0;
    letter-spacing: -.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-catalog-card-layout="invitation"] [data-catalog-card-title] > a {
    display: flex;
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
    align-items: center;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-catalog-card-layout="invitation"] [data-catalog-card-title-main] {
    display: block;
    overflow: hidden;
    min-width: 0;
    flex: 0 1 auto;
    font: inherit;
    letter-spacing: inherit;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-catalog-card-layout="invitation"] [data-catalog-card-title-suffix] {
    display: block;
    min-width: max-content;
    flex: 0 0 auto;
    margin-left: 4px;
    color: var(--bj-muted, #66635e);
    font-size: var(--bj-catalog-quantity-size, 13px);
    font-weight: var(--bj-type-body-weight, 400);
    white-space: nowrap;
}

[data-catalog-card-layout="invitation"] [data-catalog-card-badges] {
    display: inline-flex;
    width: auto;
    height: 20px;
    min-width: 0;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
}

[data-catalog-card-layout="invitation"] [data-catalog-card-badges] > * {
    box-sizing: border-box;
    display: inline-flex;
    width: auto;
    height: 17px;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 0;
    border-radius: 999px;
    color: #5f6670;
    background: #f1f3f5;
    font-size: 11px;
    font-weight: 500;
    line-height: 17px;
    white-space: nowrap;
}

/* Discovery status uses the same quiet text treatment across product catalogs. */
[data-catalog-card-layout="invitation"] [data-catalog-card-badges] > .bj-catalog-product-status {
    height: auto;
    min-height: 20px;
    padding: 0;
    border-radius: 0;
    color: var(--bj-muted);
    background: none;
    font-size: var(--bj-catalog-supporting-size, 13px);
    font-weight: var(--bj-type-control-weight, 500);
    line-height: var(--bj-catalog-supporting-line, 20px);
}

[data-catalog-card-layout="invitation"] [data-catalog-card-commerce] {
    display: var(--catalog-card-commerce-display, flex);
    overflow: var(--catalog-card-commerce-overflow, hidden);
    width: 100%;
    height: var(--catalog-card-commerce-height, 24px);
    min-height: var(--catalog-card-commerce-min-height, 24px);
    align-items: var(--catalog-card-commerce-align, center);
    justify-content: flex-start;
    margin-top: 8px;
    gap: 12px;
    white-space: nowrap;
}

[data-catalog-card-layout="invitation"] [data-catalog-card-quantity],
[data-catalog-card-layout="invitation"] [data-catalog-card-basis] {
    display: inline-flex;
    overflow: hidden;
    width: auto;
    min-width: 0;
    max-width: calc(100% - 56px);
    height: 24px;
    flex: 0 1 auto;
    align-items: center;
    margin: 0;
    padding: 0;
    color: var(--bj-muted, #667078);
    font-family: var(--bj-font-family, "Pretendard", sans-serif);
    font-size: var(--bj-catalog-quantity-size, 13px);
    font-weight: 400;
    line-height: var(--bj-catalog-quantity-line, 20px);
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-catalog-card-layout="invitation"] [data-catalog-card-quantity] > select {
    overflow: hidden;
    width: auto;
    min-width: 0;
    max-width: 100%;
    height: 24px;
    margin: 0;
    padding: 0 2px 0 0;
    border: 0;
    border-radius: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    line-height: 24px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-catalog-card-layout="invitation"] [data-catalog-card-price] {
    display: inline-flex;
    overflow: hidden;
    width: auto;
    min-width: 0;
    height: 24px;
    flex: 0 1 auto;
    align-items: baseline;
    margin: 0;
    gap: 2px;
    color: var(--bj-text, #303c45);
    font-family: var(--bj-font-family, "Pretendard", sans-serif);
    font-size: var(--bj-catalog-price-size, 14px);
    font-weight: var(--bj-catalog-price-weight, 500);
    line-height: var(--bj-catalog-price-line, 20px);
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-catalog-card-layout="invitation"] [data-catalog-card-price] del {
    display: none;
}

[data-catalog-card-layout="invitation"] [data-catalog-card-price] :is(strong, span) {
    color: inherit;
    font: inherit;
    line-height: inherit;
    white-space: nowrap;
}

[data-catalog-card-layout="invitation"] [data-catalog-card-action] {
    box-sizing: border-box;
    display: flex;
    width: 100%;
    height: var(--bj-catalog-cta-height, 40px);
    min-height: var(--bj-catalog-cta-height, 40px);
    align-items: center;
    justify-content: center;
    margin: 16px 0 0;
    padding: 0;
    border: 1px solid #e0e2e3;
    border-radius: var(--bj-catalog-cta-radius, 8px);
    color: #667078;
    background: #fff;
    font-family: var(--bj-font-family, "Pretendard", sans-serif);
    font-size: var(--bj-catalog-cta-size, 14px);
    font-weight: var(--bj-catalog-cta-weight, 500);
    line-height: calc(var(--bj-catalog-cta-height, 40px) - 2px);
}

.catalogShell__empty {
    display: grid;
    width: 100%;
    min-height: var(--catalog-shell-empty-min-height, 240px);
    padding: var(--catalog-shell-empty-padding, 48px 20px);
    grid-column: 1 / -1;
    place-items: center;
    align-content: center;
    text-align: center;
}

.catalogShell__loading {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
}

.catalogShell :is(
    [data-catalog-card-action],
    [data-catalog-pagination] a,
    button,
    select
):focus-visible {
    outline: 2px solid var(--catalog-shell-focus, #1b2631);
    outline-offset: 3px;
}

/* Category items are block surfaces (icon tile + label): underline the label, never a box. */
.catalogShell [data-catalog-category-item]:focus-visible {
    outline: none;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

/* Catalog pages can live inside a legacy fixed table. Keep the full-width
   footer tied to the actual document width at every responsive breakpoint;
   100vw includes the scrollbar and otherwise creates a narrow-page drift. */
html body:has(.catalogShell) #tail_area {
    width: 100%;
    right: auto;
    left: 0;
    transform: none;
}

@media (min-width: 768px) and (max-width: 1023px) {
    .catalogShell {
        --catalog-shell-grid-columns: 3;
    }
}

@media (max-width: 767px) {
    .catalogShell {
        --catalog-shell-grid-columns: 2;
        --catalog-shell-grid-gap: 24px 12px;
    }

    .catalogCategoryNav {
        justify-content: flex-start;
        gap: var(--catalog-category-group-gap-mobile, 20px);
    }

    .catalogCategoryNav__group {
        gap: var(--catalog-category-gap-mobile, 20px);
    }

    .catalogCategoryNav__item {
        width: var(--catalog-category-item-width-mobile, 64px);
        padding-bottom: 14px;
    }

    .catalogCategoryNav__group--related::before {
        display: none;
    }

    .catalogCategoryNav__label {
        font-size: var(--bj-catalog-category-label-mobile, 16px);
    }

    [data-catalog-card-layout="content"] [data-catalog-card-body] {
        padding-top: 8px;
    }

    [data-catalog-card-layout="content"] [data-catalog-card-title-row] {
        gap: 4px;
    }

    [data-catalog-card-layout="invitation"] [data-catalog-card-body] {
        padding-top: 8px;
    }

    [data-catalog-card-layout="invitation"] [data-catalog-card-title-row] {
        gap: 4px;
    }

    [data-catalog-card-layout="invitation"] [data-catalog-card-commerce] {
        margin-top: 4px;
        gap: 8px;
    }

    [data-catalog-card-layout="invitation"] [data-catalog-card-action] {
        height: var(--bj-catalog-cta-height-mobile, 44px);
        min-height: var(--bj-catalog-cta-height-mobile, 44px);
        margin-top: 8px;
        line-height: calc(var(--bj-catalog-cta-height-mobile, 44px) - 2px);
    }

    .catalogShell--video > [data-catalog-sticky-owner="category"] {
        position: sticky;
        z-index: 99;
        top: var(--wedding-catalog-banner-offset, var(--catalog-shell-sticky-offset, 0px));
    }

    .catalogShell--print > [data-catalog-sticky-owner="category"] {
        position: relative;
        z-index: 11;
        top: 0;
        width: 100%;
        background: #fff;
        transition: box-shadow 160ms ease;
    }

    body[data-wedding-catalog-scroll-state="COMPACT_DOWN"]
        .catalogShell--print > [data-catalog-sticky-owner="category"],
    body[data-wedding-catalog-scroll-state="REVEAL_UP"]
        .catalogShell--print > [data-catalog-sticky-owner="category"],
    body[data-wedding-catalog-scroll-state="MODAL"]
        .catalogShell--print > [data-catalog-sticky-owner="category"] {
        position: sticky;
        z-index: 99;
        top: var(--wedding-catalog-banner-offset, var(--catalog-shell-sticky-offset, 0px));
        overflow: hidden;
        height: var(--wedding-catalog-sticky-category-height, 52px);
        min-height: var(--wedding-catalog-sticky-category-height, 52px);
    }

    body[data-wedding-catalog-scroll-state="COMPACT_DOWN"]
        .catalogShell--print > [data-catalog-sticky-owner="category"] {
        box-shadow: 0 5px 16px rgba(23, 35, 43, 0.08);
    }

    body[data-wedding-catalog-scroll-state="REVEAL_UP"]
        .catalogShell--print > [data-catalog-sticky-owner="category"],
    body[data-wedding-catalog-scroll-state="MODAL"]
        .catalogShell--print > [data-catalog-sticky-owner="category"] {
        box-shadow: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .catalogShell *,
    .catalogShell *::before,
    .catalogShell *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
