.ProductGroupPage {
    display: grid;
    gap: 16px;
    padding: 10px;
}

.ProductGroupPage .UI_PageTitle .Note {
    font-size: 0.92rem;
    color: var(--SubText1);
    line-height: 1.6;
}

.ProductGroupPage .UI_PageTitle .Breadcrumb .CategoryTrailLink {
    color: inherit;
    text-decoration: none;
}

.ProductGroupPage .UI_PageTitle .Breadcrumb .CategoryTrailLink:hover,
.ProductGroupPage .UI_PageTitle .Breadcrumb .CategoryTrailLink:focus-visible {
    text-decoration: underline;
}

.HeaderActionRow {
    display: flex;
    justify-content: flex-start;
}

.ErrorBox {
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #f1b7b7;
    background-color: #fff4f4;
    color: #8a1f1f;
}

.ProductGroupListContainer {
    display: grid;
    gap: 12px;
}

.GroupInfoCard {
    display: grid;
    grid-template-columns: minmax(220px, 320px) 1fr;
    gap: 16px;
    align-items: start;
}

.GroupGallery {
    display: grid;
    gap: 10px;
}

.GroupGalleryMainImageWrap {
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #ececec;
    background-color: #fff;
}

.GroupGalleryMainImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.GroupGalleryThumbnailList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 8px;
}

.GroupGalleryThumbnailButton {
    width: 100%;
    padding: 0;
    border-radius: 8px;
    border: 1px solid #dce4ee;
    background-color: #fff;
    overflow: hidden;
    cursor: pointer;
}

.GroupGalleryThumbnailButton.IsActive {
    border-color: #7aa7d9;
    box-shadow: 0 0 0 2px rgba(122, 167, 217, 0.18);
}

.GroupGalleryThumbnailImage {
    width: 100%;
    height: 56px;
    object-fit: cover;
    display: block;
}

.GroupInfoCard .GroupInfoBody {
    display: grid;
    gap: 10px;
}

.GroupInfoCard .GroupInfoName {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--MainText1);
}

.GroupInfoCard .GroupInfoDescription {
    color: var(--MainText2);
    line-height: 1.7;
}

.GroupInfoCard .GroupInfoMetaList {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.GroupInfoCard .GroupInfoMetaList .MetaItem {
    color: var(--SubText1);
    font-size: 0.92rem;
}

.GroupInfoCard .GroupInfoMetaList .MetaItem .CategoryTrailLink {
    color: var(--MainText2);
    text-decoration: none;
}

.GroupInfoCard .GroupInfoMetaList .MetaItem .CategoryTrailLink:hover,
.GroupInfoCard .GroupInfoMetaList .MetaItem .CategoryTrailLink:focus-visible {
    color: var(--PrimaryColor);
    text-decoration: underline;
}

.GroupInfoCard .GroupInfoMetaList .Label {
    color: var(--MainText2);
}

.GroupTableBox {
    display: grid;
    gap: 12px;
}

.SummaryText {
    color: var(--MainText2);
}

.ProductGroupTableWrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e4e8ef;
    border-radius: 8px;
    background-color: #fff;
}

.ProductGroupTable {
    --ProductGroupTableColumns:
        72px
        minmax(180px, 2.2fr)
        minmax(110px, 1fr)
        minmax(110px, 1fr)
        minmax(148px, 1.08fr)
        minmax(148px, 1.08fr)
        minmax(110px, 0.92fr)
        minmax(168px, 1.22fr);
    width: 100%;
    min-width: 1120px;
}

.ProductGroupTableHeader,
.ProductGroupTableBody {
    display: grid;
}

.ProductGroupTableHeaderRow,
.ProductGroupTableRow {
    display: grid;
    grid-template-columns: var(--ProductGroupTableColumns);
    align-items: center;
}

.ProductGroupTableCell {
    min-width: 0;
    padding: 10px 12px;
    text-align: left;
}

.ProductGroupTableHeaderRow {
    background-color: #f7f8fb;
    border-bottom: 1px solid #edf0f5;
}

.ProductGroupTableHeaderRow .ProductGroupTableCell {
    color: var(--MainText1);
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
}

.ProductGroupTableBody .ProductGroupTableRow {
    background-color: #fff;
    color: var(--MainText2);
    font-size: 0.95rem;
}

.ProductGroupTableBody .ProductGroupTableRow:not(:last-child) {
    border-bottom: 1px solid #edf0f5;
}

.ProductGroupTableBody .ProductGroupTableCellLabel {
    display: none;
}

.ProductGroupTableBody .ProductNameCell {
    min-width: 180px;
}

.ProductGroupTableBody .PriceCell {
    color: var(--PrimaryColor);
    font-weight: 700;
    white-space: nowrap;
}

.ProductGroupTableBody .QuantityInput {
    width: 92px;
    max-width: 100%;
}

.ProductGroupTableBody .ActionCell {
    white-space: nowrap;
}

.ProductGroupTableBody .ActionCell .ActionCellInner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.ProductGroupTableBody .ActionCell .UI_Button {
    white-space: nowrap;
}

.ProductGroupTableBody .ProductGroupTableRow.SetProductRow {
    background-color: #f8fbff;
}

.ProductGroupTableBody .SetProductRow .ProductGroupTableCell {
    padding-top: 7px;
    padding-bottom: 7px;
    font-size: 0.9rem;
}

