.theme-detail-hero {
    padding: 6.5rem 0 2rem;
    background: linear-gradient(180deg, #fff 0%, var(--slate-50) 100%);
    border-bottom: 1px solid var(--slate-200);
}

.theme-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--slate-500);
    margin-bottom: 1rem;
}

.theme-detail-back:hover {
    color: var(--brand-600);
}

.theme-detail-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.theme-detail-head h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--slate-900);
    margin: 0;
}

.theme-price-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.65rem 1.1rem;
    border-radius: 999px;
    background: var(--slate-900);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
}

.theme-price-badge small {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.75;
}

.theme-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 2rem;
    align-items: start;
    padding: 2.5rem 0 4rem;
}

.theme-gallery-main {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--slate-100);
    border: 1px solid var(--slate-200);
    box-shadow: var(--shadow);
    aspect-ratio: 16 / 10;
}

.theme-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.25s ease;
}

.theme-gallery-main.is-loading img {
    opacity: 0.55;
}

.theme-gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #334155 50%, #6366f1 100%);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-align: center;
    padding: 2rem;
}

.theme-gallery-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 2rem 1rem 0.75rem;
    background: linear-gradient(transparent, rgba(15, 23, 42, 0.72));
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    min-height: 2.5rem;
}

.theme-gallery-thumbs {
    display: flex;
    gap: 0.65rem;
    margin-top: 0.85rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scrollbar-width: thin;
}

.theme-gallery-thumb {
    flex: 0 0 auto;
    width: 88px;
    height: 62px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    background: var(--slate-200);
    transition: border-color 0.15s, transform 0.15s;
}

.theme-gallery-thumb:hover {
    transform: translateY(-2px);
}

.theme-gallery-thumb.active {
    border-color: var(--brand-600);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.theme-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.theme-detail-panel {
    position: sticky;
    top: 5.5rem;
}

.theme-detail-card {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.theme-detail-card h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--slate-900);
    margin: 0 0 0.75rem;
}

.theme-detail-desc {
    color: var(--slate-600);
    line-height: 1.75;
    white-space: pre-wrap;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.theme-detail-meta {
    display: grid;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: var(--slate-50);
    border-radius: 12px;
    border: 1px solid var(--slate-100);
}

.theme-detail-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.875rem;
}

.theme-detail-meta-row span:first-child {
    color: var(--slate-500);
}

.theme-detail-meta-row span:last-child {
    font-weight: 600;
    color: var(--slate-800);
    text-align: right;
}

.theme-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.theme-detail-actions .btn {
    width: 100%;
    justify-content: center;
}

.theme-owned-banner {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.theme-login-hint {
    color: var(--slate-500);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.theme-detail-actions-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.theme-detail-actions-row .btn {
    flex: 1;
    min-width: 120px;
}

@media (max-width: 900px) {
    .theme-detail-layout {
        grid-template-columns: 1fr;
    }

    .theme-detail-panel {
        position: static;
    }
}
