/* Shared character-to-product expander for collection pages. */
.tss-character-expander-ready {
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.tss-character-expander-ready:focus-visible {
    outline: 3px solid rgba(0,87,184,0.24);
    outline-offset: 4px;
}

.tss-character-expander-ready.is-expanded {
    z-index: 6;
}

.tss-character-expander-ready.is-expanded .cgi-char-avatar,
.tss-character-expander-ready.is-expanded .char-avatar,
.tss-character-expander-ready.is-expanded .ms-character-photo {
    box-shadow: 0 16px 34px rgba(0,57,120,0.14);
}

.tss-character-expand-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    margin: 12px auto 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #ee0024;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 850;
    line-height: 1;
    cursor: pointer;
}

.tss-character-expand-cta:hover {
    color: #b6001b;
    text-decoration: underline;
}

.tss-character-expand-cta svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    transition: transform 0.22s ease;
}

.tss-character-expander-ready.is-expanded .tss-character-expand-cta svg {
    transform: rotate(90deg);
}

.tss-character-product-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(260px, 0.38fr) minmax(0, 0.62fr);
    align-items: stretch;
    width: 100%;
    margin: 10px 0 28px;
    padding: 0;
    border: 1px solid rgba(0,87,184,0.14);
    border-radius: 12px;
    background:
        radial-gradient(circle at 9% 0%, rgba(255,205,0,0.16), transparent 30%),
        linear-gradient(135deg, rgba(255,255,255,0.98), rgba(246,249,255,0.98));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.82), 0 24px 54px rgba(12,24,44,0.13);
    text-align: left;
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.32s ease, transform 0.32s ease;
}

.tss-character-product-panel[hidden] {
    display: none;
}

.tss-character-product-panel.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.tss-character-showcase-hero {
    position: relative;
    min-height: 360px;
    display: flex;
    align-items: flex-end;
    padding: clamp(22px, 3vw, 34px);
    overflow: hidden;
    background: #061a32;
    color: #fff;
}

.tss-character-showcase-hero > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.04) contrast(1.04);
    transform: scale(1.02);
}

.tss-character-showcase-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(6,26,50,0.08), rgba(6,26,50,0.86)),
        linear-gradient(90deg, rgba(6,26,50,0.82), rgba(6,26,50,0.22));
}

.tss-character-showcase-copy {
    position: relative;
    z-index: 1;
    max-width: 390px;
}

.tss-character-showcase-copy span {
    display: block;
    color: #ffcd00;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.tss-character-showcase-copy strong {
    display: block;
    color: #fff;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 0.95;
    letter-spacing: 0;
}

.tss-character-showcase-copy p {
    margin: 12px 0 0;
    color: rgba(255,255,255,0.78);
    font-size: 0.95rem;
    line-height: 1.55;
}

.tss-character-showcase-close {
    position: absolute;
    z-index: 2;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255,255,255,0.24);
    border-radius: 50%;
    background: rgba(6,26,50,0.72);
    color: #fff;
    font-size: 1.55rem;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.tss-character-showcase-close:hover {
    background: rgba(238,0,36,0.9);
}

.tss-character-showcase-products {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: clamp(18px, 2.5vw, 28px);
}

.tss-character-product-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.tss-character-product-panel-title {
    min-width: 0;
}

.tss-character-product-panel-title strong {
    display: block;
    color: #10182d;
    font-size: 0.98rem;
    line-height: 1.2;
}

.tss-character-product-panel-title span {
    display: block;
    color: #687086;
    font-size: 0.78rem;
    line-height: 1.35;
    margin-top: 3px;
}

.tss-character-product-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #ee0024;
    color: #fff;
    font-size: 0.76rem;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(238,0,36,0.22);
    flex: 0 0 auto;
}

.tss-character-product-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
    gap: 12px;
}

.tss-character-product-mini {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 126px;
    padding: 11px;
    border: 1px solid rgba(0,87,184,0.1);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(0,32,78,0.06);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.tss-character-product-mini:hover,
.tss-character-product-mini:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(0,87,184,0.24);
    box-shadow: 0 14px 24px rgba(0,57,120,0.12);
    outline: none;
}