.ProductGroupTableBody .SetProductRow .ProductImage {
    width: 36px;
    height: 36px;
}

.ProductGroupTableBody .SetProductRow .ImageCell {
    text-align: right;
}

.ProductGroupTableBody .ProductGroupTableRow.SetProductGroupRow {
    background-color: #f8fbff;
    border-bottom: 0;
}

.ProductGroupTableBody .SetProductGroupRow .SetGroupCell {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    padding-left: 18px;
    padding-top: 12px;
    padding-bottom: 6px;
    font-size: 0.9rem;
}

.ProductGroupTable .SetBranchMark {
    display: inline-block;
    margin-right: 6px;
    color: #6b7a8a;
    font-weight: 700;
    line-height: 1;
}

.ProductGroupTable .SetRowBadge {
    display: inline-block;
    margin-right: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #7aa7d9;
    color: #2f5f93;
    background-color: #eef5ff;
    font-size: 0.75rem;
    font-weight: 700;
    vertical-align: middle;
}

.ProductGroupTable .ProductImageLink {
    display: inline-block;
    line-height: 0;
}

.ProductGroupTable .ProductNameLink {
    color: inherit;
    text-decoration: none;
    font-weight: 700;
}

.ProductGroupTable .ProductNameLink:hover,
.ProductGroupTable .ProductNameLink:focus-visible {
    text-decoration: underline;
}

.ProductGroupTable .CodeCell {
    white-space: nowrap;
}

.ProductGroupTable .ProductImage {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border: 1px solid #ececec;
    border-radius: 6px;
}

.ProductGroupTable .FavoriteToggleButton {
    color: #b2466b;
}

.ProductGroupTable .FavoriteToggleButton.IsActive {
    border-color: #d88aa6;
    background-color: #fff4f8;
}

.GroupSummaryBox {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

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

    .ProductGroupTableWrapper {
        overflow: visible;
        border: none;
        background-color: transparent;
    }

    .ProductGroupTable {
        min-width: 0;
    }

    .ProductGroupTableHeader {
        display: none;
    }

    .ProductGroupTableBody {
        gap: 12px;
    }

    .ProductGroupTableBody .ProductGroupTableRow {
        border-bottom: none;
    }

    .ProductGroupTableBody .ProductGroupTableRow:not(.SetProductGroupRow) {
        grid-template-columns: 72px repeat(4, minmax(0, 1fr));
        grid-template-areas:
            "image name name name name"
            "image code1 code1 code2 code2"
            "image listPrice listPrice wholesalePrice wholesalePrice"
            "image quantity actions actions actions";
        gap: 10px 12px;
        padding: 14px;
        border: 1px solid #e4e8ef;
        border-radius: 10px;
        background-color: #fff;
    }

    .ProductGroupTableBody .ProductGroupTableRow.SetProductRow {
        background-color: #f8fbff;
    }

    .ProductGroupTableBody .ProductGroupTableRow.SetProductGroupRow {
        grid-template-columns: minmax(0, 1fr);
        padding: 0;
        background-color: transparent;
    }

    .ProductGroupTableBody .SetProductGroupRow .SetGroupCell {
        min-width: 0;
        flex-wrap: wrap;
        padding: 0 4px;
    }

    .ProductGroupTableBody .ProductGroupTableCell {
        padding: 0;
    }

    .ProductGroupTableBody .ProductGroupTableCellLabel {
        display: block;
        margin-bottom: 4px;
        color: var(--SubText1);
        font-size: 0.76rem;
        font-weight: 700;
        line-height: 1.4;
    }

    .ProductGroupTableBody .ImageCell .ProductGroupTableCellLabel,
    .ProductGroupTableBody .ProductNameCell .ProductGroupTableCellLabel,
    .ProductGroupTableBody .Code1Cell .ProductGroupTableCellLabel,
    .ProductGroupTableBody .Code2Cell .ProductGroupTableCellLabel {
        display: none;
    }

    .ProductGroupTableBody .ImageCell {
        grid-area: image;
    }

    .ProductGroupTableBody .ProductNameCell {
        grid-area: name;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .ProductGroupTableBody .Code1Cell {
        grid-area: code1;
    }

    .ProductGroupTableBody .Code2Cell {
        grid-area: code2;
    }

    .ProductGroupTableBody .ListPriceCell {
        grid-area: listPrice;
    }

    .ProductGroupTableBody .WholesalePriceCell {
        grid-area: wholesalePrice;
    }

    .ProductGroupTableBody .QuantityCell {
        grid-area: quantity;
    }

    .ProductGroupTableBody .ActionCell {
        grid-area: actions;
        white-space: normal;
    }

    .ProductGroupTableBody .SetProductRow .ImageCell {
        text-align: left;
    }

    .ProductGroupTableBody .QuantityInput {
        width: 100%;
        max-width: 124px;
    }

    .GroupSummaryBox {
        grid-template-columns: 1fr;
    }
}

.ProductGroupTableBody .PriceCell {
    .PriceDisplayStack {
        display: grid;
        gap: 2px;
    }

    .PriceDisplayMain {
        font-weight: 700;
        color: var(--PrimaryColor);
        line-height: 1.2;
    }

    .PriceDisplaySub {
        font-size: 0.76rem;
        color: var(--SubText1);
        line-height: 1.3;
    }
}
