.tdm-open {
    overflow: hidden;
}

.tdm-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(6, 10, 26, 0.82);
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
}

.tdm-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.tdm-dialog {
    width: min(980px, 100%);
    max-height: min(92vh, 920px);
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid rgba(163, 191, 250, 0.18);
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.14), transparent 34%),
        radial-gradient(circle at top left, rgba(96, 165, 250, 0.18), transparent 28%),
        linear-gradient(180deg, rgba(16, 24, 48, 0.98) 0%, rgba(11, 17, 34, 0.98) 100%);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.46);
    transform: translateY(18px) scale(0.98);
    transition: transform 0.24s ease;
}

.tdm-overlay.is-open .tdm-dialog {
    transform: translateY(0) scale(1);
}

.tdm-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: min(92vh, 920px);
}

.tdm-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 3;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.tdm-close:hover,
.tdm-close:focus-visible {
    background: rgba(255, 255, 255, 0.16);
    transform: scale(1.05);
    outline: none;
}

.tdm-scroll {
    overflow: auto;
}

.tdm-header {
    padding: 28px 32px 12px;
}

.tdm-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(96, 165, 250, 0.12);
    color: #93c5fd;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tdm-title {
    margin: 14px 0 8px;
    color: #f8fafc;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 800;
    line-height: 1.05;
}

.tdm-subtitle {
    margin: 0;
    color: rgba(226, 232, 240, 0.72);
    font-size: 0.98rem;
    line-height: 1.5;
    max-width: 58ch;
}

.tdm-content {
    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
    gap: 26px;
    padding: 12px 32px 20px;
}

.tdm-visual {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tdm-image-card {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background:
        radial-gradient(circle at top, rgba(245, 158, 11, 0.17), transparent 38%),
        linear-gradient(180deg, rgba(37, 52, 89, 0.96), rgba(18, 24, 42, 0.98));
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 26px;
}

.tdm-image-card::after {
    content: '';
    position: absolute;
    inset: auto -12% -26% auto;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.28), transparent 68%);
    filter: blur(10px);
    pointer-events: none;
}

.tdm-image {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 320px;
    max-height: 470px;
    object-fit: contain;
    filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.45));
}

.tdm-seller {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.tdm-seller-avatar,
.tdm-seller-avatar-fallback {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    object-fit: cover;
    flex-shrink: 0;
}

.tdm-seller-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #60a5fa 0%, #8b5cf6 100%);
    color: #eff6ff;
    font-weight: 800;
}

.tdm-seller-copy {
    min-width: 0;
}

.tdm-seller-label {
    display: block;
    color: rgba(148, 163, 184, 0.88);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 3px;
}

.tdm-seller-name {
    display: block;
    color: #f8fafc;
    font-weight: 700;
    line-height: 1.2;
}

.tdm-seller-location {
    display: block;
    color: rgba(226, 232, 240, 0.62);
    font-size: 0.82rem;
    margin-top: 2px;
}

.tdm-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.tdm-chip-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tdm-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.tdm-chip--type {
    background: rgba(96, 165, 250, 0.14);
    color: #bfdbfe;
}

.tdm-chip--stock {
    background: rgba(51, 65, 85, 0.72);
    color: #e2e8f0;
}

.tdm-chip--stock.tdm-chip--available {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
}

.tdm-chip--stock.tdm-chip--sold-out {
    background: rgba(248, 113, 113, 0.14);
    color: #fca5a5;
}

.tdm-price-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.92));
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.tdm-price-block {
    min-width: 0;
}

.tdm-price-label,
.tdm-stock-label {
    display: block;
    margin-bottom: 6px;
    color: rgba(148, 163, 184, 0.84);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.tdm-price-value {
    color: #fde68a;
    font-size: clamp(1.6rem, 2.8vw, 2.2rem);
    font-weight: 800;
    line-height: 1;
}

.tdm-stock-value {
    color: #f8fafc;
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.1;
}

.tdm-section {
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.tdm-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    color: #e2e8f0;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.tdm-section-body {
    margin: 0;
    color: rgba(226, 232, 240, 0.82);
    font-size: 0.96rem;
    line-height: 1.65;
    white-space: pre-line;
}

.tdm-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 12px;
}

.tdm-gallery-card {
    cursor: pointer;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.92));
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.tdm-gallery-card:hover,
.tdm-gallery-card:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(96, 165, 250, 0.48);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.26);
    outline: none;
}

.tdm-gallery-card.is-active {
    border-color: rgba(245, 158, 11, 0.64);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.22), 0 16px 26px rgba(15, 23, 42, 0.28);
}

.tdm-gallery-visual {
    position: relative;
    aspect-ratio: 1;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.14), rgba(139, 92, 246, 0.16));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.tdm-gallery-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tdm-gallery-qty {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    color: #f8fafc;
    font-size: 0.84rem;
    font-weight: 800;
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.24);
}

.tdm-gallery-copy {
    padding: 12px;
}

.tdm-gallery-name {
    display: block;
    color: #f8fafc;
    font-weight: 700;
    font-size: 0.88rem;
    line-height: 1.25;
}

.tdm-gallery-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(96, 165, 250, 0.1);
    color: #bfdbfe;
    font-size: 0.72rem;
    font-weight: 700;
}

.tdm-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 32px 28px;
}

.tdm-footer-copy {
    color: rgba(148, 163, 184, 0.78);
    font-size: 0.84rem;
}

.tdm-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.tdm-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 999px;
    border: 0;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.tdm-action:hover,
.tdm-action:focus-visible {
    transform: translateY(-1px);
    outline: none;
}

.tdm-action--primary {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: #111827;
    box-shadow: 0 12px 26px rgba(249, 115, 22, 0.22);
}

.tdm-action--secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

.tdm-action--ghost {
    background: transparent;
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.tdm-action[disabled],
.tdm-action.is-disabled {
    opacity: 0.55;
    pointer-events: none;
    box-shadow: none;
}

@media (max-width: 880px) {
    .tdm-content {
        grid-template-columns: 1fr;
    }

    .tdm-image-card {
        min-height: 320px;
    }

    .tdm-image {
        max-height: 360px;
    }
}

@media (max-width: 640px) {
    .tdm-overlay {
        padding: 10px;
    }

    .tdm-dialog {
        width: 100%;
        max-height: 96vh;
        border-radius: 24px;
    }

    .tdm-header,
    .tdm-content,
    .tdm-footer {
        padding-left: 18px;
        padding-right: 18px;
    }

    .tdm-header {
        padding-top: 20px;
    }

    .tdm-content {
        gap: 18px;
    }

    .tdm-price-card {
        grid-template-columns: 1fr;
    }

    .tdm-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .tdm-actions {
        width: 100%;
        justify-content: stretch;
    }

    .tdm-action {
        width: 100%;
    }
}