.tss-character-product-image {
    width: 96px;
    height: 98px;
    border: 1px solid rgba(0,87,184,0.08);
    border-radius: 10px;
    background: linear-gradient(180deg, #f6f9ff, #eef5ff);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tss-character-product-image img,
.tss-character-product-image svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.tss-character-product-info {
    min-width: 0;
}

.tss-character-product-brand {
    color: #0057b8;
    font-size: 0.68rem;
    line-height: 1.2;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.tss-character-product-name {
    color: #1a1a2e;
    font-size: 0.88rem;
    font-weight: 850;
    line-height: 1.25;
    margin-bottom: 7px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tss-character-product-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 9px;
}

.tss-character-product-price {
    color: #ee0024;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
}

.tss-character-product-meta .status-badge {
    position: static;
    transform: none;
    font-size: 0.68rem;
    line-height: 1;
    padding: 5px 8px;
}

.tss-character-product-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.tss-character-product-actions .product-cart-btn {
    width: auto;
    min-width: 0;
    max-width: 100%;
    min-height: 36px;
    height: auto;
    padding: 9px 12px;
    border-radius: 10px !important;
    font-size: 0.78rem;
    line-height: 1.15;
    white-space: normal;
    overflow: visible;
    box-shadow: 0 8px 18px rgba(238,0,36,0.16);
}

.tss-character-product-actions .product-cart-label {
    display: inline;
    overflow: visible;
    max-width: none;
    white-space: normal;
    text-overflow: clip;
}

.tss-character-product-detail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 9px 11px;
    border: 1px solid rgba(0,87,184,0.16);
    border-radius: 10px;
    background: #f6f9ff;
    color: #0057b8;
    font-size: 0.78rem;
    font-weight: 850;
    cursor: pointer;
}

.tss-character-products-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 42px;
    margin-top: 12px;
    border-radius: 10px;
    background: #0b57b7;
    color: #fff;
    font-size: 0.84rem;
    font-weight: 850;
    text-decoration: none;
    box-shadow: 0 12px 22px rgba(0,87,184,0.18);
}

.tss-character-products-all:hover {
    background: #004899;
    color: #fff;
    text-decoration: none;
}

.tss-character-product-empty {
    padding: 14px;
    border: 1px dashed rgba(0,87,184,0.2);
    border-radius: 10px;
    background: rgba(255,255,255,0.82);
    color: #687086;
    font-size: 0.84rem;
    line-height: 1.45;
}

.ms-character-grid > .tss-character-product-panel {
    border-color: rgba(92,61,30,0.16);
    background:
        radial-gradient(circle at 12% 0%, rgba(218,165,80,0.18), transparent 34%),
        linear-gradient(135deg, rgba(255,255,255,0.98), rgba(255,250,242,0.98));
}

.ms-character-grid .tss-character-product-brand,
.ms-character-grid .tss-character-product-detail {
    color: #5c3d1e;
}

.ms-character-grid .tss-character-product-price,
.ms-character-card .tss-character-expand-cta {
    color: #8b2b13;
}

.ms-character-grid .tss-character-products-all {
    background: #5c3d1e;
    box-shadow: 0 12px 22px rgba(59,37,16,0.18);
}

.ms-character-grid .tss-character-products-all:hover {
    background: #3b2510;
}

@media (max-width: 700px) {
    .cgi-char-grid,
    .char-grid,
    .ms-character-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        max-width: min(100%, 430px);
        margin-left: auto;
        margin-right: auto;
    }

    .tss-character-expander-ready {
        width: 100%;
        min-width: 0;
    }

    .tss-character-product-panel {
        grid-template-columns: 1fr;
        margin: 6px 0 20px;
    }

    .tss-character-showcase-hero {
        min-height: 260px;
    }

    .tss-character-showcase-products {
        padding: 14px;
    }

    .tss-character-product-list {
        grid-template-columns: 1fr;
    }

    .tss-character-product-mini {
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 10px;
        min-height: 94px;
        padding: 8px;
    }

    .tss-character-product-image {
        width: 76px;
        height: 72px;
    }

    .tss-character-product-actions .product-cart-btn,
    .tss-character-product-detail {
        min-height: 34px;
        padding: 8px 10px;
        font-size: 0.74rem;
    }
}
